Galon Cloud
Galon API v1

/functions/deployments

Base URL https://api.galon.ai/v1 · export GALON_API_BASE="https://api.galon.ai/v1"

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

NameInTypeDescription
Idempotency-Keyheaderstring · required

Request body

application/json

FieldTypeDescription
namestring · requiredFunction name: lowercase letters, digits and hyphens, starting with a letter.
source_refstring · requiredsource_ref from upload_function_source.
source_sha256string · requiredsource_sha256 from upload_function_source.
environment"test" | "live" · requiredEnvironment: it must be the environment of the key.
compatibility_datestring · requiredRuntime compatibility date, YYYY-MM-DD, 2021-01-01 or later.
previous_revision_sha256stringRevision this deploy replaces, to refuse a concurrent change.

Responses

StatusDescriptionBody
2XXSuccess: the JSON body the route returns (see the description for its fields).object
401Key missing or invalidError
4XXRefused: 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"}'