---
title: "Update function"
method: PUT
path: "/api/functions/{slug}"
tags: ["Admin"]
---

# Update function

`PUT /api/functions/{slug}`

Update an existing function's code or metadata

## Path parameters

- `slug` string, required

## Request body

- object
  - `name` string — New display name
  - `code` string — Updated function code
  - `description` string — Updated description
  - `status` 'draft' | 'active' | 'error' — Function status

## Response `200`

Function updated successfully

- object
  - `success` boolean
  - `function` FunctionMetadata
    - `id` string, uuid, required — Unique identifier for the function
    - `slug` string, required — URL-friendly identifier
    - `name` string, required — Display name for the function
    - `description` string, nullable — Description of what the function does
    - `status` 'draft' | 'active' | 'error', required — Current status of the function
    - `created_at` string, date-time, required — When the function was created
    - `updated_at` string, date-time, required — When the function was last updated
    - `deployed_at` string, date-time, nullable — When the function was last deployed (null if never deployed)

## Other responses

- `400` — Invalid request
- `404` — Function not found
- `500` — Failed to update function

---

[API](https://skmtc.net/insforge/apis/insforge-authentication-api.md) · [All operations](https://skmtc.net/insforge/apis/insforge-authentication-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/insforge/insforge-authentication-api/versions/a935bb49f932/schema)
