# Get a document

`GET` `https://goblins-call-api.onrender.com/v1/knowledge/documents/:id`

Returns one document and the questions and answers that were taken from it.

Needs a [workspace API key](https://www.cracklehq.com/docs/authentication).

## Path parameters

- `id` (string, required): The document’s ID, such as `kd_4b1f0c9d2e7a6f53`.

## Errors

- `404`: No document in your workspace has that ID.

Every request can also answer `401`, `429` and `500`: see [Errors](https://www.cracklehq.com/docs/errors).

## Notes

- `GET /v1/knowledge/documents/:id/file` returns the uploaded file itself, when it was kept.

Request:

cURL:

```bash
curl "https://goblins-call-api.onrender.com/v1/knowledge/documents/kd_4b1f0c9d2e7a6f53" \
  -H "Authorization: Bearer $CRACKLE_API_KEY"
```

Node.js:

```js
const response = await fetch('https://goblins-call-api.onrender.com/v1/knowledge/documents/kd_4b1f0c9d2e7a6f53', {
  headers: {
    Authorization: `Bearer ${process.env.CRACKLE_API_KEY}`,
  },
});
if (!response.ok) throw new Error(await response.text());
const data = await response.json();
```

Python:

```python
import os
import requests

response = requests.get(
    "https://goblins-call-api.onrender.com/v1/knowledge/documents/kd_4b1f0c9d2e7a6f53",
    headers={"Authorization": f"Bearer {os.environ['CRACKLE_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()
```

Response · 200 OK:

```json
{
  "document": { "id": "kd_4b1f0c9d2e7a6f53", "status": "ready", "cardCount": 6, … },
  "cards": [
    {
      "question": "How long does a refund take?",
      "answer": "A refund for a cancelled order is paid within seven working days to the card that was used."
    }
  ]
}
```

Source: https://www.cracklehq.com/docs/reference/knowledge/get
