Revoke a signing secret
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX/secrets/sec_01HXYZABCDEFGHJKMNPQRSTVWX"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}const url = 'https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX/secrets/sec_01HXYZABCDEFGHJKMNPQRSTVWX';const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}use std::str::FromStr;use reqwest;
#[tokio::main]pub async fn main() { let url = "https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX/secrets/sec_01HXYZABCDEFGHJKMNPQRSTVWX";
let mut headers = reqwest::header::HeaderMap::new(); headers.insert("Authorization", "Bearer <token>".parse().unwrap());
let client = reqwest::Client::new(); let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url) .headers(headers) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request DELETE \ --url https://api.kirimdev.com/v1/webhook_subscriptions/wbs_01HXYZABCDEFGHJKMNPQRSTVWX/secrets/sec_01HXYZABCDEFGHJKMNPQRSTVWX \ --header 'Authorization: Bearer <token>'Immediately revoke one signing secret on the subscription. Deliveries stop using it at once; keep at least one active secret to avoid delivery failures.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Public Kirimdev webhook-subscription ID.
Example
wbs_01HXYZABCDEFGHJKMNPQRSTVWXPublic Kirimdev webhook-subscription ID.
Signing-secret metadata ID returned by the subscription resource.
Example
sec_01HXYZABCDEFGHJKMNPQRSTVWXSigning-secret metadata ID returned by the subscription resource.
Responses
Section titled “ Responses ”Secret revoked
object
The requested resource.
object
Unique request identifier to include when contacting support.
Example
{ "data": { "deleted": true }, "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX"}Validation failure
object
object
Human-readable explanation of the error.
Request field associated with the error, when applicable.
Unique request identifier to include when contacting support.
Examples
A field value is invalid.
{ "error": { "type": "invalid_request_error", "code": "invalid_field_value", "message": "A field value is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}Authentication failure
object
object
Human-readable explanation of the error.
Request field associated with the error, when applicable.
Unique request identifier to include when contacting support.
Examples
The provided API key is invalid.
{ "error": { "type": "authentication_error", "code": "invalid_api_key", "message": "The provided API key is invalid.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}Resource not found
object
object
Human-readable explanation of the error.
Request field associated with the error, when applicable.
Unique request identifier to include when contacting support.
Examples
Resource not found.
{ "error": { "type": "not_found", "code": "resource_not_found", "message": "Resource not found.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}Semantic failure (e.g. idempotency key reuse, pre-send compliance guard, media not found)
object
object
Human-readable explanation of the error.
Request field associated with the error, when applicable.
Unique request identifier to include when contacting support.
Examples
Cannot revoke the only signing secret on this subscription. Add a new secret first, then revoke the old one.
{ "error": { "type": "invalid_request_error", "code": "cannot_revoke_last_secret", "message": "Cannot revoke the only signing secret on this subscription. Add a new secret first, then revoke the old one.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}Rate limit exceeded
object
object
Human-readable explanation of the error.
Request field associated with the error, when applicable.
Unique request identifier to include when contacting support.
Examples
Rate limit exceeded.
{ "error": { "type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}Internal server error
object
object
Human-readable explanation of the error.
Request field associated with the error, when applicable.
Unique request identifier to include when contacting support.
Examples
An unexpected error occurred.
{ "error": { "type": "api_error", "code": "internal_error", "message": "An unexpected error occurred.", "request_id": "req_01HXYZABCDEFGHJKMNPQRSTVWX" }}