List every endpoint
/v1/inbound/endpointsList every endpoint a page at a time, with the routes and rules that use it. Named endpoints of every type (Slack, Discord, webhook, forward) by name, then webhooks without a name. Pass nextCursor back as cursor until it is null. addressId lists only the webhooks that get that address's received mail (subscribed to it or to every address), the full list a route's toMore points to.
Needs Receiving rules: write on the whole workspace. A person needs to be an owner or admin.
Example
import { createClient } from '@nightmail/sdk/client';
import { listInboundEndpoints } from '@nightmail/sdk';
const client = createClient({
baseUrl: 'https://nightmail.dev',
auth: scheme => scheme.scheme === 'bearer'
? process.env.NIGHTMAIL_API_KEY
: undefined,
});
const result = await listInboundEndpoints({
client,
throwOnError: true,
});
console.log(result.data);curl --request GET \
--url 'https://nightmail.dev/v1/inbound/endpoints' \
--header "Authorization: Bearer $NIGHTMAIL_API_KEY"Parameters
cursorquery · stringnextCursor from the previous page.
limitquery · integeraddressIdquery · stringOnly webhooks that get this address's received mail.
Responses
200Success
InboundEndpointPagedatarequiredobject[]data[].idrequiredstringEndpoint ID: mwh_… for a webhook, con_… for Slack, Discord or a forward.
data[].sourcerequiredstringendpoint: a named endpoint, which rules call (listEndpoints). inbound_webhook: a webhook without a name (listInboundWebhooks lists every webhook, named or not).
data[].namerequiredstringdata[].typerequiredstringdata[].statusrequiredstringdata[].targetrequiredstringWhere it delivers; URLs are write-only (last four characters).
data[].callrequiredstring or nullHow a rule calls an endpoint; null for an inbound webhook.
data[].eventTypesrequiredstring[]Events a webhook subscribes to; empty for a route-only webhook and for Slack, Discord and forward endpoints.
data[].routesrequiredintegerRoutes that name it.
data[].rulesrequiredstring[]Rules that call it.
data[].ritualsrequiredstring[]Deprecated: rules.
nextCursorrequiredstring or null400, 401, 403, 404, 409, 413, 422, 429, 500, 503Request failed; use error.code and requestId to diagnose.
ApiErrorerrorrequiredobjecterror.coderequiredstringerror.messagerequiredstringerror.requestIdrequiredstringerror.fieldstringerror.retryablerequiredbooleanerror.resetAtstringNext capacity change for a Hosted rolling send limit.
error.detailsobject[]Every problem found, when there is more than one part, such as rule diagnostics with rule, line, column, message and hint, or a measurement, such as CONTENT_TOO_LARGE_TO_SCREEN with screenedBytes and limitBytes (and index in a batch).
error.requiredobjectOn a 403 permission refusal: what the request needs that this credential lacks. The Nightmail-Required-Permission header says the same.