N1 APIDemo shop

FILES / Files

POST

/files/upload-url

Live

Get a 5-minute presigned upload for a drawing, PO or photo

Compare

Records the file against its entity (entityType + entityId) and returns a presigned S3 POST that lives 5 minutes. Send upload.fields as multipart form fields, then the bytes as the last field file, to upload.url; the file never passes through Core. S3 itself refuses a different Content-Type or more bytes than sizeBytes. The file starts PENDING; a check job marks it READY (usually within seconds of the upload) or REJECTED, and only a READY file can be downloaded. Needs Authorization: Bearer <app token>, the file.upload permission and an Idempotency-Key: a retry by the same person with the same key returns the same file with a fresh signature while the upload can still finish in time. Types: JPEG, PNG, WebP, PDF, CSV, XLSX, DXF, STEP, with a name ending in the type's extension. Up to 25 MiB a file; 500 uploads or 2 GiB per shop in any 24 hours.

POST/files/upload-url

Who can call this. file.upload: owner, admin, accountant, supervisor, QC (operators: own jobs, once job cards exist).

Headers

  • X-Request-IdstringOptional

    Your id for this request (8–128 characters of A–Z a–z 0–9 . _ : -). Echoed back in the response header and in every error, so you can quote it when reporting a problem. Core makes one if you send none.

    Example: app-7f3c2a9e-checkout

Returns

A small JSON object; see the response examples on the right.

Errors

CodeHTTPWhen
FILE_TOO_LARGE413sizeBytes is over the 25 MiB upload limit.
FILE_TYPE_NOT_ALLOWED415contentType is not a JPEG, PNG or WebP photo, PDF, CSV, XLSX, DXF or STEP file.
VALIDATION_FAILED400Input failed Zod or route schema validation. details lists each field path and problem.
FILE_QUOTA_EXCEEDED429The shop asked for more than 500 uploads or 2 GiB in the last 24 hours. The limit frees up as the day rolls on.
FORBIDDEN403Signed in, but the role or tenant does not allow the action.
IDEMPOTENCY_KEY_REQUIRED400A write from a device or retry-prone client was sent without the Idempotency-Key header.
UNAUTHENTICATED401No session, or the token is missing, expired or invalid.

Every error has the same body. See Errors.

Rate limit tier

Tier: per user. Over the limit you get RATE_LIMITED (HTTP 429) with a Retry-After header. See Response handling.