Skip to content

Upload an image​

POST
/storage/upload

Stores a base64-encoded raster image on the platform CDN and returns its public URL, which the media gallery, outcome reports and the campaign form accept. Requires a bearer session. Only raster image types are accepted (no SVG or HTML), into one of four folders. Omit path and the server stores the file under a new unique path beginning with the caller's user id, returned as path. A supplied path must begin with the caller's own user id, profile id or Cognito sub, the same rule POST /storage/delete applies. An upload never replaces an existing file. The JSON body limit (10 MB) caps the file size.

Authorizations​

BearerAuth

In the browser, authentication rides on the httpOnly session cookies set by /cognito/signin or the Google / Apple sign-in at /cognito/oauth/{provider}. For scripts and for Swagger UI testing, paste an API key (fh_live_…, created with POST /api-keys); a Cognito JWT is accepted too. Sign-in does not return a token in its body.

Type
HTTP (bearer)

Request Body​

application/json
JSON
{
"bucket": "string",
"path": "3f6c1b9e-7d2a-4c8e-9b1f-2a4d6e8f0c13/cover-1717171717.jpg",
"fileBase64": "string",
"contentType": "string"
}

Responses​

Stored

application/json
JSON
{
"success": true,
"url": "string",
"path": "string"
}

Playground​

Server
Authorization
Body

Samples​

Powered by VitePress OpenAPI

Built with VitePress