API referenceProject API

Inbound Webhooks (Project)

The Inbound Webhooks (Project) endpoints of the MCID API.

List the project's own inbound webhooks

GET/api/project/inbound-webhooks

Ordered by creation time, oldest first. Never returns a signing secret or another project's webhook.

Authentication: Project API key (X-API-Key header)

Parameters

NameInTypeRequiredDescription
limitquerynumbernoDefault: 50.
offsetquerynumbernoDefault: 0.

Responses

StatusDescriptionBody
200The requested page.ProjectInboundWebhookListDto
400Invalid limit or offset.
401Missing or invalid API key.
429Project rate limit.

Open in Swagger (opens in a new tab)

Create an inbound webhook for the project

POST/api/project/inbound-webhooks

The 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

NameInTypeRequiredDescription
serverIdquerystringyesDiscord server on which the project holds the manage_inbound_webhooks scope.

Request body (JSON, required): CreateProjectInboundWebhookDto schema.

Responses

StatusDescriptionBody
201CreatedProjectInboundWebhookDto
400Invalid input or reader roles.
401Missing or invalid API key.
403The project lacks the manage_inbound_webhooks scope or access on serverId.
409Slug already used in this project, or the project reached its webhook limit.
422Invalid schema; errors lists every problem.
429Project rate limit.

Open in Swagger (opens in a new tab)

Update a webhook's name or schema

PATCH/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

NameInTypeRequiredDescription
idpathstringyes
serverIdquerystringyesDiscord server on which the project holds the manage_inbound_webhooks scope.

Request body (JSON, required): UpdateProjectInboundWebhookDto schema.

Responses

StatusDescriptionBody
200The updated webhook, in the list projection.ProjectInboundWebhookSummaryDto
400Unknown or malformed field, or no serverId.
401Missing or invalid API key.
403The project lacks the manage_inbound_webhooks scope or access on serverId.
404No such webhook for this project.
422The schema is invalid.
429Project rate limit.

Open in Swagger (opens in a new tab)

Rotate the signing secret

POST/api/project/inbound-webhooks/{id}/rotate-secret

The 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

NameInTypeRequiredDescription
idpathstringyes
serverIdquerystringyesDiscord server on which the project holds the manage_inbound_webhooks scope.

Responses

StatusDescriptionBody
200The new secret, shown once.ProjectRotatedSecretDto
400No serverId.
401Missing or invalid API key.
403The project lacks the manage_inbound_webhooks scope or access on serverId.
404No such webhook for this project.
429Project rate limit.

Open in Swagger (opens in a new tab)

List a webhook's submissions after a cursor

GET/api/project/inbound-webhooks/{id}/submissions

Oldest 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

NameInTypeRequiredDescription
idpathstringyes
serverIdquerystringyesDiscord server on which the project holds the read_inbound_submissions scope.
cursorquerystringnoOpaque nextCursor of the previous page.
limitquerynumbernoDefault: 50.
dateFromquerystring (date-time)noISO 8601 - submissions received at or after it.
dateToquerystring (date-time)noISO 8601 - submissions received at or before it.

Responses

StatusDescriptionBody
200ProjectSubmissionPageDto
400Malformed cursor or query.
401Missing or invalid API key.
403The project lacks the read_inbound_submissions scope or read access on serverId.
404No such webhook for this project.
429Project rate limit.

Open in Swagger (opens in a new tab)

Get one of a webhook's submissions

GET/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

NameInTypeRequiredDescription
idpathstringyes
submissionIdpathstringyes
serverIdquerystringyesDiscord server on which the project holds the read_inbound_submissions scope.

Responses

StatusDescriptionBody
200ProjectSubmissionDto
400Malformed submission id or query.
401Missing or invalid API key.
403The project lacks the read_inbound_submissions scope or read access on serverId.
404No such webhook or submission for this project (never says which).
429Project rate limit.

Open in Swagger (opens in a new tab)

Schemas

CreateProjectInboundWebhookDto schema

FieldTypeRequiredDescription
acceptedOriginsarray of stringnoOrigins permitted to call this webhook. Empty = no check.
allowRoleInheritancebooleannoWhen 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.
allowedRoleIdsarray of stringnoDiscord 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.
identityMappingIdentityMappingDtonoLink 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.
namestringyes
rejectUnknownFieldsbooleannoDefault: true.
requireSignaturebooleannoDefault: true.
schemaobjectyesThe 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.
slugstringyesURL-safe identifier, unique within the project.

CreatedProjectInboundWebhookDto schema

FieldTypeRequiredDescription
idstringyes
secretstringyesThe signing secret. Shown once; no later read returns it.
slugstringyes

IdentityMappingDto schema

FieldTypeRequiredDescription
handleFieldstringyesPayload path holding the username on the provider.
memberIdFieldstringyesPayload path holding the Discord member id. Use step.field for a stepped schema.
provider"github"yes

ProjectInboundWebhookListDto schema

FieldTypeRequiredDescription
itemsarray of ProjectInboundWebhookSummaryDtoyes
totalnumberyesAll of the project's webhooks

ProjectInboundWebhookSummaryDto schema

FieldTypeRequiredDescription
activebooleanyes
createdAtstringyesISO 8601 creation timestamp
idstringyes
namestringyes
schemaobjectyesThe webhook FormSchema
slugstringyes

ProjectRotatedSecretDto schema

FieldTypeRequiredDescription
secretstringyesThe new signing secret, returned once

ProjectSubmissionDto schema

FieldTypeRequiredDescription
idstringyes
originstring or nullyes
payloadobjectyes
receivedAtstringyes

ProjectSubmissionPageDto schema

FieldTypeRequiredDescription
itemsarray of ProjectSubmissionDtoyes
nextCursorstring or nullyesPass as cursor for the next page. Null at the end.

UpdateProjectInboundWebhookDto schema

FieldTypeRequiredDescription
namestringno
schemaobjectnoEither steps or flat fields, not both; re-validated on update.

Source: apps/api/openapi.json.

On this page