---
title: "Submit an upload initiate request"
method: POST
path: "/customs/declarations/file-upload"
tags: ["Endpoints"]
---

# Submit an upload initiate request

`POST /customs/declarations/file-upload`

Obtain a signed URL to upload files to.

The SuccessRedirect and ErrorRedirect fields are optional.

If you provide them when you POST your file, then the response will be an automatic redirect. 

If you do not require these redirects for your application, then do not provide these redirect fields.

### File upload workflow
Once you receive a successful response from this endpoint, use the information in the response to POST your file to the URL provided.

You must use multipart encoding (multipart/form-data) NOT application/x-www-form-urlencoded.

The 'file' field must be the last field in the submitted form.

**Error scenarios**

<table>
  <tbody>
    <tr>
      <td><b>Scenario</b></td>
      <td><b>HTTP Status</b></td>
      <td><b>Code</b></td>
    </tr>
    <tr>
      <td>Invalid XML Payload</td>
      <td>400 (Bad Request)</td>
      <td>BAD_REQUEST</td>
    </tr>
    <tr>
      <td>A firewall rejected the request</td>
      <td>403 (Payload Forbidden)</td>
      <td>PAYLOAD_FORBIDDEN</td>
    </tr>
    <tr>
      <td>Internal server error</td>
      <td>500 (Internal Server Error)</td>
      <td>INTERNAL_SERVER_ERROR</td>
    </tr>
  </tbody>
</table>

For error scenarios that are common across all APIs, and for error formats, see our [reference guide](/api-documentation/docs/reference-guide#errors) for more on errors.

## Headers

- `Accept` string, required
- `Content-Type` string, required
- `X-Badge-Identifier` string
- `X-Eori-Identifier` string

## Response `200`

## Other responses

- `400`
- `403`
- `500`

---

[API](https://skmtc.net/hmrc/apis/customs-declarations.md) · [All operations](https://skmtc.net/hmrc/apis/customs-declarations/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hmrc/customs-declarations/versions/8c0b42fdea54/schema)
