# Get agent source

```http
GET /projects/{project_reference}/agents/{agent_id}
```

Get agent source. Requires project.agents.read.

## Parameters

| Name                 | In    | Required | Description                                                |
| -------------------- | ----- | -------- | ---------------------------------------------------------- |
| `project_reference`  | path  | Yes      | Project slug, UUID, or domain that identifies the project. |
| `agent_id`           | path  | Yes      | Agent identifier.                                          |
| `source_target_kind` | query |          |                                                            |
| `target_branch_id`   | query |          |                                                            |

## Responses

| Status | Description                                                                                                 |
| ------ | ----------------------------------------------------------------------------------------------------------- |
| 200    | Agent document                                                                                              |
| 400    | Bad request                                                                                                 |
| 401    | Unauthorized                                                                                                |
| 403    | Forbidden                                                                                                   |
| 404    | Not found                                                                                                   |
| 500    | Server error                                                                                                |
| 503    | internal: authentication state is temporarily unavailable and the request was not processed; retry shortly. |
