> ## 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.

# Presign doc scan uploads

> Generates short-lived presigned URLs that you can use to upload
documents (P45, P60, or Universal Credit statements) directly to
Teal-managed storage, before submitting them for scanning and
extraction with `POST /doc-scan`.

The request must include at least one file, file names must not
contain `/`, and at most 12 files can be requested at once. At least
one of `p45_scan_enabled`, `p60_scan_enabled` or
`universal_credit_scan_enabled` must be enabled for the user (see
client and user configuration).




## OpenAPI

````yaml PUT /doc-scan/presign
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:
  /doc-scan/presign:
    put:
      summary: Generate presigned URLs for document scan uploads
      description: |
        Generates short-lived presigned URLs that you can use to upload
        documents (P45, P60, or Universal Credit statements) directly to
        Teal-managed storage, before submitting them for scanning and
        extraction with `POST /doc-scan`.

        The request must include at least one file, file names must not
        contain `/`, and at most 12 files can be requested at once. At least
        one of `p45_scan_enabled`, `p60_scan_enabled` or
        `universal_credit_scan_enabled` must be enabled for the user (see
        client and user configuration).
      parameters:
        - $ref: '#/components/parameters/XAuthorisationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocScanPresignRequest'
      responses:
        '200':
          description: Presigned URLs generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocScanPresignResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/UnauthorizedBearer'
        '403':
          description: Forbidden — the user has no valid authorisation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - BearerAuth: []
components:
  parameters:
    XAuthorisationId:
      name: x-teal-authorisation-id
      in: header
      required: false
      description: >-
        Optional authorisation ID to associate with this request. If not
        provided, the system will attempt to resolve a valid authorisation for
        the user automatically.
      schema:
        type: string
        format: uuid
        example: 7f3b8c2a-1d4e-4f6a-8b8c-9a0b1c2d3e4f
  schemas:
    DocScanPresignRequest:
      type: object
      required:
        - files
      properties:
        files:
          type: array
          description: Document files that require presigned upload URLs
          minItems: 1
          maxItems: 12
          items:
            $ref: '#/components/schemas/DocScanPresignRequestFile'
    DocScanPresignResponse:
      type: object
      required:
        - presigned_urls
      properties:
        presigned_urls:
          type: array
          description: Generated URLs and metadata for uploading the requested files.
          items:
            $ref: '#/components/schemas/DocScanPresignResponseFile'
    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`
    DocScanPresignRequestFile:
      type: object
      required:
        - file_name
      properties:
        file_name:
          type: string
          description: File name including extension. Must not contain `/`.
          example: p45.pdf
        external_id:
          type: string
          description: Optional identifier echoed back in the presign response.
          example: ext-p45-2024-05
    DocScanPresignResponseFile:
      type: object
      required:
        - file_name
        - presigned_url
        - path
      properties:
        file_name:
          type: string
          description: The requested file name.
          example: p45.pdf
        external_id:
          type: string
          description: Optional identifier provided in the presign request.
          example: ext-p45-2024-05
        presigned_url:
          type: string
          format: uri
          description: The URL to upload the file content to via HTTP PUT.
          example: >-
            https://s3.amazonaws.com/bucket/presigned-upload-key?signature=abc123
        path:
          type: string
          description: The storage path that must be echoed when submitting the documents.
          example: client/acct123/users/user456/p45.pdf
    UnauthorizedBarer:
      type: object
      properties:
        errors:
          type: array
          items:
            type: string
          description: An array of messages describing the errors
          example:
            - 'Not Authorization: Bearer <token> 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'
    UnauthorizedBearer:
      description: Unauthorized if the X-API-KEY is not provided or is wrong
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthorizedBarer'
  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"
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token for authentication. The token should be the one returned by
        the /user-tokens endpoint.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.