POST /functions/deployments
Deploy a function
Deploy an uploaded source as a named function. Use when the user wants the function online. Before: upload_function_source. Returns the job (id, status) and the function (ref, url); then get_function_job (needs job read access) until done. Scope: functions:deploy.
API key (Bearer), on the public API endpoint.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
Idempotency-Key | header | string · required |
Request body
application/json
| Field | Type | Description |
|---|---|---|
name | string · required | Function name: lowercase letters, digits and hyphens, starting with a letter. |
source_ref | string · required | source_ref from upload_function_source. |
source_sha256 | string · required | source_sha256 from upload_function_source. |
environment | "test" | "live" · required | Environment: it must be the environment of the key. |
compatibility_date | string · required | Runtime compatibility date, YYYY-MM-DD, 2021-01-01 or later. |
previous_revision_sha256 | string | Revision this deploy replaces, to refuse a concurrent change. |
Responses
| Status | Description | Body |
|---|---|---|
2XX | Success: the JSON body the route returns (see the description for its fields). | object |
401 | Key missing or invalid | Error |
4XX | Refused: act on detail.code, then follow detail.next_action (404 not_found while the service is not open to the account). | Error |
Examples
curl
curl -X POST "$GALON_API_BASE/functions/deployments" \
-H "Authorization: Bearer $GALON_API_KEY" \
-H "Idempotency-Key: <unique-key>" \
-H "Content-Type: application/json" \
-d '{"name": "string", "source_ref": "art_...", "source_sha256": "string", "environment": "test", "compatibility_date": "string"}'