Documentation menu

Media

Upload and remove images and videos used in posts.

POST /media

Requires Authorization: Bearer <token>.

Request body (multipart/form-data)

FieldTypeNotes
filestringmax 8192format: binary
urlstringformat: uri
alt_textstringnullablemax 1000

Example request

curl -X POST 'https://app.shoutrrr.com/api/v1/media' \
  -H 'Authorization: Bearer <token>' \
  -F 'file=@/path/to/file' \
  -F 'url=https://example.com/image.jpg' \
  -F 'alt_text=string'
const form = new FormData();
form.append('file', fileInput.files[0]); // @/path/to/file
form.append('url', "https://example.com/image.jpg");
form.append('alt_text', "string");

const res = await fetch('https://app.shoutrrr.com/api/v1/media', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <token>',
  },
  body: form,
});
const data = await res.json();
import requests

res = requests.post(
    'https://app.shoutrrr.com/api/v1/media',
    headers={'Authorization': 'Bearer <token>'},
    files={'file': open('/path/to/file', 'rb')},
    data={'url': 'https://example.com/image.jpg', 'alt_text': 'string'},
)
data = res.json()
<?php
$ch = curl_init('https://app.shoutrrr.com/api/v1/media');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => [
        'file' => new CURLFile('/path/to/file'),
        'url' => 'https://example.com/image.jpg',
        'alt_text' => 'string',
    ],
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer <token>',
    ],
]);
$data = json_decode(curl_exec($ch), true);

Responses

201

FieldTypeNotes
idrequiredstring
mimerequiredstring
widthrequiredintegernullable
heightrequiredintegernullable
alt_textrequiredstringnullable

401 Unauthenticated

FieldTypeNotes
messagerequiredError overview.string

403 Authorization error

FieldTypeNotes
messagerequiredError overview.string

422 Validation error

FieldTypeNotes
messagerequiredErrors overview.string
errorsrequiredA detailed description of each field that failed validation.object

DELETE /media/{mediaId}

Requires Authorization: Bearer <token>.

Path parameters

FieldTypeNotes
mediaIdrequiredstring

Example request

curl -X DELETE 'https://app.shoutrrr.com/api/v1/media/{mediaId}' \
  -H 'Authorization: Bearer <token>'
const res = await fetch('https://app.shoutrrr.com/api/v1/media/{mediaId}', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer <token>',
  },
});
const data = await res.json();
import requests

res = requests.delete(
    'https://app.shoutrrr.com/api/v1/media/{mediaId}',
    headers={'Authorization': 'Bearer <token>'},
)
data = res.json()
<?php
$ch = curl_init('https://app.shoutrrr.com/api/v1/media/{mediaId}');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer <token>',
    ],
]);
$data = json_decode(curl_exec($ch), true);

Responses

200

FieldTypeNotes
deletedrequiredboolean
idrequiredstring

401 Unauthenticated

FieldTypeNotes
messagerequiredError overview.string