Webhooks
Regenerate Account Secret
Regenerate the account webhook secret. Affects all subscriptions for the account.
Endpoint: (POST) https://api.lusha.com/api/account/secret/regenerate
Behavior:
- If a secret already exists: Replaces with new secret (old secret is invalidated)
- If no secret exists: Creates new secret automatically
Important Notes:
- The secret is only shown once in the response. Store it securely.
- This endpoint always succeeds (upsert operation)
- Regenerating invalidates the old secret for all subscriptions (if one existed)
- An account secret must exist before webhooks can be delivered
POST
/
api
/
account
/
secret
/
regenerate
Regenerate Account Secret
curl --request POST \
--url https://api.lusha.com/api/account/secret/regenerate \
--header 'api_key: <api-key>'import requests
url = "https://api.lusha.com/api/account/secret/regenerate"
headers = {"api_key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {api_key: '<api-key>'}};
fetch('https://api.lusha.com/api/account/secret/regenerate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.lusha.com/api/account/secret/regenerate")
.header("api_key", "<api-key>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lusha.com/api/account/secret/regenerate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("api_key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"secret": "whsec_new_secret_here_abc123def456ghi789jkl012mno345"
}{
"statusCode": 401,
"message": "Invalid API key"
}{
"statusCode": 500,
"message": "Internal server error. Please try again later."
}Authorizations
Your Lusha API key. You can find this in your Lusha dashboard under API settings.
Include this key in the api_key header for all requests.
Response
Account secret regenerated successfully
Newly generated account webhook secret (store securely - only shown once)
Example:
"whsec_new_secret_here_abc123def456ghi789jkl012mno345"
Was this page helpful?
⌘I
Regenerate Account Secret
curl --request POST \
--url https://api.lusha.com/api/account/secret/regenerate \
--header 'api_key: <api-key>'import requests
url = "https://api.lusha.com/api/account/secret/regenerate"
headers = {"api_key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {api_key: '<api-key>'}};
fetch('https://api.lusha.com/api/account/secret/regenerate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://api.lusha.com/api/account/secret/regenerate")
.header("api_key", "<api-key>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.lusha.com/api/account/secret/regenerate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("api_key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"secret": "whsec_new_secret_here_abc123def456ghi789jkl012mno345"
}{
"statusCode": 401,
"message": "Invalid API key"
}{
"statusCode": 500,
"message": "Internal server error. Please try again later."
}