Skip to content
OperadeDocs

Search documentation

Type to search documentation.

Documentation
Copy page
Open raw Markdown

Update agent deployments

Replace the agent's branch traffic distribution with percentages totaling 100.

Endpoint

PUT/api/v1/workspaces/{workspace_id}/agents/{agent_id}/deployments

Authentication

Operation classAuthenticationMinimum roleAPI key
customer-apiBearer API key or dashboard session cookie; dashboard mutations also require X-CX-Request: 1.adminAllowed

Parameters

NameInTypeRequiredDescription
workspace_idpathstringYes—
agent_idpathstringYes—

Request body

application/json request schema

Field pathTypeReferenceFormatNullableRequiredEnumDescription
$objectPermintaanDeployment—NoYes——
branchesarray<BobotDeployment>——NoYes——
branches[]objectBobotDeployment—NoYes——
branches[].branch_idstring——NoYes——
branches[].percentagenumber or string——NoYes——

Example

cURL
curl --request PUT 'https://operade.ai/api/v1/workspaces/ws_demo/agents/agt_demo/deployments' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{"branches":[{"branch_id":"br_main","percentage":"100.00"}]}'
Request body JSON
{
  "branches": [
    {
      "branch_id": "br_main",
      "percentage": "100.00"
    }
  ]
}

Responses

StatusDescriptionContent
4XXHandled client errorapplication/json: ErrorResponse
200Successful Responseapplication/json: DeploymentMutationResponse

4XX application/json response schema

Field pathTypeReferenceFormatNullableRequiredEnumDescription
$objectErrorResponse—NoYes——
errorobjectErrorItem—NoYes——
error.codestring——NoYes——
error.detailsobject——NoNo——
error.messagestring——NoYes——

200 application/json response schema

Field pathTypeReferenceFormatNullableRequiredEnumDescription
$objectDeploymentMutationResponse—NoYes——
changedboolean——NoYes——
deployment_idstring or null——YesYes——
distributionarray<TrafficAllocation>——NoYes——
distribution[]objectTrafficAllocation—NoYes——
distribution[].basis_pointsinteger——NoYes——
distribution[].branch_idstring——NoYes——
distribution[].percentagestring——NoYes——

Response example

Response body JSON
{
  "changed": false,
  "deployment_id": "string",
  "distribution": []
}

Errors

Reviewed common and route-declared errors are summarized here; the list is not exhaustive. Start with the distributed error index to find each code's canonical domain page.

StatusCodeDescription
401unauthenticatedAuthentication is missing, invalid, or revoked.
403forbiddenOnly an admin or owner can deploy branch traffic.
404not_foundThe requested workspace resource was not found.
422deployment_invalidThe requested distribution has invalid percentages, duplicate branches, unknown branches, or an active traffic total other than 100 percent.
409deployment_branch_archivedRestore archived branches before deploying traffic to them.
409deployment_staleA selected live branch has no published version or is no longer ready for production traffic.
On this page
  1. Endpoint
  2. Authentication
  3. Parameters
  4. Request body
  5. application/json request schema
  6. Example
  7. Responses
  8. 4XX application/json response schema
  9. 200 application/json response schema
  10. Response example
  11. Errors
  12. Related operations