Upload an image
POST
/projects/{id}/media
const url = 'https://api.warmup.social/projects/00000000-0000-0000-0000-000000000000/media';const form = new FormData();form.append('file', 'file');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.warmup.social/projects/00000000-0000-0000-0000-000000000000/media \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form file=@fileAn image up to 15 MB in the file field. The server converts it to JPEG and
returns an id — pass it as mediaId when creating a publication.
Counts towards the publishing rate limit (30 requests per minute per user by default).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Example
00000000-0000-0000-0000-000000000000Project UUID.
Request Bodyrequired
Section titled “Request Bodyrequired”Media typemultipart/form-data
object
file
required
Image (image/*), up to 15 MB.
string format: binary
Responses
Section titled “Responses”Image saved.
Media typeapplication/json
object
id
required
string format: uuid
url
required
string format: uri
width
required
integer
height
required
integer
Example
{ "width": 1080, "height": 1350}No file (file_required), not an image (unsupported_media_type), unreadable image (invalid_image), invalid project id or the file is larger than 15 MB.
Media typeapplication/json
Error with a machine-readable code. Body validation errors come as formErrors / fieldErrors; business errors carry a code.
object
code
string
platform
string
formErrors
Array<string>
fieldErrors
object
key
additional properties
Array<string>
Example
{ "code": "connection_missing", "platform": "facebook", "fieldErrors": { "mediaId": [ "media_required" ] }}The Bearer token is missing or invalid.
Media typeapplication/json
object
statusCode
required
integer
message
required
One of:
string
Array<string>
object
key
additional properties
any
error
string
key
additional properties
any
Example
{ "statusCode": 400, "message": "Invalid request", "error": "Bad Request"}The requested resource was not found.
Media typeapplication/json
object
statusCode
required
integer
message
required
One of:
string
Array<string>
object
key
additional properties
any
error
string
key
additional properties
any
Example
{ "statusCode": 400, "message": "Invalid request", "error": "Bad Request"}The publishing rate limit was exceeded.
Media typeapplication/json
object
statusCode
required
integer
message
required
One of:
string
Array<string>
object
key
additional properties
any
error
string
key
additional properties
any
Example
{ "statusCode": 400, "message": "Invalid request", "error": "Bad Request"}