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

# Messages

API operations for messages. Browse the routes below for parameters, request examples, and responses.

API version: Selected per operation

## Get many messages

Reads several messages by ID in one call. An ID that matches no message in the environment is reported instead of failing the request.

### Endpoint

```http
POST /v1/stable/message/get-many
```

Server: https://realtime-api.voiceflow.com

### Authentication

```json
[
  {
    "token": []
  }
]
```

`token`:

```json
{
  "scheme": "bearer",
  "bearerFormat": "JWT",
  "type": "http",
  "description": "Voiceflow bearer token"
}
```

### Query parameters

#### `projectID`

Required · string

The ID of the project to operate on.

```json
{
  "type": "string",
  "description": "The ID of the project to operate on."
}
```

#### `environmentAlias`

Required · string

The alias of the environment to operate on (e.g. `main`).

```json
{
  "type": "string",
  "description": "The alias of the environment to operate on (e.g. `main`)."
}
```

### Request body

Required

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/StableMessageGetManyRequest"
      }
    }
  }
}
```

### Responses

#### 200

Returns the messages found, each with its variants, and `missing`, the requested IDs that match no message in this environment.

Schema:

```json
{
  "$ref": "#/components/schemas/StableMessageReadManyResponse"
}
```

Example:

```json
{
  "messages": [
    {
      "id": "<string>",
      "variants": [
        "<StableMessageVariant>"
      ],
      "createdAt": "2026-09-10T00:00:00.000Z",
      "updatedAt": "2026-09-10T00:00:00.000Z",
      "createdByID": 0,
      "updatedByID": 0
    }
  ],
  "missing": [
    "<string>"
  ]
}
```

### Request examples

#### cURL

```bash
curl --request POST \
  --url 'https://realtime-api.voiceflow.com/v1/stable/message/get-many?projectID=<projectID>&environmentAlias=<environmentAlias>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "ids": [
    "<string>"
  ]
}'
```

#### JavaScript

```javascript
const response = await fetch('https://realtime-api.voiceflow.com/v1/stable/message/get-many?projectID=<projectID>&environmentAlias=<environmentAlias>', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "ids": [
      "<string>"
    ]
  }),
});
const data = await response.json();
```

#### Python

```python
import requests

response = requests.post(
    'https://realtime-api.voiceflow.com/v1/stable/message/get-many?projectID=<projectID>&environmentAlias=<environmentAlias>',
    headers={'Authorization': 'Bearer <token>'},
    json={
      "ids": [
        "<string>"
      ]
    },
)
data = response.json()
```

#### Voiceflow CLI

```bash
vf message get-many --project-id <projectID> --environment-alias <environmentAlias> <<'JSON'
{
  "ids": [
    "<string>"
  ]
}
JSON
```


## Get message

Returns one message with all of its variants. A message is a set of alternative texts for one slot, and the runtime says one of them.

### Endpoint

```http
GET /v1/stable/message/{messageID}
```

Server: https://realtime-api.voiceflow.com

### Authentication

```json
[
  {
    "token": []
  }
]
```

`token`:

```json
{
  "scheme": "bearer",
  "bearerFormat": "JWT",
  "type": "http",
  "description": "Voiceflow bearer token"
}
```

### Path parameters

#### `messageID`

Required · string

The ID of the message to operate on.

```json
{
  "type": "string"
}
```

### Query parameters

#### `projectID`

Required · string

The ID of the project to operate on.

```json
{
  "type": "string",
  "description": "The ID of the project to operate on."
}
```

#### `environmentAlias`

Required · string

The alias of the environment to operate on (e.g. `main`).

```json
{
  "type": "string",
  "description": "The alias of the environment to operate on (e.g. `main`)."
}
```

### Responses

#### 200

Returns the message with its variants, each carrying its text, delay in milliseconds, condition, timestamps, and user IDs.

Schema:

```json
{
  "$ref": "#/components/schemas/StableMessageReadResponse"
}
```

Example:

```json
{
  "message": {
    "id": "<string>",
    "variants": [
      {
        "id": "<string>",
        "text": "<MarkdownLikeString>",
        "delay": 0,
        "condition": "<StableMessageVariantCondition>",
        "createdAt": "2026-09-10T00:00:00.000Z",
        "updatedAt": "2026-09-10T00:00:00.000Z",
        "updatedByID": 0
      }
    ],
    "createdAt": "2026-09-10T00:00:00.000Z",
    "updatedAt": "2026-09-10T00:00:00.000Z",
    "createdByID": 0,
    "updatedByID": 0
  }
}
```

### Request examples

#### cURL

```bash
curl --request GET \
  --url 'https://realtime-api.voiceflow.com/v1/stable/message/<messageID>?projectID=<projectID>&environmentAlias=<environmentAlias>' \
  --header 'Authorization: Bearer <token>'
