> For the complete documentation index, see [llms.txt](https://docs.cleartax.in/cleartax-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cleartax.in/cleartax-docs/gls-api/gls-api-reference/advanced-ingestion-api/get-pre-signed-url.md).

# Get Pre-signed URL

### Request Method

GET

### Request URL

```
{{base_url}}/one-integration/action/pre-sign
```

### Request Headers

| Parameter          | Data Type | Field Validations                     | Description                       |
| ------------------ | --------- | ------------------------------------- | --------------------------------- |
| x-clear-auth-token | String    | NA                                    | Mandatory. Authentication token   |
| x-integration-id   | String    | 36 length UUID (provided by Cleartax) | Mandatory. Integration identifier |

### Request Path Params

There will be no path parameters body for this API.

### Request Query Params

| Parameter | Data Type | Field Validations | Description                                                                                                                                                                                |
| --------- | --------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| filename  | String    | NA                | <p>Mandatory. Name of the file to upload with its file extension.<br>Allowed extensions: csv, xlsx, xls, zip<br></p><p>File extension should match the file content type or mime type.</p> |

### 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.                                           |
| 401              | Authentication failed                                                                           |
| 403              | Forbidden                                                                                       |
| 400              | The request is invalid or missing required parameters                                           |
| 406              | Returned when the request parameters are invalid or cannot be processed in the expected format. |
| 500              | Something went wrong on the server.                                                             |

### Response Schema

| Parameter | Data Type    | Field Callouts           | Description                                                                                                                                     |
| --------- | ------------ | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| status    | Integer      | Always returned          | HTTP status code of the response (e.g., 200 for success).                                                                                       |
| success   | Boolean      | Always returned          | <p>Indicates whether the request was successful (true or false).</p><p>If this is true, then the result object will have a file upload URL.</p> |
| message   | String       | Always returned          | Human-readable message describing the result (e.g., "generated pre-sign url successfully").                                                     |
| result    | Object       | Null on error            | Contains the presigned URL details. See Result Object below.                                                                                    |
| error     | Object/ Null | Null on success          | Error details if the request fails, null if there is no error.                                                                                  |
| metadata  | Object/ Null | Always null for this API | This will always be null.                                                                                                                       |

### Result Object

| Parameter | Data Type | Field Callouts                                | Description                                                                                                                                                            |
| --------- | --------- | --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| status    | String    | HTTP status text (e.g., "OK", "BAD\_REQUEST") | Status of the operation (e.g., "OK").                                                                                                                                  |
| uploadUrl | String    | URL expires in 1 hour (3600 seconds)          | <p>The generated presigned URL. This will be used in below APIs later:</p><ol><li>Upload File to Storage (Step 2)</li><li>Create Ingestion Activity (Step 3)</li></ol> |

### Error Object

| Parameter        | Data Type | Field Callouts                       | Description                |
| ---------------- | --------- | ------------------------------------ | -------------------------- |
| code             | String    | Always returned in case of any error | Contains the error code    |
| message          | String    | Always returned in case of any error | Contains the error message |
| validationErrors | List      | Always null                          | Always null                |

### Sample Request and Response

#### Sample Success

**Request cURL**

```
curl -X 'GET' \
'https://api-sandbox.clear.in/one-integration/action/pre-sign?filename=purchase.csv' \
  -H 'accept: */*' \
  -H 'x-clear-auth-token: your-access-token' \
  -H 'x-integration-id: your-integration-id'
```

**Response Body**

```json
{
  "status": 200,
  "success": true,
  "message": "generated pre-sign url successfully",
  "result": {
    "status": "OK",
    "uploadUrl": "https://storage.clear.in/v1/ap-south-1/one-integration-staging/85899214-187b-4ca5-9d53-f89a83f955ba/edadb372-d2db-4c95-b44c-057e76be78ef/2026/FEBRUARY/8/fb9ce29e-72ce-4661-8d34-c1e065502cb1/data_extraction/85899214-187b-4ca5-9d53-f89a83f955ba/abc.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20260208T121803Z&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Expires=3599&X-Amz-Credential=AKIATGEOL5AH262NFI54%2F20260208%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Signature=539d9fe32eb5cc7abf8afeb5916cd8f8261629a9207d21d58cb826b47d6773fc"
  },
  "error": null,
  "metadata": null
}
```

#### **Sample Error - HTTP Status Code 406**

**Request cURL**

```
curl -X 'GET' \
  'https://api-sandbox.clear.in/one-integration/action/pre-sign?filename=abc' \
  -H 'accept: */*' \
  -H 'x-clear-auth-token: your-access-token' \
  -H 'x-integration-id: your-integration-id'
```

**Response Body**

```json
{
  "status": 406,
  "success": false,
  "message": "ERROR",
  "result": null,
  "error": {
    "code": "406",
    "message": "Invalid file extension. Allowed extensions: csv, xlsx, xls, zip",
    "validationErrors": null
  },
  "metadata": null
}
```

#### Sample Error - HTTP Status Code 401

**Request cURL**

```
curl -X 'GET' \
  'https://api-sandbox.clear.in/one-integration/action/pre-sign?filename=sales.csv' \
  -H 'accept: */*' \
  -H 'x-clear-auth-token: invalid-access-token' \
  -H 'x-integration-id: your-integration-id'
```

**Response Body**

```
UNAUTHORIZED
```

### 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 1 hour.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.cleartax.in/cleartax-docs/gls-api/gls-api-reference/advanced-ingestion-api/get-pre-signed-url.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
