Functions
Serverless functions with HTTP or cron triggers. Functions are deployed as lightweight containers with automatic scaling.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/v1/functions | List functions (?projectId=) |
POST | /api/v1/functions | Create function |
GET | /api/v1/functions/:id | Get function |
PUT | /api/v1/functions/:id | Update function |
DELETE | /api/v1/functions/:id | Delete function |
Lifecycle
| Method | Path | Description |
|---|---|---|
POST | /api/v1/functions/:id/deploy | Deploy function |
POST | /api/v1/functions/:id/start | Start |
POST | /api/v1/functions/:id/stop | Stop |
Versions & Executions
| Method | Path | Description |
|---|---|---|
GET | /api/v1/functions/:id/executions | Execution history |
GET | /api/v1/functions/:id/versions | List versions |
GET | /api/v1/functions/:id/versions/:versionId/logs | Version deployment logs |
POST | /api/v1/functions/:id/versions/:versionId/deploy | Deploy specific version |
GET | /api/v1/functions/:id/dependencies | Get dependencies |
POST /api/v1/functions
{
"project_id": "uuid",
"environment_id": "uuid",
"server_id": "uuid",
"name": "send-email",
"runtime": "node20",
"code": "module.exports = async (req, res) => { res.send('ok') }",
"dependencies": "{\"nodemailer\": \"^6.9.0\"}",
"trigger_type": "http",
"exposed_port": 8080,
"cpu_limit": "0.5",
"memory_limit": "256m",
"timeout_seconds": 30,
"env": {
"SMTP_HOST": "smtp.example.com"
}
}For cron-triggered functions:
{
"trigger_type": "cron",
"schedule": "*/5 * * * *",
"schedule_config": { "timezone": "UTC" }
}Runtimes: node20, python3, go, bun, deno
Trigger types: http, cron
Last updated on