# Get all documents

Using `/documents` endpoint you can get the details of all the PDF documents uploaded along with their `docIds`.

#### Each document will have the following fields:

* `id` - docId of the PDF
* `name` - name of the uploaded PDF
* `size` - size of the PDF in bytes
* `isPublic` - boolean(true or false)
* `uploadedAt` - PDF upload timestamp
* `url` - URL of the PDF
* `importUrl` - source URL of the imported PDF if any

## Documents

## Get all documents

<mark style="color:blue;">`GET`</mark> `https://pdf.ai/api/v1/documents`

To get the uploaded documents and their docIds.

#### Headers

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| X-API-Key<mark style="color:red;">\*</mark> | string | \<API-Key>  |

{% tabs %}
{% tab title="200 List of the uploaded documents" %}

```json
{
  "data": [
    {
      "id": "abcdxxxxxxx",
      "name": "abcd.pdf",
      "size": 123456,
      "isPublic": true,
      "uploadedAt": "2023-08-09T06:20:02.854Z",
      "url": "https://cdn.openai.com/papers/gpt-4.pdf",
      "importUrl": "https://cdn.example.com/doc1.pdf"
    },
    {
      "id": "efghxxxxxxx",
      "name": "efgh.pdf",
      "size": 123456,
      "isPublic": false,
      "uploadedAt": "2023-08-09T06:16:58.750Z",
      "url: "",
      "importUrl": ""
    }
  ]
}
```

{% endtab %}

{% tab title="401 Invalid API key" %}

```json
{
    "error": "Invalid API key"
}
```

{% endtab %}
{% endtabs %}
