# Install agents

```http
POST /projects/{project_reference}/agents/{agent_id}/install-selected
```

Install agent in projects. Requires project.agents.write.

## Parameters

| Name                | In   | Required | Description                                                |
| ------------------- | ---- | -------- | ---------------------------------------------------------- |
| `project_reference` | path | Yes      | Project slug, UUID, or domain that identifies the project. |
| `agent_id`          | path | Yes      | Catalog agent identifier.                                  |

## Request body

| Field                         | Type   | Required | Description                                                                                                              |
| ----------------------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------ |
| `relation`                    | string |          | Relation of each agent access grant. The selection expands into one explicit grant per project; the agent is not copied. |
| `selected_project_references` | array  |          |                                                                                                                          |
| `selected_project_ids`        | array  |          |                                                                                                                          |

## Responses

| Status | Description                                                                                                 |
| ------ | ----------------------------------------------------------------------------------------------------------- |
| 200    | Existing installed agent cards                                                                              |
| 201    | Installed agent cards                                                                                       |
| 400    | Bad request                                                                                                 |
| 401    | Unauthorized                                                                                                |
| 403    | Forbidden                                                                                                   |
| 404    | Not found                                                                                                   |
| 409    | Conflict                                                                                                    |
| 500    | Server error                                                                                                |
| 503    | internal: authentication state is temporarily unavailable and the request was not processed; retry shortly. |
