Skip to main content
DELETE/functions/{name}

Retire Function

Transitions a developer-deployed function's status to retired, making it no longer invocable.

The function registry entry is retained for audit purposes, and the function name enters a 24-hour cooldown before it can be reused by a new deployment.

Returns 403 FORBIDDEN with context.reason: "extension_managed" if the function's source is "extension:*".

Extension-owned function lifecycles are managed by the extension system and cannot be terminated through this endpoint.

Requires PROJECT_ADMIN minimum.

Parameters
name *path

The function's name, or a module's name to retire every operation in the module.

A single operation of a module is named <module>:<operation>.

projectSlug *path

The project's slug: the path segment after @.

It is unique within the org.

Responses
HTTPK9O CodeDescription
200Success
401K9O_INVALID_CREDENTIALSThe request credentials are missing or invalid.
401K9O_SESSION_EXPIREDYour session has expired; sign in again to continue.
403K9O_ACCESS_DENIEDPROJECT_ADMIN is required to retire functions, or the function is extension-managed and cannot be deleted via this endpoint.
404K9O_FUNCTION_NOT_FOUNDNo function with that name exists in this project, or it has already been retired.
Response body (200)
data *any

The retired function, now with status retired; or, when the name is a module's, every operation it retired.

One of: object
id *string <uuid>

The function's id, a UUID.

It stays the same across redeploys.

name *string

The function's name.

A module's operations are named <module>:<operation>.

runtime *"bun" | "rust" | "go" | "tinygo" | "zig" | "assemblyscript" | "c" | "cpp"

The language runtime: bun, rust, go, tinygo, zig, assemblyscript, c or cpp.

tier *"gateway" | "sandbox"

Where the function runs: gateway or sandbox.

entryPoint *string

The artifact key of the deployed code.

version *string

The version label of the deploy.

status *"deploying" | "active" | "error" | "retired"

deploying while the code is prepared, active once it can be invoked, error when preparing it failed (see errorDetail), retired after it was deleted.

source *string

Who manages the function: developer for one you deployed, extension:<slug> for one an installed extension owns.

description *any

What the function does.

Null when none was given.

One of: string
or: null
createdAt *string <date-time>

When the function was first deployed.

deployedAt *any

When the current deploy became active.

Null while it is deploying.

One of: string <date-time>
or: null
retiredAt *any

When the function was retired.

Null unless status is retired.

One of: string <date-time>
or: null
errorDetail *any

Why the deploy failed.

Null unless status is error.

One of: string
or: null
or: object
retired *object[]

Every live operation of the module, now retired.

id *string <uuid>

The function's id, a UUID.

It stays the same across redeploys.

name *string

The function's name.

A module's operations are named <module>:<operation>.

runtime *"bun" | "rust" | "go" | "tinygo" | "zig" | "assemblyscript" | "c" | "cpp"

The language runtime: bun, rust, go, tinygo, zig, assemblyscript, c or cpp.

tier *"gateway" | "sandbox"

Where the function runs: gateway or sandbox.

entryPoint *string

The artifact key of the deployed code.

version *string

The version label of the deploy.

status *"deploying" | "active" | "error" | "retired"

deploying while the code is prepared, active once it can be invoked, error when preparing it failed (see errorDetail), retired after it was deleted.

source *string

Who manages the function: developer for one you deployed, extension:<slug> for one an installed extension owns.

description *any

What the function does.

Null when none was given.

One of: string
or: null
createdAt *string <date-time>

When the function was first deployed.

deployedAt *any

When the current deploy became active.

Null while it is deploying.

One of: string <date-time>
or: null
retiredAt *any

When the function was retired.

Null unless status is retired.

One of: string <date-time>
or: null
errorDetail *any

Why the deploy failed.

Null unless status is error.

One of: string
or: null
meta *any
TypeScript
// const k9o = new K9o({ orgSlug: 'playground', projectSlug: 'storefront', apiKey: 'k9o_…' })
const { data } = await k9o.functions.delete('greet')

Showing example in TypeScript

Response example (200)
{
  "data": {
    "id": "string",
    "name": "string",
    "runtime": "bun",
    "tier": "gateway",
    "entryPoint": "string",
    "version": "string",
    "status": "deploying",
    "source": "string",
    "description": "string",
    "createdAt": "string",
    "deployedAt": "string",
    "retiredAt": "string",
    "errorDetail": "string"
  }
}

More in Compute & Automation