# Get document

> GET https://api.nabrah.ai/api/ext/document/{document_id}

Group: Documents. Page: https://www.nabrah.ai/en/docs/api-reference/documents/get-document

Returns a single document by `id`. For file-backed documents the response includes a short-lived, pre-signed `file_url` (valid ~1 hour) you can use to download or preview the original file. Returns **404** if the document does not exist in your project.

## Authorization

- `X-API-Key` (string, header, required): your workspace API key.

## Path parameters

- `document_id` (string, required): Identifier of the document to fetch. From GET /api/ext/document or the add-document response.

## Response

### 200 Successful Response

Content type: `application/json`

```json
{
  "id": "00000000-0000-4000-8000-000000000000",
  "knowledge_base_id": "00000000-0000-4000-8000-000000000000",
  "type": "file",
  "status": "unknown",
  "title": "string",
  "summary": "string",
  "filename": "string",
  "created_at": "2026-01-15T12:00:00.000Z",
  "updated_at": "2026-01-15T12:00:00.000Z",
  "file_url": "string"
}
```

### 422 Validation Error

Content type: `application/json`

```json
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
```

## Request examples

### cURL

```bash
curl --request GET \
  --url 'https://api.nabrah.ai/api/ext/document/<document_id>' \
  --header 'X-API-Key: <your-api-key>'
```

### Python

```python
import requests

url = "https://api.nabrah.ai/api/ext/document/<document_id>"
headers = {"X-API-Key": "<your-api-key>"}

response = requests.get(url, headers=headers)
response.raise_for_status()
print(response.json())
```

### JavaScript

```javascript
const response = await fetch("https://api.nabrah.ai/api/ext/document/<document_id>", {
  method: "GET",
  headers: { "X-API-Key": "<your-api-key>" },
});

const data = await response.json();
console.log(data);
```

### Go

```go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, _ := http.NewRequest("GET", "https://api.nabrah.ai/api/ext/document/<document_id>", nil)
	req.Header.Set("X-API-Key", "<your-api-key>")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}
```
