v1

latestOpenAPI 3.0.02026-07-132716.9 KB

Create upload URL(s)

Creates one or more URLs, each of which comes with a TTL (time-to-live) and can be used to upload a file. The provided SRN and filename will be used to identify the HMRC recipient of the files to be uploaded.

post/misc/sdes-file-upload/files/upload/url/{srn}

Path parameters

srnstring required
Example:012345678901

Your organisation's unique SDES Reference Number (SRN). If you don't already have an SRN, it will be sent to you as part of registering to use the Secure Data Exchange Service (NB: this is separate to subscribing to this API).

Headers

Acceptstring required
Example:application/vnd.hmrc.1.0+json

Specifies the response format and the version of the API to be used.

Content-Typestring required
Example:application/json; charset=UTF-8

Specifies the format of the request body, which must be either XML or JSON. UTF-8 is the only valid character set.

Authorizationstring required
Example:Bearer 59fc92c1cdf0b8ef1f138a702effdbd2

Request body

filenamestring required

The name of file that will be uploaded

Example request

[
  {
    "filename": "myfile.txt",
    "metadata": [
      {
        "key": "reference",
        "value": "B1234"
      }
    ]
  }
]

Response

URL(s) created

filestring required
urlstring url required

The URL generated to upload the corresponding file. Authorisation is not required when uploading a file to SDES. <br><br> The URL supports the POST method ONLY. <br><br> The POST request MUST also include the header 'Content-Type: multipart/form-data'. <br><br> The URL generated is valid for up to 30 minutes, after which if not used, the HTTP response code 410 (EXPIRED) is generated."

Example response

[
  {
    "file": "myfile.txt",
    "url": "https://www.hmrc-domain.com/6078e65d-0a4f-4ef9-8c88-ef4bb860419d"
  }
]