Python SDK

Setup & Initialization

  1. Install Package:
pip install pingram-python
  1. Import:
from pingram import Pingram, PingramRegion
  1. Initialize and use as async context manager:
import asyncio

async def main():
    async with Pingram(api_key="pingram_sk_...") as client:
        # Use client methods here
        pass

asyncio.run(main())
NameTypeDescription
api_key*stringYour Pingram API key. You can get it from your dashboard under Environments.
regionstringOptional. Region: "us" (default), "eu", or "ca".
base_urlstringOptional. Override the base URL directly. Use https://api.ca.pingram.io for the Canada region, and https://api.eu.pingram.io for the EU region.

* required

Region specific example:

import asyncio

async def main():
    async with Pingram(api_key="pingram_sk_...", region="eu") as client:
        # Use client methods here
        pass

asyncio.run(main())

Or using base_url directly:

import asyncio

async def main():
    async with Pingram(api_key="pingram_sk_...", base_url="https://api.eu.pingram.io") as client:
        # Use client methods here
        pass

asyncio.run(main())

Send

send()

Send a notification

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    sender_post_body = SenderPostBody()
    response = await client.send(sender_post_body)
    print(response)

Parameters

NameTypeDescriptionNotes
sender_post_bodySenderPostBodySee Request Body Properties below

Request Body Properties

