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

# Get a task from the registry

> Get the operation receipts related to a task id.




## OpenAPI

````yaml /api-reference/registry.yml get /sources/{sourceKey}/v1/tasks/{taskId}
openapi: 3.0.1
info:
  title: Registry API
  version: 1.0.0
servers:
  - url: https://api.{workspaceId}.clinia.cloud
    variables:
      workspaceId:
        default: ''
        description: The workspace id.
security:
  - apiKey: []
  - basicHttpAuth: []
  - bearerHttpAuth: []
tags:
  - name: Collections
    description: Management of collections in a registry.
  - name: Relationships
    description: Management of relationships in a registry.
  - name: Resources
    description: Management of resources in a registry.
paths:
  /sources/{sourceKey}/v1/tasks/{taskId}:
    get:
      tags:
        - Task
      summary: Get a task from the registry
      description: |
        Get the operation receipts related to a task id.
      operationId: GetTask
      parameters:
        - name: sourceKey
          in: path
          description: The source key.
          required: true
          schema:
            type: string
        - name: taskId
          in: path
          description: The task id.
          required: true
          schema:
            $ref: '#/components/schemas/v1TaskId'
        - name: withReceipts
          in: query
          description: >-
            If set to true, the operation receipts of the task will be included
            in the response. Else only the status of the task will be returned.
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: The task with the given id.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1Task'
        '404':
          description: The task was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1RegistryError'
        '429':
          $ref: '#/components/responses/v1TooManyRequestError'
        '504':
          $ref: '#/components/responses/v1GatewayTimeoutError'
