Skip to main content

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 edition string 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/fileHash to create an empty Pending edition with no upload. Its response omits file and uploadId, and uploadExpiresAt is null; tusEndpoint and maxFileSize are 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 tusEndpoint URL plus the uploadId to send (base64-encoded) in the Upload-Metadata header when creating the TUS upload.

  • The uploadId never 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; once uploadExpiresAt passes, a new TUS session can be created with the same uploadId and the stalled transfer's data is discarded.

  • fileHash must 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 uploadId stays valid indefinitely. A cancelled or failed transfer is retried by creating a new TUS session with the same uploadId, 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​

Registration result. With file info it includes the TUS endpoint URL and uploadId. For an empty edition, file and uploadId are omitted.