# GET /document/v1

Use this interface to retrieve a document from our database.

## Endpoint

```
https://api.tosdr.org/document/v1
```

## Parameters

| Parameter | Type    | Description                                                                                     |
| --------- | ------- | ----------------------------------------------------------------------------------------------- |
| id        | Integer | Document ID to retrieve. Omit the parameter to list all document IDs and `text_version` values. |

## Repository

<https://github.com/tosdr/API/tree/master/functions/public/Document/GET/v1>

## Implemented error codes

| Error                               | HTTP status | Bitmask             |
| ----------------------------------- | ----------- | ------------------- |
| An invalid doc id has been supplied | 404         | `INVALID_PARAMETER` |

## Example response

```
{
  "error": 256,
  "message": "OK",
  "parameters": {
      "id": 1378,
      "name": "Example",
      "url": "http://example.com/",
      "text": " Example Domain <p>This domain is for use in illustrative examples in documents.\nYou may use this domain in literature without prior coordination or asking for permission.</p>\n<p>More information...</p> ",
      "updated_at": "2020-12-14T22:20:50.860Z",
      "created_at": "2019-05-18T21:01:08.897Z",
      "text_version": null,
      "service_id": "502"
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tosdr.org/developer/tos-dr-developers/restful-api/document-api/get-document-v1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
