Register an AI model edition
POST/api/v1/orgs/{orgId}/ai-models/{modelId}/editions
Creates the edition (status Pending) and, when file info is supplied, opens an upload session (step 1 of the resumable upload flow).
-
The
editionstring must satisfy all of the following naming restrictions: allowed characters are English letters (a-z, A-Z), digits (0-9), hyphen (-), and underscore (_); forbidden characters are special symbols (such as *, ?, ", <, >, |, :, ;, ,, , ., /), whitespace, and control characters; it MUST NOT exceed 255 characters; and it MUST NOT end with .lock, .tmp, or .staging. -
Omit all of
fileName/fileSize/fileHashto create an emptyPendingedition with no upload. Its response omitsfileanduploadId, anduploadExpiresAtis null;tusEndpointandmaxFileSizeare still returned. Supplying only some of the three returns 400 (InvalidRequest). A file cannot be added to an empty edition later. To add one, delete the edition and register it again. -
When file info is supplied, returns a scoped
tusEndpointURL plus theuploadIdto send (base64-encoded) in theUpload-Metadataheader when creating the TUS upload. -
The
uploadIdnever becomes permanently invalid.uploadExpiresAt(registration + 12 hours, refreshed each time a TUS session is created) marks when an unfinished transfer is considered abandoned: while a session is in progress and fresh, a new one cannot be created; onceuploadExpiresAtpasses, a new TUS session can be created with the sameuploadIdand the stalled transfer's data is discarded. -
fileHashmust be a 64-char lowercase SHA-256 hex string; it is re-verified server-side after the transfer completes. -
An edition can be registered exactly once: re-registering an existing edition returns 409 (WEDA.Common.AlreadyExists) regardless of its status. The
uploadIdstays valid indefinitely. A cancelled or failed transfer is retried by creating a new TUS session with the sameuploadId, without re-registering. -
Returns 400 for an invalid edition string (WEDA.AiModelUpload.InvalidEditionFormat), incomplete file info (InvalidRequest), or a malformed hash (InvalidClientHash). Returns 413 if the file is larger than 50 GB (FileTooLarge), 403 on tenant mismatch (TenantMismatch), 404 if the model is not found (ModelNotFound), and 409 if the edition already exists (WEDA.Common.AlreadyExists).
Request
Responses
- 201
- 400
- 404
- 409
- 413
Registration result. With file info it includes the TUS endpoint URL and uploadId. For an empty edition, file and uploadId are omitted.
Bad Request
Not Found
Conflict
Payload Too Large. The file is larger than 50 GB (FileTooLarge).