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

# Create Upload

> Start a secure file upload for a Shipment Manifest or NCTS Departure goods file.

- The API returns a temporary upload URL and the required headers.
- Use these details to upload the original file securely.
- Once the upload is completed, use the returned `uploadId` in the relevant import request.



## OpenAPI

````yaml /openapi/public-v1.json post /public/v1/uploads
openapi: 3.0.0
info:
  title: Eaze Customs Public API
  version: '1.0'
  description: >-
    Customer API for Shipments, Import and Export Declarations, NCTS Departure
    and Arrival, RTO, and documents. Configure webhook endpoints in the Eaze
    Customs Portal. Authenticate with an Eaze Customs API credential. Staging —
    For Integration Testing: https://staging.api.eazecustoms.com. All routes in
    this specification start with /public/v1.
servers:
  - url: https://staging.api.eazecustoms.com
    description: >-
      Staging — For Integration Testing. Do not append /public/v1. That prefix
      is already part of each path.
security:
  - bearer: []
paths:
  /public/v1/uploads:
    post:
      summary: Create Upload
      description: >-
        Start a secure file upload for a Shipment Manifest or NCTS Departure
        goods file.


        - The API returns a temporary upload URL and the required headers.

        - Use these details to upload the original file securely.

        - Once the upload is completed, use the returned `uploadId` in the
        relevant import request.
      operationId: PublicUploads_create
      parameters:
        - name: X-Eaze-Client-Ref
          in: header
          description: >-
            Required. Send the clientRef returned by List Clients. Do not send
            this header on Get Credential Details or List Clients.
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 100
            example: ACME-AMS
          example: ACME-AMS
        - name: Idempotency-Key
          in: header
          required: true
          schema:
            type: string
            minLength: 1
            maxLength: 200
            pattern: ^[!-~]{1,200}$
            example: 6f1c0b3e-8a21-4c5d-9e10-1a2b3c4d5e6f
          description: >-
            Required. Use 1 to 200 visible ASCII characters. Create a new key
            for a new request. Send the same key only when you retry the exact
            same request after a network failure. The same key with a different
            body is rejected.
          example: 6f1c0b3e-8a21-4c5d-9e10-1a2b3c4d5e6f
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePublicUploadDto'
            examples:
              shipmentManifest:
                summary: Shipment manifest
                value:
                  purpose: shipment_manifest
                  filename: manifest.csv
                  contentType: text/csv
                  byteLength: 73
                  sha256: >-
                    4ea9a34e9b058915cb420a3b6f18fee40a6b877b0f330e33b5497c1fc0370a4d
              nctsItems:
                summary: NCTS Departure goods file
                value:
                  purpose: ncts_items
                  filename: ncts-items.csv
                  contentType: text/csv
                  byteLength: 128
                  sha256: >-
                    4ea9a34e9b058915cb420a3b6f18fee40a6b877b0f330e33b5497c1fc0370a4d
      responses:
        '201':
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicUploadCreatedDto'
              example:
                id: aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa
                purpose: shipment_manifest
                status: pending
                upload:
                  method: PUT
                  url: >-
                    https://example-uploads.invalid/manifest.csv?signature=example
                  requiredHeaders:
                    content-type: text/csv
                    content-length: '73'
                    content-disposition: attachment; filename="manifest.csv"
                    x-amz-checksum-sha256: TqmjTpsFiRXLQgo7bxj+5Aprh3sPMw4ztUl8H8A3Ck0=
                    x-amz-meta-upload-id: aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa
                    x-amz-meta-credential-id: 11111111-1111-4111-8111-111111111111
                    x-amz-meta-client-company-id: example-client
                    x-amz-meta-sha256: >-
                      4ea9a34e9b058915cb420a3b6f18fee40a6b877b0f330e33b5497c1fc0370a4d
                    x-amz-server-side-encryption: AES256
                    cache-control: no-store
                expiresAt: '2026-11-17T09:25:00.000Z'
        '400':
          description: E0001 — malformed or invalid request.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E0001
                message: Invalid request parameters
                errors:
                  - field: shipmentType
                    message: 'Invalid option: expected one of "IMPORT"|"EXPORT"'
                requestId: 550e8400-e29b-41d4-a716-446655440000
        '401':
          description: >-
            E0002 — missing, invalid, expired or revoked Eaze Customs API
            credential.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E0002
                message: >-
                  Missing, invalid, expired or revoked Eaze Customs API
                  credential
                errors: []
                requestId: 550e8400-e29b-41d4-a716-446655440000
        '403':
          description: E0003 — credential, module or client authorization denied.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E0003
                message: The import module is not enabled for this credential
                errors: []
                requestId: 550e8400-e29b-41d4-a716-446655440000
        '409':
          description: E0006 — idempotency or resource-state conflict.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E0006
                message: Idempotency-Key was already used with a different request
                errors:
                  - code: idempotency_key_reused
                    message: Idempotency-Key was already used with a different request
                requestId: 550e8400-e29b-41d4-a716-446655440000
        '413':
          description: E9999 — upload exceeds the documented size limit.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E9999
                message: Upload exceeds the 20971520 byte limit
                errors: []
                requestId: 550e8400-e29b-41d4-a716-446655440000
        '415':
          description: E0007 — upload media type or filename extension is unsupported.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E0007
                message: Only CSV and XLSX uploads are supported
                errors: []
                requestId: 550e8400-e29b-41d4-a716-446655440000
        '429':
          description: >-
            E0008 — Public API rate limit exceeded; retry after the indicated
            delay.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E0008
                message: Public API rate limit exceeded
                errors: []
                requestId: 550e8400-e29b-41d4-a716-446655440000
        '500':
          description: >-
            E0009 — unexpected server error; report requestId if the problem
            persists.
          headers:
            X-Request-Id:
              description: >-
                Globally unique request UUID; identical to requestId in the
                error body and structured logs.
              schema:
                type: string
                format: uuid
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
              example:
                errorCode: E0009
                message: Unexpected server error
                errors: []
                requestId: 550e8400-e29b-41d4-a716-446655440000
      security:
        - bearer: []
