# Trigger File Ingestion

This API will trigger the ingestion to your Clear TDS Account.&#x20;

### Request Method

POST

### Request URL

```
{{BASE_URL}}/ingestion/integration/v1/{templateType}/ingest/file
```

### Request Headers

| Parameter             | Data Type | Field Validations | Description                              |
| --------------------- | --------- | ----------------- | ---------------------------------------- |
| x-cleartax-auth-token | String    | NA                | <p>Mandatory.</p><p>User auth token.</p> |
| tan                   | String    | NA                | Mandatory. TAN of deductor               |
| Content-Type          | String    | NA                | Mandatory. application/json              |

### Request Path Params

| Parameter    | Data Type | Field Validations                  | Description                                  |
| ------------ | --------- | ---------------------------------- | -------------------------------------------- |
| templateType | String    | <p></p><p></p><p>Enum: tds<br></p> | Type of document. This will always be “tds”. |

### Request Query Params

There are no query paramaters for this API.&#x20;

### Request Body

| Parameter     | Data Type | Field Validations | Description                                          |
| ------------- | --------- | ----------------- | ---------------------------------------------------- |
| userInputArgs | Object    | NA                | <p>Mandatory. </p><p>User Input Arguments Object</p> |
| fileInfo      | Object    | NA                | <p>Mandatory.</p><p>File Information Object</p>      |

#### User Input Arguments Object

| Parameter  | Data Type | Field Validations                                                                               | Description                                                                                                                                                                                                                                                                                                                                 |
| ---------- | --------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| templateId | String    | NA                                                                                              | <p>Mandatory. Template ID of the file uploaded.</p><p>For 24Q -<br>62df9202813e5b2d2d2a2ff5<br>For 26Q -<br>62de5622813e5b2d2d2a2f90<br>For 27Q -<br>62df93ca813e5b2d2d2a2ff7<br>For 27EQ -<br>62df928a813e5b2d2d2a2ff6</p><p>For custom upload templates, <a href="/pages/IYQwAL588ON72xd2qYVc">use the custom upload template ID</a>.</p> |
| metadata   | Object    | NA                                                                                              | <p>Mandatory.</p><p>Contains 3 fields, formtype, financialYear,</p><p>quarter</p>                                                                                                                                                                                                                                                           |
| tenant     | String    | <p>Enum: </p><p>For 24Q - TDSV224Q For 26Q - TDSV226Q For 27Q - TDSV227Q For 27EQ-TDSV227EQ</p> | Mandatory.                                                                                                                                                                                                                                                                                                                                  |

#### Metadata Object

| Parameter     | Data Type | Field Validations                                                                 | Description                               |
| ------------- | --------- | --------------------------------------------------------------------------------- | ----------------------------------------- |
| formType      | String    | <p>Enum: </p><p>Form24Q</p><p>Form26Q</p><p>Form27Q</p><p>Form27EQ</p><p><br></p> | <p>Mandatory.</p><p>Type of the form.</p> |
| financialYear | String    | NA                                                                                | <p>Mandatory. </p><p>Financial Year</p>   |
| quarter       | String    | NA                                                                                | <p>Mandatory. </p><p>Quarter</p>          |

#### File Information Object

| Parameter    | Data Type | Field Validations | Discriptions                                                               |
| ------------ | --------- | ----------------- | -------------------------------------------------------------------------- |
| s3FileUrl    | String    | NA                | <p>Mandatory.</p><p>Presigned URL where the file was uploaded.</p>         |
| userFileName | String    | NA                | <p>Mandatory. </p><p>Filename used when generating the Pre-signed URL.</p> |

### Sample Request

Request Body

```json
{
    "userInputArgs": {
        "templateId": "62de5622813e5b2d2d2a2f90",
        "metadata": {
            "formType": "Form26Q",
            "quarter": "Q4",
            "financialYear": "2022"
        },
        "tenant": "TDSV226Q"
    },
    "fileInfo": {
        "s3FileUrl": "https://storage.clear.in/v1/ap-south-1/ingestionv2-staging/307a6331-df8b-4bdd-a05a-d18812da0340/TDS/2023/SEPTEMBER/4c503955ff324394a720b2b05a46e4dc/OriginalFileName/4c503955ff324394a720b2b05a46e4dc__1694627112023.TDS-TEST?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEEoaCmFwLXNvdXRoLTEiSDBGAiEA%2FirnhtBmeWgDj8J8vdIX%2BAdbnSQ2DbaRzUCOGAdw%2BdkCIQCwA6eArDVE7A%2BjDk1ALQ%2Bj%2B8B4z%2Fpu9P9p5EKvOQG5mSqCBQgzEAUaDDIxOTM0MTkwNzk4MyIMmylTFDGnf5DiUg1KKt8EKKnlsrOy0jvbiYtXxTh5D%2F%2FqLbIpUaBbZdJSlJSS3kUc6hM3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%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20230913T174512Z&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Expires=35999&X-Amz-Credential=ASIATGEOL5AHSMLMZPEM%2F20230913%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Signature=bdf6fa61008bb41e8b939920f3293f69cb710a92528ce7183d0d4a117bfc072b",
        "userFileName": "TDS-TEST.csv"
    }
}
```

### Response Status Codes

| HTTP Status Code | Description                       |
| ---------------- | --------------------------------- |
| 201              | Triggered ingestion successfully. |
| 400              | Bad request.                      |
| 401              | Unauthorized                      |
| 500              | Internal Server Error             |

### Response Schema

| Parameter  | Data Type | Field Validations                            | Description                                                                                                                                                                                 |
| ---------- | --------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| activityId | String    | NA                                           | Async activity ID created by Clear.                                                                                                                                                         |
| status     | String    | <p>Enum:<br>ACTIVITY\_CREATED</p><p><br></p> | <p>Status of the triggered ingestion activity.<br><br>ACTIVITY\_CREATED - Ingestion triggered<br></p><p>If there is an error, this will be null, otherwise ACTIVITY\_CREATED</p><p><br></p> |
| errors     | Array     | NA                                           | Array of Error Objects. If there are no errors, then this will be an empty array.                                                                                                           |

#### Error Object

| Parameter    | Data Type | Field Validations | Description                                                                           |
| ------------ | --------- | ----------------- | ------------------------------------------------------------------------------------- |
| errorCode    | String    | NA                | Error code. If there is no error code, then this will be null.                        |
| errorMessage | String    | NA                | Error message. If there is no error message, then this will be null.                  |
| errorField   | String    | NA                | Error field. If there is no error field, then this will be null.                      |
| errorValues  | Array     | NA                | Array of strings. Error values. If there are no error values, then this will be null. |

### Sample Response (Success)

HTTP Status Code - 201 Created

```json
{
    "activityId": "9dac682840244551958bc1c2f90d7710",
    "status": "ACTIVITY_CREATED",
    "errors": []
}
```

### Sample Response (Error)

HTTP Status Code - 401 Unauthorized

```json
{
    "activityId": null,
    "status": null,
    "errors": [
        {
            "errorMessage": "Invalid Auth Token",
            "errorField": null,
            "errorValues": null,
            "errorCode": "AUTHENTICATION_FAILED"
        }
    ]
}
```

### API Validations

Currently there are no known validations.

### API Constraints

Currently there are no known constraints.&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cleartax.in/cleartax-docs/tds-api/tds-api-reference/tds-apis/upload-deductions/ingest-deductions-via-file/trigger-file-ingestion.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
