---
title: "Get a function"
method: GET
path: "/functions/{id}"
tags: ["Functions"]
---

# Get a function

`GET /functions/{id}`

Returns the full record for a function, including its current
source code and the deploy status / error from the most recent
deploy attempt.

## Response `200`

Function record

- object
  - `success` true, required
  - `data` object, required — Full function record returned by GET / PUT.
    - `id` string, uuid, required
    - `name` string, required
    - `code` string, required — The bundled handler source. UTF-8 string up to 1 MiB. The same value most recently passed as `code` to POST or PUT.
    - `deploy_status` 'pending' | 'deployed' | 'failed', required — Lifecycle state of the latest deploy attempt: * `pending` — deploy in flight; the runtime has not yet confirmed the new bundle is live. * `deployed` — the running edge handler is the latest code. * `failed` — the most recent deploy attempt failed; the previously-live code (if any) is still running. The `deploy_error` field carries the error message.
    - `deploy_error` string, nullable — Error message from the most recent failed deploy, or null after a successful deploy. Surface this to users to explain a `failed` status without polling.
    - `deployed_at` string, date-time, nullable
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required

## Other responses

- `401` — Invalid or missing API key
- `404` — Resource not found

---

[API](https://skmtc.dev/primitive/apis/primitive-api.md) · [All operations](https://skmtc.dev/primitive/apis/primitive-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/primitive/primitive-api/revisions/c2299d28022c/schema)
