RelayAPI

Upload a file

Upload a raw file body. Pass the filename as a query parameter and set the Content-Type header.

POST
/v1/media/upload
AuthorizationBearer <token>

API key (rlay_live_* or rlay_test_*)

In: header

Query Parameters

filename*string

Original filename

Request Body

application/octet-stream

Raw file bytes

TypeScript Definitions

Use the request body type in TypeScript.

body*file
Formatbinary

Response Body

application/json

application/json

application/json

curl -X POST "https://api.relayapi.dev/v1/media/upload?filename=string" \  -H "Content-Type: application/octet-stream" \  -d 'string'
{
  "url": "http://example.com",
  "type": "string",
  "size": 0,
  "filename": "string"
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": "string",
    "message": "string",
    "details": {
      "property1": null,
      "property2": null
    }
  }
}

Found something wrong? Help us improve this page.

Submit an Issue
Requires a GitHub account.View repo