```

#### JavaScript

```javascript
const response = await fetch('https://realtime-api.voiceflow.com/v1/stable/message/<messageID>?projectID=<projectID>&environmentAlias=<environmentAlias>', {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <token>',
  },
});
const data = await response.json();
```

#### Python

```python
import requests

response = requests.get(
    'https://realtime-api.voiceflow.com/v1/stable/message/<messageID>?projectID=<projectID>&environmentAlias=<environmentAlias>',
    headers={'Authorization': 'Bearer <token>'},
)
data = response.json()
```

#### Voiceflow CLI

```bash
vf message get --message-id <messageID> --project-id <projectID> --environment-alias <environmentAlias>
```


## Reorder message variants

Changes the sequence of a message's variants without touching their text. The request must name every variant ID of the message exactly once.

### Endpoint

```http
PATCH /v1/stable/message/{messageID}
```

Server: https://realtime-api.voiceflow.com

### Authentication

```json
[
  {
    "token": []
  }
]
```

`token`:

```json
{
  "scheme": "bearer",
  "bearerFormat": "JWT",
  "type": "http",
  "description": "Voiceflow bearer token"
}
```

### Path parameters

#### `messageID`

Required · string

The ID of the message to operate on.

```json
{
  "type": "string"
}
```

### Query parameters

#### `projectID`

Required · string

The ID of the project to operate on.

```json
{
  "type": "string",
  "description": "The ID of the project to operate on."
}
```

#### `environmentAlias`

Required · string

The alias of the environment to operate on (e.g. `main`).

```json
{
  "type": "string",
  "description": "The alias of the environment to operate on (e.g. `main`)."
}
```

### Request body

Required

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/StableMessageUpdateRequest"
      }
    }
  }
}
```

### Responses

#### 200

Confirms the variants were reordered. The body is a message only, so refetch the message to see the new sequence.

Schema:

```json
{
  "$ref": "#/components/schemas/StableUpdateResponse"
}
```

Example:

```json
{
  "message": "<string>"
}
```

### Request examples

#### cURL

```bash
curl --request PATCH \
  --url 'https://realtime-api.voiceflow.com/v1/stable/message/<messageID>?projectID=<projectID>&environmentAlias=<environmentAlias>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "variantOrder": [
    "<string>"
  ]
}'
```

#### JavaScript

```javascript
const response = await fetch('https://realtime-api.voiceflow.com/v1/stable/message/<messageID>?projectID=<projectID>&environmentAlias=<environmentAlias>', {
  method: 'PATCH',
  headers: {
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "variantOrder": [
      "<string>"
    ]
  }),
});
const data = await response.json();
```

#### Python

```python
import requests

response = requests.patch(
    'https://realtime-api.voiceflow.com/v1/stable/message/<messageID>?projectID=<projectID>&environmentAlias=<environmentAlias>',
    headers={'Authorization': 'Bearer <token>'},
    json={
      "variantOrder": [
        "<string>"
      ]
    },
)
data = response.json()
```

#### Voiceflow CLI

```bash
vf message update --message-id <messageID> --project-id <projectID> --environment-alias <environmentAlias> <<'JSON'
{
  "variantOrder": [
    "<string>"
  ]
}
JSON
```


## Delete message

Deletes a message and its variants. The call does not check which tool slot, step or reprompt holds the ID, so clear those owners first. The response carries only a confirmation message, so refetch the messages to see what is left.

### Endpoint

```http
DELETE /v1/stable/message/{messageID}
```

Server: https://realtime-api.voiceflow.com

### Authentication

```json
[
  {
    "token": []
  }
]
```

`token`:

```json
{
  "scheme": "bearer",
  "bearerFormat": "JWT",
  "type": "http",
  "description": "Voiceflow bearer token"
}
```

### Path parameters

#### `messageID`

Required · string

The ID of the message to operate on.

```json
{
  "type": "string"
}
```

### Query parameters

#### `projectID`

Required · string

The ID of the project to operate on.

```json
{
  "type": "string",
  "description": "The ID of the project to operate on."
}
```

#### `environmentAlias`

Required · string

The alias of the environment to operate on (e.g. `main`).

```json
{
  "type": "string",
  "description": "The alias of the environment to operate on (e.g. `main`)."
}
```

### Responses

#### 200

Confirms the message was deleted. The body is a message only, so any tool slot or step that held the ID still points at a message that no longer exists.

Schema:

