# updateAgentLabel

```graphql
mutation UpdateAgentLabel($input: UpdateProjectAgentLabelInput!) {
  updateAgentLabel(input: $input) {
    id
    resourceKind
    projectId
    sourceTargetKind
    sourceAgentId
    namespace
    key
    value
    color
    createdAt
    updatedAt
  }
}
```

Update agent label. Requires project.agents.write.

## Arguments

| Name                     | Type                          | Required | Description                                                                                 |
| ------------------------ | ----------------------------- | -------- | ------------------------------------------------------------------------------------------- |
| `input`                  | UpdateProjectAgentLabelInput! | 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                            |          |                                                                                             |
| `input.labelId`          | ID!                           | Yes      |                                                                                             |
| `input.label`            | ProjectAgentLabelFields!      | Yes      |                                                                                             |

## Variables

```json
{
  "input": {
    "agentId": "string",
    "labelId": "string",
    "label": {
      "key": "string"
    }
  }
}
```

## Responses

| Status | Description                               |
| ------ | ----------------------------------------- |
| 200    | The AgentLabel! in data.updateAgentLabel. |

## Call it

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

## Example response

```json
{
  "data": {
    "updateAgentLabel": {
      "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"
    }
  }
}
```
