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

# Create Pathway Chat

> Create an instance of a pathway chat, which can be used to send and receive messages to the pathway.

### Headers

<ParamField header="authorization" type="string" required>
  Your API key for authentication.
</ParamField>

### Body

<ParamField body="pathway_id" type="string" required>
  Pathway ID of the pathway to create a chat instance for.
</ParamField>

<ParamField body="start_node_id" type="string">
  The start node ID of the pathway. If not provided, the pathway will start from the node marked as the start node in the pathway configuration.
</ParamField>

<ParamField body="request_data" type="object">
  Custom key-value data to initialize the pathway chat with. This object will be stored as the pathway's initial variables and can be referenced within pathway nodes. The `request_data` must be a valid JSON object (not an array or null).

  This works the same as [request\_data in v1/calls](/api-v1/post/calls#param-request-data) where variables can be accessed using `{{variable_name}}` syntax within your pathway nodes.

  ```json theme={null}
  {
    "user_name": "John Doe",
    "account_id": "12345",
    "preference": "email"
  }
  ```
</ParamField>

<ParamField body="use_candidate_model" type="boolean">
  Whether to use the candidate model for this pathway chat. When enabled, the pathway will use an experimental model version for enhanced performance and capabilities.
</ParamField>

<ParamField body="pathway_version" type="number">
  The specific version number of the pathway to use for this chat instance. If not provided, the production version will be used.
</ParamField>

### Response

<ResponseField name="data" type="object">
  Contains the response data for the created pathway chat instance.

  <Expandable title="data properties">
    <ResponseField name="chat_id" type="uuid">
      The ID of the chat instance created. This will be used to send and receive messages to the pathway via the `/v1/pathway/chat/:id` endpoint.
    </ResponseField>

    <ResponseField name="message" type="string">
      A confirmation message. Will say "Chat instance created successfully" on success.
    </ResponseField>

    <ResponseField name="variables" type="object | null">
      The initial variables that were set for this pathway chat instance. This will contain the `request_data` object if it was provided in the request, otherwise it will be `null`.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="errors" type="null | array">
  Will be `null` on success. Contains error details if the request failed.
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "data": {
      "chat_id": "9f8e7d6c-5b4a-3c2d-1e0f-a1b2c3d4e5f6",
      "message": "Chat instance created successfully",
      "variables": {
        "user_name": "John Doe",
        "account_id": "12345",
        "preference": "email"
      }
    },
    "errors": null
  }
  ```
</ResponseExample>

***

Docs for agents: [llms.txt](/llms.txt)
