Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

Send Authorization: Bearer <api_key>. The legacy Authorization: Api-Key <api_key> scheme is also accepted.

Path Parameters

model_id
string
required
deployment_id
string
required

Body

application/json

A patch to stage against the development deployment.

Staging is durable on its own: the patch is persisted independently of the later sync, so a failed sync does not lose it.

prev_patch_hash
string
required

Content hash of the patch point this patch is applied on - the link the staged patch must build on. A stale value (the base moved underneath the client) is rejected with a conflict.

next_patch_point
DeploymentPatchPointV1 · object
required

The source state after this patch. The server derives its content hash from content_hashes.

patch_ops
(DeploymentPatchOpModelCodeV1 · object | DeploymentPatchOpPackageV1 · object | DeploymentPatchOpConfigV1 · object | DeploymentPatchOpPythonRequirementV1 · object | DeploymentPatchOpEnvVarV1 · object | DeploymentPatchOpExternalDataV1 · object)[]
required

The ordered ops that make up this patch. At least one op is required; a patch that changes nothing is not a valid request. There is no op for a directory: a directory comes into existence when the first file under it is added, and is removed when its last file is removed, so directory creation and deletion happen implicitly through the file ops. Adding or removing an otherwise empty directory therefore produces no ops even though it changes the source hash; do not send a patch request for such a change.

Minimum array length: 1

Add, update, or remove a file under the model code directory.

Response

200 - application/json

The created patch, represented by the patch point it produced.

patch_point
DeploymentPatchPointWithHashV1 · object
required

The resulting patch point the staged patch produced; matches the pending point a subsequent state read returns.