# Request an upload slot for a file

[All field references](/en/developers/field-reference) · [Files](/en/developers/fields-group-files)

`POST /v1/uploads`

First step for production files (e.g. print or engraving files) and images: you get an upload URL valid for 2 hours and upload the file directly to it with a single HTTP PUT (file content as the body). You then reference the upload_id in items[].files when you create the order. Allowed are images (PNG/JPG/WebP/GIF/SVG), PDF, DXF, EPS/PS, ZIP and text — the actual file content is checked when the order is accepted, not the file extension. At most 50 MB per file. Uploads that are never referenced expire after 14 days. An upload can only be used with a key of the same environment (test or live) as the key you requested the slot with; otherwise creating the order ends with 422 and the error detail file_not_found. Per organization (all keys combined), at most 500 upload slots per hour and 5000 per day apply; if more than 10 GB of uploads not yet used are pending, the API returns 429 (upload_limit_reached) with a Retry-After header.

Required scopes: `"files:write"`.

[How to read these tables](/en/developers/field-reference#reading-the-field-tables)

## Request body

Request body required.

Content type: `application/json`

| Field | Type | Presence | null | Meaning, limits and examples |
| --- | --- | --- | --- | --- |
| $ (whole value) | object | Whole value | Not allowed | Examples: `[{"filename":"engraving.png"}]`. Additional properties are not allowed. |
| filename | string | Required when parent is present | Not allowed | Original filename including extension. Meykt sanitizes it for the upload; the returned filename is authoritative. minLength: `1`. maxLength: `200`. |

## Response 201

201: Success

Content type: `application/json`

| Field | Type | Presence | null | Meaning, limits and examples |
| --- | --- | --- | --- | --- |
| $ (whole value) | object | Whole value | Not allowed | — |
| data | object | Required when parent is present | Not allowed | Authorized response payload or documented event data. |
| data.upload_id | string | Required when parent is present | Not allowed | Identifier of your completed upload from POST /v1/uploads. format: `"uuid"`. |
| data.filename | string | Optional | Not allowed | Original filename supplied when requesting the upload. |
| data.upload_url | string | Required when parent is present | Not allowed | Temporary signed URL to which the file bytes must be uploaded using the returned method. format: `"uri"`. |
| data.method | string | Required when parent is present | Not allowed | HTTP method to use for the signed upload URL. enum: `["PUT"]`. |
| data.expires_in_seconds | integer | Required when parent is present | Not allowed | Lifetime of the signed upload URL in seconds. Example: `7200`. |
| data.max_bytes | integer | Optional | Not allowed | Maximum accepted file size in bytes. Example: `52428800`. |

## Response 400, 401, 403, 413, 422, 429, 500, 503

400: The request is not valid JSON. 401: The key is missing, unknown, revoked or expired. 403: The key lacks a required scope, or the operation requires a live key. 413: The JSON request exceeds 256 KiB. 422: Content validation failed. The response lists all affected locations at once. 429: A rate limit was reached and the request did not run. Wait for Retry-After, then repeat it unchanged. X-RateLimit-Scope names the limit: key (120 requests per minute), organization (300 per minute across all keys), write (1,000 at once, refilling at 60 per minute) or list (300 unfiltered list pages at once, refilling at 10 per minute). 500: Unexpected error on our side. 503: Temporarily unavailable. Repeat the same request with the same business identity.

Content type: `application/json`

| Field | Type | Presence | null | Meaning, limits and examples |
| --- | --- | --- | --- | --- |
| $ (whole value) | object | Whole value | Not allowed | — |
| error | object | Required when parent is present | Not allowed | Machine-readable error code; use it to select the documented recovery path. |
| error.code | string | Required when parent is present | Not allowed | Machine-readable, permanently stable error code. Program against it, not against message. |
| error.message | string | Required when parent is present | Not allowed | Explanation for humans. May change at any time. |
| error.field | string | Optional | Not allowed | Affected location in the request, if it can be determined. |
| error.doc_url | string | Required when parent is present | Not allowed | Documentation link explaining this API error. format: `"uri"`. |
