Flares Developer Docs

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

HeaderDirectionMeaning
X-Flares-User-TokenThe end user's access token. Also accepted as Authorization: Bearer.
Content-TypePassed through to your handler.
X-Flares-Request-IdThe 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:

StatuserrorCause
404not_foundUnknown project or function.
403function_disabledThe function is disabled.
503no_deploymentNo deployment is ready.
429refusedProject invocation rate limit.
402/403refusedSuspended project or a hard cap reached.
413payload_too_largeBody over the limit.
401unauthorizedAuth-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 →