> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vsyble.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Prepare messages

Draft messages for prospects already in the campaign. Pass all: true to queue every prospect whose messages are empty (returns queued), or enrollmentId for one prospect (returns the run ID; follow its progress with campaign\_read get\_run). Retry a prospect the same way. sourceRunId with candidateKeys adds selected candidates of a finished run that saved to CRM and drafts them. Uses research and writing allowances.

**Tool:** `campaign_write` · **Method:** `prepare_messages`

Hosted OAuth MCP, local MCP, and REST API.

Choose all: true for enrolled prospects with empty messages, or enrollmentId for one prospect. sourceRunId with candidateKeys selects candidates from a completed run. Do not combine unrelated selection modes. A queued count acknowledges work; inspect the campaign and get\_run before claiming the messages are ready.

## Example

All IDs, addresses and revisions below are illustrative. Replace them with values read from your workspace.

> [tab] MCP
>
> ```json theme={null}
> {
>   "name": "campaign_write",
>   "arguments": {
>     "method": "prepare_messages",
>     "campaignId": "11111111-1111-4111-8111-111111111111",
>     "campaignRevision": 3,
>     "all": true
>   }
> }
> ```

> [tab] REST
>
> ```bash theme={null}
> curl https://api.vsyble.com/v1/outreach \
>   --request POST \
>   --header "Content-Type: application/json" \
>   --header "X-Vsyble-Api-Key: $VSYBLE_API_KEY" \
>   --data '{
>   "action": "prepareMessages",
>   "campaignId": "11111111-1111-4111-8111-111111111111",
>   "campaignRevision": 3,
>   "all": true
> }'
> ```

## Inputs

| Field | Type | Requirement | Details |
| - | - | - | - |
| `organizationId` | string | Optional | Workspace ID. Omit to use your current workspace. Format: uuid. |
| `campaignId` | string | Required | Format: uuid. |
| `campaignRevision` | integer | Required | Minimum: 1. Maximum: 2147483647. |
| `all` | true | Optional | |
| `enrollmentId` | string | Optional | Format: uuid. |
| `sourceRunId` | string | Optional | Format: uuid. |
| `candidateKeys` | string\[] | Optional | Minimum items: 1. Maximum items: 15. |

For MCP, add `method: prepare_messages` alongside these fields. For REST, use `action: prepareMessages` instead of method.

Fields inside an optional object are required only when that object is provided. Do not send fields from a different method.

## Result

MCP returns the following projected schema as structured content and JSON text. The REST response may contain additional fields; do not rely on undocumented fields.

> [accordion] Response schema
>
> ```json theme={null}
> {
>   "$schema": "https://json-schema.org/draft/2020-12/schema",
>   "type": "object",
>   "properties": {
>     "run": {
>       "type": "object",
>       "properties": {
>         "id": {
>           "type": [
>             "string",
>             "null"
>           ]
>         },
>         "status": {
>           "type": [
>             "string",
>             "null"
>           ]
>         },
>         "campaignId": {
>           "type": [
>             "string",
>             "null"
>           ]
>         },
>         "campaignRevision": {
>           "type": [
>             "number",
>             "null"
>           ]
>         }
>       },
>       "additionalProperties": false
>     },
>     "queued": {
>       "type": "integer",
>       "minimum": 0,
>       "maximum": 9007199254740991
>     }
>   },
>   "additionalProperties": false
> }
> ```

[Download input schema](https://docs.vsyble.com/schemas/prepare_messages.input.json) · [Download MCP response schema](https://docs.vsyble.com/schemas/prepare_messages.output.json)

See [permissions](https://docs.vsyble.com/security/permissions.md), [errors and recovery](https://docs.vsyble.com/api/errors.md), and [sending approval](https://docs.vsyble.com/security/sending.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.