Hanzo AI
OpenapiFunctions

Get functions

Is one function with everything a detail page needs in one round-trip: its definition, its 7-day rollup, its trigger, its twenty most recent invocations…

GET /v1/functions/{name}

Addresshttps://api.hanzo.ai/v1/functions/{name}
MethodGET
Operationget_functions_by_name
AuthAuthorization: Bearer $HANZO_API_KEY

Is one function with everything a detail page needs in one round-trip: its definition, its 7-day rollup, its trigger, its twenty most recent invocations and the NAMES of the secrets it mounts.

Secret values are never read or returned. A name the caller's org does not hold is 404, which is also what another tenant's function looks like from here.

Request

1 field.

FieldInTypeRequiredDescription
namepathstringyesName is the function the URL names.

Response

StatusBodyMeaning
200functionDetailok

200 body — 31 fields.

FieldInTypeAlwaysDescription
avgDurationMsbodynumber—
createdAtbodystring—
endpointbodystring—
envCountbodyinteger—
environmentbodystring—
errors7dbodyinteger—
imagebodystring—
invocations7dbodyinteger—
lastDeployedAtbodystring—
memoryLimitbodystring—
namebodystring—
namespacebodystring—
recentInvocationsbodyinvocationView[]—RecentInvocations is its twenty most recent runs, newest first.
recentInvocations[].durationMsbodyinteger—how long it took
recentInvocations[].idbodystring—the invocation's handle
recentInvocations[].methodbodystring—the HTTP method that triggered it
recentInvocations[].statusbodystring—how the run ended: ok, error or timeout
recentInvocations[].statusCodebodyinteger—Code is the status the function's OWN code answered with, which is not the status of the reply — a program can answer 500 through a healthy sandbox.
recentInvocations[].timebodystring—when it ran, RFC3339
secretsbodystring[]—Secrets are the NAMES it mounts.
statusbodystring—
successRatebodynumber—
targetbodystring—
timeoutSecbodyinteger—
triggersbodytriggerView[]—Triggers is how this function is reached.
triggers[].enabledbodyboolean—whether it currently fires
triggers[].functionNamebodystring—the function it calls
triggers[].idbodystring—the trigger's handle
triggers[].namebodystring—a human label for it
triggers[].targetbodystring—the path it calls
triggers[].typebodystring—what kind of trigger it is; HTTP is the only one today

Failure carries the platform error shape — see Errors.

Examples

hanzo functions get <name>

Functions API · All Hanzo APIs · Interactive reference

How is this guide?

On this page