# Upload File to Storage

### Request Method

PUT

### Request URL

{PRE\_SIGNED\_URL} received in the response body of previous API.&#x20;

### Request Headers

| Parameter    | Data Type | Field Validations | Description                                                                                                                      |
| ------------ | --------- | ----------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Content-Type | String    | Valid mime type   | Mandatory. This should be the same as “filecontenttype” used in the previous API. For Excel file, use “application/vnd.ms-excel” |

### Request Path Params

There are no path parameters for this API.

### Request Query Params

There are no query parameters for this API.

### Request Body

File to be uploaded as binary.

### Response Status Codes

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

### Response Schema

NA

### Sample Request and Response

#### Request

```
curl --location --request PUT 'https://storage.clear.in/v1/ap-south-1/ingestionv2-staging//ADVANCE_INGESTION/2024/FEBRUARY/b7f7be5b-3c10-49a1-b7a4-08147d320f8e/OriginalFileName/b7f7be5b-3c10-49a1-b7a4-08147d320f8e__1707198366785.xlsx?X-Amz-Security-Token=IQoJb3JpZ2luX2VjEO7%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCmFwLXNvdXRoLTEiRjBEAiAfqS6poTq3B7CDA8ESXyc7Zzng4k3CTUYW7Kd3E9wBNgIgQxN6isArvwhnj5RVagOuBZb4POgaOxqswisaWvWI1EsqiwUIt%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FARAGGgwyMTkzNDE5MDc5ODMiDCTYsIL8NE1t1aPKxCrfBK67deZqwYiP1BZjJPv3tKzvcxc5c98TGlsHevKjrtLhG8Icfjz04cUAS4y2MI%2BDkxNN4veysqqMb5DF5XujEAzBBJ5VHZUbcisgZOw47nCcqySE2Tt23ysn6P%2FU52BEhY8JaFefkPDuzmTkJX%2BxfFupxfrAFBvy1XDiO1tP2d27dh8yBL%2F70KNHJz%2FhjqNpjSIqAaezYukDzx8x7UxaXvxvF%2BzgZWPkUtHhXgGAaJHlA15U3mfdvfswasT3O11YsLkER%2FUjdDQlZPrK0QYKPxy9H%2BH%2B%2BkbMvOxCbPvRsZEoqbb8m519ON9GfD9K1Wzs19MA%2FT%2FRKqSII4obX4cYVLkYUA3cngfF5YWfbP8qyV%2BF1bLJbwmHQq3B3dHL5Lo7eRSnX5qlv1Wh3WWOulHHj5kt3Lbvq6VuFI73wrpSeG6RqqTq8ADsDneObVZ9t2w2AILXqNGL7p%2F9675HdJFWj7n3TzNA1dNGI2Xbh%2Fp3scfoHLoKWiI4AWdAVuC6CHpIs%2FnZb9%2BlZ%2B1NDlaSPxAyTWihxG2cqnMhc8BF3xGxQxiPaLg2yLk6mEnOz8F7lI05d6Nn8DRqI%2Frrb2DweQUGtf7sVXEgcwvXX72vLw8iuYhGFh2wxavFR15jUiG1pEp6rQ0fPGLzmYMeEm5Jcv%2F9Pcd%2F727R26Wq0rRUXJksxK8WPqjHHA2dI2A3vCpWhIbJR%2FHp22mIgLge4QgO043E3kYh%2Fu6w1OACZrQFWJqdh%2BYpi8HoiBjG0rso4t4cF74UI0U82yA1n%2FagYmnM7J0PhijuVPk71Tpt7BERWWkvo0wno%2BHrgY6mwG0%2Bd4xECbss9zXYTJ%2FknLzZgOJVy50VOJVYvHgj77IBtxQuuPK05WkmthlhYkUIj%2B%2FiqzgAhp467zKfMJ0DQWnsUg8eFLF48tPHKeLfvffycdyBN%2FKNKhX3MvfUy%2FfC8yL%2BVK14VyGqBOeIPtmq2jd%2B3EZOSF5G4M%2BY8iTsAX0ONDJRU2mlYGDUKpNRqw3FLgkrrhwzvp%2BD7YQ%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240206T054606Z&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Expires=35999&X-Amz-Credential=ASIATGEOL5AH64DYV46U%2F20240206%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Signature=d27d32cb23f5e412934da800733e6fb4824af2f2db31594cddc9e81218903d7c' \
--header 'Content-Type: application/vnd.ms-excel' \
--data '@/C:/Users/admin/report.xlsx'
```

#### Response (Success)

**HTTP Status Code: 200 OK**

The response body will be blank but the status code will be 200 for success.

#### Response (Failure) <a href="#api-validations" id="api-validations"></a>

**HTTP Status Code: 403 Forbidden**

In case the PRE\_SIGNED\_URL gets expired

```xml
<?xml version="1.0" encoding="UTF-8"?>
<Error>
    <Code>AccessDenied</Code>
    <Message>Request has expired</Message>
    <X-Amz-Expires>35999</X-Amz-Expires>
    <Expires>2025-05-19T22:43:43Z</Expires>
    <ServerTime>2025-07-04T06:09:25Z</ServerTime>
    <RequestId>X5T0NQAKMQ5GYCDZ</RequestId>
    <HostId>retwk80WA88AvAa/y93iWdLMDreBW6nvSYS4HNnyKGgJkmTv7iCh+pgN/BCJdEl8b0t/FCKsk5saKc5tAp09JfSIJAyxL1+H</HostId>
</Error>
```

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

Currently there are no known validations.

### API Constraints

Once a pre-signed URL is generated, it will be valid for only 10 mins. If upload fails, generate a new pre-signed URL and try again.


---

# 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/upload-file-to-storage.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.
