Hanzo AI
OpenapiFunction

Get function

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/function/{name}

Addresshttps://api.hanzo.ai/v1/function/{name}
MethodGET
Operationget_function_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
200function.functionDetailok
defaultproblem-detailsrefused

200 body — 31 fields.

FieldInTypeAlwaysDescription
avgDurationMsbodynumber (double)
createdAtbodystring
endpointbodystring
envCountbodyinteger (int64)
environmentbodystring
errors7dbodyinteger (int64)
imagebodystring
invocations7dbodyinteger (int64)
lastDeployedAtbodystring
memoryLimitbodystring
namebodystring
namespacebodystring
recentInvocationsbodyfunction.invocationView[]RecentInvocations is its twenty most recent runs, newest first.
recentInvocations[].durationMsbodyinteger (int64)how long it took
recentInvocations[].idbodystringthe invocation's handle
recentInvocations[].methodbodystringthe HTTP method that triggered it
recentInvocations[].statusbodystringhow the run ended: ok, error or timeout
recentInvocations[].statusCodebodyinteger (int64)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[].timebodystringwhen it ran, RFC3339
secretsbodystring[]Secrets are the NAMES it mounts.
statusbodystring
successRatebodynumber (double)
targetbodystring
timeoutSecbodyinteger (int64)
triggersbodyfunction.triggerView[]Triggers is how this function is reached.
triggers[].enabledbodybooleanwhether it currently fires
triggers[].functionNamebodystringthe function it calls
triggers[].idbodystringthe trigger's handle
triggers[].namebodystringa human label for it
triggers[].targetbodystringthe path it calls
triggers[].typebodystringwhat kind of trigger it is; HTTP is the only one today

Failure carries the platform error shape — see Errors.

Examples

hanzo function get <name>

Function API · All Hanzo APIs · Interactive reference

How is this guide?

On this page