components:
  schemas:
    v1TaskId:
      type: string
      description: >
        The task identifier. Used to track an async task in the system. Use the
        task ID to poll for completion status.

        The taskId holds different prefix to represent different tasks.

        - oneOf task: `s_<id>`.

        - bulk task: `bk_<id>` (deprecated: `<id>` only).

        - bundle task: `bd_<id>` (deprecated: `<id>` only).

        - purge task: `pg_<id>` (deprecated: `purge:<id>`).
    v1Task:
      type: object
      required:
        - status
        - taskId
      properties:
        status:
          $ref: '#/components/schemas/v1TaskStatus'
        taskId:
          $ref: '#/components/schemas/v1TaskId'
        receipts:
          type: array
          items:
            $ref: '#/components/schemas/v1OperationReceipt'
    v1RegistryError:
      allOf:
        - $ref: '#/components/schemas/v1Error'
        - type: object
          properties:
            code:
              $ref: '#/components/schemas/v1ErrorCode'
            applicationErrorCode:
              type: string
              enum:
                - REGISTRY_DUPLICATE_IDENTIFIER
                - REGISTRY_INVALID_COLLECTION_TYPE
                - REGISTRY_INVALID_CONTENT_TYPE
                - REGISTRY_INVALID_PIPELINE_STEP_DEFINITION
                - REGISTRY_INVALID_REQUEST_BODY
                - REGISTRY_INVALID_REVISION_ID
                - REGISTRY_PAYLOAD_PARSE_ERROR
                - REGISTRY_REQUIRED_FIELD_MISSING
                - REGISTRY_RESOURCE_TYPE_NOT_FOUND
                - REGISTRY_UNAVAILABLE_UPSTREAM_SERVICE
                - REGISTRY_BROWSE_SESSION_EXPIRED
                - REGISTRY_BULK_OPERATION_NOT_FOUND
                - REGISTRY_COLLECTION_NOT_FOUND
                - REGISTRY_CONTAINED_DEFINITION_NOT_FOUND
                - REGISTRY_PIPELINE_EXECUTION_NOT_FOUND
                - REGISTRY_PROFILE_NOT_FOUND
                - REGISTRY_PURGE_NOT_FOUND
                - REGISTRY_RELATIONSHIP_COLLECTION_NOT_FOUND
                - REGISTRY_RELATIONSHIP_DEFINITION_NOT_FOUND
                - REGISTRY_RELATIONSHIP_NOT_FOUND
                - REGISTRY_RESOURCE_NOT_FOUND
                - REGISTRY_RESOURCE_COLLECTION_NOT_FOUND
                - REGISTRY_SOURCE_NOT_FOUND
                - REGISTRY_TASK_NOT_FOUND
                - REGISTRY_VERSION_HISTORY_ITEM_NOT_FOUND
                - REGISTRY_REQUEST_CANCELLED
                - REGISTRY_REQUEST_TIMEOUT
                - REGISTRY_COLLECTION_ALREADY_EXISTS
                - REGISTRY_DUPLICATE_OPERATION_IN_BUNDLE
                - REGISTRY_IDENTIFIER_ALREADY_EXISTS
                - REGISTRY_RELATIONSHIP_ALREADY_EXISTS
                - REGISTRY_RELATIONSHIP_FROM_REF_ALREADY_EXISTS
                - REGISTRY_RELATIONSHIP_TO_REF_ALREADY_EXISTS
                - REGISTRY_RESOURCE_ALREADY_EXISTS
    v1TaskStatus:
      type: string
      description: |
        Status of the task.
        * `SUCCESS`: All the operations of the task completed successfully.  
        * `PENDING`: At least one operation in the task is still pending.
        * `CANCELLED`: All the operations in the task were cancelled.
        * `FAILURE`: At least one operations failed or was cancelled.
      enum:
        - SUCCESS
        - PENDING
        - CANCELLED
        - FAILURE
    v1OperationReceipt:
      oneOf:
        - $ref: '#/components/schemas/v1ResourceOperationReceipt'
        - $ref: '#/components/schemas/v1RelationshipOperationReceipt'
      discriminator:
        propertyName: targetType
        mapping:
          RESOURCE:
            $ref: '#/components/schemas/v1ResourceOperationReceipt'
          RELATIONSHIP:
            $ref: '#/components/schemas/v1RelationshipOperationReceipt'
    v1Error:
      type: object
      required:
        - code
        - message
        - type
      properties:
        code:
          $ref: '#/components/schemas/v1ErrorCode'
        message:
          type: string
        type:
          $ref: '#/components/schemas/v1ErrorType'
        details:
          description: list of errors that occurred if applicable.
          type: array
          items:
            $ref: '#/components/schemas/v1Error'
        additionalContext:
          type: object
          additionalProperties: true
    v1ErrorCode:
      type: integer
      format: int32
      enum:
        - 400
        - 401
        - 403
        - 404
        - 408
        - 409
        - 413
        - 429
        - 500
        - 501
        - 504
    v1ResourceOperationReceipt:
      allOf:
        - $ref: '#/components/schemas/v1BaseOperationReceipt'
        - $ref: '#/components/schemas/v1ResourceTarget'
    v1RelationshipOperationReceipt:
      allOf:
        - $ref: '#/components/schemas/v1BaseOperationReceipt'
        - $ref: '#/components/schemas/v1RelationshipTarget'
    v1ErrorType:
      type: string
      enum:
        - ALREADY_EXISTS
        - FAILED_PRECONDITION
        - INTERNAL
        - INVALID_ARGUMENT
        - NOT_FOUND
        - OUT_OF_RANGE
        - UNIMPLEMENTED
        - PERMISSION_DENIED
        - UNAUTHENTICATED
        - CONTENT_TOO_LARGE
        - REQUEST_TIMEOUT
        - TOO_MANY_REQUEST
        - GATEWAY_TIMEOUT
    v1BaseOperationReceipt:
      type: object
      required:
        - status
        - receivedAt
        - taskId
        - action
      properties:
        receivedAt:
          type: string
          format: date-time
          description: The time the operation was received.
          readOnly: true
        completedAt:
          type: string
          format: date-time
          description: The time the operation was completed (whether successfully or not).
          readOnly: true
        taskId:
          $ref: '#/components/schemas/v1TaskId'
          description: The ID of the task that created this operation.
          readOnly: true
        action:
          $ref: '#/components/schemas/v1OperationAction'
          description: The action that was performed.
          readOnly: true
        status:
          $ref: '#/components/schemas/v1OperationStatus'
        error:
          $ref: '#/components/schemas/v1Error'
        pipelineExecution:
          $ref: '#/components/schemas/v1PipelineExecutionInfo'
    v1ResourceTarget:
      allOf:
        - $ref: '#/components/schemas/v1TargetBase'
        - type: object
          required:
            - id
            - type
          properties:
            id:
              type: string
              description: The ID of the resource created, upserted, or deleted.
            type:
              type: string
              description: The type of resource created, upserted, or deleted.
          additionalProperties: false
    v1RelationshipTarget:
      allOf:
        - $ref: '#/components/schemas/v1TargetBase'
        - type: object
          required:
            - id
            - type
          properties:
            id:
              $ref: '#/components/schemas/v1RelationshipID'
            type:
              type: string
              description: The type of relationship created, upserted, or deleted.
          additionalProperties: false
    v1OperationAction:
      type: string
      enum:
        - CREATE
        - UPSERT
        - DELETE
        - UPDATE
      description: The action to perform.
    v1OperationStatus:
      type: string
      description: |
        Status of the operation.
          * `SUCCESS`: The operation was persisted in the source, or was dropped by a reject action of the user.
          * `PENDING`: The operation is being processed asyncronously by the system or is in a pipeline IN_REVIEW status.
          * `CANCELLED`: The operation was cancelled by the system due to a concurrent operation.
          * `FAILURE`: The operation failed due to validation or processing error.
      enum:
        - SUCCESS
        - PENDING
        - CANCELLED
        - FAILURE
    v1PipelineExecutionInfo:
      type: object
      required:
        - id
        - pipelineDefinitionId
        - status
      properties:
        id:
          type: string
          description: The id of the pipeline execution.
          readOnly: true
        pipelineDefinitionId:
          $ref: '#/components/schemas/v1RevisionId'
          description: >-
            The id of the pipeline definition with its version in the format
            `<id.version>`.
        status:
          $ref: '#/components/schemas/v1PipelineExecutionStatus'
          description: The status of the pipeline.
    v1TargetBase:
      type: object
      required:
        - targetType
      properties:
        targetType:
          $ref: '#/components/schemas/v1TargetType'
    v1RelationshipID:
      type: string
      description: |
        The unique identifier of the relationship.
        This is a key with the shape `{fromID}.{toID}`.
      pattern: ^[^.]+.[^.]+$
    v1RevisionId:
      type: string
      description: |
        The id with version in the format `<id>.<version>`.
      pattern: ^[a-zA-Z0-9_-]+.[0-9]+$
    v1PipelineExecutionStatus:
      type: string
      description: >
        Status of the pipeline execution.

        * `SUCCESSFUL`: The pipeline execution completed successfully. Every
        step of the pipeline was executed successfully and the change has been
        accepted in the system. 

        * `ERROR`: The pipeline execution failed at a step due to a system
        error.

        * `IN_PROGRESS`: The pipeline execution is being processed by the
        system. 

        * `IN_REVIEW`: The pipeline execution is waiting for a manual action.
        Refer to the ActOnPipelineExecution endpoint.  

        * `CANCELLED`: The pipeline execution has been short-circuited by the
        system and never completed. 

        * `DROPPED`: The pipeline execution has been dropped because the change
        has been rejected by the user following review.
      enum:
        - SUCCESSFUL
        - ERROR
        - IN_PROGRESS
        - IN_REVIEW
        - CANCELLED
        - DROPPED
    v1TargetType:
      type: string
      enum:
        - RELATIONSHIP
        - RESOURCE
  responses:
    v1TooManyRequestError:
      description: Returned when the server starts throttling the requests.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/v1Error'
    v1GatewayTimeoutError:
      description: Returned when the request exceeds the server timeout window.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/v1Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-Clinia-API-Key
    basicHttpAuth:
      description: Basic HTTP authentication.
      type: http
      scheme: basic
    bearerHttpAuth:
      description: JWT Bearer authentication.
      type: http
      scheme: Bearer
      bearerFormat: JWT

````