---
title: "Redeploy a function's stored code"
method: POST
path: "/functions/{id}/redeploy"
tags: ["Functions"]
---

# Redeploy a function's stored code

`POST /functions/{id}/redeploy`

## Request

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

Push the function's stored source again as a new deployment, for example after changing its secrets or runtime key. Takes no body: to ship new code, use updateFunction. A body carrying code is refused rather than ignored.

## Path parameters

- `id` string, uuid, required

## Headers

- `Idempotency-Key` string

## Response `200`

Redeploy a function's stored code

- object
  - `success` true, required
  - `data` RedeployFunctionResult, required
    - `redeployed` true, required
    - `id` string, uuid, required
    - `deployment_id` string, uuid, required

## Other responses

- `401`: Invalid or missing API key
- `403`: Authenticated caller lacks permission for the operation
- `404`: Resource not found
- `424`: deploy_failed: the function could not be deployed; details.reason owner_or_admin_stop when an owner or admin stopped it, which only reaffirmFunctionRuntimeKey from a dashboard session of that rank lifts
- `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)
