# Write a draft of the text (short fields and the description as blocks)

`PUT /lodging/text/{kind}/{id}` · Rivier · bookings

Write a draft of the text (short fields and the description as blocks). An agent's draft says which model wrote it; a person reviews and publishes.

- Scope: bookings:write
- Mcp: rivier_lodging_text_draft_save
- Sdk: bookings.text.saveDraft
- Cli: bookings text save draft

## Parameters

- `kind` (path, required), string
- `id` (path, required), string
- `locale` (query, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "doc": {
      "type": "object",
      "properties": {
        "fields": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "maxLength": 8000
          },
          "propertyNames": {
            "pattern": "^[A-Za-z]{1,32}$"
          },
          "default": {}
        },
        "blocks": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "paragraph"
                  },
                  "children": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "text": {
                          "type": "string",
                          "maxLength": 20000
                        },
                        "bold": {
                          "type": "boolean"
                        },
                        "italic": {
                          "type": "boolean"
                        },
                        "code": {
                          "type": "boolean"
                        },
                        "href": {
                          "type": "string",
                          "maxLength": 2000
                        },
                        "note": {
                          "type": "string",
                          "maxLength": 1000
                        }
                      },
                      "required": [
                        "text"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 500
                  }
                },
                "required": [
                  "type",
                  "children"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "heading"
                  },
                  "level": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 6
                  },
                  "children": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "text": {
                          "type": "string",
                          "maxLength": 20000
                        },
                        "bold": {
                          "type": "boolean"
                        },
                        "italic": {
                          "type": "boolean"
                        },
                        "code": {
                          "type": "boolean"
                        },
                        "href": {
                          "type": "string",
                          "maxLength": 2000
                        },
                        "note": {
                          "type": "string",
                          "maxLength": 1000
                        }
                      },
                      "required": [
                        "text"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 500
                  }
                },
                "required": [
                  "type",
                  "level",
                  "children"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "list"
                  },
                  "ordered": {
                    "type": "boolean"
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "text": {
                            "type": "string",
                            "maxLength": 20000
                          },
                          "bold": {
                            "type": "boolean"
                          },
                          "italic": {
                            "type": "boolean"
                          },
                          "code": {
                            "type": "boolean"
                          },
                          "href": {
                            "type": "string",
                            "maxLength": 2000
                          },
                          "note": {
                            "type": "string",
                            "maxLength": 1000
                          }
                        },
                        "required": [
                          "text"
                        ],
                        "additionalProperties": false
                      },
                      "maxItems": 500
                    },
                    "maxItems": 500
                  }
                },
                "required": [
                  "type",
                  "items"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "quote"
                  },
                  "children": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "text": {
                          "type": "string",
                          "maxLength": 20000
                        },
                        "bold": {
                          "type": "boolean"
                        },
                        "italic": {
                          "type": "boolean"
                        },
                        "code": {
                          "type": "boolean"
                        },
                        "href": {
                          "type": "string",
                          "maxLength": 2000
                        },
                        "note": {
                          "type": "string",
                          "maxLength": 1000
                        }
                      },
                      "required": [
                        "text"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 500
                  },
                  "cite": {
                    "type": "string",
                    "maxLength": 300
                  }
                },
                "required": [
                  "type",
                  "children"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "code"
                  },
                  "code": {
                    "type": "string",
                    "maxLength": 100000
                  },
                  "language": {
                    "type": "string",
                    "maxLength": 30
                  }
                },
                "required": [
                  "type",
                  "code"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "image"
                  },
                  "assetId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "alt": {
                    "type": "string",
                    "maxLength": 500
                  },
                  "caption": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "type",
                  "assetId"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "callout"
                  },
                  "tone": {
                    "type": "string",
                    "enum": [
                      "info",
                      "warning",
                      "success"
                    ]
                  },
                  "children": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "text": {
                          "type": "string",
                          "maxLength": 20000
                        },
                        "bold": {
                          "type": "boolean"
                        },
                        "italic": {
                          "type": "boolean"
                        },
                        "code": {
                          "type": "boolean"
                        },
                        "href": {
                          "type": "string",
                          "maxLength": 2000
                        },
                        "note": {
                          "type": "string",
                          "maxLength": 1000
                        }
                      },
                      "required": [
                        "text"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 500
                  }
                },
                "required": [
                  "type",
                  "children"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "embed"
                  },
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2000
                  }
                },
                "required": [
                  "type",
                  "url"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "entry"
                  },
                  "entryId": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "required": [
                  "type",
                  "entryId"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "divider"
                  }
                },
                "required": [
                  "type"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "table"
                  },
                  "header": {
                    "type": "boolean"
                  },
                  "rows": {
                    "type": "array",
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 2000
                      },
                      "minItems": 1,
                      "maxItems": 30
                    },
                    "minItems": 1,
                    "maxItems": 200
                  }
                },
                "required": [
                  "type",
                  "rows"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "gallery"
                  },
                  "items": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "assetId": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "caption": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "alt": {
                          "type": "string",
                          "maxLength": 300
                        }
                      },
                      "required": [
                        "assetId"
                      ],
                      "additionalProperties": false
                    },
                    "minItems": 1,
                    "maxItems": 60
                  }
                },
                "required": [
                  "type",
                  "items"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "button"
                  },
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2000
                  },
                  "style": {
                    "type": "string",
                    "enum": [
                      "primary",
                      "secondary"
                    ]
                  }
                },
                "required": [
                  "type",
                  "label",
                  "url"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "bookmark"
                  },
                  "url": {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 2000
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "description": {
                    "type": "string",
                    "maxLength": 400
                  }
                },
                "required": [
                  "type",
                  "url",
                  "title"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "toggle"
                  },
                  "summary": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "children": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "text": {
                          "type": "string",
                          "maxLength": 20000
                        },
                        "bold": {
                          "type": "boolean"
                        },
                        "italic": {
                          "type": "boolean"
                        },
                        "code": {
                          "type": "boolean"
                        },
                        "href": {
                          "type": "string",
                          "maxLength": 2000
                        },
                        "note": {
                          "type": "string",
                          "maxLength": 1000
                        }
                      },
                      "required": [
                        "text"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 500
                  }
                },
                "required": [
                  "type",
                  "summary",
                  "children"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "video"
                  },
                  "assetId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "posterAssetId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "caption": {
                    "type": "string",
                    "maxLength": 300
                  },
                  "captions": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "lang": {
                          "type": "string",
                          "minLength": 2,
                          "maxLength": 12
                        },
                        "label": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 40
                        },
                        "assetId": {
                          "type": "string",
                          "format": "uuid"
                        }
                      },
                      "required": [
                        "lang",
                        "label",
                        "assetId"
                      ],
                      "additionalProperties": false
                    },
                    "maxItems": 6
                  }
                },
                "required": [
                  "type",
                  "assetId",
                  "title"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "audio"
                  },
                  "assetId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "caption": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "type",
                  "assetId"
                ],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "product"
                  },
                  "productId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "product",
                      "stay",
                      "service"
                    ]
                  }
                },
                "required": [
                  "type",
                  "productId"
                ],
                "additionalProperties": false
              }
            ]
          },
          "maxItems": 2000
        }
      },
      "additionalProperties": false
    },
    "reason": {
      "type": "string",
      "maxLength": 300,
      "default": ""
    },
    "model": {
      "type": "string",
      "maxLength": 120
    }
  },
  "required": [
    "doc"
  ],
  "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/lodging/text/{kind}/{id}' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "doc": {
    "fields": {},
    "blocks": [
      {
        "type": null,
        "children": null
      }
    ]
  }
}'
```
