Moonborn — API · webhooks
Update url, event subscription, description, or status
Status transitions: `active ↔ suspended` are reversible; `archived` is terminal (use DELETE for the explicit terminal action). Changing the URL does NOT rotate the secret — call `/rotate_secret` separately to invalidate the previous endpoint.
PATCH/v1/webhooks/{id}scope · Bearer (API key or session JWT)
Path parameters
| Field | Type | Description |
|---|---|---|
| idreq | string | Webhook endpoint id (e.g. `whe_*`). |
Request body
| Field | Type | Description |
|---|---|---|
| url | string | |
| events | string · "persona.created" | "persona.updated" | "persona.deleted" | "persona.archived" | "persona.regenerated" | "persona.audit_failed" | "generation.run.started" | "generation.run.completed" | "generation.run.failed" | "subscription.upgraded" | "subscription.downgraded" | "subscription.cancelled" | "marketplace.persona.published" | "marketplace.persona.purchased" | "moderation.flagged" | "webhook.endpoint.test_ping" | object[] | |
| description | string | |
| status | string · "active" | "suspended" | "archived" |
Responses
200OK
Body
| Field | Type | Description |
|---|---|---|
| endpointIdreq | string | |
| orgIdreq | string | |
| urlreq | string | |
| eventsreq | string · "persona.created" | "persona.updated" | "persona.deleted" | "persona.archived" | "persona.regenerated" | "persona.audit_failed" | "generation.run.started" | "generation.run.completed" | "generation.run.failed" | "subscription.upgraded" | "subscription.downgraded" | "subscription.cancelled" | "marketplace.persona.published" | "marketplace.persona.purchased" | "moderation.flagged" | "webhook.endpoint.test_ping" | object[] | |
| statusreq | string · "active" | "suspended" | "archived" | |
| descriptionreq | string | |
| secretsreq | object[] | |
| createdAtreq | string | |
| updatedAtreq | string |
401Unauthenticated
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
404Endpoint not found
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
409Cannot transition out of archived
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
422Validation error
Body
| Field | Type | Description |
|---|---|---|
| errorreq | object | |
| error.codereq | string | |
| error.messagereq | string |
Examples
cURL
curl -X PATCH https://api.moonborn.co/v1/webhooks/<id> \
-H "Authorization: Bearer $MOONBORN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "<string>",
"events": [],
"description": "<string>",
"status": "active"
}'TypeScript
import Moonborn from '@moonborn/sdk';
const client = new Moonborn({ apiKey: process.env.MOONBORN_API_KEY });
const result = await client.webhooks.updateWebhookEndpoint({
id: '<id>',
url: "<string>",
events: [],
description: "<string>",
status: "active",
});Python
import os
from moonborn import Moonborn
client = Moonborn(api_key=os.environ["MOONBORN_API_KEY"])
result = client.webhooks.update_webhook_endpoint(
id="<id>",
url="<string>",
events=[],
description="<string>",
status="active",
)