Skip to content

Deploy (or replace) one function from its source in the body.

PUT
/v0/projects/{id}/functions/{name}
curl --request PUT \
--url https://infra-hyphae.run/v0/projects/example/functions/example \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: text/javascript' \
--data example

The body is the JavaScript module (UTF-8, ≤ 512 KiB) with export default async function handler(req) returning { status, headers?, body }. It is written to CLOUDD_FUNCTIONS_ROOT/<project>/<name>/index.js; the record keeps version (incremented on redeploy) and sha256 of the source. Session owner only. Receipted.

id
required
string
/^prj_[0-9a-f]{16}$/
name
required
string
/^[a-z0-9_]{1,40}$/
Media typetext/javascript
string

Redeployed (version incremented).

Media typeapplication/json
object
project
required
string
/^prj_[0-9a-f]{16}$/
name
required
string
/^[a-z0-9_]{1,40}$/
version
required
integer
sha256
required

SHA-256 hex of the deployed source.

string
size
required
integer
runtime
required
string
Allowed values: node deno none
created_at
required

RFC 3339, UTC.

string format: date-time
updated_at
required

RFC 3339, UTC.

string format: date-time
Example
{
"runtime": "node"
}

Deployed.

Media typeapplication/json
object
project
required
string
/^prj_[0-9a-f]{16}$/
name
required
string
/^[a-z0-9_]{1,40}$/
version
required
integer
sha256
required

SHA-256 hex of the deployed source.

string
size
required
integer
runtime
required
string
Allowed values: node deno none
created_at
required

RFC 3339, UTC.

string format: date-time
updated_at
required

RFC 3339, UTC.

string format: date-time
Example
{
"runtime": "node"
}

Malformed or out-of-bounds input (invalid_request).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request authentication_required authorization_denied not_found conflict payload_too_large not_implemented tenant_not_running tenant_running function_runtime_missing function_timeout function_bad_output function_busy orchestrator_unavailable upstream_unavailable internal
message
required
string
Example
{
"error": {
"code": "invalid_request"
}
}

Missing, malformed, duplicate, or unknown credential (authentication_required).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request authentication_required authorization_denied not_found conflict payload_too_large not_implemented tenant_not_running tenant_running function_runtime_missing function_timeout function_bad_output function_busy orchestrator_unavailable upstream_unavailable internal
message
required
string
Example
{
"error": {
"code": "invalid_request"
}
}
WWW-Authenticate
string
Allowed value: Bearer realm="hyphae-cloud"

Unknown route, or a project the caller does not own (not_found).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request authentication_required authorization_denied not_found conflict payload_too_large not_implemented tenant_not_running tenant_running function_runtime_missing function_timeout function_bad_output function_busy orchestrator_unavailable upstream_unavailable internal
message
required
string
Example
{
"error": {
"code": "invalid_request"
}
}

Body exceeds the surface’s limit (payload_too_large).

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: invalid_request authentication_required authorization_denied not_found conflict payload_too_large not_implemented tenant_not_running tenant_running function_runtime_missing function_timeout function_bad_output function_busy orchestrator_unavailable upstream_unavailable internal
message
required
string
Example
{
"error": {
"code": "invalid_request"
}
}