Files
Get a signed URL to upload a visual
Gives a time-limited URL a browser can send a visual to directly (uploadFileToSignedUrl), without your credentials: ask for it from your server, hand uploadUrl to the page, and the page PUTs the file there. PNG, JPEG or PDF, 25 MB at most. The URL is valid 15 minutes, for one file, on this account and in the key's mode. The file it yields is the one POST /v2/accounts/{accountId}/files would store.
Request
Authorization
Bearer token
Send your API key in the Authorization header: Authorization: Bearer sk_test_…. A sk_test_ key creates and sees test orders only. Keys and test mode.
Path parameters
accountIdstringrequiredUnique identifier of the account, or the alias@mefor the account authenticated by the token. An API key or an OAuth token acts on its own account only: another account's id is refused with 403ACCOUNT_ACCESS_DENIED.
Body application/json
fileNamestringrequiredKept as the file's name (path parts removed)contentTypestring:image/png,image/jpeg,application/pdfrequired
Responses
201The upload URL
successbooleanuploadFileUpload
400fileName or contentType missing (MISSING_PARAMETERS), or a type other than PNG, JPEG or PDF (UNSUPPORTED_FILE_TYPE)
Type: Error
401Unauthorized, authentication required, or an OAuth access token unknown, expired or revoked (INVALID_TOKEN)
Type: Error
403The API key is inactive or revoked (INACTIVE_API_KEY), or the path names another account (ACCOUNT_ACCESS_DENIED); with an OAuth access token: a token of scope mcp (INSUFFICIENT_SCOPE), a path naming another account or a person no longer a member of it (ACCOUNT_ACCESS_DENIED), a real token on the sandbox host (SANDBOX_REQUIRES_TEST_KEY)
Type: Error
500Internal server error
Type: Error