Omniplex Docs

Webhooks

These API endpoints are related to webhooks on Omniplex

Get Webhooks

GET
/{target_type}/{target_id}/webhooks

Gets a list of webhooks of a specific entity (excluding the secret due to security concerns). Requires the Get Webhooks permission

Authorization

headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

target_type*string

The entity type to return webhooks for.

target_id*string

The target ID to return webhooks for

Response Body

Success

application/json
  1. response
[index: integer]?
Example Request
curl -X GET 'https://spider.omniplex.gg/string/string/webhooks'
Example Response
[  {    "broken": true,    "created_at": "2019-08-24T14:15:22Z",    "event_whitelist": [      "string"    ],    "failed_requests": 0,    "hmac_auth": true,    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "simple_auth": true,    "target_id": "string",    "target_type": "string",    "url": "string"  }]

Create Webhook

POST
/{target_type}/{target_id}/webhooks

Creates a new webhook for an entity. Returns 204 on success. Requires Create Webhooks permission

Authorization

headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

target_type*string

The target type of the tntity

target_id*string

The target ID of the entity

Request Body

application/json
  1. body
event_whitelist?array<>

The events that are whitelisted for this webhook. Note that if unset, all events are whitelisted.

hmac_auth?boolean

Recommended auth mode: plain JSON body, signed with HMAC-SHA256 in the X-Webhook-Signature header (same shape as GitHub/Stripe webhooks).

name?string

The name of the webhook.

secret?string

The secret of the webhook, only needed for custom (non-discord) webhooks

simple_auth?boolean

Legacy simple auth: plain JSON body, raw secret in the Authorization header. Prefer hmac_auth for new webhooks. Ignored if hmac_auth is set.

url?string

The URL of the webhook.

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X POST 'https://spider.omniplex.gg/string/string/webhooks' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Update Webhook

POST
/{target_type}/{target_id}/webhooks/{webhook_id}

Updates an existing webhook on an entity. Returns 204 on success. Requires Edit Webhooks permission

Authorization

headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

target_type*string

The target type of the entity

target_id*string

The target ID of the entity

webhook_id*string

The ID of the webhook to update

Request Body

application/json
  1. body
event_whitelist?array<>

The events that are whitelisted for this webhook. Note that if unset, all events are whitelisted.

hmac_auth?boolean

Recommended auth mode: plain JSON body, signed with HMAC-SHA256 in the X-Webhook-Signature header (same shape as GitHub/Stripe webhooks).

name?string

The name of the webhook.

secret?string

The secret of the webhook, only needed for custom (non-discord) webhooks

simple_auth?boolean

Legacy simple auth: plain JSON body, raw secret in the Authorization header. Prefer hmac_auth for new webhooks. Ignored if hmac_auth is set.

url?string

The URL of the webhook.

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X POST 'https://spider.omniplex.gg/string/string/webhooks/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Delete Webhook

DELETE
/{target_type}/{target_id}/webhooks/{webhook_id}

Updates an existing webhook on an entity. Returns 204 on success. Requires Edit Webhooks permission

Authorization

headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

target_type*string

The target type of the entity

target_id*string

The target ID of the entity

webhook_id*string

The ID of the webhook to delete

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X DELETE 'https://spider.omniplex.gg/string/string/webhooks/string'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Get Webhook Logs

GET
/{target_type}/{target_id}/webhooks/logs

Gets webhook logs of a specific entity. Paginated to 10 at a time. Requires authentication

Authorization

headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

target_type*string

The target type of the entity

target_id*string

The target ID of the entity

Query Parameters

page?string

The page number

Response Body

Success

application/json
  1. response
