> ## Documentation Index
> Fetch the complete documentation index at: https://flexprice-mintlify-9d9353d9.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a task

> Use when checking task status or progress (e.g. polling after create). Returns task by ID.



## OpenAPI

````yaml /api-reference/openapi.json get /tasks/{id}
openapi: 3.0.1
info:
  title: Flexprice API
  description: Flexprice API Service
  contact:
    name: API Support
  license:
    name: AGPL-3.0
    url: https://www.gnu.org/licenses/agpl-3.0.html
  version: '1.0'
servers:
  - url: https://us.api.flexprice.io/v1
    description: US Region
  - url: https://api.cloud.flexprice.io/v1
    description: India Region
security: []
paths:
  /tasks/{id}:
    get:
      tags:
        - Tasks
      summary: Get a task
      description: >-
        Use when checking task status or progress (e.g. polling after create).
        Returns task by ID.
      operationId: getTask
      parameters:
        - name: id
          in: path
          description: Task ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskResponse'
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '404':
          description: Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    TaskResponse:
      type: object
      properties:
        completed_at:
          type: string
          format: date-time
        created_at:
          type: string
          format: date-time
        created_by:
          type: string
        entity_type:
          $ref: '#/components/schemas/types.EntityType'
        environment_id:
          type: string
        error_summary:
          type: string
        failed_at:
          type: string
          format: date-time
        failed_records:
          type: integer
        file_name:
          type: string
        file_type:
          $ref: '#/components/schemas/types.FileType'
        file_url:
          type: string
        id:
          type: string
        metadata:
          type: object
          additionalProperties: true
        processed_records:
          type: integer
        scheduled_task_id:
          type: string
        started_at:
          type: string
          format: date-time
        status:
          $ref: '#/components/schemas/types.Status'
        successful_records:
          type: integer
        task_status:
          $ref: '#/components/schemas/types.TaskStatus'
        task_type:
          $ref: '#/components/schemas/types.TaskType'
        tenant_id:
          type: string
        total_records:
          type: integer
        updated_at:
          type: string
          format: date-time
        updated_by:
          type: string
        workflow_id:
          type: string
    errors.ErrorResponse:
      type: object
      properties:
        code:
          $ref: '#/components/schemas/errors.ErrorCode'
        http_status_code:
          type: integer
        message:
          type: string
      x-speakeasy-name-override: ErrorResponse
    types.EntityType:
      type: string
      enum:
        - EVENTS
        - PRICES
        - CUSTOMERS
        - FEATURES
      x-enum-varnames:
        - EntityTypeEvents
        - EntityTypePrices
        - EntityTypeCustomers
        - EntityTypeFeatures
      x-speakeasy-name-override: EntityType
    types.FileType:
      type: string
      enum:
        - CSV
        - JSON
      x-enum-varnames:
        - FileTypeCSV
        - FileTypeJSON
      x-speakeasy-name-override: FileType
    types.Status:
      type: string
      enum:
        - published
        - deleted
        - archived
      x-enum-varnames:
        - StatusPublished
        - StatusDeleted
        - StatusArchived
      x-speakeasy-name-override: Status
    types.TaskStatus:
      type: string
      enum:
        - PENDING
        - PROCESSING
        - COMPLETED
        - FAILED
      x-enum-varnames:
        - TaskStatusPending
        - TaskStatusProcessing
        - TaskStatusCompleted
        - TaskStatusFailed
      x-speakeasy-name-override: TaskStatus
    types.TaskType:
      type: string
      enum:
        - IMPORT
        - EXPORT
      x-enum-varnames:
        - TaskTypeImport
        - TaskTypeExport
      x-speakeasy-name-override: TaskType
    errors.ErrorCode:
      type: string
      enum:
        - http_client_error
        - system_error
        - internal_error
        - not_found
        - already_exists
        - version_conflict
        - validation_error
        - invalid_operation
        - permission_denied
        - database_error
        - service_unavailable
        - too_many_requests
      x-enum-varnames:
        - ErrCodeHTTPClient
        - ErrCodeSystemError
        - ErrCodeInternalError
        - ErrCodeNotFound
        - ErrCodeAlreadyExists
        - ErrCodeVersionConflict
        - ErrCodeValidation
        - ErrCodeInvalidOperation
        - ErrCodePermissionDenied
        - ErrCodeDatabase
        - ErrCodeServiceUnavailable
        - ErrCodeTooManyRequests
      x-speakeasy-name-override: ErrorCode
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: Enter your API key in the format *x-api-key &lt;api-key&gt;**
      name: x-api-key
      in: header

````