Skip to content

Assign an agent to a zone by hand

PUT/api/public/v1/agents/{agent_id}/zone

Sets zone_override_id, so directory sync stops moving this agent — exactly as ownership already behaves once set by hand. An unknown or retired zone answers 422, not 404: the AGENT exists, the body's zone_id is what is unacceptable.

Terminal window
curl --fail-with-body -X PUT 'https://app.openlatch.ai/api/public/v1/agents/<agent_id>/zone' \
-H "Authorization: Bearer $OPENLATCH_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"zone_id":"<zone_id>"}'
Role in the organizationThis endpoint
ownerAllowed
adminAllowed
editorNot allowed
viewerNot allowed

A key carries the role its owner holds in the organization. See Authentication.

API key scope: zones:write

ParameterTypeDescription
agent_idstringRequired.
ParameterTypeDescription
Idempotency-Keystring or nullOptional. Makes the request safe to retry: the same key and the same request, within 24 hours, returns the stored response with Idempotent-Replayed: true and runs once.
FieldTypeDescription
zone_idstring (uuid)Required.
FieldTypeDescription
assignment_sourcestringRequired.
zone_idstring or nullRequired.
{
"assignment_source": "string",
"zone_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10"
}