MeyktAPI Documentation

Request an upload slot for a file

All field references · 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

#Request body

Request body required.

Content type: application/json

FieldTypePresencenullMeaning, limits and examples
$ (whole value)objectWhole valueNot allowedExamples: [{"filename":"engraving.png"}]. Additional properties are not allowed.
filenamestringRequired when parent is presentNot allowedOriginal 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

FieldTypePresencenullMeaning, limits and examples
$ (whole value)objectWhole valueNot allowed—
dataobjectRequired when parent is presentNot allowedAuthorized response payload or documented event data.
data.upload_idstringRequired when parent is presentNot allowedIdentifier of your completed upload from POST /v1/uploads. format: "uuid".
data.filenamestringOptionalNot allowedOriginal filename supplied when requesting the upload.
data.upload_urlstringRequired when parent is presentNot allowedTemporary signed URL to which the file bytes must be uploaded using the returned method. format: "uri".
data.methodstringRequired when parent is presentNot allowedHTTP method to use for the signed upload URL. enum: ["PUT"].
data.expires_in_secondsintegerRequired when parent is presentNot allowedLifetime of the signed upload URL in seconds. Example: 7200.
data.max_bytesintegerOptionalNot allowedMaximum 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

FieldTypePresencenullMeaning, limits and examples
$ (whole value)objectWhole valueNot allowed—
errorobjectRequired when parent is presentNot allowedMachine-readable error code; use it to select the documented recovery path.
error.codestringRequired when parent is presentNot allowedMachine-readable, permanently stable error code. Program against it, not against message.
error.messagestringRequired when parent is presentNot allowedExplanation for humans. May change at any time.
error.fieldstringOptionalNot allowedAffected location in the request, if it can be determined.
error.doc_urlstringRequired when parent is presentNot allowedDocumentation link explaining this API error. format: "uri".

Machine-readable version of this page: https://www.meykt.com/developers/fields-create-upload.md