> ## 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.

# 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.



## OpenAPI

````yaml /specs-prettified/realtime/openapi.stable.json post /v1/stable/message/batch
openapi: 3.0.0
info:
  title: Realtime
  description: Realtime gateway API service
  version: 1.0.0
  contact: {}
servers:
  - url: https://realtime-api.voiceflow.com
security: []
tags: []
paths:
  /v1/stable/message/batch:
    post:
      tags:
        - Message
      summary: Create many messages
      description: 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.
      operationId: StableMessageController_createMany
      parameters:
        - name: projectID
          required: true
          in: query
          schema:
            type: string
            description: The ID of the project to operate on.
        - name: environmentAlias
          required: true
          in: query
          schema:
            type: string
            description: The alias of the environment to operate on (e.g. `main`).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/StableMessageCreateManyRequest"
      responses:
        "201":
          description: 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.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/StableMessageCreateManyResponse"
          x-vf-doc:
            description: 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.
      security:
        - token: []
components:
  schemas:
    StableMessageCreateManyRequest:
      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
    StableMessageCreateRequest:
      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
    StableMessageVariantCreateRequest:
      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
    MarkdownLikeString:
      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."
    StableMessageVariantCondition:
      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.
    StableExpressionCondition:
      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
    StableConditionAssertion:
      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
    ConditionAssertionLhs:
      type: object
      properties:
        variableID:
          nullable: true
          type: string
        path:
          type: string
      required:
        - variableID
    VariableReferenceString:
      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.
    ConditionOperation:
      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
    StableScriptCondition:
      type: object
      properties:
        type:
          type: string
          enum:
            - script
          x-enumNames:
            - SCRIPT
        code:
          $ref: "#/components/schemas/VariableReferenceString"
      required:
        - type
        - code
    StableMessageCreateManyResponse:
      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
    StableMessage:
      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
    StableMessageVariant:
      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
    StableUnresolvedReference:
      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
  securitySchemes:
    token:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: Voiceflow bearer token
````
