# Update a cast member

`PATCH https://api.vidmoat.com/v1/cast/{id}`

- Scope: `cast.write`
- Cost: Free

Rename it, change its description, add images (`addReferences`, `fromUrl`, `fromJobId`, `fromFrame`), remove them (`removeReferenceIds`), approve them, or set or clear its voice. Up to 8 references; at least one stays.

### Path parameters

- `id` (string, required): The cast member id (`cm_...`).

### Body

- `name` (string, optional): Up to 60 characters.
- `description` (string or null, optional): Up to 600 characters.
- `addReferences` (array of strings, optional): Images in the account.
- `removeReferenceIds` (array of strings, optional): Reference ids.

## Response

Returns `200`.

### Response fields

- `member` (object): The updated member.

## Errors

Besides the errors any request can get ([authentication](https://developer.vidmoat.com/developer/docs/authentication#when-a-request-is-refused), [rate limits](https://developer.vidmoat.com/developer/docs/rate-limits)):

| Status | Code | When |
| --- | --- | --- |
| 404 | [`not_found`](https://developer.vidmoat.com/developer/docs/errors#not_found) | No such member in this account. |

## Request examples

```bash curl
curl -X PATCH https://api.vidmoat.com/v1/cast/$ID \
  -H "Authorization: Bearer $VIDMOAT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"description":"white spiky hair, red scarf"}'
```

```js Node
const ID = 'YOUR_PROJECT_ID';

const res = await fetch(`https://api.vidmoat.com/v1/cast/${ID}`, {
  method: 'PATCH',
  headers: {
    Authorization: `Bearer ${process.env.VIDMOAT_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    description: 'white spiky hair, red scarf',
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data.error?.message ?? `HTTP ${res.status}`);
console.log(data);
```

```python Python
import os
import requests

ID = "YOUR_PROJECT_ID"

res = requests.patch(
    f"https://api.vidmoat.com/v1/cast/{ID}",
    headers={"Authorization": f"Bearer {os.environ['VIDMOAT_KEY']}"},
    json={
      "description": "white spiky hair, red scarf",
    },
    timeout=60,
)
res.raise_for_status()
print(res.json())
```

---

Source: https://developer.vidmoat.com/developer/docs/api/cast/update-cast-member
Previous: [Get a cast member](https://developer.vidmoat.com/developer/docs/api/cast/get-cast-member.md)
Next: [Delete a cast member](https://developer.vidmoat.com/developer/docs/api/cast/delete-cast-member.md)
All documentation: https://developer.vidmoat.com/llms-full.txt
