---
title: "Suspend a function"
method: POST
path: "/functions/{id}/runtime-key/suspend"
tags: ["Functions"]
---

# Suspend a function

`POST /functions/{id}/runtime-key/suspend`

## Request

- Base URL: `https://api.primitive.dev/v1`
- URL: `https://api.primitive.dev/v1/functions/{id}/runtime-key/suspend`
- Auth: HTTP bearer

Stop the function from running by suspending its key. Its code, bindings and secrets stay stored; reaffirmFunctionRuntimeKey brings it back as it was. A stop an owner or admin places (suspended_by owner_or_admin) records their role, is lifted only in a dashboard session by someone whose role is at least that one (an owner's stop, only an owner), and replaces any stop but an owner's or admin's of at least that role, an access decision's included: keeping that decision on the waiting list then leaves the function stopped.

## Path parameters

- `id` string, uuid, required

## Headers

- `Idempotency-Key` string

## Request body

- SuspendFunctionRuntimeKeyRequest
  - `reason` 'owner_action' | 'emergency_revoke'

## Response `200`

Suspend a function

- object
  - `success` true, required
  - `data` SuspendFunctionRuntimeKeyResult, required
    - `mode` 'org_shared' | 'per_function', required
    - `preset` string, nullable, required
    - `permissions` string[], nullable, required
    - `mail_scope` unknown, required
    - `attached_secret_keys` string[], nullable, required
    - `key_prefix` string, nullable, required
    - `expires_at` string, nullable, required
    - `suspended_at` string, nullable, required
    - `suspended_reason` string, nullable, required
    - `function_bound_key` 'live' | 'revoked', nullable
    - `suspended_by` 'transfer' | 'access_decision' | 'owner_or_admin' | 'other', nullable
    - `stop_rank` 'owner' | 'admin', nullable
    - `key_suspension_reasons` string[]
    - `transfer_stop_placed` boolean

## Other responses

- `400`: Invalid request parameters
- `401`: Invalid or missing API key
- `403`: Authenticated caller lacks permission for the operation
- `404`: Resource not found
- `429`: Rate limit exceeded. The `ratelimit-*` headers describe the limiter that rejected this request, with its own limit and window, not the API budget that successful responses report. A limiter that reports only a wait sends `Retry-After` alone.

---

[API](https://skmtc.dev/primitive/apis/primitive-api.md) - [All operations](https://skmtc.dev/primitive/apis/primitive-api/llms.txt) - [OpenAPI document](https://skmtc.dev/primitive/apis/primitive-api/revisions/bce409c97acb?raw)
