cURL
curl --request POST \ --url https://psn-api.paystub.dev/admin/posts/{id}/media \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form collection=default \ --form media='@example-file'
{ "success": true, "data": { "media": { "id": 123, "name": "<string>", "file_name": "<string>", "mime_type": "<string>", "size": 123, "url": "<string>", "created_at": "2023-11-07T05:31:56Z" } }, "message": "Media uploaded successfully" }
Upload media file (image, document, etc.) to a post
Use your API token
Post ID
The media file to upload
Media collection name
Media uploaded successfully
true
Show child attributes
"Media uploaded successfully"