# Update content

Canonical page: https://docs.ovok.com/api/cms-(fhir-legacy)/update-content

`PUT /cms/{type}/{language}/{key}`

Replaces the content item with the given key in one language. Use it to edit an item you created with `POST /cms/{type}/{language}`.

**Auth:** bearer token.
**Scope:** the caller's project (from the token). Only items in that project are found.

## Behaviour

- `type` is one of `blog`, `video`, `audio`, `template` or `export-template`.
- `language` must be one of the languages in your project's locale settings.
- The body replaces `title`, `category`, `section` and `code`. Ovok sets `date` to now and `author` to your profile.
- If more than one item exists for this type, key and language, Ovok keeps the first and deletes the others.
- When you update an item, a background job runs for every project language. It only creates translations that do not exist yet; existing translations are not changed.
- The route is also served under `/internal/cms/{type}`.

## Example

```bash
curl -X PUT 'https://api.sandbox.ovok.com/cms/blog/en-US/blog-sleeping-well-a1b2c3d4' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3NjcyNjg4MDAsImV4cCI6MTc2NzI3MjQwMH0.Ql3B_ztDvctlyZ2z0vp4sl3ExXRQGkzmxdmTAqxNzZk' \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "Sleeping well",
    "category": "health",
    "section": [
      { "title": "Introduction", "text": "Why good sleep matters.", "code": ["main-content"] }
    ]
  }'
```
