Regenerate API key for authenticated user
curl --request POST \
--url https://api.sitespy.app/api/v1/auth/regenerate-key \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sitespy.app/api/v1/auth/regenerate-key"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sitespy.app/api/v1/auth/regenerate-key', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "API key regenerated successfully",
"user": {
"email": "user@example.com",
"name": "John Doe",
"api_key": "a1b2c3d4e5f6..."
}
}{
"error": "API key is not linked to a user account"
}{
"error": "API key is required"
}Authentication
Regenerate API key for authenticated user
Regenerate the API key for the currently authenticated user. The old key is invalidated and all watches are migrated to the new key. Only works for API keys linked to a user account.
POST
/
auth
/
regenerate-key
Regenerate API key for authenticated user
curl --request POST \
--url https://api.sitespy.app/api/v1/auth/regenerate-key \
--header 'x-api-key: <api-key>'import requests
url = "https://api.sitespy.app/api/v1/auth/regenerate-key"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.sitespy.app/api/v1/auth/regenerate-key', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"message": "API key regenerated successfully",
"user": {
"email": "user@example.com",
"name": "John Doe",
"api_key": "a1b2c3d4e5f6..."
}
}{
"error": "API key is not linked to a user account"
}{
"error": "API key is required"
}
