TeamCity REST API Reference 2024.03 Help

Manage Agent Pools

This article lists REST API requests concerning agent pools.

Get Agent Pools

To get a list of all agent pools, use:


The request responds with an AgentPools entity which contains instances of an AgentPool entity. The request accepts locator parameter which should be typed as AgentPoolLocator.

For example, to get a pool named MyPool, use:


Create Agent Pool

To create an empty pool, POST an empty AgentPool entity to:


Example payload:

<agentPool name="string"/>
{ "name" : "name" }

Update Agent Pool

To update an existing pool, PUT an updated AgentPool to this endpoint:


Delete Agent Pool

To delete an agent pool, send DELETE to this endpoint:


Manage Agents Within Agent Pool

To move agent to a given pool, POST an Agent entity to this endpoint:


Example payload (this will move the agent with the ID 1 to the given pool):

<agent id="1"/>
{ "id" : "1" }

Manage Projects Associated with Pool

To associate a project with a given pool, POST a Project entity to the below endpoint:


Example payload (this will move project with the ID MyProject to the given pool):

<project id="MyProject"/>
{ "id" : "MyProject" }

To remove a project from a pool, use:

DELETE /app/rest/agentPools/<agentPoolLocator>/projects/<projectLocator>

projectLocator is typed as ProjectLocator.

Last modified: 27 March 2024