magicbell
Version:
MagicBell API wrapper
735 lines (734 loc) • 37.4 kB
TypeScript
export declare const CreateBroadcastsResponseSchema: {
readonly title: "CreateBroadcastsResponseSchema";
readonly description: "A broadcast is a precursor to a notification. When you specify multiple recipients, MagicBell creates a notification for each recipient and delivers it to them based on their preferences.";
readonly type: "object";
readonly required: readonly ["id", "title", "created_at", "recipients", "status"];
readonly additionalProperties: false;
readonly properties: {
readonly id: {
readonly type: "string";
readonly description: "The unique id for this broadcast.";
readonly readOnly: true;
};
readonly title: {
readonly type: "string";
readonly description: "Title of the broadcast.";
readonly nullable: false;
readonly maxLength: 255;
};
readonly content: {
readonly type: "string";
readonly description: "Content of the broadcast.";
readonly nullable: true;
readonly maxLength: 4194304;
};
readonly action_url: {
readonly type: "string";
readonly format: "uri";
readonly description: "A URL to redirect the user to when they click the notification in their notification inbox.";
readonly nullable: true;
readonly maxLength: 2048;
};
readonly category: {
readonly type: "string";
readonly description: "Category the notification belongs to. This is useful to allow users to set their preferences.";
readonly nullable: true;
readonly maxLength: 100;
};
readonly topic: {
readonly type: "string";
readonly description: "Topic the notification belongs to. This is useful for creating threads or offering topic level unsubscriptions.";
readonly nullable: true;
readonly maxLength: 100;
};
readonly custom_attributes: {
readonly type: "object";
readonly description: "Nested key-value attributes that can be used for rendering in templates in MagicBell or third-party providers. Limited to 256KB - please see Overrides for another way to send channel specific data.";
readonly nullable: true;
readonly additionalProperties: true;
};
readonly sent_at: {
readonly type: "string";
readonly format: "date-time";
readonly description: "The timestamp when the notification was sent to its recipients.";
readonly readOnly: true;
readonly nullable: true;
};
readonly created_at: {
readonly type: "string";
readonly format: "date-time";
readonly description: "The timestamp when the notification was created.";
readonly readOnly: true;
};
readonly recipients: {
readonly type: "array";
readonly description: "Users to send the notification to. You can specify up to 1000 users in the request body. Recipient objects need to have at least one of the following attributes: email, external_id, matches, topic.";
readonly nullable: false;
readonly minItems: 1;
readonly maxItems: 1000;
readonly items: {
readonly anyOf: readonly [{
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["topic"];
readonly properties: {
readonly topic: {
readonly type: "object";
readonly description: "The topic to deliver to.";
readonly nullable: false;
readonly required: readonly ["subscribers"];
readonly additionalProperties: false;
readonly properties: {
readonly subscribers: {
readonly type: "boolean";
readonly description: "Setting this property triggers delivery to topic subscribers, respecting their unsubscriptions.";
readonly nullable: false;
};
};
};
};
}, {
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["matches"];
readonly properties: {
readonly matches: {
readonly type: "string";
readonly description: "An expression to match users by their stored attributes. Set it to `*` to match all users.";
readonly nullable: false;
};
};
}, {
readonly type: "object";
readonly additionalProperties: true;
readonly required: readonly ["email"];
readonly properties: {
readonly email: {
readonly type: "string";
readonly format: "email";
readonly description: "The identifying email of the recipient.";
readonly nullable: false;
};
};
}, {
readonly type: "object";
readonly additionalProperties: true;
readonly required: readonly ["external_id"];
readonly properties: {
readonly external_id: {
readonly type: "string";
readonly description: "The identifying external_id of the recipient.";
readonly nullable: false;
};
};
}];
};
};
readonly overrides: {
readonly type: "object";
readonly additionalProperties: true;
};
readonly status: {
readonly type: "object";
readonly required: readonly ["status", "summary", "errors"];
readonly additionalProperties: true;
readonly properties: {
readonly status: {
readonly type: "string";
readonly enum: readonly ["enqueued", "processing", "processed"];
readonly readOnly: true;
readonly nullable: false;
};
readonly summary: {
readonly type: "object";
readonly required: readonly ["total", "failures"];
readonly additionalProperties: false;
readonly properties: {
readonly total: {
readonly type: "integer";
readonly description: "The number of recipients that the broadcast was sent to.";
readonly readOnly: true;
readonly nullable: false;
};
readonly failures: {
readonly type: "integer";
readonly description: "The number of failures while processing the broadcast.";
readonly readOnly: true;
readonly nullable: false;
};
};
};
readonly errors: {
readonly type: "array";
readonly items: {
readonly type: "object";
readonly additionalProperties: true;
};
};
};
};
};
};
export declare const CreateBroadcastsPayloadSchema: {
readonly title: "CreateBroadcastsPayloadSchema";
readonly type: "object";
readonly required: readonly ["title", "recipients"];
readonly additionalProperties: false;
readonly properties: {
readonly title: {
readonly type: "string";
readonly description: "Title of the broadcast.";
readonly nullable: false;
readonly maxLength: 255;
};
readonly content: {
readonly type: "string";
readonly description: "Content of the broadcast.";
readonly nullable: true;
readonly maxLength: 4194304;
};
readonly action_url: {
readonly type: "string";
readonly format: "uri";
readonly description: "A URL to redirect the user to when they click the notification in their notification inbox.";
readonly nullable: true;
readonly maxLength: 2048;
};
readonly recipients: {
readonly description: "Users to send the notification to. You can specify up to 1000 users in the request body.";
readonly nullable: false;
readonly minItems: 1;
readonly maxItems: 1000;
readonly type: "array";
readonly items: {
readonly type: "object";
readonly description: "A recipient is a user, a segment (specified by matches), or a topic. For guidance on selecting a primary identifier, see https://www.magicbell.com/docs/choosing-an-identifier";
readonly additionalProperties: true;
readonly properties: {
readonly email: {
readonly type: "string";
readonly description: "The user's email";
readonly nullable: true;
};
readonly external_id: {
readonly type: "string";
readonly description: "The unique identifier from your database for the recipient.";
readonly nullable: true;
};
readonly matches: {
readonly type: "string";
readonly description: "An SQL-like expression to match users by their stored attributes. Set it to \"*\" to send a notification to all users.";
};
readonly topic: {
readonly type: "object";
readonly description: "The topic to send the notification to. It can be a user, a segment or a group.";
};
};
};
};
readonly custom_attributes: {
readonly type: "object";
readonly description: "Nested key-value attributes that can be used for rendering in templates in MagicBell or third-party providers. Limited to 256KB - please see Overrides for another way to send channel specific data.";
readonly nullable: true;
readonly additionalProperties: true;
};
readonly category: {
readonly type: "string";
readonly description: "Category the notification belongs to. This is useful to allow users to set their preferences.";
readonly nullable: true;
readonly maxLength: 100;
};
readonly topic: {
readonly type: "string";
readonly description: "Topic the notification belongs to. This is useful for creating threads or offering topic level unsubscriptions.";
readonly nullable: true;
readonly maxLength: 100;
};
readonly overrides: {
readonly type: "object";
readonly description: "Optional overrides to configure notifications per target destination.";
readonly nullable: true;
readonly properties: {
readonly channels: {
readonly type: "object";
readonly description: "Overrides for specific channels";
readonly properties: {
readonly in_app: {
readonly type: "object";
readonly properties: {
readonly title: {
readonly type: "string";
readonly description: "Overriden title for this channel";
};
readonly content: {
readonly type: "string";
readonly description: "Overriden content for this channel";
};
readonly action_url: {
readonly type: "string";
readonly description: "Overriden action_url for this channel";
};
};
};
readonly email: {
readonly type: "object";
readonly properties: {
readonly title: {
readonly type: "string";
readonly description: "Overriden title for this channel";
};
readonly content: {
readonly type: "string";
readonly description: "Overriden content for this channel";
};
readonly action_url: {
readonly type: "string";
readonly description: "Overriden action_url for this channel";
};
};
};
readonly web_push: {
readonly type: "object";
readonly properties: {
readonly title: {
readonly type: "string";
readonly description: "Overriden title for this channel";
};
readonly content: {
readonly type: "string";
readonly description: "Overriden content for this channel";
};
readonly action_url: {
readonly type: "string";
readonly description: "Overriden action_url for this channel";
};
};
};
readonly mobile_push: {
readonly type: "object";
readonly properties: {
readonly title: {
readonly type: "string";
readonly description: "Overriden title for this channel";
};
readonly content: {
readonly type: "string";
readonly description: "Overriden content for this channel";
};
readonly action_url: {
readonly type: "string";
readonly description: "Overriden action_url for this channel";
};
};
};
};
};
readonly providers: {
readonly type: "object";
readonly description: "Overrides for specific providers (Sendgrid, Postmark, APNs, etc)";
readonly properties: {
readonly sendgrid: {
readonly type: "object";
readonly description: "Set of key-value pairs that you can pass on to Sendgrid. Applied only if it is configured for your project.";
};
readonly mailgun: {
readonly type: "object";
readonly description: "Set of key-value pairs that you can pass on to Mailgun. Applied only if it is configured for your project.";
};
readonly postmark: {
readonly type: "object";
readonly description: "Set of key-value pairs that you can pass on to Postmark. Applied only if it is configured for your project.";
};
readonly ios: {
readonly type: "object";
readonly description: "Set of key-value pairs that you can pass on to APNs. Applied only if it is configured for your project.";
};
readonly android: {
readonly type: "object";
readonly description: "Set of key-value pairs that you can pass on to FCM. Applied only if it is configured for your project.";
};
};
};
};
};
};
};
export declare const ListBroadcastsResponseSchema: {
readonly title: "ListBroadcastsResponseSchema";
readonly type: "object";
readonly required: readonly ["broadcasts", "current_page", "per_page"];
readonly properties: {
readonly per_page: {
readonly type: "integer";
readonly description: "Number of entities per page.";
readonly readOnly: true;
};
readonly current_page: {
readonly type: "integer";
readonly description: "Number of the page returned.";
readonly readOnly: true;
};
readonly broadcasts: {
readonly type: "array";
readonly items: {
readonly type: "object";
readonly description: "A broadcast is a precursor to a notification. When you specify multiple recipients, MagicBell creates a notification for each recipient and delivers it to them based on their preferences.";
readonly required: readonly ["id", "title", "created_at", "recipients", "status"];
readonly additionalProperties: false;
readonly properties: {
readonly id: {
readonly type: "string";
readonly description: "The unique id for this broadcast.";
readonly readOnly: true;
};
readonly title: {
readonly type: "string";
readonly description: "Title of the broadcast.";
readonly nullable: false;
readonly maxLength: 255;
};
readonly content: {
readonly type: "string";
readonly description: "Content of the broadcast.";
readonly nullable: true;
readonly maxLength: 4194304;
};
readonly action_url: {
readonly type: "string";
readonly format: "uri";
readonly description: "A URL to redirect the user to when they click the notification in their notification inbox.";
readonly nullable: true;
readonly maxLength: 2048;
};
readonly category: {
readonly type: "string";
readonly description: "Category the notification belongs to. This is useful to allow users to set their preferences.";
readonly nullable: true;
readonly maxLength: 100;
};
readonly topic: {
readonly type: "string";
readonly description: "Topic the notification belongs to. This is useful for creating threads or offering topic level unsubscriptions.";
readonly nullable: true;
readonly maxLength: 100;
};
readonly custom_attributes: {
readonly type: "object";
readonly description: "Nested key-value attributes that can be used for rendering in templates in MagicBell or third-party providers. Limited to 256KB - please see Overrides for another way to send channel specific data.";
readonly nullable: true;
readonly additionalProperties: true;
};
readonly sent_at: {
readonly type: "string";
readonly format: "date-time";
readonly description: "The timestamp when the notification was sent to its recipients.";
readonly readOnly: true;
readonly nullable: true;
};
readonly created_at: {
readonly type: "string";
readonly format: "date-time";
readonly description: "The timestamp when the notification was created.";
readonly readOnly: true;
};
readonly recipients: {
readonly type: "array";
readonly description: "Users to send the notification to. You can specify up to 1000 users in the request body. Recipient objects need to have at least one of the following attributes: email, external_id, matches, topic.";
readonly nullable: false;
readonly minItems: 1;
readonly maxItems: 1000;
readonly items: {
readonly anyOf: readonly [{
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["topic"];
readonly properties: {
readonly topic: {
readonly type: "object";
readonly description: "The topic to deliver to.";
readonly nullable: false;
readonly required: readonly ["subscribers"];
readonly additionalProperties: false;
readonly properties: {
readonly subscribers: {
readonly type: "boolean";
readonly description: "Setting this property triggers delivery to topic subscribers, respecting their unsubscriptions.";
readonly nullable: false;
};
};
};
};
}, {
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["matches"];
readonly properties: {
readonly matches: {
readonly type: "string";
readonly description: "An expression to match users by their stored attributes. Set it to `*` to match all users.";
readonly nullable: false;
};
};
}, {
readonly type: "object";
readonly additionalProperties: true;
readonly required: readonly ["email"];
readonly properties: {
readonly email: {
readonly type: "string";
readonly format: "email";
readonly description: "The identifying email of the recipient.";
readonly nullable: false;
};
};
}, {
readonly type: "object";
readonly additionalProperties: true;
readonly required: readonly ["external_id"];
readonly properties: {
readonly external_id: {
readonly type: "string";
readonly description: "The identifying external_id of the recipient.";
readonly nullable: false;
};
};
}];
};
};
readonly overrides: {
readonly type: "object";
readonly additionalProperties: true;
};
readonly status: {
readonly type: "object";
readonly required: readonly ["status", "summary", "errors"];
readonly additionalProperties: true;
readonly properties: {
readonly status: {
readonly type: "string";
readonly enum: readonly ["enqueued", "processing", "processed"];
readonly readOnly: true;
readonly nullable: false;
};
readonly summary: {
readonly type: "object";
readonly required: readonly ["total", "failures"];
readonly additionalProperties: false;
readonly properties: {
readonly total: {
readonly type: "integer";
readonly description: "The number of recipients that the broadcast was sent to.";
readonly readOnly: true;
readonly nullable: false;
};
readonly failures: {
readonly type: "integer";
readonly description: "The number of failures while processing the broadcast.";
readonly readOnly: true;
readonly nullable: false;
};
};
};
readonly errors: {
readonly type: "array";
readonly items: {
readonly type: "object";
readonly additionalProperties: true;
};
};
};
};
};
};
};
};
};
export declare const ListBroadcastsPayloadSchema: {
readonly title: "ListBroadcastsPayloadSchema";
readonly type: "object";
readonly properties: {
readonly page: {
readonly title: "page";
readonly description: "The page number of the paginated response. Defaults to 1.";
readonly type: "integer";
};
readonly per_page: {
readonly title: "per_page";
readonly description: "The number of items per page. Defaults to 20.";
readonly type: "integer";
};
};
readonly additionalProperties: false;
readonly required: readonly [];
};
export declare const GetBroadcastsResponseSchema: {
readonly title: "GetBroadcastsResponseSchema";
readonly description: "A broadcast is a precursor to a notification. When you specify multiple recipients, MagicBell creates a notification for each recipient and delivers it to them based on their preferences.";
readonly type: "object";
readonly required: readonly ["id", "title", "created_at", "recipients", "status"];
readonly additionalProperties: false;
readonly properties: {
readonly id: {
readonly type: "string";
readonly description: "The unique id for this broadcast.";
readonly readOnly: true;
};
readonly title: {
readonly type: "string";
readonly description: "Title of the broadcast.";
readonly nullable: false;
readonly maxLength: 255;
};
readonly content: {
readonly type: "string";
readonly description: "Content of the broadcast.";
readonly nullable: true;
readonly maxLength: 4194304;
};
readonly action_url: {
readonly type: "string";
readonly format: "uri";
readonly description: "A URL to redirect the user to when they click the notification in their notification inbox.";
readonly nullable: true;
readonly maxLength: 2048;
};
readonly category: {
readonly type: "string";
readonly description: "Category the notification belongs to. This is useful to allow users to set their preferences.";
readonly nullable: true;
readonly maxLength: 100;
};
readonly topic: {
readonly type: "string";
readonly description: "Topic the notification belongs to. This is useful for creating threads or offering topic level unsubscriptions.";
readonly nullable: true;
readonly maxLength: 100;
};
readonly custom_attributes: {
readonly type: "object";
readonly description: "Nested key-value attributes that can be used for rendering in templates in MagicBell or third-party providers. Limited to 256KB - please see Overrides for another way to send channel specific data.";
readonly nullable: true;
readonly additionalProperties: true;
};
readonly sent_at: {
readonly type: "string";
readonly format: "date-time";
readonly description: "The timestamp when the notification was sent to its recipients.";
readonly readOnly: true;
readonly nullable: true;
};
readonly created_at: {
readonly type: "string";
readonly format: "date-time";
readonly description: "The timestamp when the notification was created.";
readonly readOnly: true;
};
readonly recipients: {
readonly type: "array";
readonly description: "Users to send the notification to. You can specify up to 1000 users in the request body. Recipient objects need to have at least one of the following attributes: email, external_id, matches, topic.";
readonly nullable: false;
readonly minItems: 1;
readonly maxItems: 1000;
readonly items: {
readonly anyOf: readonly [{
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["topic"];
readonly properties: {
readonly topic: {
readonly type: "object";
readonly description: "The topic to deliver to.";
readonly nullable: false;
readonly required: readonly ["subscribers"];
readonly additionalProperties: false;
readonly properties: {
readonly subscribers: {
readonly type: "boolean";
readonly description: "Setting this property triggers delivery to topic subscribers, respecting their unsubscriptions.";
readonly nullable: false;
};
};
};
};
}, {
readonly type: "object";
readonly additionalProperties: false;
readonly required: readonly ["matches"];
readonly properties: {
readonly matches: {
readonly type: "string";
readonly description: "An expression to match users by their stored attributes. Set it to `*` to match all users.";
readonly nullable: false;
};
};
}, {
readonly type: "object";
readonly additionalProperties: true;
readonly required: readonly ["email"];
readonly properties: {
readonly email: {
readonly type: "string";
readonly format: "email";
readonly description: "The identifying email of the recipient.";
readonly nullable: false;
};
};
}, {
readonly type: "object";
readonly additionalProperties: true;
readonly required: readonly ["external_id"];
readonly properties: {
readonly external_id: {
readonly type: "string";
readonly description: "The identifying external_id of the recipient.";
readonly nullable: false;
};
};
}];
};
};
readonly overrides: {
readonly type: "object";
readonly additionalProperties: true;
};
readonly status: {
readonly type: "object";
readonly required: readonly ["status", "summary", "errors"];
readonly additionalProperties: true;
readonly properties: {
readonly status: {
readonly type: "string";
readonly enum: readonly ["enqueued", "processing", "processed"];
readonly readOnly: true;
readonly nullable: false;
};
readonly summary: {
readonly type: "object";
readonly required: readonly ["total", "failures"];
readonly additionalProperties: false;
readonly properties: {
readonly total: {
readonly type: "integer";
readonly description: "The number of recipients that the broadcast was sent to.";
readonly readOnly: true;
readonly nullable: false;
};
readonly failures: {
readonly type: "integer";
readonly description: "The number of failures while processing the broadcast.";
readonly readOnly: true;
readonly nullable: false;
};
};
};
readonly errors: {
readonly type: "array";
readonly items: {
readonly type: "object";
readonly additionalProperties: true;
};
};
};
};
};
};