# Get Ingestion Activity Status

### Request Method

GET

### Request URL

```
{{base_url}}/one-integration/workflow/status
```

### Request Headers

| Parameter          | Data Type | Field Validations | Description                       |
| ------------------ | --------- | ----------------- | --------------------------------- |
| x-clear-auth-token | String    | MinLength:1       | Mandatory. Authentication token   |
| x-integration-id   | String    | MinLength:1       | Mandatory. Integration identifier |

### Request Path Params

There are no request path params.

### Request Query Params

| Parameter | Data Type | Field Validations | Description                                        |
| --------- | --------- | ----------------- | -------------------------------------------------- |
| taskId    | String    | MinLength:1       | Mandatory. Task ID returned from the ingestion API |

### Request Body

There will be no request body for this API.

### Response Status Codes

| HTTP Status Code | Description                                            |
| ---------------- | ------------------------------------------------------ |
| 200              | Request processed successfully and response returned.  |
| 400              | The request is invalid or missing required parameters. |
| 403              | User not authorized.                                   |
| 500              | Something went wrong on the server.                    |

### Response Schema

<table><thead><tr><th width="187">Parameter</th><th>Data Type</th><th width="187">Field Validations</th><th>Description</th></tr></thead><tbody><tr><td>status</td><td>Integer</td><td>Always 200 on success</td><td>HTTP status code of the response (e.g., 200 for success).</td></tr><tr><td>success</td><td>Boolean</td><td>Always true on success</td><td>Indicates whether the request was successful (true or false).</td></tr><tr><td>message</td><td>String</td><td>Contains taskId in message</td><td>Human-readable message describing the result.</td></tr><tr><td>result</td><td>Object/Null</td><td>Null if task not found</td><td><p>Contains the detailed result data.</p><p>If status is 200, the result will be present. For non-200 this will be null.</p></td></tr><tr><td>error</td><td>Object/Null</td><td>Null on success</td><td><p>Error object containing code, message, and optional validationErrors array. Only populated when non-200 status.</p><p>If status is 200, then this will null even if the Workflow processing failures.</p></td></tr><tr><td>metadata</td><td>Object/Null</td><td>Always null for this API</td><td>not applicable for this endpoint.</td></tr></tbody></table>

### &#x20;Result Object

<table><thead><tr><th width="187">Parameter</th><th>Data Type</th><th>Field Callouts</th><th>Description</th></tr></thead><tbody><tr><td>workflowStatus</td><td>String</td><td><p>ENUM: CREATED, </p><p>PROCESSING,<br>SUCCESS, FAILED</p></td><td><p>High-level status of the workflow execution.</p><p></p><p>End states are : SUCCESS, FAILED</p><p><br>CREATED: Workflow has been created and queued.</p><p>PROCESSING: Processing of workflow is under execution.</p><p>SUCCESS: Workflow status is SUCCESS if all stages are SUCCESS or PARTIAL_SUCCESS.</p><p>FAILED: Processing failed with errors.</p></td></tr><tr><td>taskId</td><td>String</td><td>Matches TaskId from create API</td><td>Unique identifier of the async task</td></tr><tr><td>activityStatusList</td><td>List</td><td>One entry per stage/template combination</td><td>List of Activity Status objects showing status for each processing stage. See Activity Status Object below.</td></tr><tr><td>message</td><td>String</td><td>NA</td><td></td></tr><tr><td>urlsToNotify</td><td>List</td><td>For callback integrations</td><td>List of webhook URLs that were notified upon completion (empty if no callbacks configured).</td></tr><tr><td>preSignedUrls</td><td>List</td><td>For output file downloads</td><td>List of presigned URLs for downloading generated output files (empty if no outputs).</td></tr><tr><td>generatedURLs</td><td>List</td><td>For report downloads</td><td>List of URLs for generated reports or processed files (empty if none).</td></tr></tbody></table>

### Activity Status Object

