Rotate the webhook signing secret
curl --request POST \
--url https://conigma-tool-server-production.up.railway.app/api/tool-webhooks/secret/rotate \
--header 'Authorization: Bearer <token>'import requests
url = "https://conigma-tool-server-production.up.railway.app/api/tool-webhooks/secret/rotate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://conigma-tool-server-production.up.railway.app/api/tool-webhooks/secret/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://conigma-tool-server-production.up.railway.app/api/tool-webhooks/secret/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://conigma-tool-server-production.up.railway.app/api/tool-webhooks/secret/rotate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://conigma-tool-server-production.up.railway.app/api/tool-webhooks/secret/rotate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://conigma-tool-server-production.up.railway.app/api/tool-webhooks/secret/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw",
"previousSecretValidUntil": "2023-11-07T05:31:56Z"
}{
"status": "completed",
"ok": true,
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toolId": "<string>",
"result": "<unknown>",
"resultRef": {
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"error": {
"code": "insufficient_credits",
"message": "<string>",
"retryable": true
},
"billing": {
"chargedCredits": 123,
"items": [
{
"toolId": "<string>",
"summary": "<string>",
"chargedCredits": 123,
"status": "charged",
"externalBilling": "may_apply",
"heldCredits": 123
}
],
"lowBalance": {
"balance": 123,
"message": "<string>",
"nextStep": "<string>",
"url": "<string>"
}
},
"replayed": true,
"chargedThisRequest": 123,
"recovery": {
"toolId": "get-generation",
"input": {
"recoveryId": "<string>"
}
}
}{
"status": "completed",
"ok": true,
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toolId": "<string>",
"result": "<unknown>",
"resultRef": {
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"error": {
"code": "insufficient_credits",
"message": "<string>",
"retryable": true
},
"billing": {
"chargedCredits": 123,
"items": [
{
"toolId": "<string>",
"summary": "<string>",
"chargedCredits": 123,
"status": "charged",
"externalBilling": "may_apply",
"heldCredits": 123
}
],
"lowBalance": {
"balance": 123,
"message": "<string>",
"nextStep": "<string>",
"url": "<string>"
}
},
"replayed": true,
"chargedThisRequest": 123,
"recovery": {
"toolId": "get-generation",
"input": {
"recoveryId": "<string>"
}
}
}{
"status": "completed",
"ok": true,
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toolId": "<string>",
"result": "<unknown>",
"resultRef": {
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"error": {
"code": "insufficient_credits",
"message": "<string>",
"retryable": true
},
"billing": {
"chargedCredits": 123,
"items": [
{
"toolId": "<string>",
"summary": "<string>",
"chargedCredits": 123,
"status": "charged",
"externalBilling": "may_apply",
"heldCredits": 123
}
],
"lowBalance": {
"balance": 123,
"message": "<string>",
"nextStep": "<string>",
"url": "<string>"
}
},
"replayed": true,
"chargedThisRequest": 123,
"recovery": {
"toolId": "get-generation",
"input": {
"recoveryId": "<string>"
}
}
}{
"status": "completed",
"ok": true,
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toolId": "<string>",
"result": "<unknown>",
"resultRef": {
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"error": {
"code": "insufficient_credits",
"message": "<string>",
"retryable": true
},
"billing": {
"chargedCredits": 123,
"items": [
{
"toolId": "<string>",
"summary": "<string>",
"chargedCredits": 123,
"status": "charged",
"externalBilling": "may_apply",
"heldCredits": 123
}
],
"lowBalance": {
"balance": 123,
"message": "<string>",
"nextStep": "<string>",
"url": "<string>"
}
},
"replayed": true,
"chargedThisRequest": 123,
"recovery": {
"toolId": "get-generation",
"input": {
"recoveryId": "<string>"
}
}
}{
"status": "completed",
"ok": true,
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toolId": "<string>",
"result": "<unknown>",
"resultRef": {
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"error": {
"code": "insufficient_credits",
"message": "<string>",
"retryable": true
},
"billing": {
"chargedCredits": 123,
"items": [
{
"toolId": "<string>",
"summary": "<string>",
"chargedCredits": 123,
"status": "charged",
"externalBilling": "may_apply",
"heldCredits": 123
}
],
"lowBalance": {
"balance": 123,
"message": "<string>",
"nextStep": "<string>",
"url": "<string>"
}
},
"replayed": true,
"chargedThisRequest": 123,
"recovery": {
"toolId": "get-generation",
"input": {
"recoveryId": "<string>"
}
}
}Tool API
Rotate the webhook signing secret
Replaces the secret. For the next 24 hours every webhook carries two signatures, one per secret, so you can switch your receiver without missing an event.
POST
/
api
/
tool-webhooks
/
secret
/
rotate
Rotate the webhook signing secret
curl --request POST \
--url https://conigma-tool-server-production.up.railway.app/api/tool-webhooks/secret/rotate \
--header 'Authorization: Bearer <token>'import requests
url = "https://conigma-tool-server-production.up.railway.app/api/tool-webhooks/secret/rotate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://conigma-tool-server-production.up.railway.app/api/tool-webhooks/secret/rotate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://conigma-tool-server-production.up.railway.app/api/tool-webhooks/secret/rotate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://conigma-tool-server-production.up.railway.app/api/tool-webhooks/secret/rotate"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://conigma-tool-server-production.up.railway.app/api/tool-webhooks/secret/rotate")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://conigma-tool-server-production.up.railway.app/api/tool-webhooks/secret/rotate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"secret": "whsec_MfKQ9r8GKYqrTwjUPD8ILPZIo2LaLaSw",
"previousSecretValidUntil": "2023-11-07T05:31:56Z"
}{
"status": "completed",
"ok": true,
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toolId": "<string>",
"result": "<unknown>",
"resultRef": {
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"error": {
"code": "insufficient_credits",
"message": "<string>",
"retryable": true
},
"billing": {
"chargedCredits": 123,
"items": [
{
"toolId": "<string>",
"summary": "<string>",
"chargedCredits": 123,
"status": "charged",
"externalBilling": "may_apply",
"heldCredits": 123
}
],
"lowBalance": {
"balance": 123,
"message": "<string>",
"nextStep": "<string>",
"url": "<string>"
}
},
"replayed": true,
"chargedThisRequest": 123,
"recovery": {
"toolId": "get-generation",
"input": {
"recoveryId": "<string>"
}
}
}{
"status": "completed",
"ok": true,
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toolId": "<string>",
"result": "<unknown>",
"resultRef": {
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"error": {
"code": "insufficient_credits",
"message": "<string>",
"retryable": true
},
"billing": {
"chargedCredits": 123,
"items": [
{
"toolId": "<string>",
"summary": "<string>",
"chargedCredits": 123,
"status": "charged",
"externalBilling": "may_apply",
"heldCredits": 123
}
],
"lowBalance": {
"balance": 123,
"message": "<string>",
"nextStep": "<string>",
"url": "<string>"
}
},
"replayed": true,
"chargedThisRequest": 123,
"recovery": {
"toolId": "get-generation",
"input": {
"recoveryId": "<string>"
}
}
}{
"status": "completed",
"ok": true,
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toolId": "<string>",
"result": "<unknown>",
"resultRef": {
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"error": {
"code": "insufficient_credits",
"message": "<string>",
"retryable": true
},
"billing": {
"chargedCredits": 123,
"items": [
{
"toolId": "<string>",
"summary": "<string>",
"chargedCredits": 123,
"status": "charged",
"externalBilling": "may_apply",
"heldCredits": 123
}
],
"lowBalance": {
"balance": 123,
"message": "<string>",
"nextStep": "<string>",
"url": "<string>"
}
},
"replayed": true,
"chargedThisRequest": 123,
"recovery": {
"toolId": "get-generation",
"input": {
"recoveryId": "<string>"
}
}
}{
"status": "completed",
"ok": true,
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toolId": "<string>",
"result": "<unknown>",
"resultRef": {
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"error": {
"code": "insufficient_credits",
"message": "<string>",
"retryable": true
},
"billing": {
"chargedCredits": 123,
"items": [
{
"toolId": "<string>",
"summary": "<string>",
"chargedCredits": 123,
"status": "charged",
"externalBilling": "may_apply",
"heldCredits": 123
}
],
"lowBalance": {
"balance": 123,
"message": "<string>",
"nextStep": "<string>",
"url": "<string>"
}
},
"replayed": true,
"chargedThisRequest": 123,
"recovery": {
"toolId": "get-generation",
"input": {
"recoveryId": "<string>"
}
}
}{
"status": "completed",
"ok": true,
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"toolId": "<string>",
"result": "<unknown>",
"resultRef": {
"invocationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"error": {
"code": "insufficient_credits",
"message": "<string>",
"retryable": true
},
"billing": {
"chargedCredits": 123,
"items": [
{
"toolId": "<string>",
"summary": "<string>",
"chargedCredits": 123,
"status": "charged",
"externalBilling": "may_apply",
"heldCredits": 123
}
],
"lowBalance": {
"balance": 123,
"message": "<string>",
"nextStep": "<string>",
"url": "<string>"
}
},
"replayed": true,
"chargedThisRequest": 123,
"recovery": {
"toolId": "get-generation",
"input": {
"recoveryId": "<string>"
}
}
}Authorizations
A workspace API key from Settings → Developers → API keys, sent as Authorization: Bearer sk_… (or X-API-Key: sk_…). It acts as one workspace member and uses the workspace's credits.