Inbound Webhooks (Project)
The Inbound Webhooks (Project) endpoints of the MCID API.
List the project's own inbound webhooks
/api/project/inbound-webhooksOrdered by creation time, oldest first. Never returns a signing secret or another project's webhook.
Authentication: Project API key (X-API-Key header)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
limit | query | number | no | Default: 50. |
offset | query | number | no | Default: 0. |
Responses
| Status | Description | Body |
|---|---|---|
200 | The requested page. | ProjectInboundWebhookListDto |
400 | Invalid limit or offset. | |
401 | Missing or invalid API key. | |
429 | Project rate limit. |
Open in Swagger (opens in a new tab)
Create an inbound webhook for the project
/api/project/inbound-webhooksThe project comes from the API key; a projectId in the body is rejected. Same schema rules as the admin create, and allowedRoleIds must belong to the project's servers (omit it for the default reader roles). The signing secret is returned once. Requires the manage_inbound_webhooks scope on the serverId given in the query, and a project holds at most INBOUND_WEBHOOK_MAX_PER_PROJECT webhooks (100 by default).
Authentication: Project API key (X-API-Key header)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
serverId | query | string | yes | Discord server on which the project holds the manage_inbound_webhooks scope. |
Request body (JSON, required): CreateProjectInboundWebhookDto schema.
Responses
| Status | Description | Body |
|---|---|---|
201 | CreatedProjectInboundWebhookDto | |
400 | Invalid input or reader roles. | |
401 | Missing or invalid API key. | |
403 | The project lacks the manage_inbound_webhooks scope or access on serverId. | |
409 | Slug already used in this project, or the project reached its webhook limit. | |
422 | Invalid schema; errors lists every problem. | |
429 | Project rate limit. |
Open in Swagger (opens in a new tab)
Update a webhook's name or schema
/api/project/inbound-webhooks/{id}Same schema rules as the admin update. Audited with the project id. Requires the manage_inbound_webhooks scope on the serverId given in the query.
Authentication: Project API key (X-API-Key header)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
serverId | query | string | yes | Discord server on which the project holds the manage_inbound_webhooks scope. |
Request body (JSON, required): UpdateProjectInboundWebhookDto schema.
Responses
| Status | Description | Body |
|---|---|---|
200 | The updated webhook, in the list projection. | ProjectInboundWebhookSummaryDto |
400 | Unknown or malformed field, or no serverId. | |
401 | Missing or invalid API key. | |
403 | The project lacks the manage_inbound_webhooks scope or access on serverId. | |
404 | No such webhook for this project. | |
422 | The schema is invalid. | |
429 | Project rate limit. |
Open in Swagger (opens in a new tab)
Rotate the signing secret
/api/project/inbound-webhooks/{id}/rotate-secretThe new secret is returned once and the old one stops verifying. Audited with the project id. Requires the manage_inbound_webhooks scope on the serverId given in the query.
Authentication: Project API key (X-API-Key header)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
serverId | query | string | yes | Discord server on which the project holds the manage_inbound_webhooks scope. |
Responses
| Status | Description | Body |
|---|---|---|
200 | The new secret, shown once. | ProjectRotatedSecretDto |
400 | No serverId. | |
401 | Missing or invalid API key. | |
403 | The project lacks the manage_inbound_webhooks scope or access on serverId. | |
404 | No such webhook for this project. | |
429 | Project rate limit. |
Open in Swagger (opens in a new tab)
List a webhook's submissions after a cursor
/api/project/inbound-webhooks/{id}/submissionsOldest first, keyset-paged on (receivedAt, id), so rows arriving between pages are neither skipped nor repeated. Every read is audited. Requires the read_inbound_submissions scope on the serverId given in the query.
Authentication: Project API key (X-API-Key header)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
serverId | query | string | yes | Discord server on which the project holds the read_inbound_submissions scope. |
cursor | query | string | no | Opaque nextCursor of the previous page. |
limit | query | number | no | Default: 50. |
dateFrom | query | string (date-time) | no | ISO 8601 - submissions received at or after it. |
dateTo | query | string (date-time) | no | ISO 8601 - submissions received at or before it. |
Responses
| Status | Description | Body |
|---|---|---|
200 | ProjectSubmissionPageDto | |
400 | Malformed cursor or query. | |
401 | Missing or invalid API key. | |
403 | The project lacks the read_inbound_submissions scope or read access on serverId. | |
404 | No such webhook for this project. | |
429 | Project rate limit. |
Open in Swagger (opens in a new tab)
Get one of a webhook's submissions
/api/project/inbound-webhooks/{id}/submissions/{submissionId}Same fields as a list item. Every read is audited. Requires the read_inbound_submissions scope on the serverId given in the query.
Authentication: Project API key (X-API-Key header)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
submissionId | path | string | yes | |
serverId | query | string | yes | Discord server on which the project holds the read_inbound_submissions scope. |
Responses
| Status | Description | Body |
|---|---|---|
200 | ProjectSubmissionDto | |
400 | Malformed submission id or query. | |
401 | Missing or invalid API key. | |
403 | The project lacks the read_inbound_submissions scope or read access on serverId. | |
404 | No such webhook or submission for this project (never says which). | |
429 | Project rate limit. |
Open in Swagger (opens in a new tab)
Schemas
CreateProjectInboundWebhookDto schema
| Field | Type | Required | Description |
|---|---|---|---|
acceptedOrigins | array of string | no | Origins permitted to call this webhook. Empty = no check. |
allowRoleInheritance | boolean | no | When true, a member can also read this webhook's submissions through role inheritance: a role they hold on the main server that is the source of an enabled inheritance rule covering the server of a granted role counts as that granted role, matched by role name. Off by default: data access should be explicit. Default: false. |
allowedRoleIds | array of string | no | Discord role IDs permitted to READ submissions. When omitted, the configured default reader roles are used (MC Executive unless changed in the inbound webhook settings); when given, exactly these roles are used. At least one role must result. |
identityMapping | IdentityMappingDto | no | Link an account from each accepted submission: the member comes from one field, the username from another. Submissions with an unknown member or an invalid username are refused. |
name | string | yes | |
rejectUnknownFields | boolean | no | Default: true. |
requireSignature | boolean | no | Default: true. |
schema | object | yes | The shape of what callers send. Either steps (a multi-step form; the payload is keyed by step) or fields (a flat payload, for an event or any non-form data), not both. Validated by the Layer-1 schema validator. |
slug | string | yes | URL-safe identifier, unique within the project. |
CreatedProjectInboundWebhookDto schema
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
secret | string | yes | The signing secret. Shown once; no later read returns it. |
slug | string | yes |
IdentityMappingDto schema
| Field | Type | Required | Description |
|---|---|---|---|
handleField | string | yes | Payload path holding the username on the provider. |
memberIdField | string | yes | Payload path holding the Discord member id. Use step.field for a stepped schema. |
provider | "github" | yes |
ProjectInboundWebhookListDto schema
| Field | Type | Required | Description |
|---|---|---|---|
items | array of ProjectInboundWebhookSummaryDto | yes | |
total | number | yes | All of the project's webhooks |
ProjectInboundWebhookSummaryDto schema
| Field | Type | Required | Description |
|---|---|---|---|
active | boolean | yes | |
createdAt | string | yes | ISO 8601 creation timestamp |
id | string | yes | |
name | string | yes | |
schema | object | yes | The webhook FormSchema |
slug | string | yes |
ProjectRotatedSecretDto schema
| Field | Type | Required | Description |
|---|---|---|---|
secret | string | yes | The new signing secret, returned once |
ProjectSubmissionDto schema
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | |
origin | string or null | yes | |
payload | object | yes | |
receivedAt | string | yes |
ProjectSubmissionPageDto schema
| Field | Type | Required | Description |
|---|---|---|---|
items | array of ProjectSubmissionDto | yes | |
nextCursor | string or null | yes | Pass as cursor for the next page. Null at the end. |
UpdateProjectInboundWebhookDto schema
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | |
schema | object | no | Either steps or flat fields, not both; re-validated on update. |
Source: apps/api/openapi.json.