Headers

Header name Description
Content-Type
required
application/json
X-API-KEY
required
YOUR_API_KEY

Params

Param name Description
asset_id
required

Asset ID

Validations:

  • Must be a String

file_url
required

URL where file is located and can be downloaded by Media Pocket

Validations:

  • Must be a String

filename
required

Original filename

Validations:

  • Must be a String

Examples

// HTTP file URL
POST /api/v2/assets/4Z1MJ6s7L1HqPBf7Mol5/media
{
  "file_url": "http://www.example.com/jpgfile.jpg",
  "filename": "jpgfile.jpg"
}
200
{
  "ok": "ok"
}
// HTTPS file URL
POST /api/v2/assets/xGZbvO04EXYglsPR1xuL/media
{
  "file_url": "https://www.example.com/jpgfile.jpg",
  "filename": "jpgfile.jpg"
}
200
{
  "ok": "ok"
}
// Invalid file URL
POST /api/v2/assets/5f-96poumuaeFIVS0u2F/media
{
  "file_url": "/local/downloads/myfile.jpg",
  "filename": "myfile.jpg"
}
400
{
  "error": "not a valid HTTP URL"
}

Errors

Code Description
401 Unauthorized
404 Not found
500 Internal Server Error
422 Missing parameters