Python SDK
Setup & Initialization
- Install Package:
pip install pingram-python
- Import:
from pingram import Pingram, PingramRegion
- 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())
| Name | Type | Description |
|---|---|---|
api_key* | string | Your Pingram API key. You can get it from your dashboard under Environments. |
region | string | Optional. Region: "us" (default), "eu", or "ca". |
base_url | string | Optional. 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
| Name | Type | Description | Notes |
|---|---|---|---|
| sender_post_body | SenderPostBody | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
type | string | ID of the notification type (e.g. “welcome_email”). Creates a new notification if it does not exist. |
to | object | Recipient user. Provide id, email, or number to identify the user. |
to.id | string | Unique user identifier. Required. |
to.email | string | User’s email address for email notifications. |
to.number | string | User’s phone number for SMS/call notifications. |
to.pushTokens | object[] | Mobile push tokens (FCM, APN) for push notifications. |
to.pushTokens[].type | ”FCM” | “APN” | (required) |
to.pushTokens[].token | string | (required) |
to.pushTokens[].device | object | (required) |
to.pushTokens[].device.app_id | string | |
to.pushTokens[].device.ad_id | string | |
to.pushTokens[].device.device_id | string | (required) |
to.pushTokens[].device.platform | string | |
to.pushTokens[].device.manufacturer | string | |
to.pushTokens[].device.model | string | |
to.pushTokens[].environment | string | used by APN to differentiate between sandbox and production builds (sandbox/undefined or production) |
to.webPushTokens | object[] | Web push subscription config from the browser. |
to.webPushTokens[].sub | object | (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.endpoint | string | (required) |
to.webPushTokens[].sub.keys | object | (required) |
to.webPushTokens[].sub.keys.p256dh | string | (required) |
to.webPushTokens[].sub.keys.auth | string | (required) |
to.timezone | string | User’s timezone (e.g. “America/New_York”) for scheduling. |
to.slackChannel | string | The 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.slackToken | object | |
to.slackToken.access_token | string | |
to.slackToken.app_id | string | |
to.slackToken.authed_user | object | |
to.slackToken.authed_user.access_token | string | |
to.slackToken.authed_user.expires_in | number | |
to.slackToken.authed_user.id | string | |
to.slackToken.authed_user.refresh_token | string | |
to.slackToken.authed_user.scope | string | |
to.slackToken.authed_user.token_type | string | |
to.slackToken.bot_user_id | string | |
to.slackToken.enterprise | object | |
to.slackToken.enterprise.id | string | |
to.slackToken.enterprise.name | string | |
to.slackToken.error | string | |
to.slackToken.expires_in | number | |
to.slackToken.incoming_webhook | object | |
to.slackToken.incoming_webhook.channel | string | |
to.slackToken.incoming_webhook.channel_id | string | |
to.slackToken.incoming_webhook.configuration_url | string | |
to.slackToken.incoming_webhook.url | string | |
to.slackToken.is_enterprise_install | boolean | |
to.slackToken.needed | string | |
to.slackToken.ok | boolean | (required) |
to.slackToken.provided | string | |
to.slackToken.refresh_token | string | |
to.slackToken.scope | string | |
to.slackToken.team | object | |
to.slackToken.team.id | string | |
to.slackToken.team.name | string | |
to.slackToken.token_type | string | |
to.slackToken.warning | string | |
to.slackToken.response_metadata | object | |
to.slackToken.response_metadata.warnings | string[] | |
to.slackToken.response_metadata.next_cursor | string | |
to.slackToken.response_metadata.scopes | string[] | |
to.slackToken.response_metadata.acceptedScopes | string[] | |
to.slackToken.response_metadata.retryAfter | number | |
to.slackToken.response_metadata.messages | string[] | |
to.lastSeenTime | string | Last activity timestamp. Updated automatically. Read-only. |
to.updatedAt | string | Last update timestamp. Read-only. |
to.createdAt | string | Creation timestamp. Read-only. |
to.emailSuppressionStatus | object | Bounce or complaint status if email was suppressed. Read-only. |
to.emailSuppressionStatus.reason | ”Bounce” | “Complaint” | (required) |
to.emailSuppressionStatus.details | object | (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. |
parameters | Record<string, any> | Key-value pairs for template merge tags. Replaces placeholders like {{firstName}} in templates. |
secondaryId | string | Optional sub-notification identifier for grouping or tracking. |
templateId | string | Specific template ID to use. If omitted, uses the default template for each channel. |
subNotificationId | string | Sub-notification identifier (e.g. for grouping related notifications). |
options | object | Per-channel overrides for send options (email, APN, FCM). |
options.email | object | Email-specific overrides. |
options.email.replyToAddresses | string[] | Reply-to addresses for the email. |
options.email.ccAddresses | string[] | CC recipients. |
options.email.bccAddresses | string[] | BCC recipients. |
options.email.fromAddress | string | Override sender email address. |
options.email.fromName | string | Override sender display name. |
options.email.attachments | (object | object)[] | File attachments (by URL or inline base64 content). |
options.email.condition | string | Conditional expression for when to send (e.g. merge tag logic). |
options.apn | object | Apple Push Notification (APN) overrides. |
options.apn.expiry | number | Seconds until the notification expires. |
options.apn.priority | number | Delivery priority (10 = immediate, 5 = power-saving). |
options.apn.collapseId | string | Group notifications with the same ID (replaces previous). |
options.apn.threadId | string | Thread identifier for grouping notifications. |
options.apn.badge | number | Badge count on app icon. |
options.apn.sound | string | Sound file name. |
options.apn.contentAvailable | boolean | Silent background notification (no alert). |
options.fcm | object | Firebase Cloud Messaging (FCM) overrides. |
options.fcm.android | object | Android-specific FCM options. |
options.fcm.android.collapseKey | string | Collapse key for grouping messages. |
options.fcm.android.priority | ”high” | “normal” | Delivery priority. |
options.fcm.android.ttl | number | Time to live in seconds. |
options.fcm.android.restrictedPackageName | string | Restrict delivery to a specific package. |
schedule | string | |
email | object | Inline email content (subject, html). Use when not using templates. |
email.subject | string | (required) Email subject line. |
email.html | string | (required) HTML body content. |
email.previewText | string | Preview/snippet text shown in inbox. |
email.senderName | string | Display name of sender. |
email.senderEmail | string | Sender email address. |
inapp | object | Inline in-app content (title, url, image). |
inapp.title | string | (required) Notification title. |
inapp.url | string | URL to open when clicked. |
inapp.image | string | Image URL. |
sms | object | Inline SMS content (message, autoReply). |
sms.message | string | SMS body text. |
sms.autoReply | object | |
sms.autoReply.message | string | (required) Auto-reply message to send when user texts in. |
call | object | Inline call content (message). |
call.message | string | (required) Text to speak (TTS). |
web_push | object | Inline web push content (title, message, icon, url). |
web_push.title | string | (required) Notification title. |
web_push.message | string | (required) Body text. |
web_push.icon | string | Icon URL. |
web_push.url | string | URL to open when clicked. |
mobile_push | object | Inline mobile push content (title, message). |
mobile_push.title | string | (required) Notification title. |
mobile_push.message | string | (required) Body text. |
slack | object | Inline Slack content (text, blocks, etc.). |
slack.text | string | (required) Fallback plain text (required when using blocks). |
slack.blocks | Record<string, any>[] | Slack Block Kit blocks. |
slack.username | string | Override bot username. |
slack.icon | string | Icon: emoji (e.g. “:smile:”) or URL. Default: bot’s icon. |
slack.thread_ts | string | Parent message ts to post in a thread. |
slack.reply_broadcast | boolean | When 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_names | boolean | Convert channel and username refs to Slack links. Default: false. |
slack.mrkdwn | boolean | Enable Slack markup (bold, italic, code). Default: true. |
slack.unfurl_links | boolean | Unfurl link previews. Default: true. |
slack.unfurl_media | boolean | Unfurl media previews. Default: true. |
slack.metadata | object | Slack message metadata with optional work object entities. Combines standard Slack message metadata fields with an array of entity objects. |
slack.metadata.entities | object[] | An array of work object entities. |
slack.metadata.entities[].entity_type | string | (required) Entity type (e.g., ‘slack#/entities/task’, ‘slack#/entities/file’). |
slack.metadata.entities[].entity_payload | Record<string, any> | (required) Schema for the given entity type. |
slack.metadata.entities[].external_ref | object | (required) Reference used to identify an entity within the developer’s system. |
slack.metadata.entities[].external_ref.id | string | (required) |
slack.metadata.entities[].external_ref.type | string | |
slack.metadata.entities[].url | string | (required) URL used to identify an entity within the developer’s system. |
slack.metadata.entities[].app_unfurl_url | string | The exact URL posted in the source message. Required in metadata passed to chat.unfurl. |
slack.metadata.event_type | string | A human readable alphanumeric string representing your application’s metadata event. |
slack.metadata.event_payload | Record<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
| Name | Type | Description | Notes |
|---|---|---|---|
| create_address_request | CreateAddressRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
prefix | string | (required) |
domain | string | |
displayName | string |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| update_address_request | UpdateAddressRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
fullAddress | string | (required) |
prefix | string | |
displayName | string |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| post_senders_request_body | PostSendersRequestBody | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
sender | string | (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
| Name | Type | Description | Notes |
|---|---|---|---|
| sender | str | Sender 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
| Name | Type | Description | Notes |
|---|---|---|---|
| environment_create_request | EnvironmentCreateRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
title | string | (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
| Name | Type | Description | Notes |
|---|---|---|---|
| client_id | str | Environment client ID | |
| environment_patch_request | EnvironmentPatchRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
resetSecret | boolean | |
disableSending | (“EMAIL” | “INAPP_WEB” | “SMS” | “CALL” | “PUSH” | “WEB_PUSH” | “SLACK”)[] | |
title | string | |
secureMode | boolean |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | float | Maximum number of logs to return (default | [optional] |
| cursor | str | Pagination 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
| Name | Type | Description | Notes |
|---|---|---|---|
| tracking_ids | str | Comma-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
| Name | Type | Description | Notes |
|---|---|---|---|
| query_id | str | Query 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
| Name | Type | Description | Notes |
|---|---|---|---|
| log_query_post_body | LogQueryPostBody | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
dateRangeFilter | number[] | A tuple of [startTime, endTime] for the date range filter, each representing a unix timestamp. |
userFilter | string | |
envIdFilter | string[] | |
statusFilter | string | |
channelFilter | (“email” | “inapp” | “sms” | “call” | “web_push” | “mobile_push” | “slack”)[] | |
notificationFilter | string[] |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| start_date | str | Start date (YYYY-MM-DD) for the range | |
| end_date | str | End 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
| Name | Type | Description | Notes |
|---|---|---|---|
| apn_config | APNConfig | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
KeyId | string | (required) |
Key | string | (required) |
TeamId | string | (required) |
Topic | string | (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
| Name | Type | Description | Notes |
|---|---|---|---|
| push_settings_fcm_put_request | PushSettingsFCMPutRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
fcmConfig | string | (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
| Name | Type | Description | Notes |
|---|---|---|---|
| tracking_id | str | The 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
| Name | Type | Description | Notes |
|---|---|---|---|
| post_email_test_request | PostEmailTestRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
notificationId | string | (required) |
to | string | (required) |
subject | string | (required) |
html | string | (required) |
fromAddress | string | (required) |
fromName | string | (required) |
previewText | string |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| tracking_id | str | The tracking ID of the scheduled notification | |
| sender_post_body | SenderPostBody | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
type | string | ID of the notification type (e.g. “welcome_email”). Creates a new notification if it does not exist. |
to | object | Recipient user. Provide id, email, or number to identify the user. |
to.id | string | Unique user identifier. Required. |
to.email | string | User’s email address for email notifications. |
to.number | string | User’s phone number for SMS/call notifications. |
to.pushTokens | object[] | Mobile push tokens (FCM, APN) for push notifications. |
to.pushTokens[].type | ”FCM” | “APN” | (required) |
to.pushTokens[].token | string | (required) |
to.pushTokens[].device | object | (required) |
to.pushTokens[].device.app_id | string | |
to.pushTokens[].device.ad_id | string | |
to.pushTokens[].device.device_id | string | (required) |
to.pushTokens[].device.platform | string | |
to.pushTokens[].device.manufacturer | string | |
to.pushTokens[].device.model | string | |
to.pushTokens[].environment | string | used by APN to differentiate between sandbox and production builds (sandbox/undefined or production) |
to.webPushTokens | object[] | Web push subscription config from the browser. |
to.webPushTokens[].sub | object | (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.endpoint | string | (required) |
to.webPushTokens[].sub.keys | object | (required) |
to.webPushTokens[].sub.keys.p256dh | string | (required) |
to.webPushTokens[].sub.keys.auth | string | (required) |
to.timezone | string | User’s timezone (e.g. “America/New_York”) for scheduling. |
to.slackChannel | string | The 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.slackToken | object | |
to.slackToken.access_token | string | |
to.slackToken.app_id | string | |
to.slackToken.authed_user | object | |
to.slackToken.authed_user.access_token | string | |
to.slackToken.authed_user.expires_in | number | |
to.slackToken.authed_user.id | string | |
to.slackToken.authed_user.refresh_token | string | |
to.slackToken.authed_user.scope | string | |
to.slackToken.authed_user.token_type | string | |
to.slackToken.bot_user_id | string | |
to.slackToken.enterprise | object | |
to.slackToken.enterprise.id | string | |
to.slackToken.enterprise.name | string | |
to.slackToken.error | string | |
to.slackToken.expires_in | number | |
to.slackToken.incoming_webhook | object | |
to.slackToken.incoming_webhook.channel | string | |
to.slackToken.incoming_webhook.channel_id | string | |
to.slackToken.incoming_webhook.configuration_url | string | |
to.slackToken.incoming_webhook.url | string | |
to.slackToken.is_enterprise_install | boolean | |
to.slackToken.needed | string | |
to.slackToken.ok | boolean | (required) |
to.slackToken.provided | string | |
to.slackToken.refresh_token | string | |
to.slackToken.scope | string | |
to.slackToken.team | object | |
to.slackToken.team.id | string | |
to.slackToken.team.name | string | |
to.slackToken.token_type | string | |
to.slackToken.warning | string | |
to.slackToken.response_metadata | object | |
to.slackToken.response_metadata.warnings | string[] | |
to.slackToken.response_metadata.next_cursor | string | |
to.slackToken.response_metadata.scopes | string[] | |
to.slackToken.response_metadata.acceptedScopes | string[] | |
to.slackToken.response_metadata.retryAfter | number | |
to.slackToken.response_metadata.messages | string[] | |
to.lastSeenTime | string | Last activity timestamp. Updated automatically. Read-only. |
to.updatedAt | string | Last update timestamp. Read-only. |
to.createdAt | string | Creation timestamp. Read-only. |
to.emailSuppressionStatus | object | Bounce or complaint status if email was suppressed. Read-only. |
to.emailSuppressionStatus.reason | ”Bounce” | “Complaint” | (required) |
to.emailSuppressionStatus.details | object | (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. |
parameters | Record<string, any> | Key-value pairs for template merge tags. Replaces placeholders like {{firstName}} in templates. |
secondaryId | string | Optional sub-notification identifier for grouping or tracking. |
templateId | string | Specific template ID to use. If omitted, uses the default template for each channel. |
subNotificationId | string | Sub-notification identifier (e.g. for grouping related notifications). |
options | object | Per-channel overrides for send options (email, APN, FCM). |
options.email | object | Email-specific overrides. |
options.email.replyToAddresses | string[] | Reply-to addresses for the email. |
options.email.ccAddresses | string[] | CC recipients. |
options.email.bccAddresses | string[] | BCC recipients. |
options.email.fromAddress | string | Override sender email address. |
options.email.fromName | string | Override sender display name. |
options.email.attachments | (object | object)[] | File attachments (by URL or inline base64 content). |
options.email.condition | string | Conditional expression for when to send (e.g. merge tag logic). |
options.apn | object | Apple Push Notification (APN) overrides. |
options.apn.expiry | number | Seconds until the notification expires. |
options.apn.priority | number | Delivery priority (10 = immediate, 5 = power-saving). |
options.apn.collapseId | string | Group notifications with the same ID (replaces previous). |
options.apn.threadId | string | Thread identifier for grouping notifications. |
options.apn.badge | number | Badge count on app icon. |
options.apn.sound | string | Sound file name. |
options.apn.contentAvailable | boolean | Silent background notification (no alert). |
options.fcm | object | Firebase Cloud Messaging (FCM) overrides. |
options.fcm.android | object | Android-specific FCM options. |
options.fcm.android.collapseKey | string | Collapse key for grouping messages. |
options.fcm.android.priority | ”high” | “normal” | Delivery priority. |
options.fcm.android.ttl | number | Time to live in seconds. |
options.fcm.android.restrictedPackageName | string | Restrict delivery to a specific package. |
schedule | string | |
email | object | Inline email content (subject, html). Use when not using templates. |
email.subject | string | (required) Email subject line. |
email.html | string | (required) HTML body content. |
email.previewText | string | Preview/snippet text shown in inbox. |
email.senderName | string | Display name of sender. |
email.senderEmail | string | Sender email address. |
inapp | object | Inline in-app content (title, url, image). |
inapp.title | string | (required) Notification title. |
inapp.url | string | URL to open when clicked. |
inapp.image | string | Image URL. |
sms | object | Inline SMS content (message, autoReply). |
sms.message | string | SMS body text. |
sms.autoReply | object | |
sms.autoReply.message | string | (required) Auto-reply message to send when user texts in. |
call | object | Inline call content (message). |
call.message | string | (required) Text to speak (TTS). |
web_push | object | Inline web push content (title, message, icon, url). |
web_push.title | string | (required) Notification title. |
web_push.message | string | (required) Body text. |
web_push.icon | string | Icon URL. |
web_push.url | string | URL to open when clicked. |
mobile_push | object | Inline mobile push content (title, message). |
mobile_push.title | string | (required) Notification title. |
mobile_push.message | string | (required) Body text. |
slack | object | Inline Slack content (text, blocks, etc.). |
slack.text | string | (required) Fallback plain text (required when using blocks). |
slack.blocks | Record<string, any>[] | Slack Block Kit blocks. |
slack.username | string | Override bot username. |
slack.icon | string | Icon: emoji (e.g. “:smile:”) or URL. Default: bot’s icon. |
slack.thread_ts | string | Parent message ts to post in a thread. |
slack.reply_broadcast | boolean | When 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_names | boolean | Convert channel and username refs to Slack links. Default: false. |
slack.mrkdwn | boolean | Enable Slack markup (bold, italic, code). Default: true. |
slack.unfurl_links | boolean | Unfurl link previews. Default: true. |
slack.unfurl_media | boolean | Unfurl media previews. Default: true. |
slack.metadata | object | Slack message metadata with optional work object entities. Combines standard Slack message metadata fields with an array of entity objects. |
slack.metadata.entities | object[] | An array of work object entities. |
slack.metadata.entities[].entity_type | string | (required) Entity type (e.g., ‘slack#/entities/task’, ‘slack#/entities/file’). |
slack.metadata.entities[].entity_payload | Record<string, any> | (required) Schema for the given entity type. |
slack.metadata.entities[].external_ref | object | (required) Reference used to identify an entity within the developer’s system. |
slack.metadata.entities[].external_ref.id | string | (required) |
slack.metadata.entities[].external_ref.type | string | |
slack.metadata.entities[].url | string | (required) URL used to identify an entity within the developer’s system. |
slack.metadata.entities[].app_unfurl_url | string | The exact URL posted in the source message. Required in metadata passed to chat.unfurl. |
slack.metadata.event_type | string | A human readable alphanumeric string representing your application’s metadata event. |
slack.metadata.event_payload | Record<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
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | str | Notification ID | |
| channel | str | Channel type | |
| template_post_request | TemplatePostRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
templateId | string | (required) Unique ID for this template within the notification and channel. Required. |
html | string | HTML body of the email. |
previewText | string | Preview text (e.g. for inbox). |
internal | string | Internal 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. |
subject | string | Email subject line. |
senderName | string | Sender display name. |
senderEmail | string | Sender email address. |
title | string | Notification title (in-app). |
redirectURL | string | URL to open when the user taps the notification. |
imageURL | string | Image URL shown in the in-app notification. |
instant | object | Copy for instant (real-time) delivery. |
instant.title | string | |
instant.redirectURL | string | |
instant.imageURL | string | (required) |
batch | object | Copy for batch delivery. |
batch.title | string | (required) |
batch.redirectURL | string | (required) |
batch.imageURL | string | (required) |
text | string | Message text (SMS or call). |
message | string | Push notification body text. (title is shared with INAPP_WEB above.) |
icon | string | Web push: icon URL. Slack: bot icon (emoji or URL). |
url | string | Web push: URL to open when the notification is clicked. |
blocks | Record<string, any>[] | Slack message blocks (optional). |
username | string | Slack 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
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | str | Notification ID | |
| channel | str | Channel type | |
| template_id | str | Template 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
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | str | Notification ID | |
| channel | str | Channel type | |
| template_id | str | Template 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
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | str | Notification ID | |
| channel | str | Channel 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
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | str | Notification ID | |
| channel | str | Channel type | |
| set_default_template_request | SetDefaultTemplateRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
templateId | string | (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
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | str | Notification ID | |
| channel | str | Channel type | |
| template_id | str | Template ID | |
| template_patch_request | TemplatePatchRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
html | string | HTML body of the email. |
previewText | string | Preview text (e.g. for inbox). |
internal | string | Internal 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. |
subject | string | Email subject line. |
senderName | string | Sender display name. |
senderEmail | string | Sender email address. |
title | string | Notification title (in-app). |
redirectURL | string | URL to open when the user taps the notification. |
imageURL | string | Image URL shown in the in-app notification. |
instant | object | Copy for instant (real-time) delivery. |
instant.title | string | |
instant.redirectURL | string | |
instant.imageURL | string | (required) |
batch | object | Copy for batch delivery. |
batch.title | string | (required) |
batch.redirectURL | string | (required) |
batch.imageURL | string | (required) |
text | string | Message text (SMS or call). |
message | string | Push notification body text. (title is shared with INAPP_WEB above.) |
icon | string | Web push: icon URL. Slack: bot icon (emoji or URL). |
url | string | Web push: URL to open when the notification is clicked. |
blocks | Record<string, any>[] | Slack message blocks (optional). |
username | string | Slack 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
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_create_request | NotificationCreateRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
notificationId | string | (required) |
title | string | (required) |
channels | string[] | (required) |
options | object | |
options.EMAIL | object | |
options.EMAIL.defaultDeliveryOption | ”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.EMAIL.off | object | |
options.EMAIL.off.enabled | boolean | (required) |
options.EMAIL.instant | object | |
options.EMAIL.instant.enabled | boolean | (required) |
options.EMAIL.hourly | object | |
options.EMAIL.hourly.enabled | boolean | (required) |
options.EMAIL.daily | object | |
options.EMAIL.daily.enabled | boolean | (required) |
options.EMAIL.daily.hour | string | |
options.EMAIL.weekly | object | |
options.EMAIL.weekly.enabled | boolean | (required) |
options.EMAIL.weekly.hour | string | |
options.EMAIL.weekly.day | string | |
options.EMAIL.monthly | object | |
options.EMAIL.monthly.enabled | boolean | (required) |
options.EMAIL.monthly.hour | string | |
options.EMAIL.monthly.date | ”first” | “last” | |
options.INAPP_WEB | object | |
options.INAPP_WEB.defaultDeliveryOption | ”off” | “instant” | (required) |
options.INAPP_WEB.off | object | |
options.INAPP_WEB.off.enabled | boolean | (required) |
options.INAPP_WEB.instant | object | |
options.INAPP_WEB.instant.enabled | boolean | (required) |
options.INAPP_WEB.instant.batching | boolean | |
options.INAPP_WEB.instant.batchingKey | string | |
options.INAPP_WEB.instant.batchingWindow | number | |
options.SMS | object | |
options.SMS.defaultDeliveryOption | ”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.SMS.off | object | |
options.SMS.off.enabled | boolean | (required) |
options.SMS.instant | object | |
options.SMS.instant.enabled | boolean | (required) |
options.SMS.hourly | object | |
options.SMS.hourly.enabled | boolean | (required) |
options.SMS.daily | object | |
options.SMS.daily.enabled | boolean | (required) |
options.SMS.daily.hour | string | |
options.SMS.weekly | object | |
options.SMS.weekly.enabled | boolean | (required) |
options.SMS.weekly.hour | string | |
options.SMS.weekly.day | string | |
options.SMS.monthly | object | |
options.SMS.monthly.enabled | boolean | (required) |
options.SMS.monthly.hour | string | |
options.SMS.monthly.date | ”first” | “last” | |
options.CALL | object | |
options.CALL.defaultDeliveryOption | ”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.CALL.off | object | |
options.CALL.off.enabled | boolean | (required) |
options.CALL.instant | object | |
options.CALL.instant.enabled | boolean | (required) |
options.CALL.hourly | object | |
options.CALL.hourly.enabled | boolean | (required) |
options.CALL.daily | object | |
options.CALL.daily.enabled | boolean | (required) |
options.CALL.daily.hour | string | |
options.CALL.weekly | object | |
options.CALL.weekly.enabled | boolean | (required) |
options.CALL.weekly.hour | string | |
options.CALL.weekly.day | string | |
options.CALL.monthly | object | |
options.CALL.monthly.enabled | boolean | (required) |
options.CALL.monthly.hour | string | |
options.CALL.monthly.date | ”first” | “last” | |
options.PUSH | object | |
options.PUSH.defaultDeliveryOption | ”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.PUSH.off | object | |
options.PUSH.off.enabled | boolean | (required) |
options.PUSH.instant | object | |
options.PUSH.instant.enabled | boolean | (required) |
options.PUSH.hourly | object | |
options.PUSH.hourly.enabled | boolean | (required) |
options.PUSH.daily | object | |
options.PUSH.daily.enabled | boolean | (required) |
options.PUSH.daily.hour | string | |
options.PUSH.weekly | object | |
options.PUSH.weekly.enabled | boolean | (required) |
options.PUSH.weekly.hour | string | |
options.PUSH.weekly.day | string | |
options.PUSH.monthly | object | |
options.PUSH.monthly.enabled | boolean | (required) |
options.PUSH.monthly.hour | string | |
options.PUSH.monthly.date | ”first” | “last” | |
options.WEB_PUSH | object | |
options.WEB_PUSH.defaultDeliveryOption | ”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.WEB_PUSH.off | object | |
options.WEB_PUSH.off.enabled | boolean | (required) |
options.WEB_PUSH.instant | object | |
options.WEB_PUSH.instant.enabled | boolean | (required) |
options.WEB_PUSH.hourly | object | |
options.WEB_PUSH.hourly.enabled | boolean | (required) |
options.WEB_PUSH.daily | object | |
options.WEB_PUSH.daily.enabled | boolean | (required) |
options.WEB_PUSH.daily.hour | string | |
options.WEB_PUSH.weekly | object | |
options.WEB_PUSH.weekly.enabled | boolean | (required) |
options.WEB_PUSH.weekly.hour | string | |
options.WEB_PUSH.weekly.day | string | |
options.WEB_PUSH.monthly | object | |
options.WEB_PUSH.monthly.enabled | boolean | (required) |
options.WEB_PUSH.monthly.hour | string | |
options.WEB_PUSH.monthly.date | ”first” | “last” | |
options.SLACK | object | |
options.SLACK.defaultDeliveryOption | ”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.SLACK.off | object | |
options.SLACK.off.enabled | boolean | (required) |
options.SLACK.instant | object | |
options.SLACK.instant.enabled | boolean | (required) |
options.SLACK.hourly | object | |
options.SLACK.hourly.enabled | boolean | (required) |
options.SLACK.daily | object | |
options.SLACK.daily.enabled | boolean | (required) |
options.SLACK.daily.hour | string | |
options.SLACK.weekly | object | |
options.SLACK.weekly.enabled | boolean | (required) |
options.SLACK.weekly.hour | string | |
options.SLACK.weekly.day | string | |
options.SLACK.monthly | object | |
options.SLACK.monthly.enabled | boolean | (required) |
options.SLACK.monthly.hour | string | |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | str | The 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
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | str | The 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
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | str | The notification ID | |
| notification_patch_request | NotificationPatchRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
title | string | |
channels | (“EMAIL” | “INAPP_WEB” | “SMS” | “CALL” | “PUSH” | “WEB_PUSH” | “SLACK”)[] | |
enabled | boolean | |
deduplication | object | |
deduplication.duration | number | (required) |
throttling | object | |
throttling.max | number | (required) |
throttling.period | number | (required) |
throttling.unit | ”seconds” | “minutes” | “hours” | “days” | “months” | “years” | (required) |
throttling.forever | boolean | (required) |
throttling.scope | (“userId” | “notificationId”)[] | (required) |
retention | number | null |
options | object | |
options.EMAIL | object | |
options.EMAIL.defaultDeliveryOption | ”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.EMAIL.off | object | |
options.EMAIL.off.enabled | boolean | (required) |
options.EMAIL.instant | object | |
options.EMAIL.instant.enabled | boolean | (required) |
options.EMAIL.hourly | object | |
options.EMAIL.hourly.enabled | boolean | (required) |
options.EMAIL.daily | object | |
options.EMAIL.daily.enabled | boolean | (required) |
options.EMAIL.daily.hour | string | |
options.EMAIL.weekly | object | |
options.EMAIL.weekly.enabled | boolean | (required) |
options.EMAIL.weekly.hour | string | |
options.EMAIL.weekly.day | string | |
options.EMAIL.monthly | object | |
options.EMAIL.monthly.enabled | boolean | (required) |
options.EMAIL.monthly.hour | string | |
options.EMAIL.monthly.date | ”first” | “last” | |
options.INAPP_WEB | object | |
options.INAPP_WEB.defaultDeliveryOption | ”off” | “instant” | (required) |
options.INAPP_WEB.off | object | |
options.INAPP_WEB.off.enabled | boolean | (required) |
options.INAPP_WEB.instant | object | |
options.INAPP_WEB.instant.enabled | boolean | (required) |
options.INAPP_WEB.instant.batching | boolean | |
options.INAPP_WEB.instant.batchingKey | string | |
options.INAPP_WEB.instant.batchingWindow | number | |
options.SMS | object | |
options.SMS.defaultDeliveryOption | ”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.SMS.off | object | |
options.SMS.off.enabled | boolean | (required) |
options.SMS.instant | object | |
options.SMS.instant.enabled | boolean | (required) |
options.SMS.hourly | object | |
options.SMS.hourly.enabled | boolean | (required) |
options.SMS.daily | object | |
options.SMS.daily.enabled | boolean | (required) |
options.SMS.daily.hour | string | |
options.SMS.weekly | object | |
options.SMS.weekly.enabled | boolean | (required) |
options.SMS.weekly.hour | string | |
options.SMS.weekly.day | string | |
options.SMS.monthly | object | |
options.SMS.monthly.enabled | boolean | (required) |
options.SMS.monthly.hour | string | |
options.SMS.monthly.date | ”first” | “last” | |
options.CALL | object | |
options.CALL.defaultDeliveryOption | ”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.CALL.off | object | |
options.CALL.off.enabled | boolean | (required) |
options.CALL.instant | object | |
options.CALL.instant.enabled | boolean | (required) |
options.CALL.hourly | object | |
options.CALL.hourly.enabled | boolean | (required) |
options.CALL.daily | object | |
options.CALL.daily.enabled | boolean | (required) |
options.CALL.daily.hour | string | |
options.CALL.weekly | object | |
options.CALL.weekly.enabled | boolean | (required) |
options.CALL.weekly.hour | string | |
options.CALL.weekly.day | string | |
options.CALL.monthly | object | |
options.CALL.monthly.enabled | boolean | (required) |
options.CALL.monthly.hour | string | |
options.CALL.monthly.date | ”first” | “last” | |
options.PUSH | object | |
options.PUSH.defaultDeliveryOption | ”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.PUSH.off | object | |
options.PUSH.off.enabled | boolean | (required) |
options.PUSH.instant | object | |
options.PUSH.instant.enabled | boolean | (required) |
options.PUSH.hourly | object | |
options.PUSH.hourly.enabled | boolean | (required) |
options.PUSH.daily | object | |
options.PUSH.daily.enabled | boolean | (required) |
options.PUSH.daily.hour | string | |
options.PUSH.weekly | object | |
options.PUSH.weekly.enabled | boolean | (required) |
options.PUSH.weekly.hour | string | |
options.PUSH.weekly.day | string | |
options.PUSH.monthly | object | |
options.PUSH.monthly.enabled | boolean | (required) |
options.PUSH.monthly.hour | string | |
options.PUSH.monthly.date | ”first” | “last” | |
options.WEB_PUSH | object | |
options.WEB_PUSH.defaultDeliveryOption | ”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.WEB_PUSH.off | object | |
options.WEB_PUSH.off.enabled | boolean | (required) |
options.WEB_PUSH.instant | object | |
options.WEB_PUSH.instant.enabled | boolean | (required) |
options.WEB_PUSH.hourly | object | |
options.WEB_PUSH.hourly.enabled | boolean | (required) |
options.WEB_PUSH.daily | object | |
options.WEB_PUSH.daily.enabled | boolean | (required) |
options.WEB_PUSH.daily.hour | string | |
options.WEB_PUSH.weekly | object | |
options.WEB_PUSH.weekly.enabled | boolean | (required) |
options.WEB_PUSH.weekly.hour | string | |
options.WEB_PUSH.weekly.day | string | |
options.WEB_PUSH.monthly | object | |
options.WEB_PUSH.monthly.enabled | boolean | (required) |
options.WEB_PUSH.monthly.hour | string | |
options.WEB_PUSH.monthly.date | ”first” | “last” | |
options.SLACK | object | |
options.SLACK.defaultDeliveryOption | ”off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.SLACK.off | object | |
options.SLACK.off.enabled | boolean | (required) |
options.SLACK.instant | object | |
options.SLACK.instant.enabled | boolean | (required) |
options.SLACK.hourly | object | |
options.SLACK.hourly.enabled | boolean | (required) |
options.SLACK.daily | object | |
options.SLACK.daily.enabled | boolean | (required) |
options.SLACK.daily.hour | string | |
options.SLACK.weekly | object | |
options.SLACK.weekly.enabled | boolean | (required) |
options.SLACK.weekly.hour | string | |
options.SLACK.weekly.day | string | |
options.SLACK.monthly | object | |
options.SLACK.monthly.enabled | boolean | (required) |
options.SLACK.monthly.hour | string | |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| user_id | str | User ID | |
| slack_oauth_request | SlackOauthRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
code | string | (required) |
redirect_uri | string | (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
| Name | Type | Description | Notes |
|---|---|---|---|
| user_id | str | User 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
| Name | Type | Description | Notes |
|---|---|---|---|
| before | str | Timestamp or ISO date to fetch notifications before | [optional] |
| count | float | Number 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
| Name | Type | Description | Notes |
|---|---|---|---|
| user_id | str | User 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
| Name | Type | Description | Notes |
|---|---|---|---|
| user_id | str | User ID | |
| post_user_request | PostUserRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
id | string | Unique user identifier. Required. |
email | string | User’s email address for email notifications. |
number | string | User’s phone number for SMS/call notifications. |
pushTokens | object[] | Mobile push tokens (FCM, APN) for push notifications. |
pushTokens[].type | ”FCM” | “APN” | (required) |
pushTokens[].token | string | (required) |
pushTokens[].device | object | (required) |
pushTokens[].device.app_id | string | |
pushTokens[].device.ad_id | string | |
pushTokens[].device.device_id | string | (required) |
pushTokens[].device.platform | string | |
pushTokens[].device.manufacturer | string | |
pushTokens[].device.model | string | |
pushTokens[].environment | string | used by APN to differentiate between sandbox and production builds (sandbox/undefined or production) |
webPushTokens | object[] | Web push subscription config from the browser. |
webPushTokens[].sub | object | (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.endpoint | string | (required) |
webPushTokens[].sub.keys | object | (required) |
webPushTokens[].sub.keys.p256dh | string | (required) |
webPushTokens[].sub.keys.auth | string | (required) |
timezone | string | User’s timezone (e.g. “America/New_York”) for scheduling. |
slackChannel | string | The 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” |
slackToken | object | |
slackToken.access_token | string | |
slackToken.app_id | string | |
slackToken.authed_user | object | |
slackToken.authed_user.access_token | string | |
slackToken.authed_user.expires_in | number | |
slackToken.authed_user.id | string | |
slackToken.authed_user.refresh_token | string | |
slackToken.authed_user.scope | string | |
slackToken.authed_user.token_type | string | |
slackToken.bot_user_id | string | |
slackToken.enterprise | object | |
slackToken.enterprise.id | string | |
slackToken.enterprise.name | string | |
slackToken.error | string | |
slackToken.expires_in | number | |
slackToken.incoming_webhook | object | |
slackToken.incoming_webhook.channel | string | |
slackToken.incoming_webhook.channel_id | string | |
slackToken.incoming_webhook.configuration_url | string | |
slackToken.incoming_webhook.url | string | |
slackToken.is_enterprise_install | boolean | |
slackToken.needed | string | |
slackToken.ok | boolean | (required) |
slackToken.provided | string | |
slackToken.refresh_token | string | |
slackToken.scope | string | |
slackToken.team | object | |
slackToken.team.id | string | |
slackToken.team.name | string | |
slackToken.token_type | string | |
slackToken.warning | string | |
slackToken.response_metadata | object | |
slackToken.response_metadata.warnings | string[] | |
slackToken.response_metadata.next_cursor | string | |
slackToken.response_metadata.scopes | string[] | |
slackToken.response_metadata.acceptedScopes | string[] | |
slackToken.response_metadata.retryAfter | number | |
slackToken.response_metadata.messages | string[] |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| in_app_notification_unread_clear_request | InAppNotificationUnreadClearRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
notificationId | string | |
trackingId | string |
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
| Name | Type | Description | Notes |
|---|---|---|---|
| in_app_notification_patch_request | InAppNotificationPatchRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
trackingIds | string[] | (required) |
opened | string | |
clicked | string | |
archived | string | |
actioned1 | string | |
actioned2 | string | |
reply | object | |
reply.date | string | (required) |
reply.message | string | (required) |
replies | object[] | |
replies[].date | string | (required) |
replies[].message | string | (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
| Name | Type | Description | Notes |
|---|---|---|---|
| user_id | str | User ID | |
| env_id | str | Environment 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
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | float | Maximum number of users to return (default | |
| next_token | str | Pagination token for next page | |
| env_id | str | Environment 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
| Name | Type | Description | Notes |
|---|---|---|---|
| user_id | str | User ID | |
| channel | str | Channel type (EMAIL) | |
| env_id | str | Environment 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
| Name | Type | Description | Notes |
|---|---|---|---|
| events_webhook_upsert_request | EventsWebhookUpsertRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
webhook | string | (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. |