ComRaidComRaid Docs

Node SDK

Send Notifications from your server with @comraid/node.

Push Channel helpers in @comraid/node are thin clients over REST: Single send and Broadcast create Messages (/messages); on the push Channel those are Notifications. A Notification reaches many Contacts; each Contact's copy is a Delivery. Multi-send creates a Campaign (/campaigns). Contacts are addressed by external_user_id via Endpoints / Subscriptions. The SDK sets channel: push and nests push Content under content.push.

API keys (cr_sk_…) are backend-only — never ship them in a mobile or browser app. Use an App ID with the mobile SDKs instead. This page is the canonical long-form reference; the package README on github.com/comraid-io/comraid-node stays at method-reference parity. Full HTTP schemas live in the API Reference.

Install

pnpm add @comraid/node
# or: npm install @comraid/node

Requires Node.js 20+. Types ship with the package and track the public OpenAPI document.

Getting started

Create a client with a project API key and call product APIs from your backend. Examples below are clustered by lifecycle — see Method reference for parameter tables.

import { ComRaid } from "@comraid/node";

const comraid = new ComRaid({
  apiKey: process.env.COMRAID_API_KEY,
  // baseUrl defaults to https://api.comraid.io
});

// Single send — named Contacts by External user ID
await comraid.push.send({
  to: { external_user_ids: ["user_a", "user_b"] },
  content: { title: "Hello", body: "World" },
  idempotencyKey: comraid.createIdempotencyKey(),
});

// Rich push fields (OpenAPI content.push) — optional; nested under content.push as-is.
// deep_link is delivered to devices as cr_deep_link in FCM/APNs data.
await comraid.push.send({
  to: { external_user_ids: ["user_a"] },
  content: {
    title: "Order shipped",
    body: "Your package is on the way",
    deep_link: "myapp://orders/42",
    sound: "shipping",
    subtitle: "Tracking update",
    badge: 3,
    thread_id: "orders",
  },
});

// Broadcast — Segment, ad-hoc rules, or everyone
await comraid.push.broadcast({
  targeting: { everyone: true },
  content: { title: "Hello", body: "Everyone" },
});

// Multi-send — per-Contact Contents → Campaign
await comraid.push.multiSend({
  recipients: [
    { external_user_id: "user_a", content: { title: "Hi A", body: "Welcome A" } },
    { external_user_id: "user_b", content: { title: "Hi B", body: "Welcome B" } },
  ],
});

// Contacts + attributes
await comraid.contacts.create({
  external_user_id: "user_a",
  name: "Ada",
  attributes: { plan: "pro" },
});
await comraid.contacts.upsert("user_a", { locale: "en-US" });
await comraid.attributes.upsert("user_a", { attributes: { seats: 3 } });

// Notification status / cancel (REST /messages)
const detail = await comraid.push.get(messageId);
await comraid.push.cancel(messageId);

// Drafts
const draft = await comraid.push.drafts.create({
  targeting: { everyone: true },
  content: { title: "Later", body: "Save for review" },
});
const loaded = await comraid.push.get(draft.message_id);
await comraid.push.drafts.update(draft.message_id, {
  updated_at: loaded.updated_at,
  targeting: { everyone: true },
  content: { title: "Later", body: "Edited" },
});
await comraid.push.drafts.send(draft.message_id);

// Campaigns
await comraid.campaigns.get(campaignId);
await comraid.campaigns.cancel(campaignId);

// Opt-out / preferences
await comraid.contacts.optOut("user_a", "push");
await comraid.contacts.setPreferences("user_a", {
  preferences: [{ category: "promo", channel: "push", enabled: false }],
});

// Segments (full CRUD + restore)
const { segments } = await comraid.segments.list();
const rules = {
  operator: "and",
  conditions: [{ field: "attr.plan", op: "eq", value: "pro" }],
};
const created = await comraid.segments.create({ name: "Pro users", rules });
await comraid.segments.get(created.segment_id);
await comraid.segments.update(created.segment_id, {
  name: "Pro users (v2)",
  rules,
});
await comraid.segments.archive(created.segment_id);
await comraid.segments.restore(created.segment_id);

