Create a media folder
Create a media folder. Folders group files into galleries. Move files in by setting folderId on a file or on several at once.
POST https://sitepaste.com/api/v1/public/media/folders
Requires the media scope.
Usage
curl -X POST "https://sitepaste.com/api/v1/public/media/folders" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "name": "Wedding 2026" }'
Authorizations
| Header | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token (Authorization: Bearer sp_...). Created in the dashboard under Account > Tokens. See authentication. |
Body
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | The folder’s name, 1 to 100 characters. A missing or over-long name is a 422. |
Response
201 Created with the new folder, and a Location header naming it.
{ "id": "f2ghjk4lmnop", "name": "Gallery" }
409 if another folder in the workspace already has the name.