> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thanx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Upload URL

> This endpoint provides a pre-signed url where an image or file can be uploaded.

<Note>
  In order to submit a receipt to Thanx, you must first make a request to the API to get a pre-signed upload URL. Once you have uploaded the image to this URL, make a `POST /receipts` request to create the receipt in Thanx.
</Note>

<Note>
  Please review proper request headers [here](/consumer/usage/headers).
</Note>

The `file_path` can be used as the input to the `POST /receipts` endpoint.

### Parameters

<ParamField query="upload_type" type="string" required>
  The type of upload; currently only option is (`receipt`)
</ParamField>

### Response

<ResponseField name="url" type="string">
  Url to upload the image to
</ResponseField>

<ResponseField name="file_path" type="string">
  Path where the image will be saved
</ResponseField>

<RequestExample>
  ```bash Get Upload Url theme={null}
  curl https://api.thanxsandbox.com/upload_url \
    -X GET \
    -H "Content-Type: application/json"  \
    -H "Accept-Version: v4.0" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer ${token}" \
    -H "X-ClientId: ${client_id}" 
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "upload_url": {
      "url": "https://thanx.s3.amazonaws.com/uploads/receipts/image_5051555_1534872299.jpeg?AWS-PARAMS",
      "file_path": "uploads/receipts/image_5051555_1534872299.jpeg"
    }
  }
  ```
</ResponseExample>