```json
{
  "$ref": "#/components/schemas/StableDeleteResponse"
}
```

Example:

```json
{
  "message": "<string>"
}
```

### Request examples

#### cURL

```bash
curl --request DELETE \
  --url 'https://realtime-api.voiceflow.com/v1/stable/message/<messageID>?projectID=<projectID>&environmentAlias=<environmentAlias>' \
  --header 'Authorization: Bearer <token>'
```

#### JavaScript

```javascript
const response = await fetch('https://realtime-api.voiceflow.com/v1/stable/message/<messageID>?projectID=<projectID>&environmentAlias=<environmentAlias>', {
  method: 'DELETE',
  headers: {
    Authorization: 'Bearer <token>',
  },
});
const data = await response.json();
```

#### Python

```python
import requests

response = requests.delete(
    'https://realtime-api.voiceflow.com/v1/stable/message/<messageID>?projectID=<projectID>&environmentAlias=<environmentAlias>',
    headers={'Authorization': 'Bearer <token>'},
)
data = response.json()
```

#### Voiceflow CLI

```bash
vf message delete --message-id <messageID> --project-id <projectID> --environment-alias <environmentAlias>
```


## Create message

Creates a message, which is a set of variants that say the same thing in different words, and returns it with its ID. The message belongs to nothing until a tool slot, workflow step, or reprompt holds its ID.

### Endpoint

```http
POST /v1/stable/message
```

Server: https://realtime-api.voiceflow.com

### Authentication

```json
[
  {
    "token": []
  }
]
```

`token`:

```json
{
  "scheme": "bearer",
  "bearerFormat": "JWT",
  "type": "http",
  "description": "Voiceflow bearer token"
}
```

### Query parameters

#### `projectID`

Required · string

The ID of the project to operate on.

```json
{
  "type": "string",
  "description": "The ID of the project to operate on."
}
```

#### `environmentAlias`

Required · string

The alias of the environment to operate on (e.g. `main`).

```json
{
  "type": "string",
  "description": "The alias of the environment to operate on (e.g. `main`)."
}
```

### Request body

Required

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/StableMessageCreateRequest"
      }
    }
  }
}
```

### Responses

#### 201

Returns the new message with its variants and IDs, and `unresolvedReferences` for any variable or reference in the text that did not resolve.

Schema:

```json
{
  "$ref": "#/components/schemas/StableMessageCreateResponse"
}
```

Example:

```json
{
  "message": {
    "id": "<string>",
    "variants": [
      {
        "id": "<string>",
        "text": "<MarkdownLikeString>",
        "delay": 0,
        "condition": "<StableMessageVariantCondition>",
        "createdAt": "2026-09-10T00:00:00.000Z",
        "updatedAt": "2026-09-10T00:00:00.000Z",
        "updatedByID": 0
      }
    ],
    "createdAt": "2026-09-10T00:00:00.000Z",
    "updatedAt": "2026-09-10T00:00:00.000Z",
    "createdByID": 0,
    "updatedByID": 0
  },
  "unresolvedReferences": [
    {
      "path": "<string>",
      "token": "<string>",
      "reason": "unknown"
    }
  ]
}
```

### Request examples

#### cURL

```bash
curl --request POST \
  --url 'https://realtime-api.voiceflow.com/v1/stable/message?projectID=<projectID>&environmentAlias=<environmentAlias>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "variants": [
    {
      "text": "<string>",
      "delay": 0,
      "condition": "<StableMessageVariantCondition>"
    }
  ]
}'
```

#### JavaScript

```javascript
const response = await fetch('https://realtime-api.voiceflow.com/v1/stable/message?projectID=<projectID>&environmentAlias=<environmentAlias>', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "variants": [
      {
        "text": "<string>",
        "delay": 0,
        "condition": "<StableMessageVariantCondition>"
      }
    ]
  }),
});
const data = await response.json();
```

#### Python

```python
import requests

