# Update sponsor settings

URL: https://www.atmee.ai/docs/v2/api/reference/avatars/updateAvatarSponsor

`PATCH /v1/avatars/{avatarId}/sponsor`

One request applies all of its fields or none. `anonymousAccess: true`
lets visitors without an account spend the pool, so it needs an avatar
that was funded (`409 avatar_not_budget_managed`: grant credits first,
or turn on auto top-up) and is public or unlisted (`409
avatar_not_shared`: change its visibility first). A monetized avatar
cannot be sponsored (`409 monetized_avatar_cannot_be_sponsored`).
`autoTopupEnabled: true` needs a threshold and an amount, sent here or
already stored (`400 auto_topup_incomplete`).

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `avatarId` | path | yes |  |

## Request body

- `application/json`: `AvatarSponsorPatch`

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `maxPerSessionMicrocredits` | integer | no | null clears the cap. |
| `exhaustedBehavior` | string (`pause`, `spend_balance`) | no |  |
| `autoTopupEnabled` | boolean | no |  |
| `autoTopupThresholdMicrocredits` | integer | no |  |
| `autoTopupAmountMicrocredits` | integer | no |  |
| `anonymousAccess` | boolean | no |  |
| `anonymousDailySecondsPerVisitor` | integer | no | null clears the per-visitor daily cap. |

## Responses

| Status | Description | Schema |
| --- | --- | --- |
| `200` | Updated; returns the sponsor view. | `AvatarSponsor` |
| `400` | Validation failure \| auto_topup_incomplete (send a threshold and an amount with autoTopupEnabled) | none |
| `401` | Missing or invalid API key -- or a user token that is invalid, anonymous, or of a user who may act for no account (invalid_login) | none |
| `403` | insufficient_scope \| avatar_not_allowed | none |
| `404` | avatar_not_found | none |
| `409` | avatar_not_budget_managed \| avatar_not_shared \| monetized_avatar_cannot_be_sponsored (each message says what to do first) \| account_ambiguous | none |

## `200` response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `balance` | object | yes |  |
| `settings` | object | yes |  |
