> ## 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 bank statement uploads

> Generates short-lived presigned URLs that you can use to upload bank
statement PDFs directly to Teal-managed storage. Use this endpoint
before uploading any files and submitting them for processing.




## OpenAPI

````yaml PUT /documents/bank-statements/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:
  /documents/bank-statements/presign:
    put:
      summary: Generate presigned URLs for bank statement uploads
      description: |
        Generates short-lived presigned URLs that you can use to upload bank
        statement PDFs directly to Teal-managed storage. Use this endpoint
        before uploading any files and submitting them for processing.
      parameters:
        - $ref: '#/components/parameters/XAuthorisationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BankStatementPresignRequest'
      responses:
        '200':
          description: Presigned URLs generated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankStatementPresignResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/UnauthorizedBearer'
      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-5f6g-7h8i-9j0k1l2m3n4o
  schemas:
    BankStatementPresignRequest:
      type: object
      required:
        - files
      properties:
        files:
          type: array
          description: Bank statement files that require presigned upload URLs
          minItems: 1
          items:
            $ref: '#/components/schemas/BankStatementPresignRequestFile'
    BankStatementPresignResponse:
      type: object
      required:
        - presigned_urls
      properties:
        presigned_urls:
          type: array
          description: Generated URLs and metadata for uploading the requested files.
          items:
            $ref: '#/components/schemas/BankStatementPresignResponseFile'
    BankStatementPresignRequestFile:
      type: object
      required:
        - file_name
      properties:
        file_name:
          type: string
          description: File name including extension. Must be a PDF.
          example: hsbc-january-2024.pdf
        external_id:
          type: string
          description: Optional identifier echoed back in the presign response.
          example: ext-stmt-2024-01
    BankStatementPresignResponseFile:
      type: object
      required:
        - file_name
        - presigned_url
        - path
      properties:
        file_name:
          type: string
          description: The requested file name.
          example: hsbc-january-2024.pdf
        external_id:
          type: string
          description: Optional identifier provided in the presign request.
          example: ext-stmt-2024-01
        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 bank
            statements.
          example: client/acct123/users/user456/stmt1.pdf
    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`
    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.

````