---
title: Retrieve a document
slug: andrei/retrieve-a-document
createdAt: 2026-10-05T10:36:01.732Z
---

{
  "id": "C7amimR5_wBl-CCgIjPSp",
  "type": "api-oas-v2",
  "data": {
    "method": "GET",
    "url": "https://api.detected.app/api/v2/public/documents/{id}",
    "servers": [
      {
        "url": "https://api.detected.app/api/v2/public/documents/{id}",
        "description": "Production"
      }
    ],
    "name": "Retrieve a document",
    "description": "<p>Returns a single document, including a temporary link to download it and the results of processing, such as OCR, translation and fraud analysis.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "<p>ID of the item named in the path, for example the form in <code>/forms/{id}</code> or the document in <code>/documents/{id}</code>.</p>"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "AccessToken",
          "name": "AccessToken",
          "kind": "optional",
          "type": "http",
          "description": "<p>The API uses OAuth 2.0. Request an access token from <code>POST /oauth/token</code> with the client ID and client secret of your integration client, and your account slug. Send the access token in the <code>Authorization</code> header of every request, in the format <code>Authorization: Bearer &#x3C;access_token></code>. The access token carries the scopes set on your integration client in the dashboard. Access tokens expire. When one expires, request a new one.</p>",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "OK",
        "jsonExample": "",
        "isExpanded": true,
        "headers": [
          {
            "kind": "optional",
            "name": "X-RateLimit-Limit",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "X-RateLimit-Remaining",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "x-ratelimit-reset",
            "description": ""
          },
          {
            "kind": "optional",
            "name": "retry-after",
            "description": ""
          }
        ],
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "data",
                "kind": "optional",
                "type": "object",
                "description": "",
                "modelRef": "#/components/schemas/DocumentViewResponse",
                "customType": "DocumentViewResponse",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "number",
                    "description": "Document ID."
                  },
                  {
                    "name": "profile_id",
                    "kind": "required",
                    "type": "string",
                    "description": "UUID of the profile the document belongs to."
                  },
                  {
                    "name": "document_id",
                    "kind": "required",
                    "type": "string",
                    "description": "ID of the document type."
                  },
                  {
                    "name": "category",
                    "kind": "required",
                    "type": "string",
                    "description": "Category of the document."
                  },
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "Name of the document."
                  },
                  {
                    "name": "link",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>Temporary URL to download the document. It stops working at the time given in <code>link_expires_at</code>.</p>"
                  },
                  {
                    "name": "file_type",
                    "kind": "required",
                    "type": "string",
                    "description": "File type of the document."
                  },
                  {
                    "name": "link_expires_at",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>Date and time at which <code>link</code> expires.</p>"
                  },
                  {
                    "name": "fraud_check",
                    "kind": "optional",
                    "type": "object",
                    "description": "Results of the AI fraud analysis of the document.",
                    "example": "",
                    "schema": [
                      {
                        "name": "processed_at",
                        "kind": "optional",
                        "type": "string",
                        "description": "Date and time the fraud analysis was processed."
                      },
                      {
                        "name": "analysis",
                        "kind": "optional",
                        "type": "object",
                        "description": "Details of the fraud analysis.",
                        "example": "",
                        "schema": [
                          {
                            "name": "score",
                            "kind": "optional",
                            "type": "string",
                            "description": "<p>Fraud risk category of the document, for example <code>low</code>.</p>"
                          },
                          {
                            "name": "document_type",
                            "kind": "optional",
                            "type": "string",
                            "description": "<p>Type of document identified, in plain language.</p>"
                          },
                          {
                            "name": "meta_data",
                            "kind": "optional",
                            "type": "object",
                            "description": "Metadata embedded in the document.",
                            "example": "",
                            "schema": [
                              {
                                "name": "producer",
                                "kind": "optional",
                                "type": "string",
                                "description": "<p>Software that produced the file, from its metadata.</p>"
                              },
                              {
                                "name": "creator",
                                "kind": "optional",
                                "type": "string",
                                "description": "<p>Software that created the original document, from its metadata.</p>"
                              },
                              {
                                "name": "creation_date",
                                "kind": "optional",
                                "type": "string",
                                "description": "<p>Date the document was created, from its metadata.</p>"
                              },
                              {
                                "name": "mod_date",
                                "kind": "optional",
                                "type": "string",
                                "description": "<p>Date the document was last modified, from its metadata.</p>"
                              },
                              {
                                "name": "author",
                                "kind": "optional",
                                "type": "string",
                                "description": "<p>Author of the document, from its metadata.</p>"
                              },
                              {
                                "name": "keywords",
                                "kind": "optional",
                                "type": "string",
                                "description": "<p>Keywords in the document metadata, separated by commas.</p>"
                              },
                              {
                                "name": "subject",
                                "kind": "optional",
                                "type": "string",
                                "description": "<p>Subject of the document, from its metadata.</p>"
                              },
                              {
                                "name": "title",
                                "kind": "optional",
                                "type": "string",
                                "description": "<p>Title of the document, from its metadata.</p>"
                              }
                            ]
                          },
                          {
                            "name": "indicators",
                            "kind": "optional",
                            "type": "array",
                            "description": "Fraud indicators detected in the document.",
                            "example": "",
                            "itemType": "object",
                            "customType": "object[]",
                            "schema": [
                              {
                                "name": "type",
                                "kind": "optional",
                                "type": "string",
                                "description": "<p>Type of fraud indicator, for example <code>anomaly</code>.</p>"
                              },
                              {
                                "name": "category",
                                "kind": "optional",
                                "type": "string",
                                "description": "<p>Category of the fraud indicator, for example <code>image_manipulation</code>.</p>"
                              },
                              {
                                "name": "title",
                                "kind": "optional",
                                "type": "string",
                                "description": "Short title of the fraud indicator."
                              },
                              {
                                "name": "description",
                                "kind": "optional",
                                "type": "string",
                                "description": "Explanation of what was detected."
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "translation",
                    "kind": "optional",
                    "type": "object",
                    "description": "Translation of the document.",
                    "example": "",
                    "schema": [
                      {
                        "name": "status",
                        "kind": "optional",
                        "type": "string",
                        "description": "Status of the translation."
                      },
                      {
                        "name": "link",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>Temporary URL to download the translated document. It stops working at the time given in <code>link_expires_at</code>.</p>"
                      },
                      {
                        "name": "file_type",
                        "kind": "optional",
                        "type": "string",
                        "description": "File type of the translated document."
                      },
                      {
                        "name": "link_expires_at",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>Date and time at which <code>link</code> expires.</p>"
                      },
                      {
                        "name": "extracted",
                        "kind": "optional",
                        "type": "string",
                        "description": "Translated text of the document."
                      }
                    ]
                  },
                  {
                    "name": "ocr",
                    "kind": "optional",
                    "type": "object",
                    "description": "Text extracted from the original document using OCR.",
                    "example": "",
                    "schema": [
                      {
                        "name": "extracted",
                        "kind": "optional",
                        "type": "string",
                        "description": "Text extracted from the document."
                      }
                    ]
                  },
                  {
                    "name": "updated_at",
                    "kind": "required",
                    "type": "string",
                    "description": "Date and time the document was last updated."
                  },
                  {
                    "name": "created_at",
                    "kind": "required",
                    "type": "string",
                    "description": "Date and time the document was created."
                  }
                ]
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "<p>Unauthorized. The access token is missing, invalid or has expired.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "<p>A human-readable description of the error.</p>"
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "404",
        "description": "<p>Not Found. The requested resource does not exist, or is not available to your account.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "<p>A human-readable description of the error.</p>"
              }
            ],
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "429",
        "description": "<p>Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the <code>Retry-After</code> header before trying again.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "schema": [
              {
                "name": "message",
                "kind": "optional",
                "type": "string",
                "description": "<p>A human-readable description of the error.</p>"
              }
            ],
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request GET \\\n     --url https://api.detected.app/api/v2/public/documents/{id} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'GET',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.detected.app/api/v2/public/documents/{id}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.detected.app/api/v2/public/documents/{id}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Get.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.detected.app/api/v2/public/documents/{id}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"GET\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// OK\n{\n  \"data\": {\n    \"id\": 0,\n    \"profile_id\": \"\",\n    \"document_id\": \"\",\n    \"category\": \"\",\n    \"name\": \"\",\n    \"link\": \"\",\n    \"file_type\": \"\",\n    \"link_expires_at\": \"\",\n    \"fraud_check\": {\n      \"processed_at\": \"\",\n      \"analysis\": {\n        \"score\": \"\",\n        \"document_type\": \"\",\n        \"meta_data\": {\n          \"producer\": \"\",\n          \"creator\": \"\",\n          \"creation_date\": \"\",\n          \"mod_date\": \"\",\n          \"author\": \"\",\n          \"keywords\": \"\",\n          \"subject\": \"\",\n          \"title\": \"\"\n        },\n        \"indicators\": [\n          {\n            \"type\": \"\",\n            \"category\": \"\",\n            \"title\": \"\",\n            \"description\": \"\"\n          }\n        ]\n      }\n    },\n    \"translation\": {\n      \"status\": \"\",\n      \"link\": \"\",\n      \"file_type\": \"\",\n      \"link_expires_at\": \"\",\n      \"extracted\": \"\"\n    },\n    \"ocr\": {\n      \"extracted\": \"\"\n    },\n    \"updated_at\": \"\",\n    \"created_at\": \"\"\n  }\n}"
        },
        {
          "id": "response-1-401",
          "language": "401",
          "code": "// Unauthorized. The access token is missing, invalid or has expired.\n{\n  \"message\": \"\"\n}"
        },
        {
          "id": "response-2-404",
          "language": "404",
          "code": "// Not Found. The requested resource does not exist, or is not available to your account.\n{\n  \"message\": \"\"\n}"
        },
        {
          "id": "response-3-429",
          "language": "429",
          "code": "// Too Many Requests. You have exceeded the rate limit. Wait for the number of seconds given in the Retry-After header before trying again.\n{\n  \"message\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}