Functions

HTTP functions

Every deployed function with an HTTP trigger is an HTTPS endpoint at https://{slug}.api.cubibase.com/functions/{name}. The gateway enforces authentication, signatures and limits before your code runs.

The endpoint

GET, POST, PUT, PATCH, DELETE and OPTIONS are supported. Headers, query parameters, extra path segments and the raw body reach your handler unchanged. The response your handler returns is the response the caller receives (bounded by the platform response-size limit).

Call a public function
curl "https://example-project.api.cubibase.com/functions/hello-world?name=Ada"

# {"message":"Hello, Ada!","invocationId":"…"}

Authentication modes

Authentication is a gateway setting, independent of your code and of payload signatures. JWT is the default when you create a function.

ModeCaller must presentUse for
jwt (default)Authorization: Bearer <end-user access JWT> from CubiBase AuthCalls from your signed-in users
publicNothingWebhooks and open endpoints — pair with signature verification
api_keyA project secret API key (cb_sec_…) in the apikey header or as BearerServer-to-server calls from trusted code
internalNot externally reachable at allFunctions invoked only by other CubiBase machinery
JWT mode · call as a signed-in user
curl -X POST "https://example-project.api.cubibase.com/functions/openai-proxy" \
  -H "Authorization: Bearer <USER_ACCESS_JWT>" \
  -H "content-type: application/json" \
  -d '{"prompt": "Summarize row-level security in one sentence."}'
API key mode · call from your server
curl -X POST "https://example-project.api.cubibase.com/functions/send-email" \
  -H "apikey: cb_sec_YOUR_SECRET_KEY" \
  -H "content-type: application/json" \
  -d '{"to": "ada@example.com", "subject": "Welcome", "text": "Glad you are here."}'

Gateway responses

StatusWhen
401Missing/invalid JWT, missing/invalid secret key, or a failed signature check
404Unknown project host, unknown function, no enabled HTTP trigger, or internal-only function
409The function is disabled, or has no active deployment yet
413The request body exceeds the platform request-size limit
402The monthly invocation or compute allowance is exhausted
429The per-project HTTP rate limit or concurrent-execution limit is reached — retry shortly
500The function threw or exceeded its configured timeout (status recorded as timeout) — details are in Executions & Logs, not in the caller response
502The function returned an oversized response

Internal errors never leak infrastructure details to the caller. The invocation id in the error body matches the execution record in the Console.

Additional resources