# agentLabels

```graphql
query AgentLabels($input: ProjectAgentLabelsInput!) {
  agentLabels(input: $input) {
    labels {
      id
      resourceKind
      projectId
      sourceTargetKind
      sourceAgentId
      namespace
      key
      value
      color
      createdAt
      updatedAt
    }
  }
}
```

List agent labels. Requires project.agents.read.

## Arguments

| Name                     | Type                     | Required | Description                                                                                 |
| ------------------------ | ------------------------ | -------- | ------------------------------------------------------------------------------------------- |
| `input`                  | ProjectAgentLabelsInput! | Yes      |                                                                                             |
| `input.projectReference` | String                   |          |                                                                                             |
| `input.agentId`          | ID!                      | Yes      |                                                                                             |
| `input.sourceTargetKind` | String                   |          | Source target: project, main\_branch, or preview\_branch. Null and omission select project. |
| `input.targetBranchId`   | ID                       |          |                                                                                             |

## Variables

```json
{
  "input": {
    "agentId": "string"
  }
}
```

## Responses

| Status | Description                              |
| ------ | ---------------------------------------- |
| 200    | The AgentLabelList! in data.agentLabels. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "query AgentLabels($input: ProjectAgentLabelsInput!) {\n  agentLabels(input: $input) {\n    labels {\n      id\n      resourceKind\n      projectId\n      sourceTargetKind\n      sourceAgentId\n      namespace\n      key\n      value\n      color\n      createdAt\n      updatedAt\n    }\n  }\n}",
  "variables": {
    "input": {
      "agentId": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "agentLabels": {
      "labels": [
        {
          "id": "string",
          "resourceKind": "string",
          "projectId": "string",
          "sourceTargetKind": "string",
          "sourceAgentId": "string",
          "namespace": "string",
          "key": "string",
          "value": "string",
          "color": "string",
          "createdAt": "2026-01-01T00:00:00Z",
          "updatedAt": "2026-01-01T00:00:00Z"
        }
      ]
    }
  }
}
```
