# createAgentAvatar

```graphql
mutation CreateAgentAvatar($input: GenerateProjectAgentAvatarInput!) {
  createAgentAvatar(input: $input) {
    avatarUrl
  }
}
```

Create agent avatar. Requires project.agents.write.

## Arguments

| Name                     | Type                             | Required | Description                                                                                                                       |
| ------------------------ | -------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `input`                  | GenerateProjectAgentAvatarInput! | Yes      |                                                                                                                                   |
| `input.projectReference` | String                           |          |                                                                                                                                   |
| `input.agentId`          | ID!                              | Yes      |                                                                                                                                   |
| `input.sourceTargetKind` | String                           |          |                                                                                                                                   |
| `input.targetBranchId`   | ID                               |          |                                                                                                                                   |
| `input.config`           | JSON                             |          |                                                                                                                                   |
| `input.assign`           | Boolean                          |          | Persist the generated avatar\_url onto the agent. Defaults to false; set true to assign it to an existing agent. Default `false`. |

## Variables

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

## Responses

| Status | Description                                              |
| ------ | -------------------------------------------------------- |
| 200    | The ProjectAgentAvatarUpload! in data.createAgentAvatar. |

## 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 CreateAgentAvatar($input: GenerateProjectAgentAvatarInput!) {\n  createAgentAvatar(input: $input) {\n    avatarUrl\n  }\n}",
  "variables": {
    "input": {
      "agentId": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "createAgentAvatar": {
      "avatarUrl": "https://example.com"
    }
  }
}
```
