PLEXICHATNarrative Docs

Webhooks

Guides, route-group overviews, and live schema entry points for the Plexichat backend.

REST http://api.plexichat.com/api/v1Gateway ws://api.plexichat.com/gatewayVersion a.1.0-49

Webhooks API

Endpoints for webhook management and execution.

POST /webhooks

Create a new webhook for a channel.

Headers


Authorization: Bearer <token>

Request Body

FieldTypeRequiredConstraintsDescription
channel_idstringYesSnowflake IDTarget channel
namestringYes1-80 charsWebhook name
avatar_urlstringNoValid URLWebhook avatar

Example Request


{
  "channel_id": "123456789012345678",
  "name": "My Webhook",
  "avatar_url": "https://cdn.example.com/avatars/webhook.png"
}

Response (200 OK)


{
  "id": "123456789012345678",
  "channel_id": "123456789012345678",
  "server_id": "123456789012345678",
  "creator_id": "123456789012345678",
  "name": "My Webhook",
  "avatar_url": "https://cdn.example.com/avatars/webhook.png",
  "token": "webhook_token_here",
  "url": "https://api.plexichat.com/webhooks/123456789012345678/webhook_token_here",
  "created_at": 1704067200
}
Important: Token and URL are only returned on creation. Store them securely.

Error Responses

StatusCodeDescription
400Invalid inputValidation failed
400Webhook limitChannel webhook limit reached
403Permission deniedNo manage webhooks permission
404Channel not foundChannel doesn't exist

GET /webhooks/{webhook_id}

Get webhook details (without token).

Headers


Authorization: Bearer <token>

Response (200 OK)


{
  "id": "123456789012345678",
  "channel_id": "123456789012345678",
  "server_id": "123456789012345678",
  "creator_id": "123456789012345678",
  "name": "My Webhook",
  "avatar_url": "https://cdn.example.com/avatars/webhook.png",
  "token": null,
  "url": null,
  "created_at": 1704067200
}

Error Responses

StatusCodeDescription
400Invalid webhook IDID format invalid
403Access deniedNo permission to view
404Webhook not foundWebhook doesn't exist

DELETE /webhooks/{webhook_id}

Delete a webhook.

Headers


Authorization: Bearer <token>

Response (200 OK)


{
  "success": true
}

Error Responses

StatusCodeDescription
403Permission deniedNo manage webhooks permission
404Webhook not foundWebhook doesn't exist

POST /webhooks/{webhook_id}/{token}

Execute a webhook to send a message. No authentication required if token is valid.

Path Parameters

ParameterTypeDescription
webhook_idstringWebhook's snowflake ID
tokenstringWebhook token

Query Parameters

ParameterTypeDefaultDescription
waitboolfalseWait for message and return it

Request Body

FieldTypeRequiredConstraintsDescription
contentstringConditionalMax 2000 charsMessage content
usernamestringNoMax 80 charsOverride webhook name
avatar_urlstringNoValid URLOverride webhook avatar
embedsarrayNo-Rich embeds
thread_idstringNoSnowflake IDThread to post to

At least one of content or embeds is required.

Example Request


{
  "content": "Hello from webhook!",
  "username": "Custom Bot Name",
  "avatar_url": "https://cdn.example.com/custom-avatar.png"
}

Response (200 OK with wait=false)

Returns a standard success response.


{
  "success": true
}

Response (200 OK with wait=true)


{
  "id": "123456789012345678",
  "webhook_id": "123456789012345678",
  "channel_id": "123456789012345678",
  "content": "Hello from webhook!",
  "username": "Custom Bot Name",
  "avatar_url": "https://cdn.example.com/custom-avatar.png",
  "created_at": 1704067200
}

Error Responses

StatusCodeDescription
400Empty messageNo content or embeds
400Invalid contentContent validation failed
401Invalid tokenWebhook token invalid
404Webhook not foundWebhook doesn't exist

Webhook Object


{
  "id": "123456789012345678",
  "channel_id": "123456789012345678",
  "server_id": "123456789012345678",
  "creator_id": "123456789012345678",
  "name": "My Webhook",
  "avatar_url": "https://cdn.example.com/avatars/webhook.png",
  "token": "webhook_token_here",
  "url": "https://api.example.com/api/v1/webhooks/123456789012345678/webhook_token_here",
  "created_at": 1704067200
}
FieldTypeDescription
idstringWebhook's snowflake ID
channel_idstringTarget channel ID
server_idstringServer ID
creator_idstringCreator's user ID
namestringWebhook name
avatar_urlstring?Webhook avatar URL
tokenstring?Webhook token (only on create)
urlstring?Full webhook URL (only on create)
created_atintUnix timestamp of creation