> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve a document

> Retrieve a document.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/documents.yml get /documents/{id}
openapi: 3.1.0
info:
  title: Telnyx Documents API
  version: 2.0.0
  description: API for Documents.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /documents/{id}:
    get:
      tags:
        - Documents
      summary: Retrieve a document
      description: Retrieve a document.
      operationId: RetrieveDocument
      parameters:
        - $ref: '#/components/parameters/Id'
      responses:
        '200':
          $ref: '#/components/responses/DocServiceDocumentResponse'
        '422':
          description: >-
            Unprocessable entity. Check the 'detail' field in response for
            details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/documents_Errors'
        default:
          $ref: '#/components/responses/documents_GenericErrorResponse'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            const document = await
            client.documents.retrieve('6a09cdc3-8948-47f0-aa62-74ac943d6c58');


            console.log(document.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            document = client.documents.retrieve(
                "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
            )
            print(document.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tdocument, err := client.Documents.Get(context.TODO(), \"6a09cdc3-8948-47f0-aa62-74ac943d6c58\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", document.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
            import com.telnyx.sdk.models.documents.DocumentRetrieveParams;
            import com.telnyx.sdk.models.documents.DocumentRetrieveResponse;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    DocumentRetrieveResponse document = client.documents().retrieve("6a09cdc3-8948-47f0-aa62-74ac943d6c58");
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


            telnyx = Telnyx::Client.new(api_key: "My API Key")


            document =
            telnyx.documents.retrieve("6a09cdc3-8948-47f0-aa62-74ac943d6c58")


            puts(document)
        - lang: CLI
          source: |-
            telnyx documents retrieve \
              --api-key 'My API Key' \
              --id 6a09cdc3-8948-47f0-aa62-74ac943d6c58
components:
  parameters:
    Id:
      name: id
      description: Identifies the resource.
      in: path
      required: true
      schema:
        format: uuid
        type: string
        example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
  responses:
    DocServiceDocumentResponse:
      description: Successful response
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/DocServiceDocument'
    documents_GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/documents_Errors'
  schemas:
    documents_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/documents_Error'
      type: object
    DocServiceDocument:
      allOf:
        - $ref: '#/components/schemas/DocServiceRecord'
        - type: object
          properties:
            record_type:
              description: Identifies the type of the resource.
              type: string
              readOnly: true
              example: document
            content_type:
              description: The document's content_type.
              type: string
              readOnly: true
              example: application/pdf
            size:
              description: Indicates the document's filesize
              type: object
              readOnly: true
              properties:
                unit:
                  description: Identifies the unit
                  type: string
                  readOnly: true
                  example: bytes
                amount:
                  description: The number of bytes
                  type: integer
                  readOnly: true
                  example: 123456
            status:
              type: string
              description: Indicates the current document reviewing status
              readOnly: true
              enum:
                - pending
                - verified
                - denied
              example: pending
            sha256:
              description: >-
                The document's SHA256 hash provided for optional verification
                purposes.
              type: string
              readOnly: true
              example: 08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c
            filename:
              description: The filename of the document.
              type: string
              example: test-document.pdf
            customer_reference:
              type: string
              description: Optional reference string for customer tracking.
              example: MY REF 001
            av_scan_status:
              type: string
              description: The antivirus scan status of the document.
              readOnly: true
              enum:
                - scanned
                - infected
                - pending_scan
                - not_scanned
              example: scanned
    documents_Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          additionalProperties: true
      type: object
    DocServiceRecord:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Identifies the resource.
          readOnly: true
          example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
        record_type:
          type: string
          description: Identifies the type of the resource.
          readOnly: true
          example: sample_record_type
        created_at:
          type: string
          description: >-
            ISO 8601 formatted date-time indicating when the resource was
            created.
          readOnly: true
          example: '2018-02-02T22:25:27.521Z'
        updated_at:
          type: string
          description: >-
            ISO 8601 formatted date-time indicating when the resource was
            updated.
          readOnly: true
          example: '2018-02-02T22:25:27.521Z'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````