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

# Start an art upload

> Start uploading one art file. PUT its bytes to `uploadUrl` with exactly `uploadHeaders`, then finalize it. The file type and size limit are checked here and again at finalize; a file that can't be taken is `422 upload_refused`. The upload is yours: no other account can finalize or use it.



## OpenAPI

````yaml /api/partners/openapi.json post /api/partners/v1/uploads
openapi: 3.1.0
info:
  title: DEKHQ Partner REST API
  version: 1.0.0
  description: >-
    JSON versions of the PromoStandards Order Status and Order Shipment
    Notification services, and the partner order API. Same credentials, scopes
    and rate limit as the SOAP endpoints. Generated from the dekhq repo; do not
    edit by hand.
servers:
  - url: https://partners.dekhq.com
security:
  - basicAuth: []
paths:
  /api/partners/v1/uploads:
    post:
      summary: Start an art upload
      description: >-
        Start uploading one art file. PUT its bytes to `uploadUrl` with exactly
        `uploadHeaders`, then finalize it. The file type and size limit are
        checked here and again at finalize; a file that can't be taken is `422
        upload_refused`. The upload is yours: no other account can finalize or
        use it.
      operationId: createUpload
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUploadBody'
            example:
              filename: front-logo.png
              sizeBytes: 482113
      responses:
        '201':
          description: Success.
          headers:
            X-Request-Id:
              description: Id of this call. Quote it when you contact us.
              schema:
                type: string
          content:
            application/json:
              schema:
                type: object
                properties:
                  upload:
                    $ref: '#/components/schemas/Upload'
                  uploadUrl:
                    type: string
                    description: >-
                      PUT the file's bytes here, with exactly `uploadHeaders`.
                      Good for a few minutes.
                  uploadMethod:
                    type: string
                    const: PUT
                    description: The HTTP method to send the bytes with.
                  uploadHeaders:
                    type: object
                    properties:
                      Content-Type:
                        type: string
                        description: >-
                          Send exactly this Content-Type with the bytes; any
                          other is refused.
                    required:
                      - Content-Type
                    additionalProperties: false
                required:
                  - upload
                  - uploadUrl
                  - uploadMethod
                  - uploadHeaders
                additionalProperties: false
              example:
                upload:
                  uploadId: upl_7Hq2Xk9Lm3Np8Rs4Tv6Wy1Za5Bc0De2F
                  filename: front-logo.png
                  status: pending
                uploadUrl: https://uploads.example.com/quarantine/upload?signature=FAKE
                uploadMethod: PUT
                uploadHeaders:
                  Content-Type: image/png
        '400':
          description: >-
            A query parameter or body field is missing or invalid. `errors[]`
            lists each field.
          headers:
            X-Request-Id:
              description: Id of this call. Quote it when you contact us.
              schema:
                type: string
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://docs.dekhq.com/api/partners/errors#invalid_request
                title: Invalid request
                status: 400
                detail: >-
                  A query parameter or body field is missing or invalid.
                  `errors[]` lists each field.
                code: invalid_request
                requestId: req_0123456789abcdef
        '401':
          description: Missing or invalid credentials.
          headers:
            X-Request-Id:
              description: Id of this call. Quote it when you contact us.
              schema:
                type: string
            WWW-Authenticate:
              description: Basic realm="DEKHQ Partner API"
              schema:
                type: string
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://docs.dekhq.com/api/partners/errors#unauthenticated
                title: Unauthenticated
                status: 401
                detail: Missing or invalid credentials.
                code: unauthenticated
                requestId: req_0123456789abcdef
        '403':
          description: Your credential is not enabled for the scope this endpoint needs.
          headers:
            X-Request-Id:
              description: Id of this call. Quote it when you contact us.
              schema:
                type: string
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://docs.dekhq.com/api/partners/errors#forbidden
                title: Forbidden
                status: 403
                detail: >-
                  Your credential is not enabled for the scope this endpoint
                  needs.
                code: forbidden
                requestId: req_0123456789abcdef
        '413':
          description: The request body is larger than this endpoint accepts.
          headers:
            X-Request-Id:
              description: Id of this call. Quote it when you contact us.
              schema:
                type: string
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://docs.dekhq.com/api/partners/errors#payload_too_large
                title: Payload too large
                status: 413
                detail: The request body is larger than this endpoint accepts.
                code: payload_too_large
                requestId: req_0123456789abcdef
        '422':
          description: >-
            The file can't be taken: its type isn't an art type we accept, it is
            empty or too large, its contents don't match its extension, or its
            bytes never arrived. `detail` says which. Start a new upload.
          headers:
            X-Request-Id:
              description: Id of this call. Quote it when you contact us.
              schema:
                type: string
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://docs.dekhq.com/api/partners/errors#upload_refused
                title: Upload refused
                status: 422
                detail: >-
                  The file can't be taken: its type isn't an art type we accept,
                  it is empty or too large, its contents don't match its
                  extension, or its bytes never arrived. `detail` says which.
                  Start a new upload.
                code: upload_refused
                requestId: req_0123456789abcdef
        '429':
          description: More than the allowed requests per minute.
          headers:
            X-Request-Id:
              description: Id of this call. Quote it when you contact us.
              schema:
                type: string
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://docs.dekhq.com/api/partners/errors#rate_limited
                title: Rate limited
                status: 429
                detail: More than the allowed requests per minute.
                code: rate_limited
                requestId: req_0123456789abcdef
        '500':
          description: An unexpected error on our side. It is logged; retry later.
          headers:
            X-Request-Id:
              description: Id of this call. Quote it when you contact us.
              schema:
                type: string
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
              example:
                type: https://docs.dekhq.com/api/partners/errors#internal
                title: Internal error
                status: 500
                detail: An unexpected error on our side. It is logged; retry later.
                code: internal
                requestId: req_0123456789abcdef
components:
  schemas:
    CreateUploadBody:
      type: object
      properties:
        filename:
          type: string
          minLength: 1
          maxLength: 255
          description: The file name with its extension. The extension decides the type.
        sizeBytes:
          type: integer
          minimum: 1
          description: The file size in bytes.
      required:
        - filename
        - sizeBytes
      additionalProperties: false
      description: An art file you are about to upload.
    Upload:
      type: object
      properties:
        uploadId:
          type: string
          pattern: ^upl_[A-Za-z0-9]{1,64}$
          description: The id of an upload you finalized.
        status:
          type: string
          enum:
            - pending
            - finalized
          description: '`pending` until finalize has checked and stored the file.'
        filename:
          type: string
          description: The file name you gave.
      required:
        - uploadId
        - status
        - filename
      additionalProperties: false
      description: An art upload.
    Problem:
      type: object
      properties:
        type:
          type: string
          description: URI of the docs entry for this error code.
        title:
          type: string
          description: Short summary of the error code; the same for every occurrence.
        status:
          type: integer
          description: The HTTP status code.
        detail:
          type: string
          description: What went wrong in this request.
        code:
          type: string
          enum:
            - forbidden
            - idempotency_conflict
            - internal
            - invalid_request
            - not_found
            - order_refused
            - payload_too_large
            - rate_limited
            - unauthenticated
            - upload_refused
          description: Stable, machine-readable error code.
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ProblemFieldError'
          description: The rejected fields, for `invalid_request` and `order_refused`.
        currentTotal:
          type: string
          pattern: ^\d{1,10}\.\d{2}$
          description: >-
            With `order_refused` and a `total_changed` field error: the order's
            current total in US dollars, e.g. `1234.50`. Send it back as
            `expectedTotal` once you accept it.
        requestId:
          type: string
          description: >-
            The X-Request-Id of the call that produced this problem. Quote it
            when you contact us. A submission's stored refusal, replayed for its
            Idempotency-Key or a poll, keeps the id of the call that refused it.
      required:
        - type
        - title
        - status
        - detail
        - code
        - requestId
      additionalProperties: false
      description: An RFC 9457 problem (application/problem+json).
    ProblemFieldError:
      type: object
      properties:
        field:
          type: string
          description: >-
            Dotted path of the field, e.g. `lines.0.quantity`, or the query
            parameter name.
        code:
          type: string
          description: >-
            Why the field was rejected, e.g. `invalid_type`, `too_small`,
            `unrecognized_keys`, `not_supported_yet`, `total_changed`.
      required:
        - field
        - code
      additionalProperties: false
      description: One rejected field.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Your DEKHQ partner `id` and `password`.

````

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