# Save a document, naming the version the change started from

`PUT /documents/{id}` · Rivier · content

Save a document, naming the version the change started from. If someone saved a newer one meanwhile, the save is refused with theirs.

- Scope: content:write
- Mcp: rivier_document_save
- Graphql: Mutation.contentDocumentSave
- Sdk: content.document.save
- Cli: content document save

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "doc": {
      "type": "object",
      "properties": {},
      "additionalProperties": true
    },
    "title": {
      "type": "string",
      "maxLength": 200
    },
    "baseVersionId": {
      "type": "string"
    }
  },
  "required": [
    "doc",
    "baseVersionId"
  ],
  "additionalProperties": false
}
```

## Responses

- `200`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X PUT 'https://api.rivier.ai/documents/{id}' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "doc": {},
  "baseVersionId": "string"
}'
```
