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

# Retrieve Canvas Run

> Retrieve the status and details of an asynchronous chat completion using its unique identifier, enabling efficient polling and status monitoring.



## OpenAPI

````yaml GET /v2/chat/completions/{id}
openapi: 3.0.1
info:
  title: Tela API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.tela.com
security: []
paths:
  /v2/chat/completions/{id}:
    get:
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful retrieval of chat completion
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChatCompletionWebhookResponse'
components:
  schemas:
    ChatCompletionWebhookResponse:
      type: object
      title: Chat completion webhook response
      description: >-
        Response structure for a chat completion webhook. This represents the
        data sent to the webhook URL when a chat completion is finished.
      properties:
        id:
          type: string
          description: Unique identifier for this chat completion response
        status:
          type: string
          enum:
            - created
            - failed
            - running
            - succeeded
          description: >-
            The current status of the chat completion. 'created' means the
            request has been received but processing hasn't started. 'running'
            means the chat completion is currently being processed. 'succeeded'
            means the chat completion has finished successfully. 'failed' means
            the chat completion encountered an error and couldn't complete.
        input_content:
          type: object
          description: >-
            Contains information about the input provided for this chat
            completion
          properties:
            variables:
              $ref: '#/components/schemas/Variables'
              description: Variables passed to the chat completion, including any file URLs
            messages:
              type: array
              description: Array of messages that were part of the input
              items:
                type: object
                properties:
                  role:
                    type: string
                    description: >-
                      The role of the message sender (e.g., 'user', 'assistant',
                      'system')
                  content:
                    oneOf:
                      - type: string
                      - type: object
                        properties:
                          type:
                            type: string
                            enum:
                              - text
                              - image_url
                          text:
                            type: string
                          image_url:
                            type: object
                            properties:
                              url:
                                type: string
                              detail:
                                type: string
                                enum:
                                  - auto
                                  - high
                                  - low
                    description: >-
                      The content of the message. Can be a string for text
                      messages, or an object for more complex content types like
                      images.
                  function_call:
                    type: object
                    description: >-
                      Optional. Information about a function call, if
                      applicable.
                    properties:
                      name:
                        type: string
                      arguments:
                        type: string
            files:
              type: array
              description: Information about files used in the chat completion
              items:
                type: object
                properties:
                  name:
                    type: string
                  used_at:
                    type: string
                    enum:
                      - variables
                      - messages
                  parsed_content:
                    type: string
                  url:
                    type: string
                  type:
                    type: string
                    enum:
                      - image
                      - file
        output_content:
          type: object
          description: Contains the output generated by the chat completion
          properties:
            role:
              type: string
              enum:
                - system
                - user
                - assistant
                - function
              description: The role of the entity providing the output
            tool_calls:
              type: array
              description: >-
                Optional. Information about tool calls made during the
                completion.
              items:
                type: object
                properties:
                  name:
                    type: string
                  arguments:
                    type: string
            information:
              type: object
              description: Optional. Additional information about the completion process.
              properties:
                duration:
                  type: number
                cost:
                  type: number
                input_tokens:
                  type: integer
                output_tokens:
                  type: integer
            has_structured_output:
              type: boolean
              description: Indicates whether the output has a structured format
            content:
              type: object
              description: The main content of the chat completion output
            input_messages:
              type: string
              description: Optional. The input messages in a string format.
        raw_input:
          type: object
          nullable: true
          description: The original input parameters provided for this chat completion
          properties:
            version_id:
              type: string
              description: The ID of the version used for this chat completion
            canvas_id:
              type: string
              description: The ID of the canvas used for this chat completion
            application_id:
              type: string
              description: The ID of the application associated with this chat completion
            webhook_url:
              type: string
              description: The URL where webhook notifications are sent
            variables:
              $ref: '#/components/schemas/Variables'
            messages:
              $ref: '#/components/schemas/Messages'
            override:
              $ref: '#/components/schemas/Override'
        raw_output:
          type: object
          additionalProperties: true
          description: The raw output from the chat completion process
        compatibility_date:
          type: string
          format: date-time
          description: The date used for compatibility checks
        prompt_version_id:
          type: string
          description: The ID of the prompt version used for this chat completion
        prompt_application_id:
          type: string
          nullable: true
          description: The ID of the prompt application, if applicable
        workspace_id:
          type: string
          description: The ID of the workspace where this chat completion was executed
        created_at:
          type: string
          format: date-time
          description: The timestamp when this chat completion was created
        updated_at:
          type: string
          format: date-time
          description: The timestamp when this chat completion was last updated
    Variables:
      type: object
      description: The variables to pass to the canvas
      additionalProperties:
        oneOf:
          - type: string
          - type: object
            properties:
              file_url:
                type: string
              options:
                type: object
            required:
              - file_url
    Messages:
      type: array
      items:
        type: object
        properties:
          role:
            type: string
            enum:
              - user
              - assistant
          content:
            oneOf:
              - type: string
                description: The content of the message as a string
              - $ref: '#/components/schemas/FileMessage'
            description: The content of the message, either as a string or a file
        required:
          - role
          - content
    Override:
      type: object
      description: >-
        Override default settings specified in the canvas. This allows for
        fine-tuning the completion behavior for this specific request.
      properties:
        model:
          type: string
          description: >-
            The specific model to use for this completion. If not specified, the
            default model set in the canvas will be used.
        temperature:
          type: number
          description: >-
            Controls randomness in the output. Values between 0 and 1. Lower
            values make the output more focused and deterministic.
        type:
          type: string
          enum:
            - chat
            - completion
          description: Specifies whether to use a chat or completion model.
        functions:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              name:
                type: string
              description:
                type: string
              parameters:
                type: object
                properties:
                  type:
                    type: string
                    enum:
                      - object
                  properties:
                    type: object
                    additionalProperties: true
                  required:
                    type: array
                    items:
                      type: string
          description: >-
            An array of functions that the model can call. This allows for more
            structured and interactive completions.
        structured_output:
          type: object
          properties:
            enabled:
              type: boolean
              description: Whether to enable structured output for this completion.
            schema:
              type: object
              properties:
                properties:
                  type: object
                  additionalProperties: true
                  description: Defines the properties of the structured output
                type:
                  type: string
                  enum:
                    - object
                  description: >-
                    The type of the schema, always "object" for structured
                    output
                title:
                  type: string
                  description: The title of the schema
                description:
                  type: string
                  description: A description of the schema
                required:
                  type: array
                  items:
                    type: string
                  description: An array of required property names
              description: >-
                The schema defining the structure of the output. This is used
                when structured output is enabled.
          description: Configuration for generating structured output.
      required:
        - type
    FileMessage:
      type: object
      properties:
        file_url:
          type: string
          description: The URL of the file

````