components:
  schemas:
    CreatePublicUploadDto:
      type: object
      properties:
        purpose:
          type: string
          enum:
            - ncts_items
            - shipment_manifest
          x-nestjs_zod-parent-additional-properties: false
          description: >-
            shipment_manifest for a Shipment CSV or Excel file. ncts_items for
            an NCTS Departure goods file.
        filename:
          type: string
          minLength: 1
          maxLength: 200
          x-nestjs_zod-parent-additional-properties: false
          description: >-
            File name ending in .csv or .xlsx. The extension must match
            contentType. Start with a letter or number. The name can contain
            letters, numbers, spaces, dots, underscores, hyphens, and
            parentheses, up to 200 characters.
        contentType:
          type: string
          enum:
            - text/csv
            - application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
          x-nestjs_zod-parent-additional-properties: false
          description: >-
            text/csv for a CSV file, or
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
            for an Excel .xlsx file.
        byteLength:
          type: integer
          minimum: 1
          maximum: 20971520
          x-nestjs_zod-parent-additional-properties: false
          description: >-
            Exact size of the file in bytes. Maximum 20971520 bytes, which is 20
            MB. Calculate this from the same bytes you upload.
        sha256:
          type: string
          pattern: ^[0-9a-fA-F]{64}$
          x-nestjs_zod-parent-additional-properties: false
          description: >-
            SHA-256 fingerprint of the exact file bytes, as 64 hexadecimal
            characters. Eaze Customs stores it in lowercase.
      required:
        - purpose
        - filename
        - contentType
        - byteLength
        - sha256
    PublicUploadCreatedDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: >-
            Public Upload ID. Use it to complete the upload and later to import
            the file.
        purpose:
          type: string
          enum:
            - ncts_items
            - shipment_manifest
          description: >-
            shipment_manifest for a shipment file. ncts_items for an NCTS
            departure goods file.
        status:
          type: string
          enum:
            - pending
          description: pending means the file has not been uploaded yet.
        upload:
          $ref: '#/components/schemas/PublicUploadInstructionDto'
          description: Where and how to send the file.
        expiresAt:
          type: string
          format: date-time
          description: >-
            When this upload address expires. Date and time in ISO 8601 format.
            Example: 2026-11-17T10:30:00Z.
      required:
        - id
        - purpose
        - status
        - upload
        - expiresAt
    PublicApiError:
      type: object
      required:
        - errorCode
        - message
        - errors
        - requestId
      properties:
        errorCode:
          type: string
          example: E0001
        message:
          type: string
          example: Invalid request parameters
        errors:
          type: array
          items:
            $ref: '#/components/schemas/PublicApiValidationIssue'
        requestId:
          type: string
          format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
    PublicUploadInstructionDto:
      type: object
      properties:
        method:
          type: string
          enum:
            - PUT
          description: HTTP method for the file upload. Always PUT.
        url:
          type: string
          format: uri
          description: Short-lived presigned private upload URL.
        requiredHeaders:
          type: object
          additionalProperties:
            type: string
            description: Exact value to send for this header.
          example:
            content-type: text/csv
            content-length: '205'
            content-disposition: attachment; filename="ncts-items.csv"
            x-amz-checksum-sha256: eBhHylBbU3MDsaWhk9HOHkt1wm0toijzlCtg9m1bC50=
            x-amz-meta-upload-id: 550e8400-e29b-41d4-a716-446655440000
            x-amz-meta-credential-id: 6ff2697f-c341-4e40-8802-01e8ae5a0990
            x-amz-meta-client-company-id: '31'
            x-amz-meta-sha256: 781847ca505b537303b1a5a193d1ce1e4b75c26d2da228f3942b60f66d5b0b9d
            x-amz-server-side-encryption: AES256
            cache-control: no-store
          description: >-
            Headers you must send with the file upload. Each name is an HTTP
            header, and each value is the exact text to send. Copy every header
            unchanged.
      required:
        - method
        - url
        - requiredHeaders
    PublicApiValidationIssue:
      type: object
      required:
        - message
      properties:
        field:
          type: string
          example: filename
        code:
          type: string
          example: invalid_format
        message:
          type: string
          example: Filename contains unsupported characters
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: EZ_<credential-id>_<secret>
      type: http
      description: >-
        Send Authorization: Bearer followed by the full Eaze Customs API
        credential. The credential looks like EZ_<credential-id>_<secret>. It is
        shown only when Eaze Customs creates or rotates it.

````

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