API Documentation

Complete reference for the Vantaa Static Sites REST API.

Base URL: https://api.vantaa.dotaws.dgstage.se  |  Format: JSON  |  Auth: Bearer JWT

Authentication

Protected endpoints require a JWT access token in the Authorization header. Obtain a token via the OAuth2 login flow: visit GET /auth/login, authenticate with Google SSO, and receive tokens via GET /auth/callback.

UsageHTTP
Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...
POST/contentAuth Required

Create an HTML page from raw content.

ParameterTypeRequiredDescription
keystringrequiredS3 object key (e.g., reports/q1.html)
htmlContentstringrequiredHTML content to store
Response 200JSON
{"message":"Content created successfully","key":"reports/q1.html","url":"https://vantaa.dotaws.dgstage.se/reports/q1.html"}
POST/uploadAuth Required

Upload a file with base64-encoded body.

ParameterTypeRequiredDescription
keystringrequiredS3 object key
bodystringrequiredBase64-encoded file content
contentTypestringrequiredMIME type (e.g., image/png)
POST/files/batchAuth Required

Upload multiple files in a single request. Max 10MB total payload.

GET/filesAuth Required

List files in the S3 bucket. Supports ?prefix= query parameter for filtering.

Response 200JSON
{"files":[{"key":"reports/q1.html","size":2048,"lastModified":"2026-04-05T10:30:00.000Z"}],"count":1}
GET/files/{key+}Auth Required

Get metadata for a specific file (size, content type, last modified, ETag).

DELETE/files/{key+}Auth Required

Delete a file from S3. Returns 404 if the file doesn't exist.

POST/files/moveAuth Required

Move or rename a file. Copies to the new key, then deletes the original.

ParameterTypeRequiredDescription
sourceKeystringrequiredCurrent file path
destinationKeystringrequiredNew file path
POST/cache/invalidateAuth Required

Invalidate CloudFront cache for specified paths. Use /* to clear everything.

GET/healthPublic

Health check endpoint. Returns 200 with status and timestamp.

POST/mcpAuth Required

MCP Streamable HTTP endpoint. Accepts JSON-RPC 2.0 requests.

8 tools: upload_file, create_content, list_files, get_file, delete_file, move_file, batch_upload, invalidate_cache