# ovok_sdk.resources.cms_authoring

Canonical page: https://docs.ovok.com/python-sdk/reference/resources/cms_authoring

CMS authoring: the tenant's collections, read and written by a CMS editor.

## CmsAuthoringResource [#cmsauthoringresource]

```python
CmsAuthoringResource(http: HttpClient)
```

Draft and published documents of the signed-in editor's tenant; access it as `ovok.cms.authoring`.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `http` | `HttpClient` |  | The client's HTTP client. |

### list() [#list]

```python
list(
    collection: str,
    params: Mapping[str, Any] | None = None,
    *,
    options: RequestOptions | None = None,
) -> Page[Any]
```

List a collection's documents.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `collection` | `str` |  | The collection slug. |
| `params` | `Mapping[str, Any] \| None` | `None` | Optional `where` (`{field: {operator: value}}`), `page` (1-based first page), `limit`, `sort`, `depth` and `locale`. |
| `options` | `RequestOptions \| None` | `None` | Per-request options; `timeout` overrides the client's. |

**Returns**

- `Page[Any]`: A page of documents that loads later pages on demand.

**Examples**

```python
>>> ovok.cms.authoring.list("faqs", {"where": {"status": {"equals": "draft"}}})
```

### retrieve() [#retrieve]

```python
retrieve(
    collection: str,
    document_id: int | str,
    *,
    options: RequestOptions | None = None,
) -> Any
```

Read one document by its ID.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `collection` | `str` |  | The collection slug. |
| `document_id` | `int \| str` |  | The document ID. |
| `options` | `RequestOptions \| None` | `None` | Per-request options; `timeout` overrides the client's. |

**Returns**

- `Any`: The document.

### create() [#create]

```python
create(
    collection: str,
    document: Mapping[str, Any],
    *,
    options: RequestOptions | None = None,
) -> Any
```

Create a document.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `collection` | `str` |  | The collection slug. |
| `document` | `Mapping[str, Any]` |  | The document's fields. |
| `options` | `RequestOptions \| None` | `None` | Per-request options; `timeout` overrides the client's. |

**Returns**

- `Any`: The created document.

### update() [#update]

```python
update(
    collection: str,
    document_id: int | str,
    fields: Mapping[str, Any],
    *,
    options: RequestOptions | None = None,
) -> Any
```

Change some fields of a document.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `collection` | `str` |  | The collection slug. |
| `document_id` | `int \| str` |  | The document ID. |
| `fields` | `Mapping[str, Any]` |  | The fields to change. |
| `options` | `RequestOptions \| None` | `None` | Per-request options; `timeout` overrides the client's. |

**Returns**

- `Any`: The document after the change.

### delete() [#delete]

```python
delete(
    collection: str,
    document_id: int | str,
    *,
    options: RequestOptions | None = None,
) -> None
```

Delete a document.

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| `collection` | `str` |  | The collection slug. |
| `document_id` | `int \| str` |  | The document ID. |
| `options` | `RequestOptions \| None` | `None` | Per-request options; `timeout` overrides the client's. |
