Agents API

List deployments for an environment

get
https://api.dev.poly.ai/v1/agents/{agentId}/deployments

Query Parameters

environmentstringrequired

Environment to list deployments for (sandbox, pre-release, live)

Allowed values:sandboxpre-releaselive

limitinteger

Max number of deployments to return

Path Parameters

agentIdstringrequired

Response

application/json

Successful response

GetDeploymentsResponse

Deployments for the requested environment, ordered newest first.

deploymentsarray[object]required

A deployment of an agent version to a specific environment, plus
who created it and when.

Show Child Parameters
get/v1/agents/{agentId}/deployments
 
application/json

Get active deployment per environment

get
https://api.dev.poly.ai/v1/agents/{agentId}/deployments/active

Path Parameters

agentIdstringrequired

Response

application/json

Successful response

ActiveDeploymentsResponse

The latest deployment for each environment (sandbox, pre-release,
live). Entries are null when no deployment exists for an environment.

activeDeploymentsobjectrequired

Latest deployment per environment (sandbox, pre-release, live). Value is null if no deployment exists for that environment.

get/v1/agents/{agentId}/deployments/active
 
application/json

Publish the current draft to an environment

post
https://api.dev.poly.ai/v1/agents/{agentId}/deployments/publish

Path Parameters

agentIdstringrequired

Body

application/json

PublishDeploymentBody

Metadata attached to a publish action, with an optional target environment.

deploymentMessagestring

Message describing this publish

Default:

environmentstring

Environment to publish to (defaults to sandbox)

Response

application/json

Successful response

MutationDeploymentResponse

The resulting deployment from a promote / rollback / publish action,
plus any test runs it triggered.

deploymentobjectrequired

A deployment of an agent version to a specific environment, plus
who created it and when.

Show Child Parameters
testRunIdsarray[string]

IDs of test runs triggered by this deployment action

post/v1/agents/{agentId}/deployments/publish

Body

{}
 
application/json

Promote a deployment to the next environment

post
https://api.dev.poly.ai/v1/agents/{agentId}/deployments/{deploymentId}/promote

Path Parameters

agentIdstringrequired
deploymentIdstringrequired

Body

application/json

PromoteDeploymentBody

Metadata attached to a promote action: an optional message and an
explicit target environment override.

deploymentMessagestring

Message describing this promotion

Default:

targetEnvironmentstring

Target environment to promote to. If omitted, promotes to the next environment in sequence (sandbox->pre-release->live).

Response

application/json

Successful response

MutationDeploymentResponse

The resulting deployment from a promote / rollback / publish action,
plus any test runs it triggered.

deploymentobjectrequired

A deployment of an agent version to a specific environment, plus
who created it and when.

Show Child Parameters
testRunIdsarray[string]

IDs of test runs triggered by this deployment action

post/v1/agents/{agentId}/deployments/{deploymentId}/promote

Body

{}
 
application/json

Rollback to a previous deployment

post
https://api.dev.poly.ai/v1/agents/{agentId}/deployments/{deploymentId}/rollback

Path Parameters

agentIdstringrequired
deploymentIdstringrequired

Body

application/json

RollbackDeploymentBody

Metadata attached to a rollback action.

deploymentMessagestring

Message describing this rollback

Default:

Response

application/json

Successful response

MutationDeploymentResponse

The resulting deployment from a promote / rollback / publish action,
plus any test runs it triggered.

deploymentobjectrequired

A deployment of an agent version to a specific environment, plus
who created it and when.

Show Child Parameters
testRunIdsarray[string]

IDs of test runs triggered by this deployment action

post/v1/agents/{agentId}/deployments/{deploymentId}/rollback

Body

{}
 
application/json