Regenerate an API key
POST
/api/api-keys/{id}/regenerate
curl --request POST \ --url https://api.sipstack.com/api/api-keys/1/regenerate \ --header 'Authorization: Bearer <token>'import requests
url = "https://api.sipstack.com/api/api-keys/1/regenerate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.json())const url = 'https://api.sipstack.com/api/api-keys/1/regenerate';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}import axios from 'axios';
const options = { method: 'POST', url: 'https://api.sipstack.com/api/api-keys/1/regenerate', headers: {Authorization: 'Bearer <token>'}};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}Replaces the key’s secret and re-activates it. The previous value stops working immediately. The new key is returned only in this response.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
integer
Responses
Section titled “ Responses ”Key regenerated — data.key is shown once.
Media type application/json
object
success
boolean
message
string
data
object
key
string
prefix
string
Example generated
{ "success": true, "message": "example", "data": { "key": "example", "prefix": "example" }}Not an owner/admin.
Key not found in your organization.