// Preview Broadcast targeting without creating a Message
const preview = await comraid.push.previewAudience({
  everyone: true,
  platforms: ["android", "ios"],
});

Further Channels can land as additive namespaces (for example comraid.whatsapp.send) without changing push.

Method reference

Grouped by lifecycle. Depth: signature, purpose, parameters, returns. Clustered examples live under Getting started. OpenAPI operation names appear where a helper maps 1:1 to a public HTTP operation.

Configure / client

new ComRaid(options)

Constructs a client. By default builds a FetchTransport from apiKey / baseUrl. Pass a custom transport instead when you need a different HTTP stack.

ParamTypeRequiredDescription
options.apiKeystringyes*Project API key (cr_sk_…). Backend only.
options.baseUrlstringnoAPI origin (no trailing slash required). Defaults to https://api.comraid.io.
options.fetchtypeof fetchnoOverride globalThis.fetch.
options.timeoutMsnumbernoPer-attempt timeout; default 15000.
options.maxRetriesnumbernoRetries after the first attempt; 0–10, default 2.
options.transportTransportyes*Custom transport; mutually exclusive with the Fetch options above.

*Either apiKey or transport.

Returns: ComRaid with push, campaigns, contacts, attributes, segments, identity, request, and createIdempotencyKey.

comraid.createIdempotencyKey()

Generates a UUID suitable for the Idempotency-Key header on mutating requests.

Returns: string

identity.createToken(externalUserId, options)

Offline helper that mints an RS256 Identity verification JWT for mobile login(externalUserId, jwt). Also available as ComRaid.identity.createToken / comraid.identity.createToken. Does not call the API — upload the matching public key under Push settings. Identity verification stays optional per project; skip this when the required toggle is off. See Authentication.

