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

# Retrieve a specific document



## OpenAPI

````yaml GET /documents/{document_id}
openapi: 3.0.1
info:
  title: Payroll API
  description: A full flagged payroll api provided by Teal
  version: 1.0.0
servers:
  - url: https://api.sandbox.goteal.co
    description: Sandbox server for experiments
  - url: https://api.goteal.co
    description: Production server
security:
  - ApiKeyAuth: []
  - MemberBearerAuth: []
paths:
  /documents/{document_id}:
    get:
      summary: Returns all documents for a user entry
      parameters:
        - in: path
          name: document_id
          schema:
            type: string
          required: true
          description: The id of the file
      responses:
        '200':
          description: Document response
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/DocumentResponse'
                  - properties:
                      file_contents:
                        type: string
                        description: Base-64 encoded string containing file contents
                        example: JVBERi0xLjQKJdPr6eEKMSAwIG9iago8PC9UaXRsZSAoS...
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/UnauthorizedApiKey'
components:
  schemas:
    DocumentResponse:
      type: object
      required:
        - document_id
        - file_name
        - type
        - uploaded_at
        - file_contents
      properties:
        document_id:
          type: string
          format: uuid
          description: A unique document identifier
          example: 95a0e70b-fe02-4f47-aef9-2efff279df71
        file_name:
          type: string
          description: Name of the file
          example: payslip1.pdf
        document_external_id:
          type: string
          description: >-
            A string coming from the parameters of the uploaded payslip1.pdf
            either the form field name or `external_document_id` header for the
            file part. It might not be unique and depends on what's passed when
            uploading.
          example: payslip123456
        type:
          type: string
          description: The type of document (Payslip, Bank Statement, or Document)
          example: Payslip
        uploaded_at:
          $ref: '#/components/schemas/Date'
    Date:
      type: string
      format: date-time
      example: '2019-05-17T00:00:00.000Z'
    Error:
      required:
        - errors
      type: object
      properties:
        errors:
          type: array
          items:
            type: string
          description: An array of messages describing the errors
          example:
            - The request is missing the required field `name`
    Unauthorized:
      type: object
      properties:
        errors:
          type: string
          description: An array of messages describing the errors
          example:
            - No X-API-KEY header provided or wrong value
  responses:
    BadRequest:
      description: Bad request if one of the required parameters is missing
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    UnauthorizedApiKey:
      description: Unauthorized if the X-API-KEY is not provided or is wrong
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Unauthorized'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
    MemberBearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token for authentication. The token should be the one returned by
        the "/members/signin"

````