response = requests.post(
    'https://realtime-api.voiceflow.com/v1/stable/message?projectID=<projectID>&environmentAlias=<environmentAlias>',
    headers={'Authorization': 'Bearer <token>'},
    json={
      "variants": [
        {
          "text": "<string>",
          "delay": 0,
          "condition": "<StableMessageVariantCondition>"
        }
      ]
    },
)
data = response.json()
```

#### Voiceflow CLI

```bash
vf message create --project-id <projectID> --environment-alias <environmentAlias> <<'JSON'
{
  "variants": [
    {
      "text": "<string>",
      "delay": 0,
      "condition": "<StableMessageVariantCondition>"
    }
  ]
}
JSON
```


## Create many messages

Creates several messages in one call, each with its own variants. None of them belongs to anything until a tool slot, workflow step, or reprompt holds its ID.

### Endpoint

```http
POST /v1/stable/message/batch
```

Server: https://realtime-api.voiceflow.com

### Authentication

```json
[
  {
    "token": []
  }
]
```

`token`:

```json
{
  "scheme": "bearer",
  "bearerFormat": "JWT",
  "type": "http",
  "description": "Voiceflow bearer token"
}
```

### Query parameters

#### `projectID`

Required · string

The ID of the project to operate on.

```json
{
  "type": "string",
  "description": "The ID of the project to operate on."
}
```

#### `environmentAlias`

Required · string

The alias of the environment to operate on (e.g. `main`).

```json
{
  "type": "string",
  "description": "The alias of the environment to operate on (e.g. `main`)."
}
```

### Request body

Required

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/StableMessageCreateManyRequest"
      }
    }
  }
}
```

### Responses

#### 201

Returns the new messages, in request order, with their variants and IDs, and `unresolvedReferences` for any variable or reference in the text that did not resolve.

Schema:

```json
{
  "$ref": "#/components/schemas/StableMessageCreateManyResponse"
}
```

Example:

```json
{
  "messages": [
    {
      "id": "<string>",
      "variants": [
        "<StableMessageVariant>"
      ],
      "createdAt": "2026-09-10T00:00:00.000Z",
      "updatedAt": "2026-09-10T00:00:00.000Z",
      "createdByID": 0,
      "updatedByID": 0
    }
  ],
  "unresolvedReferences": [
    {
      "path": "<string>",
      "token": "<string>",
      "reason": "unknown"
    }
  ]
}
```

### Request examples

#### cURL

```bash
curl --request POST \
  --url 'https://realtime-api.voiceflow.com/v1/stable/message/batch?projectID=<projectID>&environmentAlias=<environmentAlias>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "messages": [
    {
      "variants": [
        "<StableMessageVariantCreateRequest>"
      ]
    }
  ]
}'
```

#### JavaScript

```javascript
const response = await fetch('https://realtime-api.voiceflow.com/v1/stable/message/batch?projectID=<projectID>&environmentAlias=<environmentAlias>', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "messages": [
      {
        "variants": [
          "<StableMessageVariantCreateRequest>"
        ]
      }
    ]
  }),
});
const data = await response.json();
```

#### Python

```python
import requests

response = requests.post(
    'https://realtime-api.voiceflow.com/v1/stable/message/batch?projectID=<projectID>&environmentAlias=<environmentAlias>',
    headers={'Authorization': 'Bearer <token>'},
    json={
      "messages": [
        {
          "variants": [
            "<StableMessageVariantCreateRequest>"
          ]
        }
      ]
    },
)
data = response.json()
```

#### Voiceflow CLI

```bash
vf message create-many --project-id <projectID> --environment-alias <environmentAlias> <<'JSON'
{
  "messages": [
    {
      "variants": [
        "<StableMessageVariantCreateRequest>"
      ]
    }
  ]
}
JSON
```


## Add message variant

Adds another alternative text to an existing message, placed after the variants it already has. The runtime says one variant of a message, not all of them in turn.

### Endpoint

```http
POST /v1/stable/message/{messageID}/variant
```

Server: https://realtime-api.voiceflow.com

### Authentication

```json
[
  {
    "token": []
  }
]
```

`token`:

```json
{
  "scheme": "bearer",
  "bearerFormat": "JWT",
  "type": "http",
  "description": "Voiceflow bearer token"
}
```

### Path parameters

#### `messageID`

Required · string

The ID of the message to operate on.

```json
{
  "type": "string"
}
```

### Query parameters

#### `projectID`

Required · string

The ID of the project to operate on.

```json
{
  "type": "string",
  "description": "The ID of the project to operate on."
}
```

#### `environmentAlias`

Required · string

The alias of the environment to operate on (e.g. `main`).

```json
{
  "type": "string",
  "description": "The alias of the environment to operate on (e.g. `main`)."
}
```

### Request body

