Shotstash
API referenceREST referenceUploads

Upload a cover or avatar

Multipart form with kind (project or user) and file. Project covers need section.create; an avatar needs an active writable account. The image is re-encoded to JPEG; the answer names its cookie-authorised URL under /media/c.

Try the REST routes against the public demo at https://demostash.aldyernesto.my.id. Get a read-only token (valid for 60 minutes), then paste it as the Bearer token in the console of any route.

POST
/api/upload/cover

Multipart form with kind (project or user) and file. Project covers need section.create; an avatar needs an active writable account. The image is re-encoded to JPEG; the answer names its cookie-authorised URL under /media/c.

Authorization

SessionToken
headerAuthorizationBearer <token>

Session token from POST /api/v1/auth/login or the login mutation, sent as Authorization: Bearer <token>.

Request Body

multipart/form-data
  1. body
kind?|

project (a project cover, needs section.create) or user (your own avatar).

Value in"project""user"null
file*string

The image, at most 10 MiB; re-encoded to JPEG.

Response Body

Cover stored

application/json
  1. response
url*string

Relative cookie-authorised URL, /media/c/<kind>/<id>?v=<n>.

id*string

Cover id (UUID).

curl -X POST "https://example.com/api/upload/cover" \  -F file="string"
{  "url": "string",  "id": "string"}