| Parameter          | Data Type     | Field Callouts                           | Description                                                                                                                                                                                                                                                                                                                                                 |
| ------------------ | ------------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| stage              | String        | ENUM: TRANSFORMATION, INGESTION, SYSTEM  | <p>The stage of processing (e.g., INGESTION, TRANSFORMATION,SYSTEM).</p><p>INGESTION can be 0 or n (number of ingestionTemplate)</p><p>SYSTEM can be 0 or 1.</p><p>TRANSFORMATION can be 0 or 1.</p>                                                                                                                                                        |
| ingestionTemplate  | String        | ingestionTemplate                        | <p>Template name used for processing (e.g., PURCHASE).<br></p><p>If stage is non INGESTION, then this will be null.</p>                                                                                                                                                                                                                                     |
| status             | String        | ENUM: SUCCESS, FAILURE, PARTIAL\_SUCCESS | <p>Status can be SUCCESS or FAILURE or PARTIAL\_SUCCESS, in case of INGESTION stage. If some or all records in that template have gone into Validation failure, it will be PARTIAL\_SUCCESS.<br></p><p>Status can be either SUCCESS or FAILURE, In case of TRANSFORMATION stage.</p><p></p><p>And it will be only FAILURE, in the case of SYSTEM stage.</p> |
| errorReportPreSign | String / Null | URL expires in 1 hour                    | <p>Presigned URL for error report (if any errors occurred), null if not applicable.<br><br>This will be applicable only for INGESTION and TRANSFORMATION stages. For SYSTEM it will be null.</p>                                                                                                                                                            |
| errorMessage       | String / Null | Optional                                 | Error message if the status failure, null if success or partial\_success.                                                                                                                                                                                                                                                                                   |
| activityId         | String        | NA                                       | Optional. Unique identifier for this ingestion activity. This can be ignored.                                                                                                                                                                                                                                                                               |

### Sample Request and Response

#### Sample Success

**Request cURL**

```
curl -X GET "https://api-sandbox.clear.in/one-integration/workflow/status?taskId=6988855cffad3510146f7535" \
  -H "x-clear-auth-token: your-access-token" \
  -H "x-integration-id: your-integration-id"
```

**Response Body (Task in Processing State)**

{% code overflow="wrap" %}

```json
{
  "status": 200,
  "success": true,
  "message": "Status fetched successfully 6988a3bc2e0e5e3c6c9aa6da",
  "result": {
    "taskId": "6988a3bc2e0e5e3c6c9aa6da",
    "activityStatusList": null,
    "workflowStatus": "PROCESSING",
    "message": null,
    "urlsToNotify": [],
    "preSignedUrls": [],
    "generatedURLs": []
  },
  "error": null,
  "metadata": null
}
```

{% endcode %}

**Response Body (Task in Success)**

```json
{
  "status": 200,
  "success": true,
  "message": "Status fetched successfully 6988a3bc2e0e5e3c6c9aa6da",
  "result": {
    "taskId": "6988a3bc2e0e5e3c6c9aa6da",
    "activityStatusList": [
      {
        "stage": "INGESTION",
        "ingestionTemplate": "PURCHASE",
        "status": "SUCCESS",
        "errorReportPreSign": null,
        "errorMessage": null,
        "activityId": "b9a5dac0d01241089994b2444f102542"
      }
    ],
    "workflowStatus": "SUCCESS",
    "message": null,
    "urlsToNotify": [],
    "preSignedUrls": [],
    "generatedURLs": []
  },
  "error": null,
  "metadata": null
}

```

**Response Body (Activity Failed)**

```json
{
  "status": 200,
  "success": true,
  "message": "Status fetched successfully 6988c9f8b359874b346bbe9c",
  "result": {
    "taskId": "6988c9f8b359874b346bbe9c",
    "activityStatusList": [
      {
        "stage": "INGESTION",
        "ingestionTemplate": "PURCHASE",
        "status": "FAILURE",
        "errorReportPreSign": null,
        "errorMessage": "This is a duplicate file. Data import for this file is already in progress. Please refer import history section for more details.",
        "activityId": "0d03fcd78acb4f8394e19d8f07abf59b"
      },
      {
        "stage": "INGESTION",
        "ingestionTemplate": "PURCHASE",
        "status": "SUCCESS",
        "errorReportPreSign": null,
        "errorMessage": null,
        "activityId": "c6f0f01dfc34413fa70a7d3b830499c5"
      }
    ],
    "workflowStatus": "FAILED",
    "message": "Contact ClearTax support",
    "urlsToNotify": [],
    "preSignedUrls": [],
    "generatedURLs": []
  },
  "error": null,
  "metadata": null
}

```

#### Sample Error

**Request**

```
curl -X GET "https://api-sandbox.clear.in/one-integration/workflow/status?taskId=invalid-task-id" \
  -H "x-clear-auth-token: your-access-token" \
  -H "x-integration-id: your-integration-id"
```

**Response**

```
{
  "status": 404,
  "success": false,
  "message": "No task found with taskId: 6988a3bc2e0e5e3c6c9aa6d",
  "result": null,
  "error": {
    "code": "404",
    "message": "No Such Element Found",
    "validationErrors": null
  },
  "metadata": null
}
```

### API Validations <a href="#api-validations" id="api-validations"></a>

Currently there are no known validations.

### API Constraints

There are no constraints at API level.