count?integer
Range0 <= value <= 18446744073709552000
per_page?integer
Range0 <= value <= 18446744073709552000
results?array<>
Example Request
curl -X GET 'https://spider.omniplex.gg/string/string/webhooks/logs'
Example Response
{  "count": 0,  "per_page": 0,  "results": [    {      "bad_intent": true,      "created_at": "2019-08-24T14:15:22Z",      "data": {        "property1": null,        "property2": null      },      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "last_try": "2019-08-24T14:15:22Z",      "request_headers": {        "property1": null,        "property2": null      },      "response": "string",      "response_headers": {        "property1": null,        "property2": null      },      "state": "string",      "status_code": 0,      "target_id": "string",      "target_type": "string",      "tries": 0,      "url": "string",      "user": {        "avatar": "string",        "bot": true,        "display_name": "string",        "extra_data": {          "property1": null,          "property2": null        },        "flags": [          "string"        ],        "id": "string",        "status": "string",        "username": "string"      },      "webhook_id": "a47606a1-5b39-4a81-9480-c2cb738ff675"    }  ]}
GET
/{target_type}/{target_id}/webhooks/test

Responds with the metadata of all webhooks that can currently be tested. Note that this does not require any specific permission

Path Parameters

target_type*string

The target type of the entity

target_id*string

The target ID of the entity

Query Parameters

event*string

The event that is being posted

Response Body

Success

application/json
  1. response
data?array<>

The types of webhooks to test.

Example Request
curl -X GET 'https://spider.omniplex.gg/string/string/webhooks/test?event=string'
Example Response
{  "data": [    {      "type": "string"    }  ]}

Test Webhook

POST
/{target_type}/{target_id}/webhooks/test

Sends a test webhook.

Authorization

headerUser-Auth<token>

Requires a user token. Should be prefixed with User in Authorization header.

Path Parameters

target_type*string

The target type of the entity

target_id*string

The target ID of the entity

Query Parameters

event*string

The event that is being posted

Request Body

application/json
  1. body
[key: string]?unknown

Response Body

Success

application/json
  1. response
context?

Context of the error. Usually used for validation error contexts

message?string

Message of the error

Example Request
curl -X POST 'https://spider.omniplex.gg/string/string/webhooks/test?event=string' \  -H 'Content-Type: application/json' \  -d '{  "property1": null,  "property2": null}'
Example Response
{  "context": {    "property1": "string",    "property2": "string"  },  "message": "string"}

Delete Review

This webhook is sent when a user delete their review on an entity.

Request Body

application/json
  1. body
creator?

The user who created the action/event (e.g voted for the bot or made a review)

data?unknown

The data of the webhook event

metadata?

Metadata about the webhook event

targets?

The target of the webhook, can be one of. or a possible combination of bot, team and server

type?string

The type of the webhook event

Example Requests
POST/DELETE_REVIEW

Edit Review

This webhook is sent when a user edits an existing review on an entity.

Request Body

application/json
  1. body
creator?

The user who created the action/event (e.g voted for the bot or made a review)

data?unknown

The data of the webhook event

metadata?

Metadata about the webhook event

targets?

The target of the webhook, can be one of. or a possible combination of bot, team and server

type?string

The type of the webhook event

Example Requests
POST/EDIT_REVIEW

New Review

This webhook is sent when a user creates a new review on an entity.

Request Body

application/json
  1. body
creator?

The user who created the action/event (e.g voted for the bot or made a review)

data?unknown

The data of the webhook event

metadata?

Metadata about the webhook event

targets?

The target of the webhook, can be one of. or a possible combination of bot, team and server

type?string

The type of the webhook event

Example Requests
POST/NEW_REVIEW

New Vote

This webhook is sent when a user votes for an entity.

Request Body

application/json
  1. body
creator?

The user who created the action/event (e.g voted for the bot or made a review)

data?unknown

The data of the webhook event

metadata?

Metadata about the webhook event

targets?

The target of the webhook, can be one of. or a possible combination of bot, team and server

type?string

The type of the webhook event

Example Requests
POST/NEW_VOTE

Team Edit

This webhook is sent when a user edits the basic settings of a team (name/short/tags) is changed.

Request Body

application/json
  1. body
creator?

The user who created the action/event (e.g voted for the bot or made a review)

data?unknown

The data of the webhook event

metadata?

Metadata about the webhook event

targets?

The target of the webhook, can be one of. or a possible combination of bot, team and server

type?string

The type of the webhook event

Example Requests
POST/TEAM_EDIT