Class Braze

Constructors

  • Parameters

    • apiUrl: string

      Braze REST endpoint.

    • apiKey: string

      Braze API key.

    Returns Braze

Properties

campaigns: {
    list: (
        parameters?: CampaignsListParameters,
    ) => Promise<CampaignsListResponse>;
    trigger: {
        schedule: {
            create: (
                body: CampaignsTriggerScheduleCreateObject,
            ) => Promise<CampaignsTriggerScheduleCreateResponse>;
            delete: (
                body: CampaignsTriggerScheduleDeleteObject,
            ) => Promise<ServerResponse>;
            update: (
                body: CampaignsTriggerScheduleUpdateObject,
            ) => Promise<ServerResponse>;
        };
        send: (
            body: CampaignsTriggerSendObject,
        ) => Promise<{ dispatch_id: string; message: string }>;
    };
} = ...

Type declaration

canvas: {
    list: (parameters?: CanvasListParameters) => Promise<CanvasListResponse>;
    trigger: {
        schedule: {
            create: (
                body: CanvasTriggerScheduleCreateObject,
            ) => Promise<CanvasTriggerScheduleCreatResponse>;
            delete: (
                body: CanvasTriggerScheduleDeleteObject,
            ) => Promise<ServerResponse>;
            update: (
                body: CanvasTriggerScheduleUpdateObject,
            ) => Promise<ServerResponse>;
        };
        send: (
            body: CanvasTriggerSendObject,
        ) => Promise<{ dispatch_id: string; message: string }>;
    };
} = ...

Type declaration

catalogs: {
    synchronous: {
        item: <T extends CatalogListItem<Record<string, unknown>>>(
            body: CatalogListItemBody,
        ) => Promise<CatalogListItemResponse<T>>;
        items: <T extends CatalogListItem<Record<string, unknown>>>(
            body: CatalogListItemsBody,
        ) => AsyncGenerator<T>;
        list: () => Promise<CatalogListResponse>;
    };
} = ...
email: {
    blacklist: (body: EmailBlacklistObject) => Promise<ServerResponse>;
    bounce: {
        remove: (body: EmailBounceRemoveObject) => Promise<ServerResponse>;
    };
    spam: { remove: (body: EmailSpamRemoveObject) => Promise<ServerResponse> };
} = ...

Type declaration

messages: {
    schedule: {
        create: (
            body: MessagesScheduleCreateObject,
        ) => Promise<
            { dispatch_id: string; message: string; schedule_id: string },
        >;
        delete: (body: MessagesScheduleDeleteObject) => Promise<ServerResponse>;
        update: (body: MessagesScheduleUpdateObject) => Promise<ServerResponse>;
    };
    scheduled_broadcasts: (
        body: ScheduledBroadcastsObject,
    ) => Promise<ScheduledBroadcastsResponse>;
    send: (
        body: MessagesSendObject,
    ) => Promise<{ dispatch_id: string; message: string }>;
} = ...

Type declaration

segments: {
    analytics: (
        parameters: SegmentsAnalyticsParameters,
    ) => Promise<SegmentsAnalyticsResponse>;
    details: (
        parameters: SegmentsDetailsParameters,
    ) => Promise<SegmentsDetailsResponse>;
    list: (
        parameters?: SegmentsListParameters,
    ) => Promise<SegmentsListResponse>;
} = ...

Type declaration

  • analytics: (parameters: SegmentsAnalyticsParameters) => Promise<SegmentsAnalyticsResponse>

    GET /segments/data_series

  • details: (parameters: SegmentsDetailsParameters) => Promise<SegmentsDetailsResponse>

    GET /segments/details

  • list: (parameters?: SegmentsListParameters) => Promise<SegmentsListResponse>

    GET /segments/list

sends: {
    id: {
        create: (
            body: SendsIdCreateObject,
        ) => Promise<{ message: string; send_id: string }>;
    };
} = ...
subscription: {
    status: {
        get: (
            body: SubscriptionStatusGetObject,
        ) => Promise<
            {
                message: string;
                status: Record<string, "Subscribed" | "Unsubscribed" | "Unknown">;
            },
        >;
        set: (body: SubscriptionStatusSetObject) => Promise<{ message: string }>;
    };
    user: {
        status: (
            body: SubscriptionUserStatusObject,
        ) => Promise<SubscriptionUserStatusResponse>;
    };
} = ...
templates: {
    content_blocks: {
        create: (
            body: CreateContentBlockBody,
        ) => Promise<PostContentBlockResponse>;
        get: (body: ContentBlockBody) => Promise<ContentBlockResponse>;
        list: (body: ContentBlockListBody) => Promise<ContentBlockListResponse>;
        update: (
            body: UpdateContentBlockBody,
        ) => Promise<PostContentBlockResponse>;
    };
    email_templates: {
        create: (
            body: CreateEmailTemplateBody,
        ) => Promise<PostEmailTemplateResponse>;
        get: (body: EmailTemplateBody) => Promise<EmailTemplateResponse>;
        list: (body: EmailTemplateListBody) => Promise<EmailTemplateListResponse>;
        update: (
            body: UpdateEmailTemplateBody,
        ) => Promise<PostEmailTemplateResponse>;
    };
} = ...
transactional: {
    v1: {
        campaigns: {
            send: (
                campaignId: string,
                body: TransactionalV1CampaignsSendObject,
            ) => Promise<CampaignSendResponse>;
        };
    };
} = ...
users: {
    alias: {
        new: (body: UsersAliasObject) => Promise<ServerResponse>;
        update: (body: UserAliasUpdates) => Promise<ServerResponse>;
    };
    delete: (body: UsersDeleteObject) => Promise<UsersDeleteResponse>;
    export: {
        global_control_group: (
            body: UsersExportGlobalControlGroupObject,
        ) => Promise<UsersExportGlobalControlGroupResponse>;
        ids: (body: UsersExportIdsObject) => Promise<UsersExportIdsResponse>;
        segment: (
            body: UsersExportSegmentObject,
        ) => Promise<UsersExportSegmentResponse>;
    };
    external_ids: {
        remove: (
            body: UsersExternalIdsRemoveObject,
        ) => Promise<
            { message: string; removal_errors: string[]; removed_ids: string[] },
        >;
        rename: (
            body: UsersExternalIdsRenameObject,
        ) => Promise<
            { external_ids: string[]; message: string; rename_errors: string[] },
        >;
    };
    identify: (body: UsersIdentifyObject) => Promise<ServerResponse>;
    merge: (body: UsersMergeObject) => Promise<ServerResponse>;
    track: (
        body: UsersTrackObject,
        bulk?: boolean,
    ) => Promise<
        {
            attributes_processed?: number;
            errors?: object[];
            events_processed?: number;
            message: string;
            purchases_processed?: number;
        },
    >;
} = ...

Type declaration

v2: {
    subscription: {
        status: {
            set: (
                body: V2SubscriptionStatusSetObject,
            ) => Promise<{ message: string }>;
        };
    };
} = ...

Type declaration