Required

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/StableMessageVariantCreateRequest"
      }
    }
  }
}
```

### Responses

#### 201

Returns the new variant with its ID, and `unresolvedReferences` for any variable or reference in its text that did not resolve.

Schema:

```json
{
  "$ref": "#/components/schemas/StableMessageVariantCreateResponse"
}
```

Example:

```json
{
  "variant": {
    "id": "<string>",
    "text": "<string>",
    "delay": 0,
    "condition": "<StableExpressionCondition>",
    "createdAt": "2026-09-10T00:00:00.000Z",
    "updatedAt": "2026-09-10T00:00:00.000Z",
    "updatedByID": 0
  },
  "unresolvedReferences": [
    {
      "path": "<string>",
      "token": "<string>",
      "reason": "unknown"
    }
  ]
}
```

### Request examples

#### cURL

```bash
curl --request POST \
  --url 'https://realtime-api.voiceflow.com/v1/stable/message/<messageID>/variant?projectID=<projectID>&environmentAlias=<environmentAlias>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "text": "<string>",
  "delay": 0,
  "condition": {
    "type": "value-variable",
    "matchAll": true,
    "assertions": [
      "<StableConditionAssertion>"
    ]
  }
}'
```

#### JavaScript

```javascript
const response = await fetch('https://realtime-api.voiceflow.com/v1/stable/message/<messageID>/variant?projectID=<projectID>&environmentAlias=<environmentAlias>', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "text": "<string>",
    "delay": 0,
    "condition": {
      "type": "value-variable",
      "matchAll": true,
      "assertions": [
        "<StableConditionAssertion>"
      ]
    }
  }),
});
const data = await response.json();
```

#### Python

```python
import requests

response = requests.post(
    'https://realtime-api.voiceflow.com/v1/stable/message/<messageID>/variant?projectID=<projectID>&environmentAlias=<environmentAlias>',
    headers={'Authorization': 'Bearer <token>'},
    json={
      "text": "<string>",
      "delay": 0,
      "condition": {
        "type": "value-variable",
        "matchAll": True,
        "assertions": [
          "<StableConditionAssertion>"
        ]
      }
    },
)
data = response.json()
```

#### Voiceflow CLI

```bash
vf message add-variant --message-id <messageID> --project-id <projectID> --environment-alias <environmentAlias> <<'JSON'
{
  "text": "<string>",
  "delay": 0,
  "condition": {
    "type": "value-variable",
    "matchAll": true,
    "assertions": [
      "<StableConditionAssertion>"
    ]
  }
}
JSON
```


## Update message variant

Edits one variant of a message in place, so the message keeps its ID and its owner. Send only the text, delay, or condition you want to change; `condition: null` removes the condition.

### Endpoint

```http
PATCH /v1/stable/message/{messageID}/variant/{variantID}
```

Server: https://realtime-api.voiceflow.com

### Authentication

```json
[
  {
    "token": []
  }
]
```

`token`:

```json
{
  "scheme": "bearer",
  "bearerFormat": "JWT",
  "type": "http",
  "description": "Voiceflow bearer token"
}
```

### Path parameters

#### `messageID`

Required · string

The ID of the message to operate on.

```json
{
  "type": "string"
}
```

#### `variantID`

Required · string

The ID of the message variant to operate on.

```json
{
  "type": "string"
}
```

### Query parameters

#### `projectID`

Required · string

The ID of the project to operate on.

```json
{
  "type": "string",
  "description": "The ID of the project to operate on."
}
```

#### `environmentAlias`

Required · string

The alias of the environment to operate on (e.g. `main`).

```json
{
  "type": "string",
  "description": "The alias of the environment to operate on (e.g. `main`)."
}
```

### Request body

Required

```json
{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "allOf": [
          {
            "$ref": "#/components/schemas/StableMessageVariantUpdateRequest"
          }
        ]
      }
    }
  }
}
```

### Responses

#### 200

Confirms the variant was updated. The body is a message, with `unresolvedReferences` for any variable or reference in the new text that did not resolve.

Schema:

```json
{
  "$ref": "#/components/schemas/StableTextUpdateResponse"
}
```

Example:

```json
{
  "message": "<string>",
  "unresolvedReferences": [
    {
      "path": "<string>",
      "token": "<string>",
      "reason": "unknown"
    }
  ]
}
```

### Request examples

#### cURL

```bash
curl --request PATCH \
  --url 'https://realtime-api.voiceflow.com/v1/stable/message/<messageID>/variant/<variantID>?projectID=<projectID>&environmentAlias=<environmentAlias>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "text": "<string>",
  "delay": 0,
  "condition": "<StableExpressionCondition>"
}'
```

#### JavaScript

```javascript
const response = await fetch('https://realtime-api.voiceflow.com/v1/stable/message/<messageID>/variant/<variantID>?projectID=<projectID>&environmentAlias=<environmentAlias>', {
  method: 'PATCH',
  headers: {
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "text": "<string>",
    "delay": 0,
    "condition": "<StableExpressionCondition>"
  }),
});
const data = await response.json();
```

#### Python

```python
import requests

