Skip to content
Connect an agent

Organisations

Choose which agents may connect to an organisation

Turns "Only approved agents can connect" on or off and sets the approved agents.

PUT/orgs/{org}/policies/agents

TL;DR

QuestionAnswer
What does it do?Choose which agents may connect to an organisation.
What does it take?A JSON body of type AllowedAgentsPolicyBody.
What does it return?Status 200 with a body of type AllowedAgentsPolicyResult.
What can go wrong?400 the body is not valid, or an entry cannot be used (orgs.policy_invalid); 401 not signed in; 403 a member or a reader (orgs.forbidden), a plan without the policies (plan.policies_not_included), or the request came from an origin that may not make changes; 404 no such organisation, or the caller is not a member of it; 429 too many requests; 503 organisations are not set up on this server. Every failure uses the one error envelope.

What it does

Turns "Only approved agents can connect" on or off and sets the approved agents. Connections of agents the list no longer approves are ended; dryRun answers how many. Enterprise to turn on; off works on any plan.

Path parameters

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.

Request body

The body has the type AllowedAgentsPolicyBody.

FieldTypeRequiredDescription
enabledbooleanyes
agents(object | object)[]yes
dryRunbooleannoAnswer how many connections the change would end, and change nothing.

Responses

StatusMeaningBody
200The policy as stored, and how many connections ended.AllowedAgentsPolicyResult
400The body is not valid, or an entry cannot be used (orgs.policy_invalid).ErrorResponse
401Not signed in.ErrorResponse
403A member or a reader (orgs.forbidden), a plan without the policies (plan.policies_not_included), or the request came from an origin that may not make changes.ErrorResponse
404No such organisation, or the caller is not a member of it.ErrorResponse
429Too many requests.ErrorResponse
503Organisations are not set up on this server.ErrorResponse

Response body

A 200 answer has the type AllowedAgentsPolicyResult.

FieldTypeRequiredDescription
enabledbooleanyes
agentsAllowedAgent[]yes
connectionsEndedintegeryesThe connections from agents the list no longer approves, which the change ended (or with dryRun, would end).
dryRunbooleanyes

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools