# Get Pre-signed URL

### Request Method

GET

### Request URL

```
{{BASE_URL}}/ingestion/elt/url/pre-sign
```

### Request Headers

| Parameter             | Data Type | Field Validations | Description                                                                                            |
| --------------------- | --------- | ----------------- | ------------------------------------------------------------------------------------------------------ |
| x-cleartax-product    | String    | NA                | Mandatory. This will be “GST”.                                                                         |
| x-workspace-id        | String    | NA                | Mandatory. Workspace ID.                                                                               |
| x-cleartax-orgunit    | String    | NA                | Mandatory. Organization Unit ID.                                                                       |
| x-cleartax-auth-token | String    | NA                | Mandatory. Access token linked to the workspace and environment.                                       |
| filecontenttype       | String    | Valid mime type   | Mandatory. Content Type of the File to be uploaded. Eg: For Excel file, use “application/vnd.ms-excel” |

### Request Path Params

There will be no path parameters body for this API.

### Request Query Params

| Parameter  | Data Type | Field Validations | Description                                 |
| ---------- | --------- | ----------------- | ------------------------------------------- |
| file\_name | String    | NA                | Mandatory. Name of the file to be uploaded. |

### Request Body

There will be no request body for this API.

### Response Status Codes

| HTTP Status Code | Description  |
| ---------------- | ------------ |
| 200              | OK           |
| 400              | Bad request  |
| 401              | Unauthorized |
| 403              | Forbidden    |

### Response Schema

| Parameter | Data Type | Field Validations | Description                                |
| --------- | --------- | ----------------- | ------------------------------------------ |
| status    | String    | NA                | If success, this will be “OK”              |
| payload   | String    | NA                | Pre-signed URL to be used in the next API. |

### Sample Request and Response

#### Request

```
curl --location 'https://api-sandbox.clear.in/ingestion/elt/url/pre-sign?file_name=report.xlsx' \
--header 'filecontenttype: application/vnd.ms-excel' \
--header 'x-cleartax-product: GST' \
--header 'x-workspace-id: ' \
--header 'x-cleartax-orgunit: ' \
--header 'x-cleartax-auth-token: ' \
--data ''
```

#### Response (Success)

**HTTP Status Code: 200 OK**

```json
{
    "status": "OK",
    "payload": "https://storage.clear.in/v1/ap-south-1/ingestionv2-staging//ADVANCE_INGESTION/2024/FEBRUARY/46e7b2e2-ff4e-4446-bb8f-74cf24c63074/OriginalFileName/46e7b2e2-ff4e-4446-bb8f-74cf24c63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Pv0aR36BriAEy6y0hT79vJSJENM90CAmAFRYHdwcHHp7ftibQ36u8aT4DtvdzDJ64KuBjqZAeVDd7IdhEfhRyj%2FhzvW1Aq%2BZELINglPDtWvTMu4AsjOcXmPso0nNSmdGK4GuIg%2Bxh%2BHjyonBO4dkoOA4YweWmcOz9O%2BWvysgTjkfI1Av34oj6HcOn6SzIb%2BNgIDmuZDkaD%2BTOlHWfU0SyUjXGOxSqmPcWY%2Bn2PRzahfOdi1H59Kp5MxdEWS41ThFFEhsme20ytDiF6A28e2eA%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240205T104250Z&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Expires=36000&X-Amz-Credential=ASIATGEOL5AHYCWHQ6W7%2F20240205%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Signature=a5e1cd9d3a0886a8865c8c1805ef5ada0a559920995f14c746f0d1f9da21b5ff"
}
```

#### Response (Failure)

HTTP Status Code: 401 Unauthorized

```json
{
    "status": "UNAUTHORIZED",
    "error": "User is not authorized to perform this action",
    "timestamp": "03-07-2025 07:22:01"
}
```

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

Filename cannot be empty.

### API Constraints

Once a pre-signed URL is generated, it will be valid for only 10 mins.


---

# 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/gls-api/gls-api-reference/advanced-ingestion-api-reference-deprecated/get-pre-signed-url.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.
