---
title: "Replace an app's AI key"
method: POST
path: "/client/services/{id}/gateway-key/replace"
tags: ["Apps"]
---

# Replace an app's AI key

`POST /client/services/{id}/gateway-key/replace`

## Request

- Base URL: `https://api.roar-ai.com`
- URL: `https://api.roar-ai.com/client/services/{id}/gateway-key/replace`
- Auth: HTTP bearer

Revokes the key the app runs on, gives it a new one with the same settings and tool bundles (active, even if the old one was paused), and redeploys the app so it starts using it. The old key stops working immediately. `redeployed: false` means the key was replaced but the redeploy was not started — redeploy the app to start using the new key. The new key is never returned. **A person signed in to the console only**: an API key or agent connection gets 403. Needs deploy rights on the app and key rights in its project. `id` is a SERVICE id.

## Path parameters

- `id` string, uuid, required

## Response `200`

The new key's id and prefix, and whether the redeploy started. (Response shape not yet modelled in this spec.)

- object

## Other responses

- `403`: Not a signed-in person, or no rights to deploy this app or manage its keys
- `404`: No such app service
- `409`: A deploy is in progress, or the app has no key to replace

---

[API](https://skmtc.dev/roar-ai/apis/roar-ai-api.md) · [All operations](https://skmtc.dev/roar-ai/apis/roar-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/roar-ai/apis/roar-ai-api/revisions/37e4d0d5a7fe?raw)