response = requests.patch(
    'https://realtime-api.voiceflow.com/v1/stable/message/<messageID>/variant/<variantID>?projectID=<projectID>&environmentAlias=<environmentAlias>',
    headers={'Authorization': 'Bearer <token>'},
    json={
      "text": "<string>",
      "delay": 0,
      "condition": "<StableExpressionCondition>"
    },
)
data = response.json()
```

#### Voiceflow CLI

```bash
vf message update-variant --message-id <messageID> --variant-id <variantID> --project-id <projectID> --environment-alias <environmentAlias> <<'JSON'
{
  "text": "<string>",
  "delay": 0,
  "condition": "<StableExpressionCondition>"
}
JSON
```


## Delete message variant

Removes one variant from a message; a message needs at least one, so delete the message to drop the last. The response is a confirmation message, so refetch the message to see its variants.

### Endpoint

```http
DELETE /v1/stable/message/{messageID}/variant/{variantID}
```

Server: https://realtime-api.voiceflow.com

### Authentication

```json
[
  {
    "token": []
  }
]
```

`token`:

```json
{
  "scheme": "bearer",
  "bearerFormat": "JWT",
  "type": "http",
  "description": "Voiceflow bearer token"
}
```

### Path parameters

#### `messageID`

Required · string

The ID of the message to operate on.

```json
{
  "type": "string"
}
```

#### `variantID`

Required · string

The ID of the message variant to operate on.

```json
{
  "type": "string"
}
```

### Query parameters

#### `projectID`

Required · string

The ID of the project to operate on.

```json
{
  "type": "string",
  "description": "The ID of the project to operate on."
}
```

#### `environmentAlias`

Required · string

The alias of the environment to operate on (e.g. `main`).

```json
{
  "type": "string",
  "description": "The alias of the environment to operate on (e.g. `main`)."
}
```

### Responses

#### 200

Confirms the variant was deleted. The body is a message that also says when deleting the first variant cleared the condition of the one that took its place.

Schema:

```json
{
  "$ref": "#/components/schemas/StableDeleteResponse"
}
```

Example:

```json
{
  "message": "<string>"
}
```

### Request examples

#### cURL

```bash
curl --request DELETE \
  --url 'https://realtime-api.voiceflow.com/v1/stable/message/<messageID>/variant/<variantID>?projectID=<projectID>&environmentAlias=<environmentAlias>' \
  --header 'Authorization: Bearer <token>'
```

#### JavaScript

```javascript
const response = await fetch('https://realtime-api.voiceflow.com/v1/stable/message/<messageID>/variant/<variantID>?projectID=<projectID>&environmentAlias=<environmentAlias>', {
  method: 'DELETE',
  headers: {
    Authorization: 'Bearer <token>',
  },
});
const data = await response.json();
```

#### Python

```python
import requests

response = requests.delete(
    'https://realtime-api.voiceflow.com/v1/stable/message/<messageID>/variant/<variantID>?projectID=<projectID>&environmentAlias=<environmentAlias>',
    headers={'Authorization': 'Bearer <token>'},
)
data = response.json()
```

#### Voiceflow CLI

```bash
vf message delete-variant --message-id <messageID> --variant-id <variantID> --project-id <projectID> --environment-alias <environmentAlias>
```


## Schema definitions

### ConditionAssertionLhs

```json
{
  "type": "object",
  "properties": {
    "variableID": {
      "nullable": true,
      "type": "string"
    },
    "path": {
      "type": "string"
    }
  },
  "required": [
    "variableID"
  ]
}
```

### ConditionOperation

```json
{
  "type": "string",
  "enum": [
    "is",
    "is_not",
    "greater_than",
    "greater_or_equal",
    "less_than",
    "less_or_equal",
    "contains",
    "not_contains",
    "starts_with",
    "ends_with",
    "is_empty",
    "is_not_empty"
  ],
  "x-enumNames": [
    "IS",
    "IS_NOT",
    "GREATER_THAN",
    "GREATER_OR_EQUAL",
    "LESS_THAN",
    "LESS_OR_EQUAL",
    "CONTAINS",
    "NOT_CONTAINS",
    "STARTS_WITH",
    "ENDS_WITH",
    "IS_EMPTY",
    "IS_NOT_EMPTY"
  ]
}
```

### MarkdownLikeString

```json
{
  "type": "string",
  "description": "Message text shown to the end user. Limited markdown: **bold**, _italic_, <u>underline</u>, ~~strikethrough~~, [label](url). {variable_name} inserts a variable or entity, {variable_name.path} a field of a variable. Escape a literal { or \\ with a backslash. A name matching neither is stored as literal text and reported in unresolvedReferences; secrets are not available here."
}
```

### StableConditionAssertion

```json
{
  "type": "object",
  "properties": {
    "key": {
      "type": "string"
    },
    "lhs": {
      "$ref": "#/components/schemas/ConditionAssertionLhs"
    },
    "rhs": {
      "$ref": "#/components/schemas/VariableReferenceString"
    },
    "operation": {
      "default": "is",
      "allOf": [
        {
          "$ref": "#/components/schemas/ConditionOperation"
        }
      ]
    }
  },
  "required": [
    "key",
    "lhs",
    "rhs"
  ]
}
```

### StableDeleteResponse

```json
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "A human-readable message confirming the deletion."
    }
  },
  "required": [
    "message"
  ]
}
```

### StableExpressionCondition

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "value-variable"
      ],
      "x-enumNames": [
        "VALUE_VARIABLE"
      ]
    },
    "matchAll": {
      "type": "boolean"
    },
    "assertions": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/StableConditionAssertion"
      }
    }
  },
  "required": [
    "type",
    "matchAll",
    "assertions"
  ]
}
```

