Skip to content

Delete a function version

DELETE
/v1/t/adapters/edge/functions/{slug}/{version}
curl --request DELETE \
--url https://example.com/v1/t/adapters/edge/functions/example/1 \
--header 'Authorization: Bearer <token>'

Deletes the row, then removes the bundle from the bucket and the local version folder. A run after that gets 404 and cannot rebuild the bundle. If the removal fails, the call is 500 and goes to Sentry with both paths; the row is already gone. A missing local folder is fine, the cache cron may have removed it. Deleting the latest version does not make an older one latest.

Permission

This operation needs the permission tenant:scenario_template:manage.

slug
required

Function name inside the account. Needs at least one [A-Za-z0-9_] character and must not be by-id. Other characters are not rejected.

string
>= 1 characters <= 100 characters
version
required
integer
>= 1
X-Tenant-Sid
string

Names the target tenant.

By principal:

  • A tenant-scoped principal may omit it.
  • A principal with no tenant of its own names one here.

Refused when:

  • A tenant-scoped principal sends a value naming any other tenant.
  • A principal with no tenant of its own omits it.

Deleted

Media typeapplication/json
object
ok
required
boolean
deleted
required
boolean
Example
{
"ok": true,
"deleted": true
}

Domain error. A failed bundle comes as 400 with err_code: INTERNAL_SERVER_ERROR. On a run route a bundle that could not be rebuilt is this 400 too.

Media typeapplication/json
object
ok
required
boolean
error
required
string
err_code
required
string
Allowed values: UNAUTHORIZED FORBIDDEN NOT_FOUND BAD_REQUEST INTERNAL_SERVER_ERROR VALIDATION_ERROR
Example
{
"ok": false,
"err_code": "UNAUTHORIZED"
}

Unauthorized

Forbidden

No version with these keys in the account

Media typeapplication/json
object
ok
required
boolean
error
required
string
err_code
required
string
Allowed values: UNAUTHORIZED FORBIDDEN NOT_FOUND BAD_REQUEST INTERNAL_SERVER_ERROR VALIDATION_ERROR
Example
{
"ok": false,
"error": "Function not found",
"err_code": "NOT_FOUND"
}

The body, query or path params did not pass the zod schema

Media typeapplication/json
object
ok
required
boolean
error
required
string
Allowed values: Validation failed
issues
required

Zod issues as is

Array<object>
object
code
required
string
path
required
Array
message
required
string
Example
{
"ok": false,
"error": "Validation failed"
}

Unexpected error, for example a database or a disk failure. The body has err_code: INTERNAL_SERVER_ERROR.

Media typeapplication/json
object
ok
required
boolean
error
required
string
err_code
required
string
Allowed values: UNAUTHORIZED FORBIDDEN NOT_FOUND BAD_REQUEST INTERNAL_SERVER_ERROR VALIDATION_ERROR
Example
{
"ok": false,
"err_code": "UNAUTHORIZED"
}

Bad gateway (upstream adapter error)