> ## Documentation Index
> Fetch the complete documentation index at: https://docs-staging.incredibuild.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Assigning Agents to a Build Group

Last updated on Mar 08, 2023

The `Groups/{Group name}/AddAgents` API allows you to assign one or more Agents to an existing Build Group.

You cannot perform the Agent Assignment action if:

* The Agent is currently participating in a build execution.

* The Agent is offline.

**Request Syntax**

[Copy](javascript:void\(0\);)

```
POST https:// {Coordinator IP Address/Hostname}:{Web Access Port}/Groups/{Group name}/AddAgents
[
    {
        "Name":"{Agent name}",

        "IP":"{Agent IP address}
    }
]
```

Where:

* Web Access Port is the port number defined in the [**Coordinator Settings** dialog box](/windows/9.0/assigning-agents-to-build-groups) (default**31100**).

* Group name is case sensitive.

In the following example, a request is sent to assign three Agents to the **QA** Build Group:

[Copy](javascript:void\(0\);)

```
POST https://win10-1:31100/Groups/QA/AddAgents
[
    {
        "Name":"WIN10-1",

        "IP":"192.100.00.001"
    },

    {
        "Name":"WIN10-2",

        "IP":"192.100.00.002"
    },

    {    
        "Name":"WIN10-3",

        "IP":"192.100.00.003"
    }
]
```

**Response Syntax**

When an Agent is successfully assigned to the specified Build Group, the result is: `"{Agent name}": "OK"`.

For example:

[Copy](javascript:void\(0\);)

```
[
    {
        "WIN10-1": "OK"
    },

    {
        "WIN10-2": "OK"
    },

    {
        "WIN10-3": "OK"
    }
]
```

**Errors**

The request fails if:

* The Agent is currently participating in a build execution.

* The Agent does not exist.

* The Agent is offline.

* The Build Group does not exist.

In the following example, one Agent is currently offline, while another Agent does not exist:

[Copy](javascript:void\(0\);)

```
[
    {
        "WIN10-2": "Agent is offline"
    },

    {
        "WIN10-4": "Agent does not exist"
    }
]
```

[https://docs.incredibuild.com/Default.htm](https://docs.incredibuild.com/Default.htm)

[https://docs.incredibuild.com/lin/latest/Default.htm](https://docs.incredibuild.com/lin/latest/Default.htm)

[https://docs.incredibuild.com/win/v9/Default.htm](https://docs.incredibuild.com/win/v9/Default.htm)

[https://docs.incredibuild.com/cloud/Default.htm](https://docs.incredibuild.com/cloud/Default.htm)

Windowshttps\://[www.incredibuild.com/](http://www.incredibuild.com/) 9.6.11
