curl --request POST 'https://api.voicecheap.ai/v1/actions/webhooks_create_secret' \
--header "x-api-key: $VOICECHEAP_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"requestId":"58d5bb53-00d0-4692-bdaf-c6650ee87e30"}'
const input = {
requestId: '58d5bb53-00d0-4692-bdaf-c6650ee87e30',
};
const response = await fetch('https://api.voicecheap.ai/v1/actions/webhooks_create_secret', {
method: 'POST',
headers: {
'x-api-key': process.env.VOICECHEAP_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify(input),
});
const body = await response.json();
if (!response.ok) throw new Error(body.code + ': ' + body.message);
console.log(body);
import os
import requests
response = requests.post(
"https://api.voicecheap.ai/v1/actions/webhooks_create_secret",
headers={"x-api-key": os.environ["VOICECHEAP_API_KEY"]},
json={"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30"},
timeout=120,
)
body = response.json()
if not response.ok:
raise RuntimeError(f"{body.get('code')}: {body.get('message')}")
print(body)
{
"data": {
"url": "https://example.com/voicecheap-events",
"secretPrefix": "whsec_REP",
"secretSuffix": "CRET",
"createdAt": 1792065600000,
"updatedAt": 1792152000000,
"fullSecret": "whsec_REPLACE_WITH_NEW_SIGNING_SECRET"
},
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30"
}
{
"data": {
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30",
"operation": "webhooks_create_secret",
"createdAt": 1792144800000,
"updatedAt": 1792144820000,
"status": "running",
"pollAfterSeconds": 5
},
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30"
}
{
"data": {
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30",
"operation": "webhooks_create_secret",
"createdAt": 1792144800000,
"updatedAt": 1792144820000,
"status": "completed",
"resultStored": false,
"message": "The action completed. Retrieve its output from the corresponding history or resource action."
},
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30"
}
Webhook
Crea o ruota un segreto di firma webhook
Crea o ruota il segreto di firma webhook del tuo account personale. Restituisce il nuovo segreto una sola volta; salvalo in modo sicuro. La rotazione invalida il segreto precedente.
POST
/
v1
/
actions
/
webhooks_create_secret
curl --request POST 'https://api.voicecheap.ai/v1/actions/webhooks_create_secret' \
--header "x-api-key: $VOICECHEAP_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"requestId":"58d5bb53-00d0-4692-bdaf-c6650ee87e30"}'
const input = {
requestId: '58d5bb53-00d0-4692-bdaf-c6650ee87e30',
};
const response = await fetch('https://api.voicecheap.ai/v1/actions/webhooks_create_secret', {
method: 'POST',
headers: {
'x-api-key': process.env.VOICECHEAP_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify(input),
});
const body = await response.json();
if (!response.ok) throw new Error(body.code + ': ' + body.message);
console.log(body);
import os
import requests
response = requests.post(
"https://api.voicecheap.ai/v1/actions/webhooks_create_secret",
headers={"x-api-key": os.environ["VOICECHEAP_API_KEY"]},
json={"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30"},
timeout=120,
)
body = response.json()
if not response.ok:
raise RuntimeError(f"{body.get('code')}: {body.get('message')}")
print(body)
{
"data": {
"url": "https://example.com/voicecheap-events",
"secretPrefix": "whsec_REP",
"secretSuffix": "CRET",
"createdAt": 1792065600000,
"updatedAt": 1792152000000,
"fullSecret": "whsec_REPLACE_WITH_NEW_SIGNING_SECRET"
},
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30"
}
{
"data": {
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30",
"operation": "webhooks_create_secret",
"createdAt": 1792144800000,
"updatedAt": 1792144820000,
"status": "running",
"pollAfterSeconds": 5
},
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30"
}
{
"data": {
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30",
"operation": "webhooks_create_secret",
"createdAt": 1792144800000,
"updatedAt": 1792144820000,
"status": "completed",
"resultStored": false,
"message": "The action completed. Retrieve its output from the corresponding history or resource action."
},
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30"
}
Crea o ruota il segreto di firma webhook del tuo account personale. Restituisce il nuovo segreto una sola volta; salvalo in modo sicuro. La rotazione invalida il segreto precedente.
Autorizzazioni richieste:
POST https://api.voicecheap.ai/v1/actions/webhooks_create_secret
Autenticazione e autorizzazioni
string
obbligatorio
Invia una chiave API VoiceCheap in questa intestazione. È supportato anche Authorization: Bearer con la stessa chiave API. I token di accesso OAuth
sono accettati solo da MCP, non da questo endpoint REST.
webhooks:write.
È necessario un abbonamento a pagamento attivo. Le autorizzazioni non modificano i ruoli del team, la proprietà delle risorse, i crediti multimediali o i limiti del piano.
Parametri
string
Facoltativo al livello di trasporto: se omesso, il server inserisce un identificatore prima della validazione. Fornisci un tuo UUID v4 stabile per recuperare in sicurezza una risposta persa.Formato: “uuid”. Pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$.Schema di input completo
Schema di input completo
Il JSON Schema seguente conserva i nomi esatti dei campi, i tipi annidati, i valori predefiniti, i limiti e i valori accettati esposti dalla discovery. Le ulteriori regole tra campi sono elencate nelle note sull’operazione.
{
"type": "object",
"properties": {
"requestId": {
"type": "string",
"format": "uuid",
"pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$",
"description": "UUID v4 for this action. Reuse the same ID with identical arguments on retries."
}
},
"additionalProperties": false
}
Idempotenza
Usa un UUID v4 in requestId o nell’intestazione HTTP Idempotency-Key per ogni modifica. Riutilizza lo stesso identificatore e argomenti identici dopo un errore di rete. Se vengono forniti entrambi, devono coincidere. Ripetere una richiesta salvata non ripete l’operazione e non consuma un’altra chiamata mensile. Le richieste non riuscite o interrotte non vengono riavviate automaticamente. Ogni modifica può restituire HTTP 202 quando un nuovo tentativo trova la stessa richiesta ancora in esecuzione, anche se la prima esecuzione è normalmente sincrona. Se l’esecuzione è completata ma resultStored è false, un nuovo tentativo restituisce HTTP 200 con lo stato della richiesta salvata anziché il risultato originale. Recupera l’output tramite l’azione di cronologia, risultato o download del relativo dominio.Esempi di richiesta
Sostituisci gli identificatori delle risorse e le chiavi multimediali di esempio con i valori restituiti per il tuo account. Mantieni stabile l’identificatore della richiesta quando ripeti la stessa modifica.curl --request POST 'https://api.voicecheap.ai/v1/actions/webhooks_create_secret' \
--header "x-api-key: $VOICECHEAP_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"requestId":"58d5bb53-00d0-4692-bdaf-c6650ee87e30"}'
const input = {
requestId: '58d5bb53-00d0-4692-bdaf-c6650ee87e30',
};
const response = await fetch('https://api.voicecheap.ai/v1/actions/webhooks_create_secret', {
method: 'POST',
headers: {
'x-api-key': process.env.VOICECHEAP_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify(input),
});
const body = await response.json();
if (!response.ok) throw new Error(body.code + ': ' + body.message);
console.log(body);
import os
import requests
response = requests.post(
"https://api.voicecheap.ai/v1/actions/webhooks_create_secret",
headers={"x-api-key": os.environ["VOICECHEAP_API_KEY"]},
json={"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30"},
timeout=120,
)
body = response.json()
if not response.ok:
raise RuntimeError(f"{body.get('code')}: {body.get('message')}")
print(body)
Risposta
Una prima esecuzione riuscita restituisce HTTP 200 con il risultato dell’operazione in data. Una ripetizione può invece restituire lo stato della richiesta salvata. L’esempio mostra una risposta supportata, non tutti i campi facoltativi. Restituisce le impostazioni dei webhook e il segreto di firma appena creato.{
"data": {
"url": "https://example.com/voicecheap-events",
"secretPrefix": "whsec_REP",
"secretSuffix": "CRET",
"createdAt": 1792065600000,
"updatedAt": 1792152000000,
"fullSecret": "whsec_REPLACE_WITH_NEW_SIGNING_SECRET"
},
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30"
}
{
"data": {
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30",
"operation": "webhooks_create_secret",
"createdAt": 1792144800000,
"updatedAt": 1792144820000,
"status": "running",
"pollAfterSeconds": 5
},
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30"
}
{
"data": {
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30",
"operation": "webhooks_create_secret",
"createdAt": 1792144800000,
"updatedAt": 1792144820000,
"status": "completed",
"resultStored": false,
"message": "The action completed. Retrieve its output from the corresponding history or resource action."
},
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30"
}
Campi del risultato
| Campo | Descrizione |
|---|---|
data.url | Destinazione del webhook salvata; una stringa vuota quando esiste un segreto ma nessun URL è configurato. |
data.secretPrefix | Parte iniziale visibile del segreto di firma. |
data.secretSuffix | Parte finale visibile del segreto di firma. |
data.createdAt | Timestamp di creazione della configurazione del webhook in millisecondi. |
data.updatedAt | Timestamp dell’ultimo aggiornamento della configurazione del webhook in millisecondi. |
data.fullSecret | Nuovo segreto di firma completo. Salvalo in modo sicuro; le successive azioni di lettura restituiscono solo il prefisso e il suffisso visibili. |
Recupera e monitora questa richiesta
Usa lo stesso identificatore anche dopo una connessione persa. Se resultStored è false, recupera l’output tramite la corrispondente azione di cronologia, risultato o download. Non avviare mai una seconda generazione solo per verificarne l’avanzamento.curl --request POST 'https://api.voicecheap.ai/v1/actions/action_request_get' \
--header "x-api-key: $VOICECHEAP_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"requestId":"58d5bb53-00d0-4692-bdaf-c6650ee87e30","operation":"webhooks_create_secret"}'
HTTP 200
{
"data": {
"requestId": "58d5bb53-00d0-4692-bdaf-c6650ee87e30",
"operation": "webhooks_create_secret",
"status": "completed",
"createdAt": 1792144800000,
"updatedAt": 1792144820000,
"resultStored": true,
"result": {
"url": "https://example.com/voicecheap-events",
"secretPrefix": "whsec_REP",
"secretSuffix": "CRET",
"createdAt": 1792065600000,
"updatedAt": 1792152000000,
"fullSecret": "whsec_REPLACE_WITH_NEW_SIGNING_SECRET"
}
}
}
Note sull’operazione
- webhooks_create_secret è disponibile solo tramite REST ed è escluso dalla discovery MCP. L’esecuzione o il polling tramite MCP restituisce l’errore dello strumento ACTION_NOT_AVAILABLE_IN_MCP. I segreti di firma non vengono inviati agli assistenti.
- La creazione di un segreto quando ne esiste già uno ne esegue la rotazione e invalida immediatamente il segreto precedente.
- L’URL del webhook esistente viene conservato. Per il primo segreto, url è una stringa vuota finché non viene configurato.
- Usa un requestId univoco per la rotazione prevista e riutilizza lo stesso ID nei nuovi tentativi, in modo che la perdita di una risposta non attivi un’altra rotazione.
Utilizzo
Ogni invocazione riuscita consuma una chiamata API/MCP mensile. Si applicano anche i crediti multimediali e le quote di generazione proprie dell’operazione.Errori
| Stato HTTP | Codice | Significato o risoluzione |
|---|---|---|
| 400 | BAD_REQUEST | Impossibile trovare l’account autenticato. |
| 400 | CREDENTIAL_IN_QUERY | Le credenziali sono state fornite in un parametro di query access_token o api_key. Invia le credenziali negli header. |
| 400 | IDEMPOTENCY_CONFLICT | L’intestazione Idempotency-Key e il campo requestId del corpo devono coincidere. |
| 400 | INVALID_REQUEST_ID | Fornisci requestId o Idempotency-Key come UUID v4. |
| 400 | VALIDATION_ERROR | L’oggetto JSON contiene un campo non supportato, un valore non valido o un argomento obbligatorio mancante. |
| 401 | API_KEY_EXPIRED | La chiave API è scaduta. |
| 401 | INVALID_API_KEY | Fornisci una chiave API valida e non scaduta. |
| 401 | INVALID_CREDENTIAL | L’header Authorization non è valido oppure è in conflitto con x-api-key. |
| 401 | MISSING_CREDENTIAL | Non è stata fornita alcuna credenziale utilizzabile negli header, oppure la credenziale superava 4096 caratteri. |
| 401 | USER_NOT_FOUND | L’account associato alla credenziale non esiste più. |
| 403 | ACCOUNT_UNAVAILABLE | L’account che esegue l’azione o quello di fatturazione non è disponibile o è in fase di eliminazione. |
| 403 | AMBIGUOUS_TEAM_API_KEY | L’utente della credenziale appartiene a più di un team, quindi il contesto di fatturazione è ambiguo. |
| 403 | INSUFFICIENT_SCOPE | Concedi tutte le autorizzazioni richieste o scegli un’altra credenziale. |
| 403 | INTEGRATION_PLAN_UNSUPPORTED | Impossibile verificare i limiti di integrazione dell’account. |
| 403 | SUBSCRIPTION_REQUIRED | Usa un abbonamento a pagamento attivo. |
| 403 | TEAM_OWNER_NOT_FOUND | Non è stato possibile trovare l’account effettivo del proprietario del team. |
| 409 | CONCURRENT_ACTION_LIMIT_REACHED | Questo account ha già 10 azioni di integrazione in esecuzione. Interroga una richiesta esistente prima di avviarne un’altra. |
| 409 | IDEMPOTENCY_CONFLICT | Riutilizza un identificatore solo con la stessa operazione e gli stessi argomenti. |
| 429 | INTEGRATION_MONTHLY_LIMIT_REACHED | Attendi il ripristino mensile o cambia piano. |
| 429 | INTEGRATION_RATE_LIMIT_REACHED | Rispetta Retry-After quando presente e applica attese crescenti tra i tentativi. |
| 500 | INTERNAL_ERROR | Controlla lo stato della richiesta salvata e la cronologia delle risorse prima di decidere se ripetere una modifica. |
| 503 | ACTION_RESULT_UNAVAILABLE | L’azione è stata eseguita ma non è stato possibile salvarne il risultato. Esamina lo stato della richiesta salvata e la cronologia delle risorse prima di avviare una nuova generazione. |
| 503 | SERVER_RESTARTING | Il server si sta riavviando. Riprova tra poco e mantieni lo stesso identificatore della richiesta per una modifica. |
{
"code": "INSUFFICIENT_SCOPE",
"message": "This credential does not permit the requested action.",
"status": 403,
"details": {
"requiredScopes": ["webhooks:write"]
}
}
Questa pagina è stata utile?

