asyncwithPingram(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
asyncdefmain():
asyncwithPingram(api_key="pingram_sk_...",region="eu") as client:
# Use client methods here
pass
asyncio.run(main())
Or using base_url directly:
import asyncio
asyncdefmain():
asyncwithPingram(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 (email, SMS, etc.) to one user. Requires a notification type which categorizes this messages for future reporting, and channel-specific payloads such as email or sms. Recipient is specified with the to parameter. Returns a trackingId for error or delivery lookup through our Logs.
from pingram import Pingram
asyncwithPingram(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.
Start removing all email suppressions of the given reason (retryable or bounces) for users in the environment. Returns immediately after the job is queued — suppressions are not yet cleared when this response is received. Large removals are processed in the background in batches.
from pingram import Pingram
asyncwithPingram(api_key="pingram_sk_...") as client:
Send an email. Requires type, to, subject, and html. Optional: fromAddress, fromName, schedule, attachments. The fromAddress must be a verified domain; otherwise our built-in address will be used which is fine for testing purposes.
from pingram import Pingram
asyncwithPingram(api_key="pingram_sk_...") as client:
asyncwithPingram(api_key="pingram_sk_...") as client:
response =await client.logs.logs_tail_logs()
print(response)
Parameters
This endpoint does not need any parameter.
Numbers
numbers_list()
List active phone numbers registered for the account, including voice agent binding state.
from pingram import Pingram
asyncwithPingram(api_key="pingram_sk_...") as client:
response =await client.numbers.numbers_list()
print(response)
Parameters
This endpoint does not need any parameter.
numbers_list_released()
List released phone numbers. Released numbers may be purchased again with 2 weeks of being released. Released numbers may be removed from released list after 2 weeks.
from pingram import Pingram
asyncwithPingram(api_key="pingram_sk_...") as client:
Purchase a phone number for the authenticated account, or reactivate a released number owned by the account (preserves original createdAt). Pass phoneNumber in E.164 format (e.g. +15551234567).
from pingram import Pingram
asyncwithPingram(api_key="pingram_sk_...") as client:
(required) Legal entity type for a 10DLC brand. - PRIVATE_PROFIT: private for-profit (LLC, corp, etc.) - SOLE_PROPRIETOR: sole proprietorship - PUBLIC_PROFIT: publicly traded for-profit - NON_PROFIT: non-profit - GOVERNMENT: government
legalName
string
Official registered legal business name. For SOLE_PROPRIETOR, optional DBA or trade name (defaults to firstName and lastName).
displayName
string
(required) Public brand name shown to recipients and carriers. Use the name customers recognize (your DBA or trade name). For companies with no DBA, use the same value as legalName. For SOLE_PROPRIETOR, this is the brand you send as — not the individual’s legal name (set firstName and lastName for that). If the sole proprietor has no DBA, use first and last name.
firstName
string
Legal first name of the sole proprietor. Required when businessType is SOLE_PROPRIETOR.
lastName
string
Legal last name of the sole proprietor. Required when businessType is SOLE_PROPRIETOR.
taxId
string
For US companies (country US): 9-digit EIN (Employer Identification Number). For Canada (country CA): 9-digit BN (Business Number). For other countries: national business tax identifier. Required except when businessType is SOLE_PROPRIETOR.
website
string
(required) Public website for the brand. Include a scheme (https://) or a domain; https:// is prepended when omitted. Carriers expect a working site with privacy policy and terms.
country
string
(required) ISO 3166-1 alpha-2 country of incorporation (for example US or CA).
street
string
(required) Street address that matches official tax registration.
city
string
(required) City that matches official tax registration.
state
string
(required) State (US) or province (CA) that matches official tax registration.
postalCode
string
(required) ZIP code (US) or postal code (CA) that matches official tax registration.
complianceContactEmail
string
(required) Email for the 10DLC compliance contact. Used for carrier and registration follow-up.
complianceContactPhone
string
(required) Phone number for the 10DLC compliance contact. E.164 preferred; national numbers are normalized using country.
registrations_get_us10dlc_brand()
Get the 10DLC brand registration for the authenticated account. Returns null when no registration exists yet.
from pingram import Pingram
asyncwithPingram(api_key="pingram_sk_...") as client:
Legal entity type for a 10DLC brand. - PRIVATE_PROFIT: private for-profit (LLC, corp, etc.) - SOLE_PROPRIETOR: sole proprietorship - PUBLIC_PROFIT: publicly traded for-profit - NON_PROFIT: non-profit - GOVERNMENT: government
legalName
string
Official registered legal business name. For SOLE_PROPRIETOR, optional DBA or trade name (defaults to firstName and lastName).
displayName
string
Public brand name shown to recipients and carriers. Use the name customers recognize (your DBA or trade name). For SOLE_PROPRIETOR, this is the brand you send as — not the individual’s legal name. Omit to keep the existing value. If you change legalName and omit displayName, displayName is reset to the new legalName.
firstName
string
Legal first name of the sole proprietor. Required when businessType is SOLE_PROPRIETOR.
lastName
string
Legal last name of the sole proprietor. Required when businessType is SOLE_PROPRIETOR.
taxId
string
For US companies (country US): 9-digit EIN (Employer Identification Number). For Canada (country CA): 9-digit BN (Business Number). For other countries: national business tax identifier. Required except when businessType is SOLE_PROPRIETOR.
website
string
Public website for the brand. Include a scheme (https://) or a domain; https:// is prepended when omitted. Carriers expect a working site with privacy policy and terms.
country
string
ISO 3166-1 alpha-2 country of incorporation (for example US or CA).
street
string
Street address that matches official tax registration.
city
string
City that matches official tax registration.
state
string
State (US) or province (CA) that matches official tax registration.
postalCode
string
ZIP code (US) or postal code (CA) that matches official tax registration.
complianceContactEmail
string
Email for the 10DLC compliance contact. Used for carrier and registration follow-up.
complianceContactPhone
string
Phone number for the 10DLC compliance contact. E.164 preferred; national numbers are normalized using country.
registrations_update_us10dlc_campaign()
Update an existing 10DLC campaign registration. Campaign fields are editable before carrier submission; workflow status is managed by Pingram.
from pingram import Pingram
asyncwithPingram(api_key="pingram_sk_...") as client:
Summary of what this campaign sends and why, including audience and typical message content. Required before carrier submission.
campaignSample1
string
Example SMS that represents actual campaign traffic. Required before carrier submission. Should match the use case and typically identify the brand and include STOP/HELP language.
campaignSample2
string
Second example SMS. Required before carrier submission. Required for MARKETING and MIXED use cases.
campaignSample3
string
Optional third example SMS.
campaignSample4
string
Optional fourth example SMS.
campaignMessageFlow
string
How recipients opt in (for example website form, checkout, or keyword). Describe the call-to-action and where consent is collected. Required before carrier submission.
campaignOptinKeywords
string
Extra opt-in keywords as a comma-separated list. START is always included.
campaignOptinMessage
string
Auto-reply sent when a recipient opts in. Required before carrier submission. Should confirm the subscription, mention message frequency, and include STOP and HELP instructions.
campaignOptoutKeywords
string
Extra opt-out keywords as a comma-separated list. STOP is always included.
campaignOptoutMessage
string
Auto-reply sent when a recipient opts out. Required before carrier submission. Should confirm they will receive no further messages.
campaignHelpKeywords
string
Extra help keywords as a comma-separated list. HELP is always included.
campaignHelpMessage
string
Auto-reply sent when a recipient texts a help keyword. Required before carrier submission. Should include a support contact (email and/or phone).
campaignEmbeddedLink
boolean
Whether campaign messages include URLs.
campaignEmbeddedLinkUrl
string
Sample URL that appears in messages. Provide when campaignEmbeddedLink is true.
campaignEmbeddedPhone
boolean
Whether campaign messages include phone numbers.
campaignAgeGated
boolean
Whether campaign content is age-restricted (18+).
campaignDirectLending
boolean
Whether the campaign relates to direct lending or loan products.
campaignPrivacyPolicyLink
string
Public URL of the privacy policy that covers this SMS program.
campaignTermsAndConditionsLink
string
Public URL of the terms and conditions that cover this SMS program.
campaignUsecase
string
10DLC campaign use case submitted to carriers. Required before carrier submission. One of 2FA, ACCOUNT_NOTIFICATION, CUSTOMER_CARE, DELIVERY_NOTIFICATION, FRAUD_ALERT, MARKETING, MIXED, POLLING_VOTING, PUBLIC_SERVICE_ANNOUNCEMENT, or SECURITY_ALERT. For MIXED, append comma-separated sub-use cases after MIXED (sub-use cases cannot include MIXED), for example MIXED,2FA,ACCOUNT_NOTIFICATION.
Sender
sender_delete_schedule()
Delete (unschedule) an already scheduled notification
from pingram import Pingram
asyncwithPingram(api_key="pingram_sk_...") as client:
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.
(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
asyncwithPingram(api_key="pingram_sk_...") as client:
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
asyncwithPingram(api_key="pingram_sk_...") as client:
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
asyncwithPingram(api_key="pingram_sk_...") as client: