# Save a draft as it is written

`PUT /workspace/inbox/drafts/{id}` · Rivier · inbox

Save a draft as it is written; the version guards against two tabs overwriting each other.

- Scope: inbox:write
- Graphql: Mutation.inboxDraftSave
- Sdk: inbox.draft.save
- Cli: inbox draft save

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "version": {
      "type": "integer",
      "minimum": 1
    },
    "to": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 3,
        "maxLength": 320
      },
      "maxItems": 50
    },
    "cc": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 3,
        "maxLength": 320
      },
      "maxItems": 50
    },
    "bcc": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 3,
        "maxLength": 320
      },
      "maxItems": 50
    },
    "subject": {
      "type": "string",
      "maxLength": 300
    },
    "body": {
      "type": "string",
      "maxLength": 100000
    },
    "bodyHtml": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200000
        },
        {
          "type": "null"
        }
      ]
    },
    "mailbox": {
      "type": "string",
      "minLength": 3,
      "maxLength": 254
    },
    "signatureId": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "version"
  ],
  "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/workspace/inbox/drafts/{id}' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "version": 0
}'
```
