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

# Bind a chat

> Bind a paired chat to a bot.


## OpenAPI

```yaml openapi.json post /v1/workflows/{id}/bindings
openapi: 3.1.0
info:
  title: Ocean One API
  version: 2.3.1
servers:
  - url: https://api.plungeai.com
paths:
  /v1/workflows/{id}/bindings:
    post:
      operationId: post-v1-workflows-id-bindings
      tags:
        - Bots
      summary: Bind a paired chat to a bot
      description: "The chat must be one you paired (`POST /v1/channels/pair`); anything else is 422 not_paired. A chat talks to one bot: binding it again moves it."
      security:
        - ozkBearer: []
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: Saved workflow id (a bot you own)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                channel:
                  type: string
                  example: telegram
                sender_id:
                  type: string
                  maxLength: 128
                  description: The paired chat’s sender id, from GET /v1/channels
              required:
                - channel
                - sender_id
      responses:
        "201":
          description: Bound
          content:
            application/json:
              schema:
                type: object
                properties:
                  binding:
                    type: object
                    properties:
                      channel:
                        type: string
                      sender_id:
                        type: string
                      sender_name:
                        type: string
                      target:
                        type: string
                        description: The bot (workflow) id the chat talks to
                      target_name:
                        type: string
                    required:
                      - channel
                      - sender_id
                      - target
        "400":
          description: invalid_json — body is not valid JSON or YAML; invalid_format — format must be one of json, yaml, markdown, text
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "401":
          description: unauthorized — missing, invalid or revoked ozk_ key
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "404":
          description: "workflow_not_found — no saved workflow with that id for this account (foreign and missing ids answer alike); not_found — no route for this method on this path: every other method answers it"
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "409":
          description: binding_limit — the account has reached its binding limit
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "422":
          description: not_paired — that chat is not paired to your account; invalid_params — a field failed validation; nothing was written
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "502":
          description: upstream_error — channel bindings are unavailable
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
        "503":
          description: not_enabled — channel bindings are not enabled yet (the message gateway deploy is pending)
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Error"
components:
  schemas:
    Error:
      type: object
      description: Standard error envelope. Every error response also carries an `X-Error-Code` response header equal to error.code, so a client branches on the header regardless of the negotiated body format (json | yaml | markdown | text). When the request created an execution, the `X-Execution-Id` response header is also set. Errors follow the negotiated format like success bodies.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
            connect:
              type: object
              description: "On a 424 connection_required / credential_required: where the missing connection is made."
              properties:
                provider:
                  type: string
                method:
                  type: string
                  enum:
                    - oauth
                    - api_key
                    - wallet
                link:
                  type: string
                  example: POST /v1/connections/stripe/link
          required:
            - code
            - message
          additionalProperties: true
      required:
        - error
  securitySchemes:
    ozkBearer:
      type: http
      scheme: bearer
      description: "ozk_ platform API key (Authorization: Bearer ozk_…)"
```
