# Draft a campaign from a brief

`POST /project-hub/campaign-from-brief` · Rivier · workspace

Draft a campaign from a brief: picks the segment among those that can be written to, reuses the best template (the organisation's if the project has none), writes the copy in the audience language and runs the check. It stops at a draft: a person approves it before anything is sent.

- Scope: workspace:write
- Graphql: Mutation.workspaceProjectHubDraftFromBrief
- Sdk: workspace.projectHub.draftFromBrief
- Cli: workspace project hub draft from brief

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "brief": {
      "type": "string",
      "minLength": 10,
      "maxLength": 2000
    },
    "language": {
      "type": "string",
      "maxLength": 10
    },
    "channel": {
      "type": "string",
      "enum": [
        "email",
        "sms"
      ],
      "default": "email"
    }
  },
  "required": [
    "brief"
  ],
  "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 POST 'https://api.rivier.ai/project-hub/campaign-from-brief' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "brief": "string"
}'
```