### StableMessage

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "variants": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/StableMessageVariant"
      },
      "description": "Every variant, in stored order. Variants are alternatives: the runtime says one of them each time. The first variant cannot be given a condition."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
    },
    "createdByID": {
      "type": "number",
      "description": "The user who created the message."
    },
    "updatedByID": {
      "type": "number",
      "description": "The user who last changed the message or one of its variants."
    }
  },
  "required": [
    "id",
    "variants",
    "createdAt",
    "updatedAt",
    "createdByID",
    "updatedByID"
  ]
}
```

### StableMessageCreateManyRequest

```json
{
  "type": "object",
  "properties": {
    "messages": {
      "minItems": 1,
      "maxItems": 50,
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/StableMessageCreateRequest"
      },
      "description": "The messages to create, at most 50. Each entry is the body of a single create. The response lists them in this order."
    }
  },
  "required": [
    "messages"
  ],
  "additionalProperties": false
}
```

### StableMessageCreateManyResponse

```json
{
  "type": "object",
  "properties": {
    "messages": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/StableMessage"
      },
      "description": "The created messages, in request order."
    },
    "unresolvedReferences": {
      "description": "References this write kept as literal text instead of binding, each with the reason. The write still succeeded.",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/StableUnresolvedReference"
      }
    }
  },
  "required": [
    "messages"
  ]
}
```

### StableMessageCreateRequest

```json
{
  "type": "object",
  "properties": {
    "variants": {
      "minItems": 1,
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/StableMessageVariantCreateRequest"
      },
      "description": "The variants, in stored order. They are alternatives: the runtime says one of them each time. The first variant cannot carry a condition."
    }
  },
  "required": [
    "variants"
  ],
  "additionalProperties": false
}
```

### StableMessageCreateResponse

```json
{
  "type": "object",
  "properties": {
    "message": {
      "$ref": "#/components/schemas/StableMessage"
    },
    "unresolvedReferences": {
      "description": "References this write kept as literal text instead of binding, each with the reason. The write still succeeded.",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/StableUnresolvedReference"
      }
    }
  },
  "required": [
    "message"
  ]
}
```

### StableMessageGetManyRequest

```json
{
  "type": "object",
  "properties": {
    "ids": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Message IDs to read. Duplicates are ignored; at most 50 distinct IDs."
    }
  },
  "required": [
    "ids"
  ],
  "additionalProperties": false
}
```

### StableMessageReadManyResponse

```json
{
  "type": "object",
  "properties": {
    "messages": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/StableMessage"
      },
      "description": "The messages found, in request order."
    },
    "missing": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Requested IDs that match no message in this environment, in request order."
    }
  },
  "required": [
    "messages",
    "missing"
  ]
}
```

### StableMessageReadResponse

```json
{
  "type": "object",
  "properties": {
    "message": {
      "$ref": "#/components/schemas/StableMessage"
    }
  },
  "required": [
    "message"
  ]
}
```

### StableMessageUpdateRequest

```json
{
  "type": "object",
  "properties": {
    "variantOrder": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Every variant ID of the message, each exactly once, in the new order."
    }
  },
  "required": [
    "variantOrder"
  ],
  "additionalProperties": false
}
```

### StableMessageVariant

```json
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "text": {
      "$ref": "#/components/schemas/MarkdownLikeString"
    },
    "delay": {
      "nullable": true,
      "description": "Milliseconds to wait before this variant is sent.",
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "condition": {
      "nullable": true,
      "allOf": [
        {
          "$ref": "#/components/schemas/StableMessageVariantCondition"
        }
      ]
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
    },
    "updatedByID": {
      "nullable": true,
      "description": "The user who last changed this variant.",
      "type": "number"
    }
  },
  "required": [
    "id",
    "text",
    "delay",
    "condition",
    "createdAt",
    "updatedAt",
    "updatedByID"
  ]
}
```

### StableMessageVariantCondition

```json
{
  "oneOf": [
    {
      "$ref": "#/components/schemas/StableExpressionCondition"
    },
    {
      "$ref": "#/components/schemas/StableScriptCondition"
    }
  ],
  "description": "When the runtime may use this variant. `value-variable` compares variables with values; `script` runs code in which {variable_name} reads a variable."
}
```

### StableMessageVariantCreateRequest

```json
{
  "type": "object",
  "properties": {
    "text": {
      "$ref": "#/components/schemas/MarkdownLikeString"
    },
    "delay": {
      "description": "Milliseconds to wait before this variant is sent.",
      "nullable": true,
      "type": "integer",
      "minimum": 0,
      "maximum": 2147483647
    },
    "condition": {
      "nullable": true,
      "allOf": [
        {
          "$ref": "#/components/schemas/StableMessageVariantCondition"
        }
      ]
    }
  },
  "required": [
    "text"
  ],
  "additionalProperties": false
}
```

### StableMessageVariantCreateResponse

```json
{
  "type": "object",
  "properties": {
    "variant": {
      "$ref": "#/components/schemas/StableMessageVariant"
    },
    "unresolvedReferences": {
      "description": "References this write kept as literal text instead of binding, each with the reason. The write still succeeded.",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/StableUnresolvedReference"
      }
    }
  },
  "required": [
    "variant"
  ]
}
```

### StableMessageVariantUpdateRequest

```json
{
  "type": "object",
  "properties": {
    "text": {
      "allOf": [
        {
          "$ref": "#/components/schemas/MarkdownLikeString"
        }
      ]
    },
    "delay": {
      "description": "Milliseconds to wait before this variant is sent. null removes the delay.",
      "nullable": true,
      "type": "integer",
      "minimum": 0,
      "maximum": 2147483647
    },
    "condition": {
      "nullable": true,
      "allOf": [
        {
          "$ref": "#/components/schemas/StableMessageVariantCondition"
        }
      ]
    }
  },
  "additionalProperties": false
}
```

### StableScriptCondition

```json
{
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "script"
      ],
      "x-enumNames": [
        "SCRIPT"
      ]
    },
    "code": {
      "$ref": "#/components/schemas/VariableReferenceString"
    }
  },
  "required": [
    "type",
    "code"
  ]
}
```

### StableTextUpdateResponse

```json
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "A human-readable message confirming the update."
    },
    "unresolvedReferences": {
      "description": "References this write kept as literal text instead of binding, each with the reason. The write still succeeded.",
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/StableUnresolvedReference"
      }
    }
  },
  "required": [
    "message"
  ]
}
```

### StableUnresolvedReference

```json
{
  "type": "object",
  "properties": {
    "path": {
      "type": "string",
      "description": "Dotted path of the field that carried it, e.g. `knowledgeBaseTool.filters[0].defaultValue`."
    },
    "token": {
      "type": "string",
      "description": "The reference as written, without braces."
    },
    "reason": {
      "type": "string",
      "enum": [
        "unknown",
        "secret-not-allowed",
        "path-on-non-variable",
        "resource-id",
        "invalid-name",
        "dangling"
      ],
      "description": "`unknown`: no variable or entity of that name. `secret-not-allowed`: the name is a project secret and this field does not accept one. `path-on-non-variable`: only a variable has fields. `resource-id`: a bare resource id, not a name. `invalid-name`: outside the `^\\w{1,64}$` name grammar. `dangling`: the reference rendered as a bare id, because its row is gone or its name is outside the name grammar.",
      "x-enumNames": [
        "UNKNOWN",
        "SECRET_NOT_ALLOWED",
        "PATH_ON_NON_VARIABLE",
        "RESOURCE_ID",
        "INVALID_NAME",
        "DANGLING"
      ]
    }
  },
  "required": [
    "path",
    "token",
    "reason"
  ]
}
```

### StableUpdateResponse

```json
{
  "type": "object",
  "properties": {
    "message": {
      "type": "string",
      "description": "A human-readable message confirming the update."
    }
  },
  "required": [
    "message"
  ]
}
```

### VariableReferenceString

```json
{
  "type": "string",
  "description": "Plain text; markdown is not interpreted. {variable_name} inserts a variable or entity, {variable_name.path} a field of a variable. Escape a literal { or \\ with a backslash. A name matching neither is stored as literal text and reported in unresolvedReferences; secrets are not available here."
}
```