ParamTypeRequiredDescription
externalUserIdstringyesContact external_user_id (JWT sub + external_user_id).
options.projectIdstringyesProject UUID → iss comraid:{projectId}.
options.privateKeystring | KeyObjectyesPEM RSA private key (PKCS#8 or PKCS#1).
options.kidstringyesKey id matching an uploaded identity public key.
options.expiresInnumbernoLifetime in seconds from iat. Default 300; max 600.

Returns: string — compact JWT (aud=comraid:identity).

import { identity } from "@comraid/node";
import { readFileSync } from "node:fs";

const jwt = identity.createToken("user_123", {
  projectId: process.env.COMRAID_PROJECT_ID,
  privateKey: readFileSync("./comraid-identity.pem", "utf8"),
  kid: process.env.COMRAID_IDENTITY_KID,
  expiresIn: 300,
});
// App: ComRaid.login("user_123", jwt)

comraid.request(options)

Generic authenticated request. Use for OpenAPI operations the SDK does not wrap (see Not wrapped). Mutating methods are retried only when idempotencyKey is set (or the HTTP method is inherently idempotent: GET/HEAD/OPTIONS/PUT/DELETE).

ParamTypeRequiredDescription
options.methodHttpMethodnoDefault GET.
options.path`/${string}`yesPath under baseUrl (must start with /).
options.queryRecord<string, QueryValue>noQuery string values.
options.bodyunknownnoJSON body, or FormData / Blob for multipart (not JSON-encoded).
options.headersHeadersInitnoExtra headers (Authorization is set by the transport).
options.idempotencyKeystringnoSent as Idempotency-Key.
options.signalAbortSignalnoCancellation.

Returns: Promise<TResponse> — parsed JSON body (or empty for no-content responses).

FetchTransport

Default HTTP transport: bearer auth, JSON encode/decode (or multipart for FormData / Blob), timeouts, cancellation, bounded retries, and Retry-After handling.

new FetchTransport(options: FetchTransportOptions)
request<TResponse>(options: RequestOptions): Promise<TResponse>
ParamTypeRequiredDescription
options.apiKeystringyesBearer token.
options.baseUrlstringnoAPI origin. Defaults to https://api.comraid.io.
options.fetchtypeof fetchnoFetch implementation.
options.timeoutMsnumbernoDefault 15000.
options.maxRetriesnumbernoDefault 2.

Implement Transport.request yourself if you inject a custom transport into ComRaid.

Send (push Notifications)

Helpers set channel: push and nest caller Content under content.push. Full HTTP shapes: API Reference.

comraid.push.send(input) → OpenAPI createMessage (Single send)

ParamTypeRequiredDescription
input.toPushSendToyesexternal_user_ids (named Contacts). endpoint_ids is rejected.
input.contentPushContentyesPush title/body and optional rich fields.
input.categorystringnoNotification category.
input.typestringnoMessage type label.
input.namestringnoDashboard / reporting name.
input.priority"high" | "normal"noDelivery priority.
input.ttlnumbernoTime-to-live in seconds from send time (or from send_at when scheduled). 0 means send now and do not store (FCM ttl: 0s, APNs apns-expiration: 0); no retries.
input.collapse_keystringnoCollapse key so later sends with the same key replace earlier ones on device.
input.dataRecord<string, unknown>noCustom data object.
input.send_atstring | nullnoAbsolute UTC send time (ISO 8601). Mutually exclusive with send_at_local.
input.send_at_localstringnoLocal wall-clock datetime without timezone. Mutually exclusive with send_at.
input.idempotencyKeystringnoIdempotency key.
input.signalAbortSignalnoCancellation.

Returns: Promise<MessageAccepted> (message_id, status, …).

comraid.push.broadcast(input) → OpenAPI createMessage (Broadcast)

Same optional fields as send, except targeting is targeting instead of to.

ParamTypeRequiredDescription
input.targetingTargetingSpecyesExactly one of everyone, segment_id, or rules.
input.contentPushContentyesPush Content.
…Same optional fields as push.send (ttl, collapse_key, send_at / send_at_local, …).

Returns: Promise<MessageAccepted> with message_id and status preparing (or scheduled). ComRaid builds the audience in the background, so there is no delivery_count and no 10,000-Contact cap (only Single-send and Multi-send are capped at 10,000 recipients). Read counts with push.get once the status leaves preparing; an audience that matches nobody ends as failed.

comraid.push.multiSend(input) → OpenAPI createCampaign

ParamTypeRequiredDescription
input.recipientsPushMultiSendRecipient[]yesNon-empty; max 10,000. Each entry has external_user_id + content (and optional per-recipient ttl, collapse_key, …).
input.namestringnoCampaign name.
input.idempotencyKeystringnoIdempotency key.
input.signalAbortSignalnoCancellation.

Returns: Promise<CampaignAccepted> (campaign_id, per-Message statuses, …). Recipients are capped at 10,000.

comraid.push.uploadMedia(file, options) → OpenAPI uploadMedia

Multipart upload of a JPEG or PNG (max 1 MiB) for content.push.image_url. The client checks size and type; the server remains the authority.

ParamTypeRequiredDescription
fileBuffer | Uint8Array | Blob | string | ReadableyesImage bytes, Blob, filesystem path, or Readable stream.
options.contentType"image/jpeg" | "image/png"yesDeclared MIME type.
options.idempotencyKeystringnoIdempotency key.
options.signalAbortSignalnoCancellation.

Returns: Promise<MediaUploadResponse> (asset_id, public url).

const { url } = await comraid.push.uploadMedia(imageBuffer, {
  contentType: "image/png",
});
await comraid.push.send({
  to: { external_user_ids: ["user_a"] },
  content: { title: "Hi", body: "With image", image_url: url },
});

comraid.push.get(messageId, options?) → OpenAPI getMessage

ParamTypeRequiredDescription
messageIdstringyesMessage id.
options.signalAbortSignalnoCancellation.

Returns: Promise<MessageDetail> — status is one of draft, scheduled, preparing, processing, completed, failed, cancelled. A completed Message can still report failed and skipped counts. A Notification reaches many Contacts; each Contact's copy is a Delivery (deliveries / status_summary). Delivery outcomes include sent, delivered, opened, failed, and skipped.

comraid.push.cancel(messageId, options?) → OpenAPI cancelMessage

ParamTypeRequiredDescription
messageIdstringyesMessage id.
options.signalAbortSignalnoCancellation.

Returns: Promise<MessageCancelled>. Cancel works while the Message is scheduled, preparing, or processing; finished statuses reject with a 409 conflict. Cancel does not apply to Drafts.

comraid.push.previewAudience(input) → OpenAPI previewTargeting

Evaluates Broadcast targeting without creating a Message. Preview-only platforms filters endpoint counts; category applies the same offerability filter as Broadcast create.

ParamTypeRequiredDescription
input.everyone / segment_id / rulesTargetingSpec fieldsyes*Exactly one targeting selector.
input.platforms("android" | "ios")[]noPreview-only platform filter (not accepted on Message create targeting).
input.categorystringnoNotification Category slug for preference filtering.
input.idempotencyKeystringnoIdempotency key.
input.signalAbortSignalnoCancellation.

*Exactly one of everyone, segment_id, or rules.

Returns: Promise<TargetingPreviewResponse> (contacts, active_endpoints, android_endpoints, ios_endpoints).

Drafts

Draft helpers set draft: true / nest Content like other push methods. REST paths stay under /messages.

comraid.push.drafts.create(input) → OpenAPI createMessage (Draft)

ParamTypeRequiredDescription
input.contentPushContentyesTitle and body required for Drafts.
input.targetingTargetingSpecnoEveryone or segment_id (audience may be empty).
input.idempotencyKeystringnoIdempotency key.
input.signalAbortSignalnoCancellation.
…Same optional Message fields as push.broadcast (category, ttl, …).

Returns: Promise<MessageAccepted> with status draft.

comraid.push.drafts.update(messageId, input) → OpenAPI updateDraft

ParamTypeRequiredDescription
messageIdstringyesDraft Message id.
input.updated_atstringyesOptimistic concurrency token from push.get / list.
input.contentPushContentyesPush Content.
input.targetingTargetingSpecnoAudience.
input.signalAbortSignalnoCancellation.

Returns: Promise<MessageDetail>. Stale updated_at returns 409.

comraid.push.drafts.list(options?) → OpenAPI listMessages

ParamTypeRequiredDescription
options.limitnumbernoPage size (1–100).
options.offsetnumbernoOffset.
options.signalAbortSignalnoCancellation.

Returns: Promise<MessageList> for status=draft only.

comraid.push.drafts.send(messageId, options?) → OpenAPI sendDraft

ParamTypeRequiredDescription
messageIdstringyesDraft Message id.
options.signalAbortSignalnoCancellation.

Returns: Promise<MessageAccepted> after full validation; same row moves to scheduled / preparing.

comraid.push.drafts.archive(messageId, options?) → OpenAPI archiveDraft

ParamTypeRequiredDescription
messageIdstringyesDraft Message id.
options.signalAbortSignalnoCancellation.

Returns: Promise<DraftArchived>.

Campaigns

comraid.campaigns.get(campaignId, options?) → OpenAPI getCampaign

ParamTypeRequiredDescription
campaignIdstringyesCampaign id.
options.signalAbortSignalnoCancellation.

Returns: Promise<CampaignDetail> including child Messages, message_counts, and delivery_totals (nested Delivery rollups + CTR).

comraid.campaigns.cancel(campaignId, options?) → OpenAPI cancelCampaign

ParamTypeRequiredDescription
campaignIdstringyesCampaign id.
options.signalAbortSignalnoCancellation.

Returns: Promise<CampaignCancelled>. Cancels each child Message that is scheduled, preparing, or processing.

Contacts and attributes

comraid.contacts.create(input) → OpenAPI createContact

ParamTypeRequiredDescription
input.external_user_idstringyesExternal user ID.
input.namestringnoDisplay name.
input.localestringnoLocale Property.
input.timezonestringnoTimezone Property.
input.metadataRecord<string, unknown>noOpaque metadata.
input.attributesRecord<string, unknown>noInitial Attributes.
input.idempotencyKeystringnoIdempotency key.
input.signalAbortSignalnoCancellation.

Returns: Promise<ContactResponse>

comraid.contacts.upsert(externalUserId, input?) → OpenAPI upsertContact

ParamTypeRequiredDescription
externalUserIdstringyesExternal user ID path segment.
inputContactUpsert + keysnoPartial Contact fields (name, locale, timezone, metadata, attributes) plus optional idempotencyKey / signal.

Returns: Promise<ContactResponse>

comraid.contacts.optOut(externalUserId, channel, options?) → OpenAPI putContactChannelOptOut

ParamTypeRequiredDescription
externalUserIdstringyesExternal user ID.
channel"push"yesChannel to opt out of (V1: push only).
options.signalAbortSignalnoCancellation.

Returns: Promise<ContactOptOutResponse> with opted_out: true.

comraid.contacts.optIn(externalUserId, channel, options?) → OpenAPI putContactChannelOptOut

Same parameters as optOut. Clears the Channel opt-out (opted_out: false).

comraid.contacts.getPreferences(externalUserId, options?) → OpenAPI listContactPreferences

ParamTypeRequiredDescription
externalUserIdstringyesExternal user ID.
options.signalAbortSignalnoCancellation.

Returns: Promise<ContactPreferencesResponse>.

comraid.contacts.setPreferences(externalUserId, input) → OpenAPI upsertContactPreferences

ParamTypeRequiredDescription
externalUserIdstringyesExternal user ID.
input.preferencesContactPreference[]yesCategory / channel / enabled rows.
input.idempotencyKeystringnoIdempotency key.
input.signalAbortSignalnoCancellation.

Returns: Promise<ContactPreferencesResponse>.

comraid.contacts.endpoints.register(input) → OpenAPI registerEndpoint

ParamTypeRequiredDescription
input.external_user_idstringyesExternal user ID path segment.
input.addressstringyesFCM registration token or APNs device token.
input.platform"android" | "ios"yesEndpoint platform.
input.provider"fcm" | "apns"noDefaults from platform when omitted.
input.channel"push"noOnly push is supported.
input.metadataRecord<string, unknown>noFor APNs include apns_environment.
input.idempotencyKeystringnoIdempotency key.
input.signalAbortSignalnoCancellation.

Returns: Promise<EndpointRegistered>

await comraid.contacts.endpoints.register({
  external_user_id: "user_a",
  address: "fcm-or-apns-token",
  platform: "android",
  provider: "fcm",
});

comraid.contacts.endpoints.list(externalUserId, options?) → OpenAPI listContactEndpoints

ParamTypeRequiredDescription
externalUserIdstringyesExternal user ID.
options.signalAbortSignalnoCancellation.

Returns: Promise<EndpointListResponse> ({ endpoints: EndpointSummary[] }). Provider tokens are omitted.

const { endpoints } = await comraid.contacts.endpoints.list("user_a");

comraid.contacts.endpoints.deactivate(endpointId, options?) → OpenAPI deactivateEndpoint

ParamTypeRequiredDescription
endpointIdstringyesEndpoint id.
options.signalAbortSignalnoCancellation.

Returns: Promise<EndpointDeactivated> ({ status: "deactivated" }).

await comraid.contacts.endpoints.deactivate("11111111-1111-4111-8111-111111111111");

comraid.attributes.upsert(externalUserId, input) → OpenAPI upsertContactAttributes

ParamTypeRequiredDescription
externalUserIdstringyesExternal user ID.
input.attributesRecord<string, unknown>yesAttribute map to upsert.
input.idempotencyKeystringnoIdempotency key.
input.signalAbortSignalnoCancellation.

Returns: Promise<ContactResponse>

Segments

comraid.segments.list(options?) → OpenAPI listSegments

ParamTypeRequiredDescription
options.signalAbortSignalnoCancellation.

Returns: Promise<SegmentListResponse> ({ segments: SegmentSummary[] }).

comraid.segments.create(input) → OpenAPI createSegment

ParamTypeRequiredDescription
input.namestringyesSegment name.
input.rulesSegmentRulesyesoperator + conditions.
input.descriptionstringnoDescription.
input.idempotencyKeystringnoIdempotency key.
input.signalAbortSignalnoCancellation.

Returns: Promise<SegmentCreated>

comraid.segments.get(segmentId, options?) → OpenAPI getSegment

ParamTypeRequiredDescription
segmentIdstringyesSegment id.
options.signalAbortSignalnoCancellation.

Returns: Promise<SegmentSummary>

comraid.segments.update(segmentId, input) → OpenAPI updateSegment

ParamTypeRequiredDescription
segmentIdstringyesSegment id.
input.namestringyesName.
input.rulesSegmentRulesyesRules.
input.descriptionstringnoDescription.
input.idempotencyKeystringnoIdempotency key.
input.signalAbortSignalnoCancellation.

Returns: Promise<SegmentSummary>

comraid.segments.archive(segmentId, options?) → OpenAPI archiveSegment

ParamTypeRequiredDescription
segmentIdstringyesSegment id.
options.signalAbortSignalnoCancellation.

Returns: Promise<SegmentSummary>

comraid.segments.restore(segmentId, options?) → OpenAPI restoreSegment

ParamTypeRequiredDescription
segmentIdstringyesSegment id.
options.signalAbortSignalnoCancellation.

Returns: Promise<SegmentSummary>

Errors

Thrown by FetchTransport / request (and thus every namespace helper):

TypeWhenNotable fields
ComRaidErrorNon-OK HTTP response, invalid JSON on success, or normalized transport failurescode?, status?, requestId?, retryable, details?
ComRaidTimeoutErrorPer-attempt timeout (timeoutMs)extends ComRaidError; timeoutMs; code: "TIMEOUT"; retryable: true

Retryable HTTP statuses include 408, 425, 429, and 5xx. 409 is never retried (permanent conflicts such as idempotency_conflict). Mutating non-idempotent methods (e.g. POST without idempotencyKey) are not retried. See also Errors for the HTTP error JSON shape.

import { ComRaid, ComRaidError, ComRaidTimeoutError } from "@comraid/node";

try {
  await comraid.push.send({ /* … */ });
} catch (err) {
  if (err instanceof ComRaidTimeoutError) {
    // timed out; may retry with a fresh idempotency key if appropriate
  } else if (err instanceof ComRaidError && err.retryable) {
    // transient API / network failure
  } else {
    throw err;
  }
}

Not wrapped

These public OpenAPI operationIds have no dedicated helper. Call them with comraid.request() or raw HTTP, and use the API Reference for schemas. Mobile routes are intended for App ID clients (Android / iOS / React Native SDKs), not this API-key package.

TagoperationIdMethod + path
OpshealthzGET /healthz
OpsreadyzGET /readyz
ContactslistContactOptOutsGET /contacts/{external_user_id}/opt-outs
DeliveriesmarkDeliveryDeliveredPOST /deliveries/{id}/delivered
DeliveriesmarkDeliveryOpenedPOST /deliveries/{id}/opened
MobilemobileListCategoriesGET /mobile/notification-categories
MobilemobileRegisterSubscriptionPOST /mobile/subscriptions
MobilemobileSubscriptionLoginPOST /mobile/subscriptions/{id}/login
MobilemobileReplaceSubscriptionTokenPOST /mobile/subscriptions/{id}/token
MobilemobileSubscriptionSessionPOST /mobile/subscriptions/{id}/session
MobilemobileSubscriptionLogoutPOST /mobile/subscriptions/{id}/logout
MobilemobileSubscriptionOptOutPOST /mobile/subscriptions/{id}/opt-out
MobilemobileSubscriptionOptInPOST /mobile/subscriptions/{id}/opt-in
MobilemobileSubscriptionUpsertAttributesPUT /mobile/subscriptions/{id}/attributes

Wrapped elsewhere in this package: createContact, upsertContact, upsertContactAttributes, listContactPreferences / upsertContactPreferences (via contacts.getPreferences / setPreferences), putContactChannelOptOut (via contacts.optOut / optIn), createMessage (via push.send / push.broadcast / push.drafts.create), listMessages / updateDraft / sendDraft / archiveDraft (via push.drafts.*), getMessage / cancelMessage (via push.get / push.cancel), createCampaign (via push.multiSend), getCampaign / cancelCampaign (via campaigns.get / cancel), uploadMedia (via push.uploadMedia), previewTargeting (via push.previewAudience), and all six Segment operations.

request() escape hatch

Use comraid.request() for any public path without a dedicated helper. Prefer push.previewAudience for targeting preview.

On this page

InstallGetting startedMethod referenceConfigure / clientnew ComRaid(options)comraid.createIdempotencyKey()identity.createToken(externalUserId, options)comraid.request(options)FetchTransportSend (push Notifications)comraid.push.send(input) → OpenAPI createMessage (Single send)comraid.push.broadcast(input) → OpenAPI createMessage (Broadcast)comraid.push.multiSend(input) → OpenAPI createCampaigncomraid.push.uploadMedia(file, options) → OpenAPI uploadMediacomraid.push.get(messageId, options?) → OpenAPI getMessagecomraid.push.cancel(messageId, options?) → OpenAPI cancelMessagecomraid.push.previewAudience(input) → OpenAPI previewTargetingDraftscomraid.push.drafts.create(input) → OpenAPI createMessage (Draft)comraid.push.drafts.update(messageId, input) → OpenAPI updateDraftcomraid.push.drafts.list(options?) → OpenAPI listMessagescomraid.push.drafts.send(messageId, options?) → OpenAPI sendDraftcomraid.push.drafts.archive(messageId, options?) → OpenAPI archiveDraftCampaignscomraid.campaigns.get(campaignId, options?) → OpenAPI getCampaigncomraid.campaigns.cancel(campaignId, options?) → OpenAPI cancelCampaignContacts and attributescomraid.contacts.create(input) → OpenAPI createContactcomraid.contacts.upsert(externalUserId, input?) → OpenAPI upsertContactcomraid.contacts.optOut(externalUserId, channel, options?) → OpenAPI putContactChannelOptOutcomraid.contacts.optIn(externalUserId, channel, options?) → OpenAPI putContactChannelOptOutcomraid.contacts.getPreferences(externalUserId, options?) → OpenAPI listContactPreferencescomraid.contacts.setPreferences(externalUserId, input) → OpenAPI upsertContactPreferencescomraid.contacts.endpoints.register(input) → OpenAPI registerEndpointcomraid.contacts.endpoints.list(externalUserId, options?) → OpenAPI listContactEndpointscomraid.contacts.endpoints.deactivate(endpointId, options?) → OpenAPI deactivateEndpointcomraid.attributes.upsert(externalUserId, input) → OpenAPI upsertContactAttributesSegmentscomraid.segments.list(options?) → OpenAPI listSegmentscomraid.segments.create(input) → OpenAPI createSegmentcomraid.segments.get(segmentId, options?) → OpenAPI getSegmentcomraid.segments.update(segmentId, input) → OpenAPI updateSegmentcomraid.segments.archive(segmentId, options?) → OpenAPI archiveSegmentcomraid.segments.restore(segmentId, options?) → OpenAPI restoreSegmentErrorsNot wrappedrequest() escape hatch