POST/v2/image-upload

Upload an image for later use

Uploads an image for later use and returns its stored file details. Send the image as a multipart form field named image; you can also provide its location in the optional info metadata object. The response includes the image URL and generated identifier.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

2 body fields

Multipart form data containing the image file and optional metadata.

imagestringrequired
The image file to upload.
infoobjectoptional
Optional image metadata object. Its `location` field can record the image's location.

5 status codes
201Returns the created image details, including its identifier, file URL, filename, creation time, and any supplied location.
createdAtstringrequired
fileUrlstringrequired
filenamestringrequired
idintegerrequired
locationstringoptional
requestFilenamestringrequired
400Returned when the request is invalid, including when the required image file is missing.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
401Returned when the request is unauthenticated.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
403Returned when access to the requested operation is forbidden.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
404Returned when the requested resource is not found.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional

Error handling

A 400 indicates the request is invalid; a 401 indicates authentication is missing or invalid; a 403 indicates access is forbidden; and a 404 indicates the requested resource was not found. The image field is required and must contain the uploaded file; send the request as multipart form data.