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

# Get Tasks by Status

> Retrieve tasks for the user that are either `queued`, `processing`, `failed`, `success` or `partial_success` based on the query string. Defaults to `queued` and `processing`.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/ai/analytics.yml get /ai/embeddings
openapi: 3.1.0
info:
  title: Telnyx AI Analytics API
  version: 2.0.0
  description: API for AI conversations, insights, embeddings, and clusters.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /ai/embeddings:
    get:
      tags:
        - Embeddings
      summary: Get Tasks by Status
      description: >-
        Retrieve tasks for the user that are either `queued`, `processing`,
        `failed`, `success` or `partial_success` based on the query string.
        Defaults to `queued` and `processing`.
      operationId: GetTasksByStatus
      parameters:
        - description: List of task statuses i.e. `status=queued&status=processing`
          required: false
          schema:
            items:
              type: string
            type: array
            title: Status
            description: List of task statuses i.e. `status=queued&status=processing`
            default:
              - processing
              - queued
          name: status
          in: query
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackgroundTasksQueryResponseData'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Telnyx from 'telnyx';

            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });

            const embeddings = await client.ai.embeddings.list();

            console.log(embeddings.data);
        - lang: Python
          source: |-
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            embeddings = client.ai.embeddings.list()
            print(embeddings.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tembeddings, err := client.AI.Embeddings.List(context.TODO(), telnyx.AIEmbeddingListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", embeddings.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
            import com.telnyx.sdk.models.ai.embeddings.EmbeddingListParams;
            import com.telnyx.sdk.models.ai.embeddings.EmbeddingListResponse;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    EmbeddingListResponse embeddings = client.ai().embeddings().list();
                }
            }
        - lang: Ruby
          source: |-
            require "telnyx"

            telnyx = Telnyx::Client.new(api_key: "My API Key")

            embeddings = telnyx.ai.embeddings.list

            puts(embeddings)
        - lang: PHP
          source: >-
            <?php


            require_once dirname(__DIR__) . '/vendor/autoload.php';


            use Telnyx\Client;

            use Telnyx\Core\Exceptions\APIException;


            $client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API
            Key');


            try {
              $embeddings = $client->ai->embeddings->list(status: ['string']);

              var_dump($embeddings);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx ai:embeddings list \
              --api-key 'My API Key'
components:
  schemas:
    BackgroundTasksQueryResponseData:
      properties:
        data:
          items:
            $ref: '#/components/schemas/BackgroundTasksQueryResponse'
          type: array
          title: Data
      type: object
      required:
        - data
      title: BackgroundTasksQueryResponseData
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    BackgroundTasksQueryResponse:
      properties:
        user_id:
          type: string
          title: User Id
        task_id:
          type: string
          title: Task Id
        task_name:
          type: string
          title: Task Name
        status:
          $ref: '#/components/schemas/BackgroundTaskStatus'
        created_at:
          type: string
          format: date-time
          title: Created At
        finished_at:
          type: string
          format: date-time
          title: Finished At
        bucket:
          type: string
          title: Bucket
      type: object
      required:
        - user_id
        - task_id
        - task_name
        - status
        - created_at
      title: BackgroundTasksQueryResponse
    ValidationError:
      title: ValidationError
      required:
        - loc
        - msg
        - type
      type: object
      properties:
        loc:
          title: Location
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
    BackgroundTaskStatus:
      type: string
      enum:
        - queued
        - processing
        - success
        - failure
        - partial_success
      title: BackgroundTaskStatus
      description: Status of an embeddings task.
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````