Functions gateway
Invoking deployed functions: the /run endpoint and its refusals.
The endpoint
{GET|POST|PUT|PATCH|DELETE} https://cloud.flaresinc.com/run/{project}/{function}
No project key is required: a function's own access mode decides who may invoke it. Public functions answer anyone; auth-mode functions require a valid Flares Auth access token.
Headers
| Header | Direction | Meaning |
|---|---|---|
X-Flares-User-Token | → | The end user's access token. Also accepted as Authorization: Bearer. |
Content-Type | → | Passed through to your handler. |
X-Flares-Request-Id | ← | The invocation id. Search Logs by it. |
Cookie, Authorization and the user-token header are stripped before your code sees the request.
Example
curl -X POST 'https://cloud.flaresinc.com/run/prj_…/create-shipment' \
-H 'X-Flares-User-Token: eyJ…' \
-H 'Content-Type: application/json' \
-d '{"destination":"Kano"}' -i
HTTP/1.1 201 Created
Content-Type: application/json
X-Flares-Request-Id: 8f14e45f-ea6d-4b1c-9a2f-3c7d1b0e9a44
{"created_by":"usr_…","destination":"Kano"}
Platform refusals
These come from the gateway, before your code runs — and none of them is billed:
| Status | error | Cause |
|---|---|---|
| 404 | not_found | Unknown project or function. |
| 403 | function_disabled | The function is disabled. |
| 503 | no_deployment | No deployment is ready. |
| 429 | refused | Project invocation rate limit. |
| 402/403 | refused | Suspended project or a hard cap reached. |
| 413 | payload_too_large | Body over the limit. |
| 401 | unauthorized | Auth-mode function without a valid token. |
A failure inside your code returns 500 {"error":"function_error","request_id":"…"} — and is billed, because the runtime ran. Billing rules →