NameTypeDescription
typestringID of the notification type (e.g. “welcome_email”). Creates a new notification if it does not exist.
toobjectRecipient user. Provide id, email, or number to identify the user.
to.idstringUnique user identifier. Required.
to.emailstringUser’s email address for email notifications.
to.numberstringUser’s phone number for SMS/call notifications.
to.pushTokensobject[]Mobile push tokens (FCM, APN) for push notifications.
to.pushTokens[].type”FCM” | “APN”(required)
to.pushTokens[].tokenstring(required)
to.pushTokens[].deviceobject(required)
to.pushTokens[].device.app_idstring
to.pushTokens[].device.ad_idstring
to.pushTokens[].device.device_idstring(required)
to.pushTokens[].device.platformstring
to.pushTokens[].device.manufacturerstring
to.pushTokens[].device.modelstring
to.pushTokens[].environmentstringused by APN to differentiate between sandbox and production builds (sandbox/undefined or production)
to.webPushTokensobject[]Web push subscription config from the browser.
to.webPushTokens[].subobject(required) Configuration for a Push Subscription. This can be obtained on the frontend by calling serviceWorkerRegistration.pushManager.subscribe(). The expected format is the same output as JSON.stringify’ing a PushSubscription in the browser.
to.webPushTokens[].sub.endpointstring(required)
to.webPushTokens[].sub.keysobject(required)
to.webPushTokens[].sub.keys.p256dhstring(required)
to.webPushTokens[].sub.keys.authstring(required)
to.timezonestringUser’s timezone (e.g. “America/New_York”) for scheduling.
to.slackChannelstringThe destination channel of slack notifications sent to this user. Can be either of the following: - Channel name, e.g. “test” - Channel name with # prefix, e.g. “#test” - Channel ID, e.g. “C1234567890” - User ID for DM, e.g. “U1234567890” - Username with @ prefix, e.g. “@test”
to.slackTokenobject
to.slackToken.access_tokenstring
to.slackToken.app_idstring
to.slackToken.authed_userobject
to.slackToken.authed_user.access_tokenstring
to.slackToken.authed_user.expires_innumber
to.slackToken.authed_user.idstring
to.slackToken.authed_user.refresh_tokenstring
to.slackToken.authed_user.scopestring
to.slackToken.authed_user.token_typestring
to.slackToken.bot_user_idstring
to.slackToken.enterpriseobject
to.slackToken.enterprise.idstring
to.slackToken.enterprise.namestring
to.slackToken.errorstring
to.slackToken.expires_innumber
to.slackToken.incoming_webhookobject
to.slackToken.incoming_webhook.channelstring
to.slackToken.incoming_webhook.channel_idstring
to.slackToken.incoming_webhook.configuration_urlstring
to.slackToken.incoming_webhook.urlstring
to.slackToken.is_enterprise_installboolean
to.slackToken.neededstring
to.slackToken.okboolean(required)
to.slackToken.providedstring
to.slackToken.refresh_tokenstring
to.slackToken.scopestring
to.slackToken.teamobject
to.slackToken.team.idstring
to.slackToken.team.namestring
to.slackToken.token_typestring
to.slackToken.warningstring
to.slackToken.response_metadataobject
to.slackToken.response_metadata.warningsstring[]
to.slackToken.response_metadata.next_cursorstring
to.slackToken.response_metadata.scopesstring[]
to.slackToken.response_metadata.acceptedScopesstring[]
to.slackToken.response_metadata.retryAfternumber
to.slackToken.response_metadata.messagesstring[]
to.lastSeenTimestringLast activity timestamp. Updated automatically. Read-only.
to.updatedAtstringLast update timestamp. Read-only.
to.createdAtstringCreation timestamp. Read-only.
to.emailSuppressionStatusobjectBounce or complaint status if email was suppressed. Read-only.
to.emailSuppressionStatus.reason”Bounce” | “Complaint”(required)
to.emailSuppressionStatus.detailsobject(required)
forceChannels(“EMAIL” | “INAPP_WEB” | “SMS” | “CALL” | “PUSH” | “WEB_PUSH” | “SLACK”)[]Override which channels to send to (e.g. [“EMAIL”, “SMS”]). Bypasses notification channel config.
parametersRecord<string, any>Key-value pairs for template merge tags. Replaces placeholders like {{firstName}} in templates.
secondaryIdstringOptional sub-notification identifier for grouping or tracking.
templateIdstringSpecific template ID to use. If omitted, uses the default template for each channel.
subNotificationIdstringSub-notification identifier (e.g. for grouping related notifications).
optionsobjectPer-channel overrides for send options (email, APN, FCM).
options.emailobjectEmail-specific overrides.
options.email.replyToAddressesstring[]Reply-to addresses for the email.
options.email.ccAddressesstring[]CC recipients.
options.email.bccAddressesstring[]BCC recipients.
options.email.fromAddressstringOverride sender email address.
options.email.fromNamestringOverride sender display name.
options.email.attachments(object | object)[]File attachments (by URL or inline base64 content).
options.email.conditionstringConditional expression for when to send (e.g. merge tag logic).
options.apnobjectApple Push Notification (APN) overrides.
options.apn.expirynumberSeconds until the notification expires.
options.apn.prioritynumberDelivery priority (10 = immediate, 5 = power-saving).
options.apn.collapseIdstringGroup notifications with the same ID (replaces previous).
options.apn.threadIdstringThread identifier for grouping notifications.
options.apn.badgenumberBadge count on app icon.
options.apn.soundstringSound file name.
options.apn.contentAvailablebooleanSilent background notification (no alert).
options.fcmobjectFirebase Cloud Messaging (FCM) overrides.
options.fcm.androidobjectAndroid-specific FCM options.
options.fcm.android.collapseKeystringCollapse key for grouping messages.
options.fcm.android.priority”high” | “normal”Delivery priority.
options.fcm.android.ttlnumberTime to live in seconds.
options.fcm.android.restrictedPackageNamestringRestrict delivery to a specific package.
schedulestring
emailobjectInline email content (subject, html). Use when not using templates.
email.subjectstring(required) Email subject line.
email.htmlstring(required) HTML body content.
email.previewTextstringPreview/snippet text shown in inbox.
email.senderNamestringDisplay name of sender.
email.senderEmailstringSender email address.
inappobjectInline in-app content (title, url, image).
inapp.titlestring(required) Notification title.
inapp.urlstringURL to open when clicked.
inapp.imagestringImage URL.
smsobjectInline SMS content (message, autoReply).
sms.messagestringSMS body text.
sms.autoReplyobject
sms.autoReply.messagestring(required) Auto-reply message to send when user texts in.
callobjectInline call content (message).
call.messagestring(required) Text to speak (TTS).
web_pushobjectInline web push content (title, message, icon, url).
web_push.titlestring(required) Notification title.
web_push.messagestring(required) Body text.
web_push.iconstringIcon URL.
web_push.urlstringURL to open when clicked.
mobile_pushobjectInline mobile push content (title, message).
mobile_push.titlestring(required) Notification title.
mobile_push.messagestring(required) Body text.
slackobjectInline Slack content (text, blocks, etc.).
slack.textstring(required) Fallback plain text (required when using blocks).
slack.blocksRecord<string, any>[]Slack Block Kit blocks.
slack.usernamestringOverride bot username.
slack.iconstringIcon: emoji (e.g. “:smile:”) or URL. Default: bot’s icon.
slack.thread_tsstringParent message ts to post in a thread.
slack.reply_broadcastbooleanWhen true with thread_ts, broadcasts reply to channel. Default: false.
slack.parse”full” | “none”URL parsing: “full” (clickable links) or “none”. Default: “none”.
slack.link_namesbooleanConvert channel and username refs to Slack links. Default: false.
slack.mrkdwnbooleanEnable Slack markup (bold, italic, code). Default: true.
slack.unfurl_linksbooleanUnfurl link previews. Default: true.
slack.unfurl_mediabooleanUnfurl media previews. Default: true.
slack.metadataobjectSlack message metadata with optional work object entities. Combines standard Slack message metadata fields with an array of entity objects.
slack.metadata.entitiesobject[]An array of work object entities.
slack.metadata.entities[].entity_typestring(required) Entity type (e.g., ‘slack#/entities/task’, ‘slack#/entities/file’).
slack.metadata.entities[].entity_payloadRecord<string, any>(required) Schema for the given entity type.
slack.metadata.entities[].external_refobject(required) Reference used to identify an entity within the developer’s system.
slack.metadata.entities[].external_ref.idstring(required)
slack.metadata.entities[].external_ref.typestring
slack.metadata.entities[].urlstring(required) URL used to identify an entity within the developer’s system.
slack.metadata.entities[].app_unfurl_urlstringThe exact URL posted in the source message. Required in metadata passed to chat.unfurl.
slack.metadata.event_typestringA human readable alphanumeric string representing your application’s metadata event.
slack.metadata.event_payloadRecord<string, any>A free-form object containing whatever data your application wishes to attach to messages.

Addresses

addresses_create_address()

Create a new email address for inbound/outbound purposes. Each account can have one builtin address and many custom addresses. Custom addresses must belong to configured domains.

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    create_address_request = CreateAddressRequest()
    response = await client.undefined.addresses_create_address(create_address_request)
    print(response)

Parameters

NameTypeDescriptionNotes
create_address_requestCreateAddressRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
prefixstring(required)
domainstring
displayNamestring

addresses_list_addresses()

Lists all email addresses the account has configured to send and receive emails. Custom addresses must belong to configured domains.

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    response = await client.undefined.addresses_list_addresses()
    print(response)

Parameters

This endpoint does not need any parameter.

addresses_update_address()

Update an existing address

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    update_address_request = UpdateAddressRequest()
    response = await client.undefined.addresses_update_address(update_address_request)
    print(response)

Parameters

NameTypeDescriptionNotes
update_address_requestUpdateAddressRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
fullAddressstring(required)
prefixstring
displayNamestring

Domains

domains_add_domain()

Request to verify a new sender domain

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    post_senders_request_body = PostSendersRequestBody()
    response = await client.domains.domains_add_domain(post_senders_request_body)
    print(response)

Parameters

NameTypeDescriptionNotes
post_senders_request_bodyPostSendersRequestBodySee Request Body Properties below

Request Body Properties

NameTypeDescription
senderstring(required)

domains_delete_domain()

Delete a sender domain or email address

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    sender = 'sender_example'
    response = await client.domains.domains_delete_domain(sender)
    print(response)

Parameters

NameTypeDescriptionNotes
senderstrSender domain or email address (URL encoded)

domains_list_domains()

Get all sender domains configured for the account

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    response = await client.domains.domains_list_domains()
    print(response)

Parameters

This endpoint does not need any parameter.

Environments

environments_create_environment()

Create a new environment for the account

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    environment_create_request = EnvironmentCreateRequest()
    response = await client.environments.environments_create_environment(environment_create_request)
    print(response)

Parameters

NameTypeDescriptionNotes
environment_create_requestEnvironmentCreateRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
titlestring(required)

environments_list_environments()

Get all environments for the authenticated account

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    response = await client.environments.environments_list_environments()
    print(response)

Parameters

This endpoint does not need any parameter.

environments_update_environment()

Update environment settings (title, secret, disable sending, secure mode)

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    client_id = 'client_id_example'
    environment_patch_request = EnvironmentPatchRequest()
    response = await client.environments.environments_update_environment(client_id, environment_patch_request)
    print(response)

Parameters

NameTypeDescriptionNotes
client_idstrEnvironment client ID
environment_patch_requestEnvironmentPatchRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
resetSecretboolean
disableSending(“EMAIL” | “INAPP_WEB” | “SMS” | “CALL” | “PUSH” | “WEB_PUSH” | “SLACK”)[]
titlestring
secureModeboolean

Logs

logs_get_log_retention()

Get log retention period in days for the account

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    response = await client.logs.logs_get_log_retention()
    print(response)

Parameters

This endpoint does not need any parameter.

logs_get_logs()

List logs for the authenticated account

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    limit = 3.4
    cursor = 'cursor_example'
    response = await client.logs.logs_get_logs(limit=limit, cursor=cursor)
    print(response)

Parameters

NameTypeDescriptionNotes
limitfloatMaximum number of logs to return (default[optional]
cursorstrPagination cursor for next page[optional]

logs_get_logs_by_tracking_ids()

Get logs by tracking IDs (comma-separated, max 25 IDs)

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    tracking_ids = 'tracking_ids_example'
    response = await client.logs.logs_get_logs_by_tracking_ids(tracking_ids)
    print(response)

Parameters

NameTypeDescriptionNotes
tracking_idsstrComma-separated tracking IDs (URL encoded)

logs_get_logs_query_result()

Get results from a query ID

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    query_id = 'query_id_example'
    response = await client.logs.logs_get_logs_query_result(query_id)
    print(response)

Parameters

NameTypeDescriptionNotes
query_idstrQuery ID

logs_start_logs_query()

Start a log query and return query ID for asynchronous log searching

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    log_query_post_body = LogQueryPostBody()
    response = await client.logs.logs_start_logs_query(log_query_post_body)
    print(response)

Parameters

NameTypeDescriptionNotes
log_query_post_bodyLogQueryPostBodySee Request Body Properties below

Request Body Properties

NameTypeDescription
dateRangeFilternumber[]A tuple of [startTime, endTime] for the date range filter, each representing a unix timestamp.
userFilterstring
envIdFilterstring[]
statusFilterstring
channelFilter(“email” | “inapp” | “sms” | “call” | “web_push” | “mobile_push” | “slack”)[]
notificationFilterstring[]

logs_tail_logs()

Get last 100 logs from the stream

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    response = await client.logs.logs_tail_logs()
    print(response)

Parameters

This endpoint does not need any parameter.

Organization

organization_get_usage()

Get usage for the authenticated account’s organization (new billing model).

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    response = await client.undefined.organization_get_usage()
    print(response)

Parameters

This endpoint does not need any parameter.

organization_get_usage_history()

Get historical usage for the authenticated account’s organization over a date range.

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    start_date = 'start_date_example'
    end_date = 'end_date_example'
    response = await client.undefined.organization_get_usage_history(start_date, end_date)
    print(response)

Parameters

NameTypeDescriptionNotes
start_datestrStart date (YYYY-MM-DD) for the range
end_datestrEnd date (YYYY-MM-DD) for the range

PushSettings

push_settings_delete_push_apn_settings()

Delete Apple Push Notification (APN) configuration for the current account.

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    response = await client.undefined.push_settings_delete_push_apn_settings()
    print(response)

Parameters

This endpoint does not need any parameter.

push_settings_delete_push_fcm_settings()

Delete Firebase Cloud Messaging (FCM) configuration for the current account.

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    response = await client.undefined.push_settings_delete_push_fcm_settings()
    print(response)

Parameters

This endpoint does not need any parameter.

push_settings_get_push_apn_settings()

Get Apple Push Notification (APN) configuration for the current account.

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    response = await client.undefined.push_settings_get_push_apn_settings()
    print(response)

Parameters

This endpoint does not need any parameter.

push_settings_get_push_fcm_settings()

Get Firebase Cloud Messaging (FCM) configuration for the current account.

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    response = await client.undefined.push_settings_get_push_fcm_settings()
    print(response)

Parameters

This endpoint does not need any parameter.

push_settings_upsert_push_apn_settings()

Create or update Apple Push Notification (APN) configuration for the current account.

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    apn_config = APNConfig()
    response = await client.undefined.push_settings_upsert_push_apn_settings(apn_config)
    print(response)

Parameters

NameTypeDescriptionNotes
apn_configAPNConfigSee Request Body Properties below

Request Body Properties

NameTypeDescription
KeyIdstring(required)
Keystring(required)
TeamIdstring(required)
Topicstring(required)

push_settings_upsert_push_fcm_settings()

Create or update Firebase Cloud Messaging (FCM) configuration for the current account.

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    push_settings_fcm_put_request = PushSettingsFCMPutRequest()
    response = await client.undefined.push_settings_upsert_push_fcm_settings(push_settings_fcm_put_request)
    print(response)

Parameters

NameTypeDescriptionNotes
push_settings_fcm_put_requestPushSettingsFCMPutRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
fcmConfigstring(required)

Sender

sender_delete_schedule()

Delete (unschedule) an already scheduled notification

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    tracking_id = 'tracking_id_example'
    response = await client.sender.sender_delete_schedule(tracking_id)
    print(response)

Parameters

NameTypeDescriptionNotes
tracking_idstrThe tracking ID of the scheduled notification

sender_test_email()

Test the emailer with a sample email

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    post_email_test_request = PostEmailTestRequest()
    response = await client.sender.sender_test_email(post_email_test_request)
    print(response)

Parameters

NameTypeDescriptionNotes
post_email_test_requestPostEmailTestRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
notificationIdstring(required)
tostring(required)
subjectstring(required)
htmlstring(required)
fromAddressstring(required)
fromNamestring(required)
previewTextstring

sender_update_schedule()

Update the body or schedule of an already scheduled notification.

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    tracking_id = 'tracking_id_example'
    sender_post_body = SenderPostBody()
    response = await client.sender.sender_update_schedule(tracking_id, sender_post_body)
    print(response)

Parameters

NameTypeDescriptionNotes
tracking_idstrThe tracking ID of the scheduled notification
sender_post_bodySenderPostBodySee Request Body Properties below

Request Body Properties

NameTypeDescription
typestringID of the notification type (e.g. “welcome_email”). Creates a new notification if it does not exist.
toobjectRecipient user. Provide id, email, or number to identify the user.
to.idstringUnique user identifier. Required.
to.emailstringUser’s email address for email notifications.
to.numberstringUser’s phone number for SMS/call notifications.
to.pushTokensobject[]Mobile push tokens (FCM, APN) for push notifications.
to.pushTokens[].type”FCM” | “APN”(required)
to.pushTokens[].tokenstring(required)
to.pushTokens[].deviceobject(required)
to.pushTokens[].device.app_idstring
to.pushTokens[].device.ad_idstring
to.pushTokens[].device.device_idstring(required)
to.pushTokens[].device.platformstring
to.pushTokens[].device.manufacturerstring
to.pushTokens[].device.modelstring
to.pushTokens[].environmentstringused by APN to differentiate between sandbox and production builds (sandbox/undefined or production)
to.webPushTokensobject[]Web push subscription config from the browser.
to.webPushTokens[].subobject(required) Configuration for a Push Subscription. This can be obtained on the frontend by calling serviceWorkerRegistration.pushManager.subscribe(). The expected format is the same output as JSON.stringify’ing a PushSubscription in the browser.
to.webPushTokens[].sub.endpointstring(required)
to.webPushTokens[].sub.keysobject(required)
to.webPushTokens[].sub.keys.p256dhstring(required)
to.webPushTokens[].sub.keys.authstring(required)
to.timezonestringUser’s timezone (e.g. “America/New_York”) for scheduling.
to.slackChannelstringThe destination channel of slack notifications sent to this user. Can be either of the following: - Channel name, e.g. “test” - Channel name with # prefix, e.g. “#test” - Channel ID, e.g. “C1234567890” - User ID for DM, e.g. “U1234567890” - Username with @ prefix, e.g. “@test”
to.slackTokenobject
to.slackToken.access_tokenstring
to.slackToken.app_idstring
to.slackToken.authed_userobject
to.slackToken.authed_user.access_tokenstring
to.slackToken.authed_user.expires_innumber
to.slackToken.authed_user.idstring
to.slackToken.authed_user.refresh_tokenstring
to.slackToken.authed_user.scopestring
to.slackToken.authed_user.token_typestring
to.slackToken.bot_user_idstring
to.slackToken.enterpriseobject
to.slackToken.enterprise.idstring
to.slackToken.enterprise.namestring
to.slackToken.errorstring
to.slackToken.expires_innumber
to.slackToken.incoming_webhookobject
to.slackToken.incoming_webhook.channelstring
to.slackToken.incoming_webhook.channel_idstring
to.slackToken.incoming_webhook.configuration_urlstring
to.slackToken.incoming_webhook.urlstring
to.slackToken.is_enterprise_installboolean
to.slackToken.neededstring
to.slackToken.okboolean(required)
to.slackToken.providedstring
to.slackToken.refresh_tokenstring
to.slackToken.scopestring
to.slackToken.teamobject
to.slackToken.team.idstring
to.slackToken.team.namestring
to.slackToken.token_typestring
to.slackToken.warningstring
to.slackToken.response_metadataobject
to.slackToken.response_metadata.warningsstring[]
to.slackToken.response_metadata.next_cursorstring
to.slackToken.response_metadata.scopesstring[]
to.slackToken.response_metadata.acceptedScopesstring[]
to.slackToken.response_metadata.retryAfternumber
to.slackToken.response_metadata.messagesstring[]
to.lastSeenTimestringLast activity timestamp. Updated automatically. Read-only.
to.updatedAtstringLast update timestamp. Read-only.
to.createdAtstringCreation timestamp. Read-only.
to.emailSuppressionStatusobjectBounce or complaint status if email was suppressed. Read-only.
to.emailSuppressionStatus.reason”Bounce” | “Complaint”(required)
to.emailSuppressionStatus.detailsobject(required)
forceChannels(“EMAIL” | “INAPP_WEB” | “SMS” | “CALL” | “PUSH” | “WEB_PUSH” | “SLACK”)[]Override which channels to send to (e.g. [“EMAIL”, “SMS”]). Bypasses notification channel config.
parametersRecord<string, any>Key-value pairs for template merge tags. Replaces placeholders like {{firstName}} in templates.
secondaryIdstringOptional sub-notification identifier for grouping or tracking.
templateIdstringSpecific template ID to use. If omitted, uses the default template for each channel.
subNotificationIdstringSub-notification identifier (e.g. for grouping related notifications).
optionsobjectPer-channel overrides for send options (email, APN, FCM).
options.emailobjectEmail-specific overrides.
options.email.replyToAddressesstring[]Reply-to addresses for the email.
options.email.ccAddressesstring[]CC recipients.
options.email.bccAddressesstring[]BCC recipients.
options.email.fromAddressstringOverride sender email address.
options.email.fromNamestringOverride sender display name.
options.email.attachments(object | object)[]File attachments (by URL or inline base64 content).
options.email.conditionstringConditional expression for when to send (e.g. merge tag logic).
options.apnobjectApple Push Notification (APN) overrides.
options.apn.expirynumberSeconds until the notification expires.
options.apn.prioritynumberDelivery priority (10 = immediate, 5 = power-saving).
options.apn.collapseIdstringGroup notifications with the same ID (replaces previous).
options.apn.threadIdstringThread identifier for grouping notifications.
options.apn.badgenumberBadge count on app icon.
options.apn.soundstringSound file name.
options.apn.contentAvailablebooleanSilent background notification (no alert).
options.fcmobjectFirebase Cloud Messaging (FCM) overrides.
options.fcm.androidobjectAndroid-specific FCM options.
options.fcm.android.collapseKeystringCollapse key for grouping messages.
options.fcm.android.priority”high” | “normal”Delivery priority.
options.fcm.android.ttlnumberTime to live in seconds.
options.fcm.android.restrictedPackageNamestringRestrict delivery to a specific package.
schedulestring
emailobjectInline email content (subject, html). Use when not using templates.
email.subjectstring(required) Email subject line.
email.htmlstring(required) HTML body content.
email.previewTextstringPreview/snippet text shown in inbox.
email.senderNamestringDisplay name of sender.
email.senderEmailstringSender email address.
inappobjectInline in-app content (title, url, image).
inapp.titlestring(required) Notification title.
inapp.urlstringURL to open when clicked.
inapp.imagestringImage URL.
smsobjectInline SMS content (message, autoReply).
sms.messagestringSMS body text.
sms.autoReplyobject
sms.autoReply.messagestring(required) Auto-reply message to send when user texts in.
callobjectInline call content (message).
call.messagestring(required) Text to speak (TTS).
web_pushobjectInline web push content (title, message, icon, url).
web_push.titlestring(required) Notification title.
web_push.messagestring(required) Body text.
web_push.iconstringIcon URL.
web_push.urlstringURL to open when clicked.
mobile_pushobjectInline mobile push content (title, message).
mobile_push.titlestring(required) Notification title.
mobile_push.messagestring(required) Body text.
slackobjectInline Slack content (text, blocks, etc.).
slack.textstring(required) Fallback plain text (required when using blocks).
slack.blocksRecord<string, any>[]Slack Block Kit blocks.
slack.usernamestringOverride bot username.
slack.iconstringIcon: emoji (e.g. “:smile:”) or URL. Default: bot’s icon.
slack.thread_tsstringParent message ts to post in a thread.
slack.reply_broadcastbooleanWhen true with thread_ts, broadcasts reply to channel. Default: false.
slack.parse”full” | “none”URL parsing: “full” (clickable links) or “none”. Default: “none”.
slack.link_namesbooleanConvert channel and username refs to Slack links. Default: false.
slack.mrkdwnbooleanEnable Slack markup (bold, italic, code). Default: true.
slack.unfurl_linksbooleanUnfurl link previews. Default: true.
slack.unfurl_mediabooleanUnfurl media previews. Default: true.
slack.metadataobjectSlack message metadata with optional work object entities. Combines standard Slack message metadata fields with an array of entity objects.
slack.metadata.entitiesobject[]An array of work object entities.
slack.metadata.entities[].entity_typestring(required) Entity type (e.g., ‘slack#/entities/task’, ‘slack#/entities/file’).
slack.metadata.entities[].entity_payloadRecord<string, any>(required) Schema for the given entity type.
slack.metadata.entities[].external_refobject(required) Reference used to identify an entity within the developer’s system.
slack.metadata.entities[].external_ref.idstring(required)
slack.metadata.entities[].external_ref.typestring
slack.metadata.entities[].urlstring(required) URL used to identify an entity within the developer’s system.
slack.metadata.entities[].app_unfurl_urlstringThe exact URL posted in the source message. Required in metadata passed to chat.unfurl.
slack.metadata.event_typestringA human readable alphanumeric string representing your application’s metadata event.
slack.metadata.event_payloadRecord<string, any>A free-form object containing whatever data your application wishes to attach to messages.

Templates

templates_create_template()

Create a new template for a notification

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    notification_id = 'notification_id_example'
    channel = 'channel_example'
    template_post_request = TemplatePostRequest()
    response = await client.templates.templates_create_template(notification_id, channel, template_post_request)
    print(response)

Parameters

NameTypeDescriptionNotes
notification_idstrNotification ID
channelstrChannel type
template_post_requestTemplatePostRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
templateIdstring(required) Unique ID for this template within the notification and channel. Required.
htmlstringHTML body of the email.
previewTextstringPreview text (e.g. for inbox).
internalstringInternal editor representation of the email content (e.g. Bee or Redactor JSON). Used for editing and component embedding; the actual email sent to recipients uses the html field.
subjectstringEmail subject line.
senderNamestringSender display name.
senderEmailstringSender email address.
titlestringNotification title (in-app).
redirectURLstringURL to open when the user taps the notification.
imageURLstringImage URL shown in the in-app notification.
instantobjectCopy for instant (real-time) delivery.
instant.titlestring
instant.redirectURLstring
instant.imageURLstring(required)
batchobjectCopy for batch delivery.
batch.titlestring(required)
batch.redirectURLstring(required)
batch.imageURLstring(required)
textstringMessage text (SMS or call).
messagestringPush notification body text. (title is shared with INAPP_WEB above.)
iconstringWeb push: icon URL. Slack: bot icon (emoji or URL).
urlstringWeb push: URL to open when the notification is clicked.
blocksRecord<string, any>[]Slack message blocks (optional).
usernamestringSlack bot username.

templates_delete_template()

Delete a template

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    notification_id = 'notification_id_example'
    channel = 'channel_example'
    template_id = 'template_id_example'
    response = await client.templates.templates_delete_template(notification_id, channel, template_id)
    print(response)

Parameters

NameTypeDescriptionNotes
notification_idstrNotification ID
channelstrChannel type
template_idstrTemplate ID

templates_get_template()

Get a single template by ID

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    notification_id = 'notification_id_example'
    channel = 'channel_example'
    template_id = 'template_id_example'
    response = await client.templates.templates_get_template(notification_id, channel, template_id)
    print(response)

Parameters

NameTypeDescriptionNotes
notification_idstrNotification ID
channelstrChannel type
template_idstrTemplate ID

templates_list_templates()

List all templates for a notification and channel

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    notification_id = 'notification_id_example'
    channel = 'channel_example'
    response = await client.templates.templates_list_templates(notification_id, channel)
    print(response)

Parameters

NameTypeDescriptionNotes
notification_idstrNotification ID
channelstrChannel type

templates_set_default_template()

Set a template as default for specific delivery modes

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    notification_id = 'notification_id_example'
    channel = 'channel_example'
    set_default_template_request = SetDefaultTemplateRequest()
    response = await client.templates.templates_set_default_template(notification_id, channel, set_default_template_request)
    print(response)

Parameters

NameTypeDescriptionNotes
notification_idstrNotification ID
channelstrChannel type
set_default_template_requestSetDefaultTemplateRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
templateIdstring(required)
modes(“instant” | “hourly” | “daily” | “weekly” | “monthly”)[](required)

templates_update_template()

Update a template’s properties

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    notification_id = 'notification_id_example'
    channel = 'channel_example'
    template_id = 'template_id_example'
    template_patch_request = TemplatePatchRequest()
    response = await client.templates.templates_update_template(notification_id, channel, template_id, template_patch_request)
    print(response)

Parameters

NameTypeDescriptionNotes
notification_idstrNotification ID
channelstrChannel type
template_idstrTemplate ID
template_patch_requestTemplatePatchRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
htmlstringHTML body of the email.
previewTextstringPreview text (e.g. for inbox).
internalstringInternal editor representation of the email content (e.g. Bee or Redactor JSON). Used for editing and component embedding; the actual email sent to recipients uses the html field.
subjectstringEmail subject line.
senderNamestringSender display name.
senderEmailstringSender email address.
titlestringNotification title (in-app).
redirectURLstringURL to open when the user taps the notification.
imageURLstringImage URL shown in the in-app notification.
instantobjectCopy for instant (real-time) delivery.
instant.titlestring
instant.redirectURLstring
instant.imageURLstring(required)
batchobjectCopy for batch delivery.
batch.titlestring(required)
batch.redirectURLstring(required)
batch.imageURLstring(required)
textstringMessage text (SMS or call).
messagestringPush notification body text. (title is shared with INAPP_WEB above.)
iconstringWeb push: icon URL. Slack: bot icon (emoji or URL).
urlstringWeb push: URL to open when the notification is clicked.
blocksRecord<string, any>[]Slack message blocks (optional).
usernamestringSlack bot username.

Types

types_create_notification_type()

Create a new notification

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    notification_create_request = NotificationCreateRequest()
    response = await client.types.types_create_notification_type(notification_create_request)
    print(response)

Parameters

NameTypeDescriptionNotes
notification_create_requestNotificationCreateRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
notificationIdstring(required)
titlestring(required)
channelsstring[](required)
optionsobject
options.EMAILobject
options.EMAIL.defaultDeliveryOption”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly”(required)
options.EMAIL.offobject
options.EMAIL.off.enabledboolean(required)
options.EMAIL.instantobject
options.EMAIL.instant.enabledboolean(required)
options.EMAIL.hourlyobject
options.EMAIL.hourly.enabledboolean(required)
options.EMAIL.dailyobject
options.EMAIL.daily.enabledboolean(required)
options.EMAIL.daily.hourstring
options.EMAIL.weeklyobject
options.EMAIL.weekly.enabledboolean(required)
options.EMAIL.weekly.hourstring
options.EMAIL.weekly.daystring
options.EMAIL.monthlyobject
options.EMAIL.monthly.enabledboolean(required)
options.EMAIL.monthly.hourstring
options.EMAIL.monthly.date”first” | “last”
options.INAPP_WEBobject
options.INAPP_WEB.defaultDeliveryOption”off” | “instant”(required)
options.INAPP_WEB.offobject
options.INAPP_WEB.off.enabledboolean(required)
options.INAPP_WEB.instantobject
options.INAPP_WEB.instant.enabledboolean(required)
options.INAPP_WEB.instant.batchingboolean
options.INAPP_WEB.instant.batchingKeystring
options.INAPP_WEB.instant.batchingWindownumber
options.SMSobject
options.SMS.defaultDeliveryOption”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly”(required)
options.SMS.offobject
options.SMS.off.enabledboolean(required)
options.SMS.instantobject
options.SMS.instant.enabledboolean(required)
options.SMS.hourlyobject
options.SMS.hourly.enabledboolean(required)
options.SMS.dailyobject
options.SMS.daily.enabledboolean(required)
options.SMS.daily.hourstring
options.SMS.weeklyobject
options.SMS.weekly.enabledboolean(required)
options.SMS.weekly.hourstring
options.SMS.weekly.daystring
options.SMS.monthlyobject
options.SMS.monthly.enabledboolean(required)
options.SMS.monthly.hourstring
options.SMS.monthly.date”first” | “last”
options.CALLobject
options.CALL.defaultDeliveryOption”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly”(required)
options.CALL.offobject
options.CALL.off.enabledboolean(required)
options.CALL.instantobject
options.CALL.instant.enabledboolean(required)
options.CALL.hourlyobject
options.CALL.hourly.enabledboolean(required)
options.CALL.dailyobject
options.CALL.daily.enabledboolean(required)
options.CALL.daily.hourstring
options.CALL.weeklyobject
options.CALL.weekly.enabledboolean(required)
options.CALL.weekly.hourstring
options.CALL.weekly.daystring
options.CALL.monthlyobject
options.CALL.monthly.enabledboolean(required)
options.CALL.monthly.hourstring
options.CALL.monthly.date”first” | “last”
options.PUSHobject
options.PUSH.defaultDeliveryOption”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly”(required)
options.PUSH.offobject
options.PUSH.off.enabledboolean(required)
options.PUSH.instantobject
options.PUSH.instant.enabledboolean(required)
options.PUSH.hourlyobject
options.PUSH.hourly.enabledboolean(required)
options.PUSH.dailyobject
options.PUSH.daily.enabledboolean(required)
options.PUSH.daily.hourstring
options.PUSH.weeklyobject
options.PUSH.weekly.enabledboolean(required)
options.PUSH.weekly.hourstring
options.PUSH.weekly.daystring
options.PUSH.monthlyobject
options.PUSH.monthly.enabledboolean(required)
options.PUSH.monthly.hourstring
options.PUSH.monthly.date”first” | “last”
options.WEB_PUSHobject
options.WEB_PUSH.defaultDeliveryOption”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly”(required)
options.WEB_PUSH.offobject
options.WEB_PUSH.off.enabledboolean(required)
options.WEB_PUSH.instantobject
options.WEB_PUSH.instant.enabledboolean(required)
options.WEB_PUSH.hourlyobject
options.WEB_PUSH.hourly.enabledboolean(required)
options.WEB_PUSH.dailyobject
options.WEB_PUSH.daily.enabledboolean(required)
options.WEB_PUSH.daily.hourstring
options.WEB_PUSH.weeklyobject
options.WEB_PUSH.weekly.enabledboolean(required)
options.WEB_PUSH.weekly.hourstring
options.WEB_PUSH.weekly.daystring
options.WEB_PUSH.monthlyobject
options.WEB_PUSH.monthly.enabledboolean(required)
options.WEB_PUSH.monthly.hourstring
options.WEB_PUSH.monthly.date”first” | “last”
options.SLACKobject
options.SLACK.defaultDeliveryOption”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly”(required)
options.SLACK.offobject
options.SLACK.off.enabledboolean(required)
options.SLACK.instantobject
options.SLACK.instant.enabledboolean(required)
options.SLACK.hourlyobject
options.SLACK.hourly.enabledboolean(required)
options.SLACK.dailyobject
options.SLACK.daily.enabledboolean(required)
options.SLACK.daily.hourstring
options.SLACK.weeklyobject
options.SLACK.weekly.enabledboolean(required)
options.SLACK.weekly.hourstring
options.SLACK.weekly.daystring
options.SLACK.monthlyobject
options.SLACK.monthly.enabledboolean(required)
options.SLACK.monthly.hourstring
options.SLACK.monthly.date”first” | “last”

types_delete_notification_type()

Delete a notification

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    notification_id = 'notification_id_example'
    response = await client.types.types_delete_notification_type(notification_id)
    print(response)

Parameters

NameTypeDescriptionNotes
notification_idstrThe notification ID

types_get_notification_type()

Get a specific notification by ID

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    notification_id = 'notification_id_example'
    response = await client.types.types_get_notification_type(notification_id)
    print(response)

Parameters

NameTypeDescriptionNotes
notification_idstrThe notification ID

types_list_notification_types()

Get all notifications for an account with their templates

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    response = await client.types.types_list_notification_types()
    print(response)

Parameters

This endpoint does not need any parameter.

types_update_notification_type()

Update a notification’s settings

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    notification_id = 'notification_id_example'
    notification_patch_request = NotificationPatchRequest()
    response = await client.types.types_update_notification_type(notification_id, notification_patch_request)
    print(response)

Parameters

NameTypeDescriptionNotes
notification_idstrThe notification ID
notification_patch_requestNotificationPatchRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
titlestring
channels(“EMAIL” | “INAPP_WEB” | “SMS” | “CALL” | “PUSH” | “WEB_PUSH” | “SLACK”)[]
enabledboolean
deduplicationobject
deduplication.durationnumber(required)
throttlingobject
throttling.maxnumber(required)
throttling.periodnumber(required)
throttling.unit”seconds” | “minutes” | “hours” | “days” | “months” | “years”(required)
throttling.foreverboolean(required)
throttling.scope(“userId” | “notificationId”)[](required)
retentionnumbernull
optionsobject
options.EMAILobject
options.EMAIL.defaultDeliveryOption”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly”(required)
options.EMAIL.offobject
options.EMAIL.off.enabledboolean(required)
options.EMAIL.instantobject
options.EMAIL.instant.enabledboolean(required)
options.EMAIL.hourlyobject
options.EMAIL.hourly.enabledboolean(required)
options.EMAIL.dailyobject
options.EMAIL.daily.enabledboolean(required)
options.EMAIL.daily.hourstring
options.EMAIL.weeklyobject
options.EMAIL.weekly.enabledboolean(required)
options.EMAIL.weekly.hourstring
options.EMAIL.weekly.daystring
options.EMAIL.monthlyobject
options.EMAIL.monthly.enabledboolean(required)
options.EMAIL.monthly.hourstring
options.EMAIL.monthly.date”first” | “last”
options.INAPP_WEBobject
options.INAPP_WEB.defaultDeliveryOption”off” | “instant”(required)
options.INAPP_WEB.offobject
options.INAPP_WEB.off.enabledboolean(required)
options.INAPP_WEB.instantobject
options.INAPP_WEB.instant.enabledboolean(required)
options.INAPP_WEB.instant.batchingboolean
options.INAPP_WEB.instant.batchingKeystring
options.INAPP_WEB.instant.batchingWindownumber
options.SMSobject
options.SMS.defaultDeliveryOption”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly”(required)
options.SMS.offobject
options.SMS.off.enabledboolean(required)
options.SMS.instantobject
options.SMS.instant.enabledboolean(required)
options.SMS.hourlyobject
options.SMS.hourly.enabledboolean(required)
options.SMS.dailyobject
options.SMS.daily.enabledboolean(required)
options.SMS.daily.hourstring
options.SMS.weeklyobject
options.SMS.weekly.enabledboolean(required)
options.SMS.weekly.hourstring
options.SMS.weekly.daystring
options.SMS.monthlyobject
options.SMS.monthly.enabledboolean(required)
options.SMS.monthly.hourstring
options.SMS.monthly.date”first” | “last”
options.CALLobject
options.CALL.defaultDeliveryOption”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly”(required)
options.CALL.offobject
options.CALL.off.enabledboolean(required)
options.CALL.instantobject
options.CALL.instant.enabledboolean(required)
options.CALL.hourlyobject
options.CALL.hourly.enabledboolean(required)
options.CALL.dailyobject
options.CALL.daily.enabledboolean(required)
options.CALL.daily.hourstring
options.CALL.weeklyobject
options.CALL.weekly.enabledboolean(required)
options.CALL.weekly.hourstring
options.CALL.weekly.daystring
options.CALL.monthlyobject
options.CALL.monthly.enabledboolean(required)
options.CALL.monthly.hourstring
options.CALL.monthly.date”first” | “last”
options.PUSHobject
options.PUSH.defaultDeliveryOption”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly”(required)
options.PUSH.offobject
options.PUSH.off.enabledboolean(required)
options.PUSH.instantobject
options.PUSH.instant.enabledboolean(required)
options.PUSH.hourlyobject
options.PUSH.hourly.enabledboolean(required)
options.PUSH.dailyobject
options.PUSH.daily.enabledboolean(required)
options.PUSH.daily.hourstring
options.PUSH.weeklyobject
options.PUSH.weekly.enabledboolean(required)
options.PUSH.weekly.hourstring
options.PUSH.weekly.daystring
options.PUSH.monthlyobject
options.PUSH.monthly.enabledboolean(required)
options.PUSH.monthly.hourstring
options.PUSH.monthly.date”first” | “last”
options.WEB_PUSHobject
options.WEB_PUSH.defaultDeliveryOption”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly”(required)
options.WEB_PUSH.offobject
options.WEB_PUSH.off.enabledboolean(required)
options.WEB_PUSH.instantobject
options.WEB_PUSH.instant.enabledboolean(required)
options.WEB_PUSH.hourlyobject
options.WEB_PUSH.hourly.enabledboolean(required)
options.WEB_PUSH.dailyobject
options.WEB_PUSH.daily.enabledboolean(required)
options.WEB_PUSH.daily.hourstring
options.WEB_PUSH.weeklyobject
options.WEB_PUSH.weekly.enabledboolean(required)
options.WEB_PUSH.weekly.hourstring
options.WEB_PUSH.weekly.daystring
options.WEB_PUSH.monthlyobject
options.WEB_PUSH.monthly.enabledboolean(required)
options.WEB_PUSH.monthly.hourstring
options.WEB_PUSH.monthly.date”first” | “last”
options.SLACKobject
options.SLACK.defaultDeliveryOption”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly”(required)
options.SLACK.offobject
options.SLACK.off.enabledboolean(required)
options.SLACK.instantobject
options.SLACK.instant.enabledboolean(required)
options.SLACK.hourlyobject
options.SLACK.hourly.enabledboolean(required)
options.SLACK.dailyobject
options.SLACK.daily.enabledboolean(required)
options.SLACK.daily.hourstring
options.SLACK.weeklyobject
options.SLACK.weekly.enabledboolean(required)
options.SLACK.weekly.hourstring
options.SLACK.weekly.daystring
options.SLACK.monthlyobject
options.SLACK.monthly.enabledboolean(required)
options.SLACK.monthly.hourstring
options.SLACK.monthly.date”first” | “last”

User

user_generate_slack_oauth_path()

Complete Slack OAuth flow and store access token for user

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    user_id = 'user_id_example'
    slack_oauth_request = SlackOauthRequest()
    response = await client.user.user_generate_slack_oauth_path(user_id, slack_oauth_request)
    print(response)

Parameters

NameTypeDescriptionNotes
user_idstrUser ID
slack_oauth_requestSlackOauthRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
codestring(required)
redirect_uristring(required)

user_get_account_metadata()

Get account-level metadata including logo, VAPID key, and web push status

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    response = await client.user.user_get_account_metadata()
    print(response)

Parameters

This endpoint does not need any parameter.

user_get_available_slack_channels()

Get list of Slack channels and users for the authenticated user

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    user_id = 'user_id_example'
    response = await client.user.user_get_available_slack_channels(user_id)
    print(response)

Parameters

NameTypeDescriptionNotes
user_idstrUser ID

user_get_in_app_notifications()

Get in-app notifications for a user

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    before = 'before_example'
    count = 3.4
    response = await client.user.user_get_in_app_notifications(before=before, count=count)
    print(response)

Parameters

NameTypeDescriptionNotes
beforestrTimestamp or ISO date to fetch notifications before[optional]
countfloatNumber of notifications to return (default 10)[optional]

user_get_in_app_unread_count()

Get the count of unread in-app notifications for a user

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    response = await client.user.user_get_in_app_unread_count()
    print(response)

Parameters

This endpoint does not need any parameter.

user_get_user()

Get a user by ID. All users exist implicitly, returns basic user object if not found in DB.

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    user_id = 'user_id_example'
    response = await client.user.user_get_user(user_id)
    print(response)

Parameters

NameTypeDescriptionNotes
user_idstrUser ID

user_identify()

Create or update a user with the given ID. Updates lastSeenTime automatically.

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    user_id = 'user_id_example'
    post_user_request = PostUserRequest()
    response = await client.user.user_identify(user_id, post_user_request)
    print(response)

Parameters

NameTypeDescriptionNotes
user_idstrUser ID
post_user_requestPostUserRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
idstringUnique user identifier. Required.
emailstringUser’s email address for email notifications.
numberstringUser’s phone number for SMS/call notifications.
pushTokensobject[]Mobile push tokens (FCM, APN) for push notifications.
pushTokens[].type”FCM” | “APN”(required)
pushTokens[].tokenstring(required)
pushTokens[].deviceobject(required)
pushTokens[].device.app_idstring
pushTokens[].device.ad_idstring
pushTokens[].device.device_idstring(required)
pushTokens[].device.platformstring
pushTokens[].device.manufacturerstring
pushTokens[].device.modelstring
pushTokens[].environmentstringused by APN to differentiate between sandbox and production builds (sandbox/undefined or production)
webPushTokensobject[]Web push subscription config from the browser.
webPushTokens[].subobject(required) Configuration for a Push Subscription. This can be obtained on the frontend by calling serviceWorkerRegistration.pushManager.subscribe(). The expected format is the same output as JSON.stringify’ing a PushSubscription in the browser.
webPushTokens[].sub.endpointstring(required)
webPushTokens[].sub.keysobject(required)
webPushTokens[].sub.keys.p256dhstring(required)
webPushTokens[].sub.keys.authstring(required)
timezonestringUser’s timezone (e.g. “America/New_York”) for scheduling.
slackChannelstringThe destination channel of slack notifications sent to this user. Can be either of the following: - Channel name, e.g. “test” - Channel name with # prefix, e.g. “#test” - Channel ID, e.g. “C1234567890” - User ID for DM, e.g. “U1234567890” - Username with @ prefix, e.g. “@test”
slackTokenobject
slackToken.access_tokenstring
slackToken.app_idstring
slackToken.authed_userobject
slackToken.authed_user.access_tokenstring
slackToken.authed_user.expires_innumber
slackToken.authed_user.idstring
slackToken.authed_user.refresh_tokenstring
slackToken.authed_user.scopestring
slackToken.authed_user.token_typestring
slackToken.bot_user_idstring
slackToken.enterpriseobject
slackToken.enterprise.idstring
slackToken.enterprise.namestring
slackToken.errorstring
slackToken.expires_innumber
slackToken.incoming_webhookobject
slackToken.incoming_webhook.channelstring
slackToken.incoming_webhook.channel_idstring
slackToken.incoming_webhook.configuration_urlstring
slackToken.incoming_webhook.urlstring
slackToken.is_enterprise_installboolean
slackToken.neededstring
slackToken.okboolean(required)
slackToken.providedstring
slackToken.refresh_tokenstring
slackToken.scopestring
slackToken.teamobject
slackToken.team.idstring
slackToken.team.namestring
slackToken.token_typestring
slackToken.warningstring
slackToken.response_metadataobject
slackToken.response_metadata.warningsstring[]
slackToken.response_metadata.next_cursorstring
slackToken.response_metadata.scopesstring[]
slackToken.response_metadata.acceptedScopesstring[]
slackToken.response_metadata.retryAfternumber
slackToken.response_metadata.messagesstring[]

user_mark_in_app_notifications_as_seen()

Mark in-app web notifications as seen/read for a user

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    in_app_notification_unread_clear_request = InAppNotificationUnreadClearRequest()
    response = await client.user.user_mark_in_app_notifications_as_seen(in_app_notification_unread_clear_request)
    print(response)

Parameters

NameTypeDescriptionNotes
in_app_notification_unread_clear_requestInAppNotificationUnreadClearRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
notificationIdstring
trackingIdstring

user_update_in_app_notification_status()

Update in-app web notification status (opened, archived, clicked, etc.)

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    in_app_notification_patch_request = InAppNotificationPatchRequest()
    response = await client.user.user_update_in_app_notification_status(in_app_notification_patch_request)
    print(response)

Parameters

NameTypeDescriptionNotes
in_app_notification_patch_requestInAppNotificationPatchRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
trackingIdsstring[](required)
openedstring
clickedstring
archivedstring
actioned1string
actioned2string
replyobject
reply.datestring(required)
reply.messagestring(required)
repliesobject[]
replies[].datestring(required)
replies[].messagestring(required)

Users

users_delete_user()

Delete a user and all associated data (in-app notifications, preferences, and user record)

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    user_id = 'user_id_example'
    env_id = 'env_id_example'
    response = await client.users.users_delete_user(user_id, env_id=env_id)
    print(response)

Parameters

NameTypeDescriptionNotes
user_idstrUser ID
env_idstrEnvironment ID (required when using JWT auth)[optional]

users_list_users()

Get all users for an environment with pagination support

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    limit = 3.4
    next_token = 'next_token_example'
    env_id = 'env_id_example'
    response = await client.users.users_list_users(limit, next_token, env_id=env_id)
    print(response)

Parameters

NameTypeDescriptionNotes
limitfloatMaximum number of users to return (default
next_tokenstrPagination token for next page
env_idstrEnvironment ID (required when using JWT auth)[optional]

users_remove_user_from_suppression()

Remove user suppression status for a specific channel

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    user_id = 'user_id_example'
    channel = 'channel_example'
    env_id = 'env_id_example'
    response = await client.users.users_remove_user_from_suppression(user_id, channel, env_id=env_id)
    print(response)

Parameters

NameTypeDescriptionNotes
user_idstrUser ID
channelstrChannel type (EMAIL)
env_idstrEnvironment ID (required when using JWT auth)[optional]

Webhooks

webhooks_delete_events_webhook()

Delete the events webhook configuration for the current account/environment.

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    response = await client.undefined.webhooks_delete_events_webhook()
    print(response)

Parameters

This endpoint does not need any parameter.

webhooks_get_events_webhook()

Get the events webhook configuration for the current account/environment.

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    response = await client.undefined.webhooks_get_events_webhook()
    print(response)

Parameters

This endpoint does not need any parameter.

webhooks_upsert_events_webhook()

Create or update the events webhook configuration for the current account/environment.

from pingram import Pingram

async with Pingram(api_key="pingram_sk_...") as client:
    events_webhook_upsert_request = EventsWebhookUpsertRequest()
    response = await client.undefined.webhooks_upsert_events_webhook(events_webhook_upsert_request)
    print(response)

Parameters

NameTypeDescriptionNotes
events_webhook_upsert_requestEventsWebhookUpsertRequestSee Request Body Properties below

Request Body Properties

NameTypeDescription
webhookstring(required) Destination URL that receives webhook event payloads. Must be a valid http(s) URL.
events(“EMAIL_OPEN” | “EMAIL_CLICK” | “EMAIL_FAILED” | “EMAIL_DELIVERED” | “EMAIL_UNSUBSCRIBE” | “EMAIL_INBOUND” | “INAPP_WEB_FAILED” | “INAPP_WEB_UNSUBSCRIBE” | “SMS_DELIVERED” | “SMS_FAILED” | “SMS_UNSUBSCRIBE” | “SMS_INBOUND” | “PUSH_FAILED” | “PUSH_UNSUBSCRIBE” | “CALL_FAILED” | “CALL_UNSUBSCRIBE” | “WEB_PUSH_FAILED” | “WEB_PUSH_UNSUBSCRIBE” | “SLACK_FAILED” | “SLACK_UNSUBSCRIBE”)[](required) List of event types that should be forwarded to the webhook URL.