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

# Close an upload

> Validate and process the staged upload.



## OpenAPI

````yaml openapi.json POST /uploads/{upload_id}/close
openapi: 3.1.0
info:
  description: Push purchase orders and invoices into Pascal.
  title: Pascal Custom Source API
  version: '1'
servers:
  - url: https://app.teampascal.com/api/v1/custom-source
security: []
paths:
  /uploads/{upload_id}/close:
    post:
      tags:
        - Uploads
      summary: Close an upload for processing
      description: Validate and process the staged upload.
      operationId: close_upload_uploads__upload_id__close_post
      parameters:
        - in: path
          name: upload_id
          required: true
          schema:
            title: Upload Id
            type: string
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadStateResponse'
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Conflict
        '410':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Gone
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
          description: Service Unavailable
      security:
        - bearer: []
components:
  schemas:
    UploadStateResponse:
      properties:
        status:
          $ref: '#/components/schemas/UploadStatus'
        upload_id:
          title: Upload Id
          type: string
      required:
        - upload_id
        - status
      title: UploadStateResponse
      type: object
    ErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      required:
        - error
      title: ErrorEnvelope
      type: object
    UploadStatus:
      enum:
        - in_progress
        - done
        - failed
        - expired
        - rejected
      title: UploadStatus
      type: string
    ErrorBody:
      properties:
        code:
          title: Code
          type: string
        details:
          $ref: '#/components/schemas/JsonValue'
        message:
          title: Message
          type: string
      required:
        - code
        - message
      title: ErrorBody
      type: object
    JsonValue: {}
  securitySchemes:
    bearer:
      scheme: bearer
      type: http

````