# Write a draft for a channel

`POST /workspace/content` · Rivier · content

Write a draft for a channel.

- Scope: content:write
- Graphql: Mutation.contentItemDraft
- Sdk: content.item.draft
- Cli: content item draft

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "channel": {
      "type": "string",
      "enum": [
        "linkedin",
        "facebook",
        "instagram",
        "x",
        "tiktok",
        "threads",
        "mastodon",
        "discord",
        "telegram",
        "youtube",
        "snapchat",
        "medium"
      ]
    },
    "body": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20000
    },
    "topic": {
      "type": "string",
      "maxLength": 500
    },
    "agentId": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid"
        },
        {
          "type": "null"
        }
      ]
    },
    "mediaUrl": {
      "anyOf": [
        {
          "type": "string",
          "format": "uri",
          "maxLength": 2000
        },
        {
          "type": "null"
        }
      ]
    },
    "publishAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "channel",
    "body"
  ],
  "additionalProperties": false
}
```

## Responses

- `201`: 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 POST 'https://api.rivier.ai/workspace/content' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "channel": "linkedin",
  "body": "string"
}'
```
