Appearance
Functions
Serverless functions: code, settings, deploys, test invocations, stats and logs. A function is also a service, so the service endpoints work on it.
Base URL: https://api.fjordrun.com. Generated from the OpenAPI document (API version 0.1.0).
Function runtimes and limits
GET /api/v1/functions/limits
Runtimes, memory sizes, defaults and limits for new functions, with the limits of each plan.
Authentication: a team API token or personal access token.
Response
200: JSON.
Example
bash
curl "https://api.fjordrun.com/api/v1/functions/limits" \
-H "Authorization: Bearer $FJORDRUN_TOKEN"Create a function
POST /api/v1/projects/{pid}/functions
Authentication: a team API token or personal access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
pid | path | string (UUID) | yes |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
runtime | "node22", "python312" | no | default "node22" |
entry | string | no | max length 200, can be null |
memory_mb | integer | no | can be null |
timeout_s | integer | no | can be null |
concurrency | integer | no | can be null |
max_replicas | integer | no | can be null |
idle_timeout_s | integer | no | can be null |
auth | "public", "token" | no | can be null |
environment_id | string (UUID) | yes | |
name | string | no | max length 100, can be null |
files | array of FileIn | no | max 100 items, can be null |
source | GitHubSourceIn | no | can be null |
deploy | boolean | no | default true |
Response
201: a Function object.
Example
bash
curl -X POST "https://api.fjordrun.com/api/v1/projects/$PROJECT_ID/functions" \
-H "Authorization: Bearer $FJORDRUN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"environment_id":"00000000-0000-0000-0000-000000000000"}'Get a function
GET /api/v1/functions/{sid}
Authentication: a team API token or personal access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
sid | path | string (UUID) | yes | |
environment_id | query | string (UUID) | no | can be null |
Response
200: a Function object.
Example
bash
curl "https://api.fjordrun.com/api/v1/functions/$FUNCTION_ID" \
-H "Authorization: Bearer $FJORDRUN_TOKEN"Update a function's settings
PATCH /api/v1/functions/{sid}
Change the function's settings in one environment; a running function is redeployed with them (the same image unless the runtime or entry file changed).
Authentication: a team API token or personal access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
sid | path | string (UUID) | yes | |
environment_id | query | string (UUID) | no | can be null |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
runtime | "node22", "python312" | no | can be null |
entry | string | no | max length 200, can be null |
memory_mb | integer | no | can be null |
timeout_s | integer | no | can be null |
concurrency | integer | no | can be null |
max_replicas | integer | no | can be null |
idle_timeout_s | integer | no | can be null |
auth | "public", "token" | no | can be null |
name | string | no | min length 1, max length 100, can be null |
Response
200: a Function object.
Example
bash
curl -X PATCH "https://api.fjordrun.com/api/v1/functions/$FUNCTION_ID" \
-H "Authorization: Bearer $FJORDRUN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"runtime":"node22"}'Delete a function
DELETE /api/v1/functions/{sid}
Authentication: a team API token or personal access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
sid | path | string (UUID) | yes |
Response
204: no content.
Example
bash
curl -X DELETE "https://api.fjordrun.com/api/v1/functions/$FUNCTION_ID" \
-H "Authorization: Bearer $FJORDRUN_TOKEN"Get a function's code
GET /api/v1/functions/{sid}/code
The function's latest saved inline code (shared by all environments).
Authentication: a team API token or personal access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
sid | path | string (UUID) | yes |
Response
200: a Function code object.
Example
bash
curl "https://api.fjordrun.com/api/v1/functions/$FUNCTION_ID/code" \
-H "Authorization: Bearer $FJORDRUN_TOKEN"Save a function's code
PUT /api/v1/functions/{sid}/code
Save the function's inline code (all files; files left out are deleted) and optionally deploy it.
Authentication: a team API token or personal access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
sid | path | string (UUID) | yes | |
environment_id | query | string (UUID) | no | can be null |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
files | array of FileIn | yes | max 100 items |
deploy | boolean | no | default false |
Response
200: JSON.
Example
bash
curl -X PUT "https://api.fjordrun.com/api/v1/functions/$FUNCTION_ID/code" \
-H "Authorization: Bearer $FJORDRUN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"files":[{"path":"string","content":"string"}]}'Deploy a function
POST /api/v1/functions/{sid}/deploy
Authentication: a team API token or personal access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
sid | path | string (UUID) | yes | |
environment_id | query | string (UUID) | no | can be null |
Response
200: a Deployment object.
Example
bash
curl -X POST "https://api.fjordrun.com/api/v1/functions/$FUNCTION_ID/deploy" \
-H "Authorization: Bearer $FJORDRUN_TOKEN"Get a function's token
GET /api/v1/functions/{sid}/token
The token callers send in the X-Fjordrun-Token header when the function's auth is "token".
Authentication: a team API token or personal access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
sid | path | string (UUID) | yes | |
environment_id | query | string (UUID) | no | can be null |
Response
200: JSON.
Example
bash
curl "https://api.fjordrun.com/api/v1/functions/$FUNCTION_ID/token" \
-H "Authorization: Bearer $FJORDRUN_TOKEN"Rotate a function's token
POST /api/v1/functions/{sid}/token/rotate
Replace the token; the old one stops working once the function is redeployed (which this starts).
Authentication: a team API token or personal access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
sid | path | string (UUID) | yes | |
environment_id | query | string (UUID) | no | can be null |
Response
200: JSON.
Example
bash
curl -X POST "https://api.fjordrun.com/api/v1/functions/$FUNCTION_ID/token/rotate" \
-H "Authorization: Bearer $FJORDRUN_TOKEN"Invoke a function
POST /api/v1/functions/{sid}/invoke
Call the deployed function through its public URL (the test console). Billed like any other request.
Authentication: a team API token or personal access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
sid | path | string (UUID) | yes | |
environment_id | query | string (UUID) | no | can be null |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
method | "GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS" | no | default "GET" |
path | string | no | max length 2000, pattern ^/, default "/" |
headers | object (values: string) | no | |
body | string | no | max length 1048576, can be null |
Response
200: a Function invocation object.
Example
bash
curl -X POST "https://api.fjordrun.com/api/v1/functions/$FUNCTION_ID/invoke" \
-H "Authorization: Bearer $FJORDRUN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"method":"GET"}'Get function invocation stats
GET /api/v1/functions/{sid}/stats
Invocations, errors, cold starts and p50/p95 duration over the range, with per-step series.
Authentication: a team API token or personal access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
sid | path | string (UUID) | yes | |
environment_id | query | string (UUID) | no | can be null |
range | query | "1h", "6h", "24h", "7d" | no | default "1h" |
Response
200: a Function stats object.
Example
bash
curl "https://api.fjordrun.com/api/v1/functions/$FUNCTION_ID/stats" \
-H "Authorization: Bearer $FJORDRUN_TOKEN"Get function logs
GET /api/v1/functions/{sid}/logs
The function's output: what the handler prints, plus one line per invocation.
Authentication: a team API token or personal access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
sid | path | string (UUID) | yes | |
environment_id | query | string (UUID) | no | can be null |
search | query | string | no | can be null |
level | query | "info", "warn", "error" | no | can be null |
limit | query | integer | no | min 1, max 2000, default 200 |
Response
200: a list of Log line objects.
Example
bash
curl "https://api.fjordrun.com/api/v1/functions/$FUNCTION_ID/logs" \
-H "Authorization: Bearer $FJORDRUN_TOKEN"Request objects
CodeIn
| Field | Type | Required | Description |
|---|---|---|---|
files | array of FileIn | yes | max 100 items |
deploy | boolean | no | default false |
FileIn
| Field | Type | Required | Description |
|---|---|---|---|
path | string | yes | min length 1, max length 200 |
content | string | yes |
FunctionCreateIn
| Field | Type | Required | Description |
|---|---|---|---|
runtime | "node22", "python312" | no | default "node22" |
entry | string | no | max length 200, can be null |
memory_mb | integer | no | can be null |
timeout_s | integer | no | can be null |
concurrency | integer | no | can be null |
max_replicas | integer | no | can be null |
idle_timeout_s | integer | no | can be null |
auth | "public", "token" | no | can be null |
environment_id | string (UUID) | yes | |
name | string | no | max length 100, can be null |
files | array of FileIn | no | max 100 items, can be null |
source | GitHubSourceIn | no | can be null |
deploy | boolean | no | default true |
FunctionPatchIn
| Field | Type | Required | Description |
|---|---|---|---|
runtime | "node22", "python312" | no | can be null |
entry | string | no | max length 200, can be null |
memory_mb | integer | no | can be null |
timeout_s | integer | no | can be null |
concurrency | integer | no | can be null |
max_replicas | integer | no | can be null |
idle_timeout_s | integer | no | can be null |
auth | "public", "token" | no | can be null |
name | string | no | min length 1, max length 100, can be null |
GitHubSourceIn
| Field | Type | Required | Description |
|---|---|---|---|
type | "github" | no | default "github" |
repo | string | yes | max length 200 |
branch | string | no | max length 200, can be null |
root_dir | string | no | max length 200, can be null |
InvokeIn
| Field | Type | Required | Description |
|---|---|---|---|
method | "GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS" | no | default "GET" |
path | string | no | max length 2000, pattern ^/, default "/" |
headers | object (values: string) | no | |
body | string | no | max length 1048576, can be null |