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

# Escalate to ticketing integration

> Escalate a completed conversation to an external ticketing integration
(Plain, Pylon, or Linear). Creates a ticket with the conversation transcript
and AI-generated summary.

Can only be called once per conversation. Subsequent calls return `409 Conflict`.




## OpenAPI

````yaml /openapi-v0.yaml post /v0/chat/{conversation_id}/escalate
openapi: 3.1.0
info:
  title: Decimal Chat API
  version: v0
  description: >
    ## Authentication


    All endpoints require a Bearer token:


    ```

    Authorization: Bearer sk-de-...

    ```


    API tokens are created in the Decimal dashboard under Settings → API Tokens.

    Each token has scopes that control access: `chat:read`, `chat:write`,
    `chat:escalate`.


    ## Quick Start


    ```bash

    # 1. Send a message

    curl -X POST https://api.getdecimal.ai/v0/chat \
      -H "Authorization: Bearer sk-de-..." \
      -H "Content-Type: application/json" \
      -d '{"message": "How do I configure SSO?"}'
    # → 202 { "conversation_id": "abc123", "status": "processing" }


    # 2. Poll until complete

    curl https://api.getdecimal.ai/v0/chat/abc123 \
      -H "Authorization: Bearer sk-de-..."
    # → 200 { "status": "completed", "messages": [...] }

    ```


    ### Continue a conversation

    ```bash

    curl -X POST https://api.getdecimal.ai/v0/chat \
      -H "Authorization: Bearer sk-de-..." \
      -H "Content-Type: application/json" \
      -d '{"message": "Can you show me the SAML setup?", "conversation_id": "abc123"}'
    ```


    ## Rate Limiting


    Every response includes rate limit headers:

    - `X-RateLimit-Limit` — Requests allowed per minute

    - `X-RateLimit-Remaining` — Requests remaining in current window

    - `X-RateLimit-Reset` — Unix timestamp when the window resets


    Rate limits apply at two levels:

    - **Per API token:** 120 requests/min

    - **Per organization:** 600 requests/min across all tokens


    The stricter limit applies. Headers report the per-token limit.

    Contact support for higher limits.
  contact:
    name: Decimal Support
    url: https://getdecimal.ai
servers:
  - url: https://api.getdecimal.ai
    description: Production
  - url: http://localhost:3000
    description: Local development
security:
  - BearerAuth: []
tags:
  - name: Chat
    description: >-
      Send messages and get AI-powered answers from your public knowledge base
      and code.
  - name: Escalation
    description: Escalate conversations to external ticketing integrations.
  - name: Utility
    description: Token introspection.
paths:
  /v0/chat/{conversation_id}/escalate:
    parameters:
      - $ref: '#/components/parameters/ConversationId'
    post:
      tags:
        - Escalation
      summary: Escalate to ticketing integration
      description: >
        Escalate a completed conversation to an external ticketing integration

        (Plain, Pylon, or Linear). Creates a ticket with the conversation
        transcript

        and AI-generated summary.


        Can only be called once per conversation. Subsequent calls return `409
        Conflict`.
      operationId: escalateConversation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EscalateRequest'
      responses:
        '200':
          description: Escalation successful.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EscalateResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - BearerAuth:
            - chat:escalate
components:
  parameters:
    ConversationId:
      name: conversation_id
      in: path
      required: true
      schema:
        type: string
      description: Conversation ID (returned by `POST /v0/chat`).
  schemas:
    EscalateRequest:
      oneOf:
        - type: object
          properties:
            integration:
              type: string
              enum:
                - plain
            email:
              type: string
              minLength: 1
              format: email
              description: Customer email for the ticket.
            name:
              type: string
              minLength: 1
              description: Customer name for the ticket.
            title:
              type: string
              description: Ticket title. Auto-generated from conversation if omitted.
            summary:
              type: string
              description: Ticket summary. Auto-generated from conversation if omitted.
            additional_fields:
              type: object
              properties:
                label_type_ids:
                  type: array
                  items:
                    type: string
                priority:
                  type: number
          required:
            - integration
            - email
            - name
        - type: object
          properties:
            integration:
              type: string
              enum:
                - pylon
            email:
              type: string
              minLength: 1
              format: email
              description: Customer email for the ticket.
            name:
              type: string
              minLength: 1
              description: Customer name for the ticket.
            title:
              type: string
              description: Ticket title. Auto-generated from conversation if omitted.
            summary:
              type: string
              description: Ticket summary. Auto-generated from conversation if omitted.
            additional_fields:
              type: object
              properties:
                tags:
                  type: array
                  items:
                    type: string
                priority:
                  type: string
                  enum:
                    - urgent
                    - high
                    - medium
                    - low
                escalation_type:
                  type: string
                  enum:
                    - internal
                    - email
                support_email_address:
                  type: string
          required:
            - integration
            - email
            - name
        - type: object
          properties:
            integration:
              type: string
              enum:
                - linear
            email:
              type: string
              minLength: 1
              format: email
              description: Customer email for the ticket.
            name:
              type: string
              minLength: 1
              description: Customer name for the ticket.
            title:
              type: string
              description: Ticket title. Auto-generated from conversation if omitted.
            summary:
              type: string
              description: Ticket summary. Auto-generated from conversation if omitted.
            additional_fields:
              type: object
              properties:
                team_id:
                  type: string
                priority:
                  type: number
                label_ids:
                  type: array
                  items:
                    type: string
                project_id:
                  type: string
          required:
            - integration
            - email
            - name
        - type: object
          properties:
            integration:
              type: string
              enum:
                - zendesk
            email:
              type: string
              minLength: 1
              format: email
              description: Customer email for the ticket.
            name:
              type: string
              minLength: 1
              description: Customer name for the ticket.
            title:
              type: string
              description: Ticket title. Auto-generated from conversation if omitted.
            summary:
              type: string
              description: Ticket summary. Auto-generated from conversation if omitted.
            additional_fields:
              type: object
              properties:
                tags:
                  type: array
                  items:
                    type: string
                priority:
                  type: string
                  enum:
                    - urgent
                    - high
                    - normal
                    - low
          required:
            - integration
            - email
            - name
    EscalateResponse:
      type: object
      properties:
        success:
          type: boolean
          enum:
            - true
        integration:
          type: string
          enum:
            - plain
            - pylon
            - linear
            - zendesk
        ticket_id:
          type: string
          description: External ticket ID in the integration.
        ticket_url:
          type: string
          format: uri
          description: >-
            URL to the ticket in the integration (not available for all
            integrations).
      required:
        - success
        - integration
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - bad_request
                - unauthorized
                - forbidden
                - not_found
                - conflict
                - rate_limited
                - internal_error
              description: Machine-readable error code.
            message:
              type: string
              description: Human-readable error message.
            retryable:
              type: boolean
              description: Whether the client should retry the request.
          required:
            - code
            - message
      required:
        - error
  headers:
    X-RateLimit-Limit:
      description: Maximum requests allowed per minute.
      schema:
        type: integer
    X-RateLimit-Remaining:
      description: Requests remaining in the current window.
      schema:
        type: integer
    X-RateLimit-Reset:
      description: Unix timestamp when the rate limit window resets.
      schema:
        type: integer
  responses:
    BadRequest:
      description: Invalid request body or parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Valid API key but insufficient scope.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Conflict:
      description: >-
        Resource state conflict (e.g., conversation still processing, already
        escalated).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: Rate limit exceeded.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        Retry-After:
          description: Seconds until the rate limit resets.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: Unexpected server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        API token with `sk-de-` prefix.
        Created in the Decimal dashboard under Settings → API Tokens.

````