Ruby SDK
Setup & Initialization
- Install:
gem install pingramOr add to your Gemfile:
gem 'pingram'- Require and initialize:
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')| Name | Type | Description |
|---|---|---|
api_key* |
string | Your Pingram API key. You can get it from your dashboard under Environments. |
base_url |
string | Optional. Override the base URL. Use https://api.ca.pingram.io for the Canada region, and https://api.eu.pingram.io for the EU region. Default: US region. |
* required
Region specific example:
client = Pingram::Client.new(api_key: 'YOUR_API_KEY', base_url: 'https://api.eu.pingram.io')Send
call_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.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::SenderPostBody.new # configure as needed
begin result = client.send(body) p resultrescue Pingram::ApiError => e puts "Error when calling call_send: #{e}"endParameters
| 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.properties |
Record<string, string | number | boolean> | Custom key-value properties synced by the developer, used for audience segmentation (e.g. broadcast filters on user.properties.plan). Incremental identify calls shallow-merge keys (unset keys are preserved). Limits: max 25 keys, key length <= 64, string values <= 256 chars, serialized size <= 1KB. |
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” | “VOICE” | “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. |
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.openTracking |
boolean | When false, this send does not record opens and no open pixel is added. Delivery, bounce, and complaint events are unchanged. Defaults to true. |
options.email.clickTracking |
boolean | When false, links are left as written and clicks are not recorded. Delivery, bounce, and complaint events are unchanged. Defaults to true. |
options.email.attachments |
(object | object)[] | File attachments (by URL or inline base64 content). Inline content: ~4 MB raw per file (413 if exceeded). URL url: up to 20 MB per file. |
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. |
options.push |
object | Cross-platform mobile push options (applied to both APN and FCM). |
options.push.customData |
Record<string, string> | Up to 3 custom string key-value pairs for deep linking. Included in both APN and FCM payloads. |
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, from, mediaUrls). |
sms.message |
string | SMS/MMS body text. |
sms.mediaUrls |
string[] | Public HTTPS URLs of media to attach (MMS). Carriers fetch these via GET. Total size limits apply per provider. |
sms.from |
string | Override the sender phone number. Must be a verified number on your account. |
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. |
Return Type
SenderPostResponse
Webhooks
webhooks_create_webhook()
Create a webhook endpoint on a server outside Pingram. Pingram later POSTs signed JSON to that URL when one of the subscribed events happens. This call only saves the endpoint; it does not send a webhook and does not modify the destination server. The response includes id and a signing secret starting with pingram_whsecret_. Save it and verify the X-Pingram-Signature header. Updates keep this secret. At most 10 endpoints per account. The URL must be a public HTTPS URL and should return 2xx.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::WebhookEndpointUpsertRequest.new # configure as needed
begin result = client.webhooks.webhooks_create_webhook(body) p resultrescue Pingram::ApiError => e puts "Error when calling webhooks_create_webhook: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| webhook_endpoint_upsert_request | WebhookEndpointUpsertRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
webhook |
string | (required) Public HTTPS URL that accepts POST with a JSON event body. Return 2xx to acknowledge. Private, loopback, and link-local addresses are rejected. Requests include X-Pingram-Id, X-Pingram-Signature (v1 HMAC-SHA256), and X-Pingram-Timestamp. |
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_SUBSCRIBE” | “SMS_INBOUND” | “VOICE_INBOUND” | “VOICE_CONNECTED” | “VOICE_ENDED” | “PUSH_FAILED” | “PUSH_UNSUBSCRIBE” | “CALL_FAILED” | “CALL_UNSUBSCRIBE” | “WEB_PUSH_FAILED” | “WEB_PUSH_UNSUBSCRIBE” | “SLACK_FAILED” | “SLACK_UNSUBSCRIBE” | “ACCOUNT_USAGE”)[] | (required) Full set of event types to deliver to this URL. Omitting an event on update unsubscribes it. Inbound SMS to the free shared number only works when that person has already received a text from this number. Inbound SMS to a dedicated number works normally. |
Return Type
WebhookEndpoint
webhooks_delete_webhook()
```rubyrequire 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.webhooks.webhooks_delete_webhook p resultrescue Pingram::ApiError => e puts "Error when calling webhooks_delete_webhook: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| endpoint_id | String | Id of the webhook endpoint, from list or create. |
Return Type
nil (empty response body)
webhooks_list_webhooks()
List webhook endpoints on the current account, including each id, URL, subscribed events, and signing secret. Use the id with update or delete.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.webhooks.webhooks_list_webhooks p resultrescue Pingram::ApiError => e puts "Error when calling webhooks_list_webhooks: #{e}"endParameters
This endpoint does not need any parameter.
Return Type
WebhookEndpointsResponse
webhooks_update_webhook()
Replace one webhook endpoint’s URL and its full event subscription. The URL is a server outside Pingram. endpointId comes from list or create. The signing secret stays the same. events is the complete set; omitting an event unsubscribes it, and the previous URL stops receiving events. The previous URL and event list are not kept. The URL must be a public HTTPS URL.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::WebhookEndpointUpsertRequest.new # configure as needed
begin result = client.webhooks.webhooks_update_webhook(body) p resultrescue Pingram::ApiError => e puts "Error when calling webhooks_update_webhook: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| endpoint_id | String | Id of the webhook endpoint, from list or create. | |
| webhook_endpoint_upsert_request | WebhookEndpointUpsertRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
webhook |
string | (required) Public HTTPS URL that accepts POST with a JSON event body. Return 2xx to acknowledge. Private, loopback, and link-local addresses are rejected. Requests include X-Pingram-Id, X-Pingram-Signature (v1 HMAC-SHA256), and X-Pingram-Timestamp. |
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_SUBSCRIBE” | “SMS_INBOUND” | “VOICE_INBOUND” | “VOICE_CONNECTED” | “VOICE_ENDED” | “PUSH_FAILED” | “PUSH_UNSUBSCRIBE” | “CALL_FAILED” | “CALL_UNSUBSCRIBE” | “WEB_PUSH_FAILED” | “WEB_PUSH_UNSUBSCRIBE” | “SLACK_FAILED” | “SLACK_UNSUBSCRIBE” | “ACCOUNT_USAGE”)[] | (required) Full set of event types to deliver to this URL. Omitting an event on update unsubscribes it. Inbound SMS to the free shared number only works when that person has already received a text from this number. Inbound SMS to a dedicated number works normally. |
Return Type
WebhookEndpoint
Accounts
accounts_create_account()
Create one additional Pingram account (a separate workspace) for the signed-in user. The caller must already belong to an account. Requires a user session or personal access token; an account API key cannot call this. Does not create a login, and does not change, delete, or grant access to existing accounts. Omit plan and nothing is charged. The new account is ready for billing to be added later, and it cannot send until then. Setting plan charges immediately. It starts a paid subscription on the payment method already saved on sourceBillingAccountId, an account the caller must own. Optional memberEmails adds people who already share an account with the caller and invites everyone else.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::CreateAccountRequest.new # configure as needed
begin result = client.accounts.accounts_create_account(body) p resultrescue Pingram::ApiError => e puts "Error when calling accounts_create_account: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| create_account_request | CreateAccountRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
name |
string | (required) |
plan |
object | Billing to copy onto a new additional account. |
plan.tier |
“budget_20” | “budget_50” | “budget_100” | “budget_250” | “budget_500” | “budget_1000” | (required) |
plan.sourceBillingAccountId |
string | (required) Account whose saved payment method is copied onto the new account. The caller must be an owner of this account. |
memberEmails |
string[] | Emails to add or invite to the new account. Existing members of any account the caller belongs to are added directly; everyone else is invited. |
Return Type
CreateAccountResponse
accounts_list_accounts()
List accounts the authenticated user can access
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.accounts.accounts_list_accounts p resultrescue Pingram::ApiError => e puts "Error when calling accounts_list_accounts: #{e}"endParameters
This endpoint does not need any parameter.
Return Type
ListAccountsResponse
Addresses
addresses_create_address()
Create a new email inbox. Omit domain for a built-in @mail.pingram.io address; set domain and displayName for a custom address on a verified domain.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::CreateAddressRequest.new # configure as needed
begin result = client.addresses.addresses_create_address(body) p resultrescue Pingram::ApiError => e puts "Error when calling addresses_create_address: #{e}"endParameters
| 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 |
Return Type
AddressResponse
addresses_delete_address()
Delete a custom inbound address. Builtin addresses cannot be deleted.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.addresses.addresses_delete_address p resultrescue Pingram::ApiError => e puts "Error when calling addresses_delete_address: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| full_address | String | Full address to delete (e.g. hello@example.com) |
Return Type
SuccessResponse
addresses_list_addresses()
List email inboxes (addresses) configured for receiving. Custom addresses must use a verified domain.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.addresses.addresses_list_addresses p resultrescue Pingram::ApiError => e puts "Error when calling addresses_list_addresses: #{e}"endParameters
This endpoint does not need any parameter.
Return Type
AccountAddressesResponse
addresses_update_address()
Update one inbox on this account. A new prefix deletes the old address, so mail to the previous address stops, and that address is not kept. displayName only relabels a custom inbox and does not change where mail is delivered. Does not create an inbox or change its domain.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::UpdateAddressRequest.new # configure as needed
begin result = client.addresses.addresses_update_address(body) p resultrescue Pingram::ApiError => e puts "Error when calling addresses_update_address: #{e}"endParameters
| 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 |
Return Type
AddressResponse
Broadcasts
broadcasts_archive()
Archive an email broadcast so it is hidden from the default broadcast list. Allowed for draft, paused, sent, and canceled broadcasts. Not allowed while sending or scheduled.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.broadcasts.broadcasts_archive p resultrescue Pingram::ApiError => e puts "Error when calling broadcasts_archive: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| broadcast_id | String | Broadcast ID |
Return Type
BroadcastResponse
broadcasts_cancel()
Cancel an email broadcast. Scheduled broadcasts revert to draft and drop their schedule (they can be scheduled again). Sending or paused broadcasts become canceled; recipients already processed stay as they are, and remaining pending recipients are skipped and will not be sent. That skip cannot be undone.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.broadcasts.broadcasts_cancel p resultrescue Pingram::ApiError => e puts "Error when calling broadcasts_cancel: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| broadcast_id | String | Broadcast ID |
Return Type
BroadcastResponse
broadcasts_create()
Create a draft email broadcast. html is the send-ready body. Optional internalTemplate is visual-editor source; if set it must be paired with html. A later update can add it to a draft by sending it with html. Set audience to either a Mongo-style user filter (sync users via Users API first; for large lists) or a raw email list (max 10,000). Include name, from fields, subject, and HTML. Notification type is optional on create and required before send or schedule; it is created automatically if missing.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::CreateBroadcastRequest.new # configure as needed
begin result = client.broadcasts.broadcasts_create(body) p resultrescue Pingram::ApiError => e puts "Error when calling broadcasts_create: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| create_broadcast_request | CreateBroadcastRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
name |
string | (required) |
type |
string | Notification type id. Optional on create; required before send/schedule. Created on the fly when missing. |
channel |
“email” | |
audience |
object | (required) Broadcast audience: exactly one of filter (Mongo-style query evaluated against synced user objects) or emails (raw list, max 10,000 addresses; for larger audiences use filter after syncing users via the Users API). |
audience.filter |
Record<string, any> | |
audience.emails |
string[] | |
fromName |
string | (required) |
fromAddress |
string | (required) |
replyToAddress |
string | |
subject |
string | (required) |
html |
string | (required) |
internalTemplate |
string | Optional visual-editor source. Pair with html. A later update can add it to a draft by sending it with html. |
Return Type
BroadcastResponse
broadcasts_delete()
Delete an email broadcast. Allowed for drafts, scheduled, paused, completed, and canceled broadcasts. Not allowed while status is sending.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.broadcasts.broadcasts_delete p resultrescue Pingram::ApiError => e puts "Error when calling broadcasts_delete: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| broadcast_id | String | Broadcast ID |
Return Type
MessageResponse
broadcasts_get()
Get one email broadcast by ID, including the send-ready html body, optional internalTemplate (visual-editor source), and audience definition.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.broadcasts.broadcasts_get p resultrescue Pingram::ApiError => e puts "Error when calling broadcasts_get: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| broadcast_id | String | Broadcast ID |
Return Type
BroadcastResponse
broadcasts_get_metrics()
Poll live email broadcast metrics: status, optional pausedReason or scheduleAt, and aggregate counters (total, sent, delivered, opened, clicked, bounced, complained, unsubscribed, skipped, failed).
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.broadcasts.broadcasts_get_metrics p resultrescue Pingram::ApiError => e puts "Error when calling broadcasts_get_metrics: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| broadcast_id | String | Broadcast ID |
Return Type
BroadcastMetricsResponse
broadcasts_list()
List email broadcasts for the account, newest first. Returns metadata without html or internalTemplate bodies. A live-filter audience includes the filter. A raw email audience includes emailCount and omits the addresses. Paginate with limit (default 50, max 100) and nextToken.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.broadcasts.broadcasts_list p resultrescue Pingram::ApiError => e puts "Error when calling broadcasts_list: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | Float | Max broadcasts to return (default 50) | [optional] |
| next_token | String | Pagination token | [optional] |
Return Type
ListBroadcastsResponse
broadcasts_list_recipients()
List email broadcast recipients with per-recipient delivery fact timestamps (sentAt, deliveredAt, openedAt, etc.). Derive display status client-side from timestamps. Filter by status (pending, sent, delivered, opened, clicked, bounced, complained, unsubscribed, skipped, failed, problems). Paginate with limit (default 50, max 200) and nextToken.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.broadcasts.broadcasts_list_recipients p resultrescue Pingram::ApiError => e puts "Error when calling broadcasts_list_recipients: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| broadcast_id | String | Broadcast ID | |
| status | String | Filter | [optional] |
| limit | Float | Max recipients to return (default 50) | [optional] |
| next_token | String | Pagination token | [optional] |
Return Type
ListBroadcastRecipientsResponse
broadcasts_pause()
Pause an actively sending email broadcast. Status becomes paused with pausedReason PAUSED_BY_USER.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.broadcasts.broadcasts_pause p resultrescue Pingram::ApiError => e puts "Error when calling broadcasts_pause: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| broadcast_id | String | Broadcast ID |
Return Type
BroadcastResponse
broadcasts_resume()
Resume a paused email broadcast. Continues sending remaining recipients. Broadcasts paused for spam content cannot be resumed.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.broadcasts.broadcasts_resume p resultrescue Pingram::ApiError => e puts "Error when calling broadcasts_resume: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| broadcast_id | String | Broadcast ID |
Return Type
BroadcastResponse
broadcasts_schedule()
Schedule a draft email broadcast for a future ISO datetime (sendAt). Requires a non-empty subject. fromAddress must be the platform default sender or a domain verified for this account (Settings → Domain Verification). The platform default sender is for testing only (at most 10 recipients, heavily throttled). Cancels any existing schedule when the broadcast is returned to draft via cancel.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::ScheduleBroadcastRequest.new # configure as needed
begin result = client.broadcasts.broadcasts_schedule(body) p resultrescue Pingram::ApiError => e puts "Error when calling broadcasts_schedule: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| broadcast_id | String | Broadcast ID | |
| schedule_broadcast_request | ScheduleBroadcastRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
sendAt |
string | (required) ISO datetime in the future. |
Return Type
BroadcastResponse
broadcasts_send()
Send a draft email broadcast immediately. Requires a non-empty subject. fromAddress must be the platform default sender or a domain verified for this account (Settings → Domain Verification). The platform default sender is for testing only (at most 10 recipients, heavily throttled). Transitions status to sending and starts delivery.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.broadcasts.broadcasts_send p resultrescue Pingram::ApiError => e puts "Error when calling broadcasts_send: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| broadcast_id | String | Broadcast ID |
Return Type
BroadcastResponse
broadcasts_unarchive()
Restore an archived email broadcast to the default broadcast list.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.broadcasts.broadcasts_unarchive p resultrescue Pingram::ApiError => e puts "Error when calling broadcasts_unarchive: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| broadcast_id | String | Broadcast ID |
Return Type
BroadcastResponse
broadcasts_update()
Update a draft email broadcast. Fields you send replace the stored values (name, type, audience, sender, subject, html) and the previous values are not kept; omitted fields stay. html is the send-ready body. Send an empty replyToAddress to clear Reply-To. internalTemplate is visual-editor source: send it with html to add it to an html-only draft or to update it. It cannot be removed. Only drafts can be edited; scheduled or active broadcasts are locked. This does not send the broadcast.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::UpdateBroadcastRequest.new # configure as needed
begin result = client.broadcasts.broadcasts_update(body) p resultrescue Pingram::ApiError => e puts "Error when calling broadcasts_update: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| broadcast_id | String | Broadcast ID | |
| update_broadcast_request | UpdateBroadcastRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
name |
string | |
type |
string | |
channel |
“email” | |
audience |
object | Broadcast audience: exactly one of filter (Mongo-style query evaluated against synced user objects) or emails (raw list, max 10,000 addresses; for larger audiences use filter after syncing users via the Users API). |
audience.filter |
Record<string, any> | |
audience.emails |
string[] | |
fromName |
string | |
fromAddress |
string | |
replyToAddress |
string | Omit to leave unchanged. Empty string clears Reply-To. |
subject |
string | |
html |
string | |
internalTemplate |
string | Visual-editor source. Send with html to add it to an html-only draft or to update it. Cannot be removed. |
Return Type
BroadcastResponse
Domains
domains_add_domain()
Start verification for a domain you already own so Pingram can use it for email. Pass a bare domain (example.com) or subdomain (mail.example.com). This does not purchase, transfer, renew, or control the domain, does not edit DNS, and does not disable sending or receiving on other platforms. It saves the domain on this Pingram account and returns DNS records for you to publish. Required DKIM lets Pingram send email from addresses on this domain once verification completes. Optional inbound MX, once you publish it, routes that domain’s inbound email to Pingram. This call only begins verification. Publish the records, then start verification in the dashboard or with the start-verification API. Adding a domain that is already on the account returns the existing records.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::PostSendersRequestBody.new # configure as needed
begin result = client.domains.domains_add_domain(body) p resultrescue Pingram::ApiError => e puts "Error when calling domains_add_domain: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| post_senders_request_body | PostSendersRequestBody | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
sender |
string | (required) |
Return Type
Array<GetSendersResponseInner>
domains_delete_domain()
Remove a sender domain from the account.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.domains.domains_delete_domain p resultrescue Pingram::ApiError => e puts "Error when calling domains_delete_domain: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| sender | String | Sender domain (URL encoded) |
Return Type
SuccessResponse
domains_list_domains()
List domains already added to this Pingram account for email. Each entry includes verification status and the DNS records Pingram expects you to publish. Does not search a registrar, purchase or transfer a domain, change DNS, or include domains that have not been added to this account.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.domains.domains_list_domains p resultrescue Pingram::ApiError => e puts "Error when calling domains_list_domains: #{e}"endParameters
This endpoint does not need any parameter.
Return Type
Array<GetSendersResponseInner>
domains_start_domain_verification()
Start SES domain verification (DNS readiness is checked client-side via checkDomainDns)
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.domains.domains_start_domain_verification p resultrescue Pingram::ApiError => e puts "Error when calling domains_start_domain_verification: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| sender | String | Sender domain (URL encoded) |
Return Type
Array<GetSendersResponseInner>
email_delete_suppressions()
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.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.email.email_delete_suppressions p resultrescue Pingram::ApiError => e puts "Error when calling email_delete_suppressions: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| reason | String | Suppression reason to clear (retryable | bounces) |
Return Type
MessageResponse
email_send()
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.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::SendEmailRequest.new # configure as needed
begin result = client.email.email_send(body) p resultrescue Pingram::ApiError => e puts "Error when calling email_send: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| send_email_request | SendEmailRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
type |
string | (required) The notification type to send. |
to |
string | (required) The email address of the recipient. |
subject |
string | (required) The subject of the email. |
html |
string | (required) The HTML body of the email. |
fromName |
string | The display name of the sender. |
fromAddress |
string | The email address of the sender. |
previewText |
string | The preview text of the email. |
replyToAddresses |
string[] | The reply-to addresses of the email. |
ccAddresses |
string[] | The CC addresses of the email. |
bccAddresses |
string[] | The BCC addresses of the email. |
openTracking |
boolean | When false, this send does not record opens and no open pixel is added. Delivery, bounce, and complaint events are unchanged. Defaults to true. |
clickTracking |
boolean | When false, links are left as written and clicks are not recorded. Delivery, bounce, and complaint events are unchanged. Defaults to true. |
attachments |
object[] | URL-based file attachments. Up to 20 MB per file. |
attachments[].filename |
string | (required) |
attachments[].url |
string | (required) |
schedule |
string | The ISO 8601 datetime to schedule the email. |
Return Type
SendEmailApiResponse
Environments
environments_list_environments()
Get all environments for the authenticated account
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.environments.environments_list_environments p resultrescue Pingram::ApiError => e puts "Error when calling environments_list_environments: #{e}"endParameters
This endpoint does not need any parameter.
Return Type
Array<GetEnvironmentsResponseInner>
environments_update_environment()
Update environment settings (title, secret, disable sending, secure mode)
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::EnvironmentPatchRequest.new # configure as needed
begin result = client.environments.environments_update_environment(body) p resultrescue Pingram::ApiError => e puts "Error when calling environments_update_environment: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| client_id | String | 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” | “VOICE” | “PUSH” | “WEB_PUSH” | “SLACK”)[] | |
title |
string | |
secureMode |
boolean |
Return Type
Environment
Library
library_create()
Create an upload slot in the account library. contentType must be image/png, image/jpeg, image/gif, or image/webp. PUT the file to the returned uploadUrl with that Content-Type, then use the returned url in emails and the editor.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::CreateLibraryRequest.new # configure as needed
begin result = client.library.library_create(body) p resultrescue Pingram::ApiError => e puts "Error when calling library_create: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| use_case | String | Library use-case | |
| create_library_request | CreateLibraryRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
filename |
string | (required) Original filename, including extension (e.g. hero.png). |
contentType |
string | (required) Image MIME type. One of image/png, image/jpeg, image/gif, or image/webp. |
Return Type
CreateLibraryResponse
library_list()
List files in the account library for a use-case, newest first. Paginate with limit (default 50, max 100) and nextToken.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.library.library_list p resultrescue Pingram::ApiError => e puts "Error when calling library_list: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| use_case | String | Library use-case | |
| limit | Float | Max items to return (default 50) | [optional] |
| next_token | String | Pagination token | [optional] |
Return Type
ListLibraryResponse
Logs
logs_get_delivery_status()
Look up email and SMS delivery status for up to 25 tracking IDs. Each entry is the tracking id, channel (EMAIL or SMS), status, and the time that status was recorded. The result does not include recipients, phone numbers, user ids, request bodies, IP addresses, account ids, or user-agent data. Unknown tracking ids are omitted. Other channels are not included.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.logs.logs_get_delivery_status p resultrescue Pingram::ApiError => e puts "Error when calling logs_get_delivery_status: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| tracking_ids | String | Comma-separated tracking IDs (URL encoded, max 25) |
Return Type
LogsDeliveryStatusResponse
logs_get_log_retention()
Get log retention period in days for the account
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.logs.logs_get_log_retention p resultrescue Pingram::ApiError => e puts "Error when calling logs_get_log_retention: #{e}"endParameters
This endpoint does not need any parameter.
Return Type
LogsRetentionResponse
logs_get_logs()
List recent notification logs for the authenticated account, newest first.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.logs.logs_get_logs p resultrescue Pingram::ApiError => e puts "Error when calling logs_get_logs: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | Float | Maximum number of logs to return (default | [optional] |
| cursor | String | Pagination cursor for next page | [optional] |
Return Type
GetLogsResponse
logs_get_logs_by_tracking_ids()
Get logs by tracking IDs (comma-separated, max 25 IDs). Returns full log objects with personally identifiable information (recipients, user ids, phone numbers, and request details). For a simple delivery check, use Get Delivery Status.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.logs.logs_get_logs_by_tracking_ids p resultrescue Pingram::ApiError => e puts "Error when calling logs_get_logs_by_tracking_ids: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| tracking_ids | String | Comma-separated tracking IDs (URL encoded) |
Return Type
LogsGetResponse
logs_get_logs_query_result()
Get results from a log query started with Start Log Query. Poll until status is Complete.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.logs.logs_get_logs_query_result p resultrescue Pingram::ApiError => e puts "Error when calling logs_get_logs_query_result: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| query_id | String | Query ID returned by Start Log Query |
Return Type
LogsQueryResultResponse
logs_retry_inbound()
Resend the EMAIL_INBOUND webhook for one inbound email. Uses the original tracking ID and does not count another email. Refused when the message is older than 30 days.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.logs.logs_retry_inbound p resultrescue Pingram::ApiError => e puts "Error when calling logs_retry_inbound: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| tracking_id | String | Tracking ID of the inbound email |
Return Type
MessageResponse
logs_start_logs_query()
Start an asynchronous log search over a date range. Returns a queryId; poll with Get Log Query Results until status is Complete.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::LogQueryPostBody.new # configure as needed
begin result = client.logs.logs_start_logs_query(body) p resultrescue Pingram::ApiError => e puts "Error when calling logs_start_logs_query: #{e}"endParameters
| 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” | “voice” | “web_push” | “mobile_push” | “slack”)[] | |
notificationFilter |
string[] |
Return Type
LogsQueryResponse
logs_tail_logs()
Get last 100 logs from the stream
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.logs.logs_tail_logs p resultrescue Pingram::ApiError => e puts "Error when calling logs_tail_logs: #{e}"endParameters
This endpoint does not need any parameter.
Return Type
LogsTailResponse
Numbers
numbers_list()
List active phone numbers registered for the account, including voice agent binding state.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.numbers.numbers_list p resultrescue Pingram::ApiError => e puts "Error when calling numbers_list: #{e}"endParameters
This endpoint does not need any parameter.
Return Type
ListPhoneNumbersResponse
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.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.numbers.numbers_list_released p resultrescue Pingram::ApiError => e puts "Error when calling numbers_list_released: #{e}"endParameters
This endpoint does not need any parameter.
Return Type
ListReleasedPhoneNumbersResponse
numbers_order_number()
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).
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::OrderPhoneNumberRequest.new # configure as needed
begin result = client.numbers.numbers_order_number(body) p resultrescue Pingram::ApiError => e puts "Error when calling numbers_order_number: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| order_phone_number_request | OrderPhoneNumberRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
phoneNumber |
string | (required) E.164 from search results |
Return Type
OrderPhoneNumberResponse
numbers_release_number()
Release a phone number from the account. No refund for the current billing month.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.numbers.numbers_release_number p resultrescue Pingram::ApiError => e puts "Error when calling numbers_release_number: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| phone_number | String | E.164 phone number to release |
Return Type
ReleasePhoneNumberResponse
numbers_search_available()
Search for available phone numbers to purchase. Requires countryCode (e.g. US, CA). Use before ordering a number.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.numbers.numbers_search_available p resultrescue Pingram::ApiError => e puts "Error when calling numbers_search_available: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| country_code | String | ISO 3166-1 alpha-2 country code (e.g., US, CA) | |
| features | String | Comma-separated | [optional] |
| area_code | String | National destination / area code filter | [optional] |
| limit | Float | Max results (default 10, max 50) | [optional] |
Return Type
SearchAvailablePhoneNumbersResponse
Profile
profile_accept_invite()
Accept a team invitation using a token
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::AcceptInviteRequest.new # configure as needed
begin result = client.profile.profile_accept_invite(body) p resultrescue Pingram::ApiError => e puts "Error when calling profile_accept_invite: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| accept_invite_request | AcceptInviteRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
token |
string | (required) |
Return Type
AcceptInviteResponse
profile_delete_account()
Permanently delete the authenticated user’s account
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::DeleteAccountRequest.new # configure as needed
begin result = client.profile.profile_delete_account(body) p resultrescue Pingram::ApiError => e puts "Error when calling profile_delete_account: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| delete_account_request | DeleteAccountRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
reason |
string |
Return Type
SuccessResponse
profile_disable_mfa()
Disable MFA for the authenticated user
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.profile.profile_disable_mfa p resultrescue Pingram::ApiError => e puts "Error when calling profile_disable_mfa: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| type | String | MFA type (e.g. SOFTWARE_TOKEN_MFA) |
Return Type
SuccessResponse
profile_get_mfa_status()
Get MFA status for the authenticated user
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.profile.profile_get_mfa_status p resultrescue Pingram::ApiError => e puts "Error when calling profile_get_mfa_status: #{e}"endParameters
This endpoint does not need any parameter.
Return Type
MFAStatusResponse
profile_setup_mfa()
Start TOTP MFA setup and return QR code data
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::MFASetupRequest.new # configure as needed
begin result = client.profile.profile_setup_mfa(body) p resultrescue Pingram::ApiError => e puts "Error when calling profile_setup_mfa: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| mfa_setup_request | MFASetupRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
type |
“SOFTWARE_TOKEN_MFA” | (required) MFA methods supported by the profile MFA API. |
Return Type
MFASetupResponse
profile_verify_mfa()
Verify TOTP code and enable MFA
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::MFAVerifyRequest.new # configure as needed
begin result = client.profile.profile_verify_mfa(body) p resultrescue Pingram::ApiError => e puts "Error when calling profile_verify_mfa: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| mfa_verify_request | MFAVerifyRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
type |
“SOFTWARE_TOKEN_MFA” | (required) MFA methods supported by the profile MFA API. |
code |
string | (required) |
session |
string | (required) |
Return Type
SuccessResponse
Registrations
registrations_create_us10dlc_brand()
Create a new 10DLC brand registration. Sets brandStatus to pending_review; Pingram handles carrier submission after review.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::TenDlcBrandCreateRequest.new # configure as needed
begin result = client.registrations.registrations_create_us10dlc_brand(body) p resultrescue Pingram::ApiError => e puts "Error when calling registrations_create_us10dlc_brand: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ten_dlc_brand_create_request | TenDlcBrandCreateRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
scenarioId |
“own_brand” | “client_brand” | (required) Who the 10DLC brand is registered for. - own_brand: personal or company project - client_brand: agency or contractor |
businessType |
“PRIVATE_PROFIT” | “SOLE_PROPRIETOR” | “PUBLIC_PROFIT” | “NON_PROFIT” | “GOVERNMENT” | (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. |
Return Type
TenDlcBrandRegistration
registrations_get_us10dlc_brand()
Get the 10DLC brand registration for the authenticated account. Returns null when no registration exists yet.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.registrations.registrations_get_us10dlc_brand p resultrescue Pingram::ApiError => e puts "Error when calling registrations_get_us10dlc_brand: #{e}"endParameters
This endpoint does not need any parameter.
Return Type
TenDlcBrandRegistration
registrations_get_us10dlc_campaign()
Get the 10DLC campaign registration for the authenticated account. Returns null when no brand registration exists yet.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.registrations.registrations_get_us10dlc_campaign p resultrescue Pingram::ApiError => e puts "Error when calling registrations_get_us10dlc_campaign: #{e}"endParameters
This endpoint does not need any parameter.
Return Type
TenDlcCampaignRegistration
registrations_update_us10dlc_brand()
Overwrite business fields on this account’s existing US 10DLC brand registration (legal name, address, tax ID, website, compliance contact, and related identity). Fields you omit stay; values you send replace what was stored and are not kept as history. Does not create a registration, submit it to carriers, change brandStatus, or delete it. Workflow status stays under Pingram’s control.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::TenDlcBrandUpdateRequest.new # configure as needed
begin result = client.registrations.registrations_update_us10dlc_brand(body) p resultrescue Pingram::ApiError => e puts "Error when calling registrations_update_us10dlc_brand: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ten_dlc_brand_update_request | TenDlcBrandUpdateRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
scenarioId |
“own_brand” | “client_brand” | Who the 10DLC brand is registered for. - own_brand: personal or company project - client_brand: agency or contractor |
businessType |
“PRIVATE_PROFIT” | “SOLE_PROPRIETOR” | “PUBLIC_PROFIT” | “NON_PROFIT” | “GOVERNMENT” | 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. |
Return Type
TenDlcBrandRegistration
registrations_update_us10dlc_campaign()
Overwrite campaign fields on this account’s existing US 10DLC campaign (description, samples, opt-in and opt-out text, use case, and related settings). Fields you send replace the stored values and the previous text is not kept; omitted fields stay. Editing is refused once the campaign is in_progress or approved. Does not submit the campaign to carriers, change campaignStatus, or delete it.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::TenDlcCampaignUpdateRequest.new # configure as needed
begin result = client.registrations.registrations_update_us10dlc_campaign(body) p resultrescue Pingram::ApiError => e puts "Error when calling registrations_update_us10dlc_campaign: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ten_dlc_campaign_update_request | TenDlcCampaignUpdateRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
campaignDescription |
string | 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. |
Return Type
TenDlcCampaignRegistration
Sender
sender_delete_schedule()
Delete (unschedule) an already scheduled notification
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.sender.sender_delete_schedule p resultrescue Pingram::ApiError => e puts "Error when calling sender_delete_schedule: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| tracking_id | String | The tracking ID of the scheduled notification |
Return Type
MessageResponse
sender_update_schedule()
Update the body or schedule of an already scheduled notification.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::SenderPostBody.new # configure as needed
begin result = client.sender.sender_update_schedule(body) p resultrescue Pingram::ApiError => e puts "Error when calling sender_update_schedule: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| tracking_id | String | 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.properties |
Record<string, string | number | boolean> | Custom key-value properties synced by the developer, used for audience segmentation (e.g. broadcast filters on user.properties.plan). Incremental identify calls shallow-merge keys (unset keys are preserved). Limits: max 25 keys, key length <= 64, string values <= 256 chars, serialized size <= 1KB. |
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” | “VOICE” | “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. |
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.openTracking |
boolean | When false, this send does not record opens and no open pixel is added. Delivery, bounce, and complaint events are unchanged. Defaults to true. |
options.email.clickTracking |
boolean | When false, links are left as written and clicks are not recorded. Delivery, bounce, and complaint events are unchanged. Defaults to true. |
options.email.attachments |
(object | object)[] | File attachments (by URL or inline base64 content). Inline content: ~4 MB raw per file (413 if exceeded). URL url: up to 20 MB per file. |
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. |
options.push |
object | Cross-platform mobile push options (applied to both APN and FCM). |
options.push.customData |
Record<string, string> | Up to 3 custom string key-value pairs for deep linking. Included in both APN and FCM payloads. |
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, from, mediaUrls). |
sms.message |
string | SMS/MMS body text. |
sms.mediaUrls |
string[] | Public HTTPS URLs of media to attach (MMS). Carriers fetch these via GET. Total size limits apply per provider. |
sms.from |
string | Override the sender phone number. Must be a verified number on your account. |
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. |
Return Type
MessageResponse
Sms
sms_send()
Send an SMS or MMS directly without a template. Requires type and to. Pass message and/or mediaUrls. Optional: from, schedule.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::SendSmsRequest.new # configure as needed
begin result = client.sms.sms_send(body) p resultrescue Pingram::ApiError => e puts "Error when calling sms_send: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| send_sms_request | SendSmsRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
type |
string | (required) The notification type to send. |
to |
string | (required) The phone number of the recipient. |
message |
string | The message of the SMS or MMS notification. Optional when mediaUrls is provided. |
mediaUrls |
string[] | Public HTTPS URLs of media to attach (MMS). |
schedule |
string | The ISO 8601 datetime to schedule the SMS notification. |
from |
string | Override the sender phone number. Must be a dedicated number on your Pingram account. |
Return Type
SendSmsResponse
SubNotifications
sub_notifications_delete_sub_notification()
```rubyrequire 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.sub_notifications.sub_notifications_delete_sub_notification p resultrescue Pingram::ApiError => e puts "Error when calling sub_notifications_delete_sub_notification: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | String | The notification ID | |
| sub_notification_id | String | The sub-notification ID |
Return Type
nil (empty response body)
sub_notifications_put_sub_notification()
This endpoint is no longer maintained and should not be used.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::SubNotificationPUTRequest.new # configure as needed
begin result = client.sub_notifications.sub_notifications_put_sub_notification(body) p resultrescue Pingram::ApiError => e puts "Error when calling sub_notifications_put_sub_notification: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | String | The notification ID | |
| sub_notification_id | String | The sub-notification ID | |
| sub_notification_put_request | SubNotificationPUTRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
title |
string | (required) |
Return Type
SubNotification
Templates
templates_create_template()
Create a new template for a notification
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::TemplatePostRequest.new # configure as needed
begin result = client.templates.templates_create_template(body) p resultrescue Pingram::ApiError => e puts "Error when calling templates_create_template: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | String | Notification ID | |
| channel | String | 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. |
Return Type
Template
templates_delete_template()
```rubyrequire 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.templates.templates_delete_template p resultrescue Pingram::ApiError => e puts "Error when calling templates_delete_template: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | String | Notification ID | |
| channel | String | Channel type | |
| template_id | String | Template ID |
Return Type
nil (empty response body)
templates_get_template()
Get a single template by ID
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.templates.templates_get_template p resultrescue Pingram::ApiError => e puts "Error when calling templates_get_template: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | String | Notification ID | |
| channel | String | Channel type | |
| template_id | String | Template ID |
Return Type
GetTemplatesResponse
templates_list_templates()
List all templates for a notification and channel
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.templates.templates_list_templates p resultrescue Pingram::ApiError => e puts "Error when calling templates_list_templates: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | String | Notification ID | |
| channel | String | Channel type |
Return Type
Array<GetTemplatesListResponseInner>
templates_set_default_template()
Set a template as default for specific delivery modes
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::SetDefaultTemplateRequest.new # configure as needed
begin result = client.templates.templates_set_default_template(body) p resultrescue Pingram::ApiError => e puts "Error when calling templates_set_default_template: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | String | Notification ID | |
| channel | String | 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) |
Return Type
Template
templates_update_template()
Update a template’s properties
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::TemplatePatchRequest.new # configure as needed
begin result = client.templates.templates_update_template(body) p resultrescue Pingram::ApiError => e puts "Error when calling templates_update_template: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | String | Notification ID | |
| channel | String | Channel type | |
| template_id | String | 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. |
Return Type
Template
Types
types_create_notification_type()
Create a new notification
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::NotificationCreateRequest.new # configure as needed
begin result = client.types.types_create_notification_type(body) p resultrescue Pingram::ApiError => e puts "Error when calling types_create_notification_type: #{e}"endParameters
| 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.VOICE |
object | |
options.VOICE.defaultDeliveryOption |
“off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.VOICE.off |
object | |
options.VOICE.off.enabled |
boolean | (required) |
options.VOICE.instant |
object | |
options.VOICE.instant.enabled |
boolean | (required) |
options.VOICE.hourly |
object | |
options.VOICE.hourly.enabled |
boolean | (required) |
options.VOICE.daily |
object | |
options.VOICE.daily.enabled |
boolean | (required) |
options.VOICE.daily.hour |
string | |
options.VOICE.weekly |
object | |
options.VOICE.weekly.enabled |
boolean | (required) |
options.VOICE.weekly.hour |
string | |
options.VOICE.weekly.day |
string | |
options.VOICE.monthly |
object | |
options.VOICE.monthly.enabled |
boolean | (required) |
options.VOICE.monthly.hour |
string | |
options.VOICE.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” |
Return Type
Notification
types_delete_notification_type()
```rubyrequire 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.types.types_delete_notification_type p resultrescue Pingram::ApiError => e puts "Error when calling types_delete_notification_type: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | String | The notification ID |
Return Type
nil (empty response body)
types_get_notification_type()
Get a specific notification by ID
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.types.types_get_notification_type p resultrescue Pingram::ApiError => e puts "Error when calling types_get_notification_type: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | String | The notification ID |
Return Type
Array<GetNotificationsResponseInner>
types_list_notification_types()
Get all notifications for an account with their templates
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.types.types_list_notification_types p resultrescue Pingram::ApiError => e puts "Error when calling types_list_notification_types: #{e}"endParameters
This endpoint does not need any parameter.
Return Type
Array<GetNotificationsResponseInner>
types_update_notification_type()
Update a notification’s settings
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::NotificationPatchRequest.new # configure as needed
begin result = client.types.types_update_notification_type(body) p resultrescue Pingram::ApiError => e puts "Error when calling types_update_notification_type: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| notification_id | String | 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” | “VOICE” | “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.VOICE |
object | |
options.VOICE.defaultDeliveryOption |
“off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.VOICE.off |
object | |
options.VOICE.off.enabled |
boolean | (required) |
options.VOICE.instant |
object | |
options.VOICE.instant.enabled |
boolean | (required) |
options.VOICE.hourly |
object | |
options.VOICE.hourly.enabled |
boolean | (required) |
options.VOICE.daily |
object | |
options.VOICE.daily.enabled |
boolean | (required) |
options.VOICE.daily.hour |
string | |
options.VOICE.weekly |
object | |
options.VOICE.weekly.enabled |
boolean | (required) |
options.VOICE.weekly.hour |
string | |
options.VOICE.weekly.day |
string | |
options.VOICE.monthly |
object | |
options.VOICE.monthly.enabled |
boolean | (required) |
options.VOICE.monthly.hour |
string | |
options.VOICE.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” |
Return Type
Notification
User
user_get_account_metadata()
Get account-level metadata including logo, VAPID key, and web push status
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.user.user_get_account_metadata p resultrescue Pingram::ApiError => e puts "Error when calling user_get_account_metadata: #{e}"endParameters
This endpoint does not need any parameter.
Return Type
GetAccountMetadataResponse
user_get_user()
Get a user by ID. All users exist implicitly, returns basic user object if not found in DB.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.user.user_get_user p resultrescue Pingram::ApiError => e puts "Error when calling user_get_user: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| user_id | String | User ID |
Return Type
User
user_identify()
Create or update a user with the given ID. Updates lastSeenTime automatically.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::PostUserRequest.new # configure as needed
begin result = client.user.user_identify(body) p resultrescue Pingram::ApiError => e puts "Error when calling user_identify: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| user_id | String | 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[] | |
properties |
Record<string, string | number | boolean> | Custom key-value properties synced by the developer, used for audience segmentation (e.g. broadcast filters on user.properties.plan). Incremental identify calls shallow-merge keys (unset keys are preserved). Limits: max 25 keys, key length <= 64, string values <= 256 chars, serialized size <= 1KB. |
Return Type
User
Users
users_delete_user()
Delete a user and all associated data (in-app notifications, preferences, and user record)
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.users.users_delete_user p resultrescue Pingram::ApiError => e puts "Error when calling users_delete_user: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| user_id | String | User ID | |
| env_id | String | Environment ID (required when using JWT auth) | [optional] |
Return Type
DeleteUserResponse
users_list_users()
Get all users for an environment with pagination support
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.users.users_list_users p resultrescue Pingram::ApiError => e puts "Error when calling users_list_users: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | Float | Maximum number of users to return (default | |
| next_token | String | Pagination token for next page | |
| env_id | String | Environment ID (required when using JWT auth) | [optional] |
Return Type
GetUsersResponse
users_remove_user_from_suppression()
Remove user suppression status for a specific channel
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.users.users_remove_user_from_suppression p resultrescue Pingram::ApiError => e puts "Error when calling users_remove_user_from_suppression: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| user_id | String | User ID | |
| channel | String | Channel type (EMAIL) | |
| env_id | String | Environment ID (required when using JWT auth) | [optional] |
Return Type
UserSuppressionDeleteResponse
Voice
voice_arm_inbound_claim()
Arm the shared test number so the next call from this user’s phone uses this inbound behavior
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::ArmVoiceInboundClaimRequest.new # configure as needed
begin result = client.voice.voice_arm_inbound_claim(body) p resultrescue Pingram::ApiError => e puts "Error when calling voice_arm_inbound_claim: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| arm_voice_inbound_claim_request | ArmVoiceInboundClaimRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
inbound |
object | object | object | object | (required) |
inbound.type |
“script” | (required) |
inbound.steps |
object[] | (required) |
inbound.steps[].verb |
“Say” | (required) |
inbound.steps[].text |
string | (required) |
inbound.privacy |
object | Omitted privacy means record and transcribe are both on. |
inbound.privacy.record |
boolean | |
inbound.privacy.transcribe |
boolean |
Return Type
ArmVoiceInboundClaimResponse
voice_call()
Place an outbound call. The config is not saved.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::VoiceCallRequest.new # configure as needed
begin result = client.voice.voice_call(body) p resultrescue Pingram::ApiError => e puts "Error when calling voice_call: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| voice_call_request | VoiceCallRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
to |
string | (required) E.164 number to dial. |
config |
object | object | (required) |
config.type |
“script” | (required) |
config.steps |
object[] | (required) |
config.steps[].verb |
“Say” | (required) |
config.steps[].text |
string | (required) |
config.voicemailAction |
“hangup” | “message” | “continue” | What to do when an answering machine picks up. hangup ends the call, message plays voicemailMessage, continue keeps talking. Default: continue. |
config.voicemailMessage |
string | |
config.privacy |
object | Omitted privacy means record and transcribe are both on. |
config.privacy.record |
boolean | |
config.privacy.transcribe |
boolean | |
variables |
Record<string, string> | Optional per-call {{variable}} overrides. |
Return Type
VoiceCallResponse
voice_clear_number_inbound()
Remove inbound call behavior from a number this account owns
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.voice.voice_clear_number_inbound p resultrescue Pingram::ApiError => e puts "Error when calling voice_clear_number_inbound: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| phone_number | String | E.164 phone number |
Return Type
MessageResponse
voice_create_browser_call()
Place a browser playground call. Script calls use POST /voice/call.
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::VoiceBrowserCallRequest.new # configure as needed
begin result = client.voice.voice_create_browser_call(body) p resultrescue Pingram::ApiError => e puts "Error when calling voice_create_browser_call: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| voice_browser_call_request | VoiceBrowserCallRequest | See Request Body Properties below |
Request Body Properties
| Name | Type | Description |
|---|---|---|
config |
object | object | object | object | object | object | (required) Agent behavior for this browser call. Script calls use POST /voice/call. |
variables |
Record<string, string> | Optional per-call {{variable}} overrides for browser playground. |
direction |
“inbound” | “outbound” | inbound speaks the greeting. outbound speaks the opener. Omitted means outbound. |
Return Type
VoiceBrowserCallResponse
voice_get_call()
Get a call with transcript timeline and recording playback URL
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.voice.voice_get_call p resultrescue Pingram::ApiError => e puts "Error when calling voice_get_call: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| tracking_id | String | Call tracking id |
Return Type
GetVoiceCallResponse
voice_list_calls()
List recent calls newest-first (30-day retention)
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')
begin result = client.voice.voice_list_calls p resultrescue Pingram::ApiError => e puts "Error when calling voice_list_calls: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | Float | Page size (default 25, max 100) | [optional] |
| cursor | String | Pagination cursor from a previous response | [optional] |
Return Type
ListVoiceCallsResponse
voice_put_number_inbound()
Store inbound call behavior on a number this account owns
require 'pingram'
client = Pingram::Client.new(api_key: 'YOUR_API_KEY')body = Pingram::InboundConfig.new # configure as needed
begin result = client.voice.voice_put_number_inbound(body) p resultrescue Pingram::ApiError => e puts "Error when calling voice_put_number_inbound: #{e}"endParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| phone_number | String | E.164 phone number | |
| inbound_config | InboundConfig | See Request Body Properties below |
Return Type
MessageResponse