Regenerate the project API key
import requests
url = "https://app.langwatch.ai/api/projects/{id}/regenerate-api-key"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.langwatch.ai/api/projects/{id}/regenerate-api-key', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/projects/{id}/regenerate-api-key \
--header 'Authorization: Bearer <token>'{
"apiKey": "<string>"
}Projects
Regenerate project API key
Issue a new API key for the project and invalidate the previous one immediately. Anything still sending the old key starts failing authentication as soon as this returns, so roll it out before calling this. Requires an admin API key holding project:manage.
POST
/
api
/
projects
/
{id}
/
regenerate-api-key
Regenerate the project API key
import requests
url = "https://app.langwatch.ai/api/projects/{id}/regenerate-api-key"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.langwatch.ai/api/projects/{id}/regenerate-api-key', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/projects/{id}/regenerate-api-key \
--header 'Authorization: Bearer <token>'{
"apiKey": "<string>"
}Authorizations
Admin API key for organization-level operations (managing projects, API keys). Create one in Settings > API Keys or via POST /api/api-keys. Format: sk-lw-{id}_{secret}.
Path Parameters
Project id
Response
The new API key. The previous one no longer authenticates.
Send as X-Auth-Token, Bearer, or Basic
Last modified on June 9, 2026
Was this page helpful?