Go SDK
Setup & Initialization
- Install Package:
go get github.com/pingram-io/pingram-go- Import:
import ( pingram "github.com/pingram-io/pingram-go")- Initialize:
client := pingram.NewClient("pingram_sk_your_api_key")| Name | Type | Description |
|---|---|---|
apiKey* |
string | Your Pingram API key. You can get it from your dashboard under Environments. |
baseURL |
string | Optional. Use pingram.WithBaseURL("https://api.eu.pingram.io") or pingram.WithRegion(pingram.RegionEU) for EU/CA. Default is US. |
* required
Region example:
client := pingram.NewClient("pingram_sk_...", pingram.WithRegion(pingram.RegionEU))Working example
Full runnable example that sends a notification:
package main
import ( "context" "encoding/json" "fmt" "log"
pingram "github.com/pingram-io/pingram-go")
func main() { client := pingram.NewClient("pingram_sk_your_api_key") // or WithBaseURL("https://api.pingram.click") for custom host
body := pingram.SenderPostBody{ Type: pingram.PtrString("domain_verification"), User: &pingram.GetUsersResponseUsersInner{ Id: "user@example.com", Email: pingram.PtrString("user@example.com"), }, Email: &pingram.SenderPostBodyEmail{ Subject: "Domain Verification", Html: "<p>Please verify your domain by clicking the link below.</p>", }, }
resp, _, err := client.DefaultAPI.Send(context.Background()).SenderPostBody(body).Execute() if err != nil { log.Fatal(err) } out, _ := json.MarshalIndent(resp, "", " ") fmt.Println(string(out))}The sections below list every API method. For most use cases the Send method and the Domains / Users / Types APIs are the main ones.
Send
Send()
Send a notification (email, SMS, etc.) to one user. Requires a notification type which categorizes this messages for future reporting, and channel-specific payloads such as email or sms. Recipient is specified with the to parameter. Returns a trackingId for error or delivery lookup through our Logs.
senderPostBody := *pingram.NewSenderPostBody() // SenderPostBody
resp, _, err := client.DefaultAPI.Send(ctx).SenderPostBody(senderPostBody).Execute()if err != nil { // handle error}// resp is SenderPostResponseParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
type |
string | ID of the notification type (e.g. “welcome_email”). Creates a new notification if it does not exist. |
to |
object | Recipient user. Provide id, email, or number to identify the user. |
to.id |
string | Unique user identifier. Required. |
to.email |
string | User’s email address for email notifications. |
to.number |
string | User’s phone number for SMS/call notifications. |
to.pushTokens |
object[] | Mobile push tokens (FCM, APN) for push notifications. |
to.pushTokens[].type |
“FCM” | “APN” | (required) |
to.pushTokens[].token |
string | (required) |
to.pushTokens[].device |
object | (required) |
to.pushTokens[].device.app_id |
string | |
to.pushTokens[].device.ad_id |
string | |
to.pushTokens[].device.device_id |
string | (required) |
to.pushTokens[].device.platform |
string | |
to.pushTokens[].device.manufacturer |
string | |
to.pushTokens[].device.model |
string | |
to.pushTokens[].environment |
string | used by APN to differentiate between sandbox and production builds (sandbox/undefined or production) |
to.webPushTokens |
object[] | Web push subscription config from the browser. |
to.webPushTokens[].sub |
object | (required) Configuration for a Push Subscription. This can be obtained on the frontend by calling serviceWorkerRegistration.pushManager.subscribe(). The expected format is the same output as JSON.stringify’ing a PushSubscription in the browser. |
to.webPushTokens[].sub.endpoint |
string | (required) |
to.webPushTokens[].sub.keys |
object | (required) |
to.webPushTokens[].sub.keys.p256dh |
string | (required) |
to.webPushTokens[].sub.keys.auth |
string | (required) |
to.timezone |
string | User’s timezone (e.g. “America/New_York”) for scheduling. |
to.slackChannel |
string | The destination channel of slack notifications sent to this user. Can be either of the following: - Channel name, e.g. “test” - Channel name with # prefix, e.g. “#test” - Channel ID, e.g. “C1234567890” - User ID for DM, e.g. “U1234567890” - Username with @ prefix, e.g. “@test” |
to.slackToken |
object | |
to.slackToken.access_token |
string | |
to.slackToken.app_id |
string | |
to.slackToken.authed_user |
object | |
to.slackToken.authed_user.access_token |
string | |
to.slackToken.authed_user.expires_in |
number | |
to.slackToken.authed_user.id |
string | |
to.slackToken.authed_user.refresh_token |
string | |
to.slackToken.authed_user.scope |
string | |
to.slackToken.authed_user.token_type |
string | |
to.slackToken.bot_user_id |
string | |
to.slackToken.enterprise |
object | |
to.slackToken.enterprise.id |
string | |
to.slackToken.enterprise.name |
string | |
to.slackToken.error |
string | |
to.slackToken.expires_in |
number | |
to.slackToken.incoming_webhook |
object | |
to.slackToken.incoming_webhook.channel |
string | |
to.slackToken.incoming_webhook.channel_id |
string | |
to.slackToken.incoming_webhook.configuration_url |
string | |
to.slackToken.incoming_webhook.url |
string | |
to.slackToken.is_enterprise_install |
boolean | |
to.slackToken.needed |
string | |
to.slackToken.ok |
boolean | (required) |
to.slackToken.provided |
string | |
to.slackToken.refresh_token |
string | |
to.slackToken.scope |
string | |
to.slackToken.team |
object | |
to.slackToken.team.id |
string | |
to.slackToken.team.name |
string | |
to.slackToken.token_type |
string | |
to.slackToken.warning |
string | |
to.slackToken.response_metadata |
object | |
to.slackToken.response_metadata.warnings |
string[] | |
to.slackToken.response_metadata.next_cursor |
string | |
to.slackToken.response_metadata.scopes |
string[] | |
to.slackToken.response_metadata.acceptedScopes |
string[] | |
to.slackToken.response_metadata.retryAfter |
number | |
to.slackToken.response_metadata.messages |
string[] | |
to.lastSeenTime |
string | Last activity timestamp. Updated automatically. Read-only. |
to.updatedAt |
string | Last update timestamp. Read-only. |
to.createdAt |
string | Creation timestamp. Read-only. |
to.emailSuppressionStatus |
object | Bounce or complaint status if email was suppressed. Read-only. |
to.emailSuppressionStatus.reason |
“Bounce” | “Complaint” | (required) |
to.emailSuppressionStatus.details |
object | (required) |
forceChannels |
(“EMAIL” | “INAPP_WEB” | “SMS” | “CALL” | “PUSH” | “WEB_PUSH” | “SLACK”)[] | Override which channels to send to (e.g. [“EMAIL”, “SMS”]). Bypasses notification channel config. |
parameters |
Record<string, any> | Key-value pairs for template merge tags. Replaces placeholders like {{firstName}} in templates. |
secondaryId |
string | Optional sub-notification identifier for grouping or tracking. |
templateId |
string | Specific template ID to use. If omitted, uses the default template for each channel. |
subNotificationId |
string | Sub-notification identifier (e.g. for grouping related notifications). |
options |
object | Per-channel overrides for send options (email, APN, FCM). |
options.email |
object | Email-specific overrides. |
options.email.replyToAddresses |
string[] | Reply-to addresses for the email. |
options.email.ccAddresses |
string[] | CC recipients. |
options.email.bccAddresses |
string[] | BCC recipients. |
options.email.fromAddress |
string | Override sender email address. |
options.email.fromName |
string | Override sender display name. |
options.email.attachments |
(object | object)[] | File attachments (by URL or inline base64 content). Inline content: ~4 MB raw per file (413 if exceeded). URL url: up to 20 MB per file. |
options.email.condition |
string | Conditional expression for when to send (e.g. merge tag logic). |
options.apn |
object | Apple Push Notification (APN) overrides. |
options.apn.expiry |
number | Seconds until the notification expires. |
options.apn.priority |
number | Delivery priority (10 = immediate, 5 = power-saving). |
options.apn.collapseId |
string | Group notifications with the same ID (replaces previous). |
options.apn.threadId |
string | Thread identifier for grouping notifications. |
options.apn.badge |
number | Badge count on app icon. |
options.apn.sound |
string | Sound file name. |
options.apn.contentAvailable |
boolean | Silent background notification (no alert). |
options.fcm |
object | Firebase Cloud Messaging (FCM) overrides. |
options.fcm.android |
object | Android-specific FCM options. |
options.fcm.android.collapseKey |
string | Collapse key for grouping messages. |
options.fcm.android.priority |
“high” | “normal” | Delivery priority. |
options.fcm.android.ttl |
number | Time to live in seconds. |
options.fcm.android.restrictedPackageName |
string | Restrict delivery to a specific package. |
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, autoReply, 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.autoReply |
object | |
sms.autoReply.message |
string | (required) Auto-reply message to send when user texts in. |
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. |
Webhooks
WebhooksDeleteEventsWebhook()
Delete the events webhook configuration for the current account/environment.
_, err := client.WebhooksAPI.WebhooksDeleteEventsWebhook(ctx).Execute()if err != nil { // handle error}Parameters
This endpoint does not need any parameter.
WebhooksGetEventsWebhook()
Get the events webhook configuration for the current account/environment.
resp, _, err := client.WebhooksAPI.WebhooksGetEventsWebhook(ctx).Execute()if err != nil { // handle error}// resp is EventsWebhookResponseParameters
This endpoint does not need any parameter.
WebhooksUpsertEventsWebhook()
Create or update the events webhook configuration for the current account/environment.
eventsWebhookUpsertRequest := *pingram.NewEventsWebhookUpsertRequest("Webhook_example", []string{"Events_example"}) // EventsWebhookUpsertRequest
resp, _, err := client.WebhooksAPI.WebhooksUpsertEventsWebhook(ctx).EventsWebhookUpsertRequest(eventsWebhookUpsertRequest).Execute()if err != nil { // handle error}// resp is EventsWebhookResponseParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
webhook |
string | (required) Destination URL that receives webhook event payloads. Must be a valid http(s) URL. |
events |
(“EMAIL_OPEN” | “EMAIL_CLICK” | “EMAIL_FAILED” | “EMAIL_DELIVERED” | “EMAIL_UNSUBSCRIBE” | “EMAIL_INBOUND” | “INAPP_WEB_FAILED” | “INAPP_WEB_UNSUBSCRIBE” | “SMS_DELIVERED” | “SMS_FAILED” | “SMS_UNSUBSCRIBE” | “SMS_SUBSCRIBE” | “SMS_INBOUND” | “PUSH_FAILED” | “PUSH_UNSUBSCRIBE” | “CALL_FAILED” | “CALL_UNSUBSCRIBE” | “WEB_PUSH_FAILED” | “WEB_PUSH_UNSUBSCRIBE” | “SLACK_FAILED” | “SLACK_UNSUBSCRIBE” | “VOICE_INBOUND”)[] | (required) List of event types that should be forwarded to the webhook URL. |
Addresses
AddressesCreateAddress()
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.
createAddressRequest := *pingram.NewCreateAddressRequest("Prefix_example") // CreateAddressRequest
resp, _, err := client.AddressesAPI.AddressesCreateAddress(ctx).CreateAddressRequest(createAddressRequest).Execute()if err != nil { // handle error}// resp is AddressResponseParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
prefix |
string | (required) |
domain |
string | |
displayName |
string |
AddressesDeleteAddress()
Delete a custom inbound address. Builtin addresses cannot be deleted.
fullAddress := // Full address to delete (e.g. hello@example.com)
resp, _, err := client.AddressesAPI.AddressesDeleteAddress(ctx, fullAddress).Execute()if err != nil { // handle error}// resp is SuccessResponseParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| fullAddress | string | Full address to delete (e.g. hello@example.com) | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
AddressesListAddresses()
List email inboxes (addresses) configured for receiving. Custom addresses must use a verified domain.
resp, _, err := client.AddressesAPI.AddressesListAddresses(ctx).Execute()if err != nil { // handle error}// resp is AccountAddressesResponseParameters
This endpoint does not need any parameter.
AddressesUpdateAddress()
Update an inbox prefix or display name.
updateAddressRequest := *pingram.NewUpdateAddressRequest("FullAddress_example") // UpdateAddressRequest
resp, _, err := client.AddressesAPI.AddressesUpdateAddress(ctx).UpdateAddressRequest(updateAddressRequest).Execute()if err != nil { // handle error}// resp is AddressResponseParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
fullAddress |
string | (required) |
prefix |
string | |
displayName |
string |
Domains
DomainsAddDomain()
Add and start verification for a new sender domain. Pass the domain only (not a full email address).
postSendersRequestBody := *pingram.NewPostSendersRequestBody("Sender_example") // PostSendersRequestBody
resp, _, err := client.DomainsAPI.DomainsAddDomain(ctx).PostSendersRequestBody(postSendersRequestBody).Execute()if err != nil { // handle error}// resp is []GetSendersResponseInnerParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
sender |
string | (required) |
DomainsDeleteDomain()
Remove a sender domain from the account.
sender := // Sender domain (URL encoded)
resp, _, err := client.DomainsAPI.DomainsDeleteDomain(ctx, sender).Execute()if err != nil { // handle error}// resp is SuccessResponseParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| sender | string | Sender domain (URL encoded) | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
DomainsListDomains()
List sender domains configured for the account (for outbound email).
resp, _, err := client.DomainsAPI.DomainsListDomains(ctx).Execute()if err != nil { // handle error}// resp is []GetSendersResponseInnerParameters
This endpoint does not need any parameter.
DomainsStartDomainVerification()
Start SES domain verification (DNS readiness is checked client-side via checkDomainDns)
sender := // Sender domain (URL encoded)
resp, _, err := client.DomainsAPI.DomainsStartDomainVerification(ctx, sender).Execute()if err != nil { // handle error}// resp is []GetSendersResponseInnerParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| sender | string | Sender domain (URL encoded) | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
EmailSend()
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.
sendEmailRequest := *pingram.NewSendEmailRequest("Type_example", "To_example", "Subject_example", "Html_example") // SendEmailRequest
resp, _, err := client.EmailAPI.EmailSend(ctx).SendEmailRequest(sendEmailRequest).Execute()if err != nil { // handle error}// resp is SendEmailApiResponseParameters
| Name | Type | Description | Notes |
|---|
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. |
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. |
Environments
EnvironmentsCreateEnvironment()
Create a new environment for the account
environmentCreateRequest := *pingram.NewEnvironmentCreateRequest("Title_example") // EnvironmentCreateRequest
resp, _, err := client.EnvironmentsAPI.EnvironmentsCreateEnvironment(ctx).EnvironmentCreateRequest(environmentCreateRequest).Execute()if err != nil { // handle error}// resp is EnvironmentParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
title |
string | (required) |
EnvironmentsListEnvironments()
Get all environments for the authenticated account
resp, _, err := client.EnvironmentsAPI.EnvironmentsListEnvironments(ctx).Execute()if err != nil { // handle error}// resp is []GetEnvironmentsResponseInnerParameters
This endpoint does not need any parameter.
EnvironmentsUpdateEnvironment()
Update environment settings (title, secret, disable sending, secure mode)
clientId := // Environment client IDenvironmentPatchRequest := *pingram.NewEnvironmentPatchRequest() // EnvironmentPatchRequest
resp, _, err := client.EnvironmentsAPI.EnvironmentsUpdateEnvironment(ctx, clientId).EnvironmentPatchRequest(environmentPatchRequest).Execute()if err != nil { // handle error}// resp is EnvironmentParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| clientId | string | Environment client ID | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
Request Body Properties
| Name | Type | Description |
|---|---|---|
resetSecret |
boolean | |
disableSending |
(“EMAIL” | “INAPP_WEB” | “SMS” | “CALL” | “PUSH” | “WEB_PUSH” | “SLACK”)[] | |
title |
string | |
secureMode |
boolean |
Logs
LogsGetLogRetention()
Get log retention period in days for the account
resp, _, err := client.LogsAPI.LogsGetLogRetention(ctx).Execute()if err != nil { // handle error}// resp is LogsRetentionResponseParameters
This endpoint does not need any parameter.
LogsGetLogs()
List recent notification logs for the authenticated account, newest first.
limit := float32(8.14) // float32 (optional)cursor := "cursor_example" // string (optional)
resp, _, err := client.LogsAPI.LogsGetLogs(ctx).Limit(limit).Cursor(cursor).Execute()if err != nil { // handle error}// resp is GetLogsResponseParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | float32 | Maximum number of logs to return (default | |
| cursor | string | Pagination cursor for next page |
LogsGetLogsByTrackingIds()
Get logs by tracking IDs (comma-separated, max 25 IDs). Use after sending email or SMS to look up delivery status.
trackingIds := // Comma-separated tracking IDs (URL encoded)
resp, _, err := client.LogsAPI.LogsGetLogsByTrackingIds(ctx, trackingIds).Execute()if err != nil { // handle error}// resp is LogsGetResponseParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| trackingIds | string | Comma-separated tracking IDs (URL encoded) | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
LogsGetLogsQueryResult()
Get results from a log query started with Start Log Query. Poll until status is Complete.
queryId := // Query ID returned by Start Log Query
resp, _, err := client.LogsAPI.LogsGetLogsQueryResult(ctx, queryId).Execute()if err != nil { // handle error}// resp is LogsQueryResultResponseParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| queryId | string | Query ID returned by Start Log Query | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
LogsStartLogsQuery()
Start an asynchronous log search over a date range. Returns a queryId; poll with Get Log Query Results until status is Complete.
logQueryPostBody := *pingram.NewLogQueryPostBody() // LogQueryPostBody
resp, _, err := client.LogsAPI.LogsStartLogsQuery(ctx).LogQueryPostBody(logQueryPostBody).Execute()if err != nil { // handle error}// resp is LogsQueryResponseParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
dateRangeFilter |
number[] | A tuple of [startTime, endTime] for the date range filter, each representing a unix timestamp. |
userFilter |
string | |
envIdFilter |
string[] | |
statusFilter |
string | |
channelFilter |
(“email” | “inapp” | “sms” | “call” | “web_push” | “mobile_push” | “slack”)[] | |
notificationFilter |
string[] |
LogsTailLogs()
Get last 100 logs from the stream
resp, _, err := client.LogsAPI.LogsTailLogs(ctx).Execute()if err != nil { // handle error}// resp is LogsTailResponseParameters
This endpoint does not need any parameter.
Numbers
NumbersList()
List active phone numbers registered for the account.
resp, _, err := client.NumbersAPI.NumbersList(ctx).Execute()if err != nil { // handle error}// resp is ListPhoneNumbersResponseParameters
This endpoint does not need any parameter.
NumbersListReleased()
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.
resp, _, err := client.NumbersAPI.NumbersListReleased(ctx).Execute()if err != nil { // handle error}// resp is ListReleasedPhoneNumbersResponseParameters
This endpoint does not need any parameter.
NumbersOrderNumber()
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).
orderPhoneNumberRequest := *pingram.NewOrderPhoneNumberRequest("PhoneNumber_example") // OrderPhoneNumberRequest
resp, _, err := client.NumbersAPI.NumbersOrderNumber(ctx).OrderPhoneNumberRequest(orderPhoneNumberRequest).Execute()if err != nil { // handle error}// resp is OrderPhoneNumberResponseParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
phoneNumber |
string | (required) E.164 from search results |
NumbersReleaseNumber()
Release a phone number from the account. No refund for the current billing month.
phoneNumber := // E.164 phone number to release
resp, _, err := client.NumbersAPI.NumbersReleaseNumber(ctx, phoneNumber).Execute()if err != nil { // handle error}// resp is ReleasePhoneNumberResponseParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| phoneNumber | string | E.164 phone number to release | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
NumbersSearchAvailable()
Search for available phone numbers to purchase. Requires countryCode (e.g. US, CA). Use before ordering a number.
countryCode := "countryCode_example" // stringfeatures := "features_example" // string (optional)areaCode := "areaCode_example" // string (optional)limit := float32(8.14) // float32 (optional)
resp, _, err := client.NumbersAPI.NumbersSearchAvailable(ctx).CountryCode(countryCode).Features(features).AreaCode(areaCode).Limit(limit).Execute()if err != nil { // handle error}// resp is SearchAvailablePhoneNumbersResponseParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| countryCode | string | ISO 3166-1 alpha-2 country code (e.g., US, CA) | |
| features | string | Comma-separated | |
| areaCode | string | National destination / area code filter | |
| limit | float32 | Max results (default 10, max 50) |
Organization
OrganizationCreate()
Create organization after SMS verification bypass
resp, _, err := client.OrganizationAPI.OrganizationCreate(ctx).Execute()if err != nil { // handle error}// resp is CreateOrganizationResponseParameters
This endpoint does not need any parameter.
OrganizationGetUsage()
Get usage for the authenticated account’s organization (new billing model).
resp, _, err := client.OrganizationAPI.OrganizationGetUsage(ctx).Execute()if err != nil { // handle error}// resp is OrganizationUsageParameters
This endpoint does not need any parameter.
OrganizationGetUsageHistory()
Get historical usage for the authenticated account’s organization over a date range.
startDate := "startDate_example" // stringendDate := "endDate_example" // string
resp, _, err := client.OrganizationAPI.OrganizationGetUsageHistory(ctx).StartDate(startDate).EndDate(endDate).Execute()if err != nil { // handle error}// resp is OrganizationUsageHistoryParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| startDate | string | Start date (YYYY-MM-DD) for the range | |
| endDate | string | End date (YYYY-MM-DD) for the range |
Profile
ProfileAcceptInvite()
Accept a team invitation using a token
acceptInviteRequest := *pingram.NewAcceptInviteRequest("Token_example") // AcceptInviteRequest
resp, _, err := client.ProfileAPI.ProfileAcceptInvite(ctx).AcceptInviteRequest(acceptInviteRequest).Execute()if err != nil { // handle error}// resp is AcceptInviteResponseParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
token |
string | (required) |
ProfileChangeEmail()
Change the email address of the authenticated user
changeEmailRequest := *pingram.NewChangeEmailRequest("NewEmail_example") // ChangeEmailRequest
resp, _, err := client.ProfileAPI.ProfileChangeEmail(ctx).ChangeEmailRequest(changeEmailRequest).Execute()if err != nil { // handle error}// resp is SuccessResponseParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
newEmail |
string | (required) |
ProfileDeleteAccount()
Permanently delete the authenticated user’s account
deleteAccountRequest := *pingram.NewDeleteAccountRequest() // DeleteAccountRequest
resp, _, err := client.ProfileAPI.ProfileDeleteAccount(ctx).DeleteAccountRequest(deleteAccountRequest).Execute()if err != nil { // handle error}// resp is SuccessResponseParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
reason |
string |
ProfileDisableMfa()
Disable MFA for the authenticated user
type_ := // MFA type (e.g. SOFTWARE_TOKEN_MFA)
resp, _, err := client.ProfileAPI.ProfileDisableMfa(ctx, type_).Execute()if err != nil { // handle error}// resp is SuccessResponseParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| type_ | string | MFA type (e.g. SOFTWARE_TOKEN_MFA) | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
ProfileGetMfaStatus()
Get MFA status for the authenticated user
resp, _, err := client.ProfileAPI.ProfileGetMfaStatus(ctx).Execute()if err != nil { // handle error}// resp is MFAStatusResponseParameters
This endpoint does not need any parameter.
ProfileSetupMfa()
Start TOTP MFA setup and return QR code data
mFASetupRequest := *pingram.NewMFASetupRequest("Type_example") // MFASetupRequest
resp, _, err := client.ProfileAPI.ProfileSetupMfa(ctx).MFASetupRequest(mFASetupRequest).Execute()if err != nil { // handle error}// resp is MFASetupResponseParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
type |
“SOFTWARE_TOKEN_MFA” | (required) MFA methods supported by the profile MFA API. |
ProfileVerifyMfa()
Verify TOTP code and enable MFA
mFAVerifyRequest := *pingram.NewMFAVerifyRequest("Type_example", "Code_example", "Session_example") // MFAVerifyRequest
resp, _, err := client.ProfileAPI.ProfileVerifyMfa(ctx).MFAVerifyRequest(mFAVerifyRequest).Execute()if err != nil { // handle error}// resp is SuccessResponseParameters
| Name | Type | Description | Notes |
|---|
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) |
PushSettings
PushSettingsDeletePushApnSettings()
Delete Apple Push Notification (APN) configuration for the current account.
_, err := client.PushSettingsAPI.PushSettingsDeletePushApnSettings(ctx).Execute()if err != nil { // handle error}Parameters
This endpoint does not need any parameter.
PushSettingsDeletePushFcmSettings()
Delete Firebase Cloud Messaging (FCM) configuration for the current account.
_, err := client.PushSettingsAPI.PushSettingsDeletePushFcmSettings(ctx).Execute()if err != nil { // handle error}Parameters
This endpoint does not need any parameter.
PushSettingsGetPushApnSettings()
Get Apple Push Notification (APN) configuration for the current account.
resp, _, err := client.PushSettingsAPI.PushSettingsGetPushApnSettings(ctx).Execute()if err != nil { // handle error}// resp is APNConfigParameters
This endpoint does not need any parameter.
PushSettingsGetPushFcmSettings()
Get Firebase Cloud Messaging (FCM) configuration for the current account.
resp, _, err := client.PushSettingsAPI.PushSettingsGetPushFcmSettings(ctx).Execute()if err != nil { // handle error}// resp is PushSettingsFCMResponseParameters
This endpoint does not need any parameter.
PushSettingsUpsertPushApnSettings()
Create or update Apple Push Notification (APN) configuration for the current account.
aPNConfig := *pingram.NewAPNConfig("KeyId_example", "Key_example", "TeamId_example", "Topic_example") // APNConfig
resp, _, err := client.PushSettingsAPI.PushSettingsUpsertPushApnSettings(ctx).APNConfig(aPNConfig).Execute()if err != nil { // handle error}// resp is APNConfigParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
KeyId |
string | (required) |
Key |
string | (required) |
TeamId |
string | (required) |
Topic |
string | (required) |
PushSettingsUpsertPushFcmSettings()
Create or update Firebase Cloud Messaging (FCM) configuration for the current account.
pushSettingsFCMPutRequest := *pingram.NewPushSettingsFCMPutRequest("FcmConfig_example") // PushSettingsFCMPutRequest
resp, _, err := client.PushSettingsAPI.PushSettingsUpsertPushFcmSettings(ctx).PushSettingsFCMPutRequest(pushSettingsFCMPutRequest).Execute()if err != nil { // handle error}// resp is PushSettingsFCMResponseParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
fcmConfig |
string | (required) |
Sender
SenderDeleteSchedule()
Delete (unschedule) an already scheduled notification
trackingId := // The tracking ID of the scheduled notification
resp, _, err := client.SenderAPI.SenderDeleteSchedule(ctx, trackingId).Execute()if err != nil { // handle error}// resp is MessageResponseParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| trackingId | string | The tracking ID of the scheduled notification | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
SenderUpdateSchedule()
Update the body or schedule of an already scheduled notification.
trackingId := // The tracking ID of the scheduled notificationsenderPostBody := *pingram.NewSenderPostBody() // SenderPostBody
resp, _, err := client.SenderAPI.SenderUpdateSchedule(ctx, trackingId).SenderPostBody(senderPostBody).Execute()if err != nil { // handle error}// resp is MessageResponseParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| trackingId | string | The tracking ID of the scheduled notification | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
Request Body Properties
| Name | Type | Description |
|---|---|---|
type |
string | ID of the notification type (e.g. “welcome_email”). Creates a new notification if it does not exist. |
to |
object | Recipient user. Provide id, email, or number to identify the user. |
to.id |
string | Unique user identifier. Required. |
to.email |
string | User’s email address for email notifications. |
to.number |
string | User’s phone number for SMS/call notifications. |
to.pushTokens |
object[] | Mobile push tokens (FCM, APN) for push notifications. |
to.pushTokens[].type |
“FCM” | “APN” | (required) |
to.pushTokens[].token |
string | (required) |
to.pushTokens[].device |
object | (required) |
to.pushTokens[].device.app_id |
string | |
to.pushTokens[].device.ad_id |
string | |
to.pushTokens[].device.device_id |
string | (required) |
to.pushTokens[].device.platform |
string | |
to.pushTokens[].device.manufacturer |
string | |
to.pushTokens[].device.model |
string | |
to.pushTokens[].environment |
string | used by APN to differentiate between sandbox and production builds (sandbox/undefined or production) |
to.webPushTokens |
object[] | Web push subscription config from the browser. |
to.webPushTokens[].sub |
object | (required) Configuration for a Push Subscription. This can be obtained on the frontend by calling serviceWorkerRegistration.pushManager.subscribe(). The expected format is the same output as JSON.stringify’ing a PushSubscription in the browser. |
to.webPushTokens[].sub.endpoint |
string | (required) |
to.webPushTokens[].sub.keys |
object | (required) |
to.webPushTokens[].sub.keys.p256dh |
string | (required) |
to.webPushTokens[].sub.keys.auth |
string | (required) |
to.timezone |
string | User’s timezone (e.g. “America/New_York”) for scheduling. |
to.slackChannel |
string | The destination channel of slack notifications sent to this user. Can be either of the following: - Channel name, e.g. “test” - Channel name with # prefix, e.g. “#test” - Channel ID, e.g. “C1234567890” - User ID for DM, e.g. “U1234567890” - Username with @ prefix, e.g. “@test” |
to.slackToken |
object | |
to.slackToken.access_token |
string | |
to.slackToken.app_id |
string | |
to.slackToken.authed_user |
object | |
to.slackToken.authed_user.access_token |
string | |
to.slackToken.authed_user.expires_in |
number | |
to.slackToken.authed_user.id |
string | |
to.slackToken.authed_user.refresh_token |
string | |
to.slackToken.authed_user.scope |
string | |
to.slackToken.authed_user.token_type |
string | |
to.slackToken.bot_user_id |
string | |
to.slackToken.enterprise |
object | |
to.slackToken.enterprise.id |
string | |
to.slackToken.enterprise.name |
string | |
to.slackToken.error |
string | |
to.slackToken.expires_in |
number | |
to.slackToken.incoming_webhook |
object | |
to.slackToken.incoming_webhook.channel |
string | |
to.slackToken.incoming_webhook.channel_id |
string | |
to.slackToken.incoming_webhook.configuration_url |
string | |
to.slackToken.incoming_webhook.url |
string | |
to.slackToken.is_enterprise_install |
boolean | |
to.slackToken.needed |
string | |
to.slackToken.ok |
boolean | (required) |
to.slackToken.provided |
string | |
to.slackToken.refresh_token |
string | |
to.slackToken.scope |
string | |
to.slackToken.team |
object | |
to.slackToken.team.id |
string | |
to.slackToken.team.name |
string | |
to.slackToken.token_type |
string | |
to.slackToken.warning |
string | |
to.slackToken.response_metadata |
object | |
to.slackToken.response_metadata.warnings |
string[] | |
to.slackToken.response_metadata.next_cursor |
string | |
to.slackToken.response_metadata.scopes |
string[] | |
to.slackToken.response_metadata.acceptedScopes |
string[] | |
to.slackToken.response_metadata.retryAfter |
number | |
to.slackToken.response_metadata.messages |
string[] | |
to.lastSeenTime |
string | Last activity timestamp. Updated automatically. Read-only. |
to.updatedAt |
string | Last update timestamp. Read-only. |
to.createdAt |
string | Creation timestamp. Read-only. |
to.emailSuppressionStatus |
object | Bounce or complaint status if email was suppressed. Read-only. |
to.emailSuppressionStatus.reason |
“Bounce” | “Complaint” | (required) |
to.emailSuppressionStatus.details |
object | (required) |
forceChannels |
(“EMAIL” | “INAPP_WEB” | “SMS” | “CALL” | “PUSH” | “WEB_PUSH” | “SLACK”)[] | Override which channels to send to (e.g. [“EMAIL”, “SMS”]). Bypasses notification channel config. |
parameters |
Record<string, any> | Key-value pairs for template merge tags. Replaces placeholders like {{firstName}} in templates. |
secondaryId |
string | Optional sub-notification identifier for grouping or tracking. |
templateId |
string | Specific template ID to use. If omitted, uses the default template for each channel. |
subNotificationId |
string | Sub-notification identifier (e.g. for grouping related notifications). |
options |
object | Per-channel overrides for send options (email, APN, FCM). |
options.email |
object | Email-specific overrides. |
options.email.replyToAddresses |
string[] | Reply-to addresses for the email. |
options.email.ccAddresses |
string[] | CC recipients. |
options.email.bccAddresses |
string[] | BCC recipients. |
options.email.fromAddress |
string | Override sender email address. |
options.email.fromName |
string | Override sender display name. |
options.email.attachments |
(object | object)[] | File attachments (by URL or inline base64 content). Inline content: ~4 MB raw per file (413 if exceeded). URL url: up to 20 MB per file. |
options.email.condition |
string | Conditional expression for when to send (e.g. merge tag logic). |
options.apn |
object | Apple Push Notification (APN) overrides. |
options.apn.expiry |
number | Seconds until the notification expires. |
options.apn.priority |
number | Delivery priority (10 = immediate, 5 = power-saving). |
options.apn.collapseId |
string | Group notifications with the same ID (replaces previous). |
options.apn.threadId |
string | Thread identifier for grouping notifications. |
options.apn.badge |
number | Badge count on app icon. |
options.apn.sound |
string | Sound file name. |
options.apn.contentAvailable |
boolean | Silent background notification (no alert). |
options.fcm |
object | Firebase Cloud Messaging (FCM) overrides. |
options.fcm.android |
object | Android-specific FCM options. |
options.fcm.android.collapseKey |
string | Collapse key for grouping messages. |
options.fcm.android.priority |
“high” | “normal” | Delivery priority. |
options.fcm.android.ttl |
number | Time to live in seconds. |
options.fcm.android.restrictedPackageName |
string | Restrict delivery to a specific package. |
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, autoReply, 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.autoReply |
object | |
sms.autoReply.message |
string | (required) Auto-reply message to send when user texts in. |
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. |
Sms
SmsSend()
Send an SMS or MMS directly without a template. Requires type and to. Pass message and/or mediaUrls. Optional: from, schedule.
sendSmsRequest := *pingram.NewSendSmsRequest("Type_example", "To_example") // SendSmsRequest
resp, _, err := client.SmsAPI.SmsSend(ctx).SendSmsRequest(sendSmsRequest).Execute()if err != nil { // handle error}// resp is SendSmsResponseParameters
| Name | Type | Description | Notes |
|---|
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. |
Templates
TemplatesCreateTemplate()
Create a new template for a notification
notificationId := // Notification IDchannel := // Channel typetemplatePostRequest := *pingram.NewTemplatePostRequest("TemplateId_example") // TemplatePostRequest
resp, _, err := client.TemplatesAPI.TemplatesCreateTemplate(ctx, notificationId, channel).TemplatePostRequest(templatePostRequest).Execute()if err != nil { // handle error}// resp is TemplateParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| notificationId | string | Notification ID | |
| channel | string | Channel type | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
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. |
TemplatesDeleteTemplate()
Delete a template
notificationId := // Notification IDchannel := // Channel typetemplateId := // Template ID
_, err := client.TemplatesAPI.TemplatesDeleteTemplate(ctx, notificationId, channel, templateId).Execute()if err != nil { // handle error}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| notificationId | string | Notification ID | |
| channel | string | Channel type | |
| templateId | string | Template ID | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
TemplatesGetTemplate()
Get a single template by ID
notificationId := // Notification IDchannel := // Channel typetemplateId := // Template ID
resp, _, err := client.TemplatesAPI.TemplatesGetTemplate(ctx, notificationId, channel, templateId).Execute()if err != nil { // handle error}// resp is GetTemplatesResponseParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| notificationId | string | Notification ID | |
| channel | string | Channel type | |
| templateId | string | Template ID | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
TemplatesListTemplates()
List all templates for a notification and channel
notificationId := // Notification IDchannel := // Channel type
resp, _, err := client.TemplatesAPI.TemplatesListTemplates(ctx, notificationId, channel).Execute()if err != nil { // handle error}// resp is []GetTemplatesListResponseInnerParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| notificationId | string | Notification ID | |
| channel | string | Channel type | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
TemplatesSetDefaultTemplate()
Set a template as default for specific delivery modes
notificationId := // Notification IDchannel := // Channel typesetDefaultTemplateRequest := *pingram.NewSetDefaultTemplateRequest("TemplateId_example", []string{"Modes_example"}) // SetDefaultTemplateRequest
resp, _, err := client.TemplatesAPI.TemplatesSetDefaultTemplate(ctx, notificationId, channel).SetDefaultTemplateRequest(setDefaultTemplateRequest).Execute()if err != nil { // handle error}// resp is TemplateParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| notificationId | string | Notification ID | |
| channel | string | Channel type | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
Request Body Properties
| Name | Type | Description |
|---|---|---|
templateId |
string | (required) |
modes |
(“instant” | “hourly” | “daily” | “weekly” | “monthly”)[] | (required) |
TemplatesUpdateTemplate()
Update a template’s properties
notificationId := // Notification IDchannel := // Channel typetemplateId := // Template IDtemplatePatchRequest := *pingram.NewTemplatePatchRequest() // TemplatePatchRequest
resp, _, err := client.TemplatesAPI.TemplatesUpdateTemplate(ctx, notificationId, channel, templateId).TemplatePatchRequest(templatePatchRequest).Execute()if err != nil { // handle error}// resp is TemplateParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| notificationId | string | Notification ID | |
| channel | string | Channel type | |
| templateId | string | Template ID | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
Request Body Properties
| Name | Type | Description |
|---|---|---|
html |
string | HTML body of the email. |
previewText |
string | Preview text (e.g. for inbox). |
internal |
string | Internal editor representation of the email content (e.g. Bee or Redactor JSON). Used for editing and component embedding; the actual email sent to recipients uses the html field. |
subject |
string | Email subject line. |
senderName |
string | Sender display name. |
senderEmail |
string | Sender email address. |
title |
string | Notification title (in-app). |
redirectURL |
string | URL to open when the user taps the notification. |
imageURL |
string | Image URL shown in the in-app notification. |
instant |
object | Copy for instant (real-time) delivery. |
instant.title |
string | |
instant.redirectURL |
string | |
instant.imageURL |
string | (required) |
batch |
object | Copy for batch delivery. |
batch.title |
string | (required) |
batch.redirectURL |
string | (required) |
batch.imageURL |
string | (required) |
text |
string | Message text (SMS or call). |
message |
string | Push notification body text. (title is shared with INAPP_WEB above.) |
icon |
string | Web push: icon URL. Slack: bot icon (emoji or URL). |
url |
string | Web push: URL to open when the notification is clicked. |
blocks |
Record<string, any>[] | Slack message blocks (optional). |
username |
string | Slack bot username. |
Types
TypesCreateNotificationType()
Create a new notification
notificationCreateRequest := *pingram.NewNotificationCreateRequest("NotificationId_example", "Title_example", []string{"Channels_example"}) // NotificationCreateRequest
resp, _, err := client.TypesAPI.TypesCreateNotificationType(ctx).NotificationCreateRequest(notificationCreateRequest).Execute()if err != nil { // handle error}// resp is NotificationParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
notificationId |
string | (required) |
title |
string | (required) |
channels |
string[] | (required) |
options |
object | |
options.EMAIL |
object | |
options.EMAIL.defaultDeliveryOption |
“off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.EMAIL.off |
object | |
options.EMAIL.off.enabled |
boolean | (required) |
options.EMAIL.instant |
object | |
options.EMAIL.instant.enabled |
boolean | (required) |
options.EMAIL.hourly |
object | |
options.EMAIL.hourly.enabled |
boolean | (required) |
options.EMAIL.daily |
object | |
options.EMAIL.daily.enabled |
boolean | (required) |
options.EMAIL.daily.hour |
string | |
options.EMAIL.weekly |
object | |
options.EMAIL.weekly.enabled |
boolean | (required) |
options.EMAIL.weekly.hour |
string | |
options.EMAIL.weekly.day |
string | |
options.EMAIL.monthly |
object | |
options.EMAIL.monthly.enabled |
boolean | (required) |
options.EMAIL.monthly.hour |
string | |
options.EMAIL.monthly.date |
“first” | “last” | |
options.INAPP_WEB |
object | |
options.INAPP_WEB.defaultDeliveryOption |
“off” | “instant” | (required) |
options.INAPP_WEB.off |
object | |
options.INAPP_WEB.off.enabled |
boolean | (required) |
options.INAPP_WEB.instant |
object | |
options.INAPP_WEB.instant.enabled |
boolean | (required) |
options.INAPP_WEB.instant.batching |
boolean | |
options.INAPP_WEB.instant.batchingKey |
string | |
options.INAPP_WEB.instant.batchingWindow |
number | |
options.SMS |
object | |
options.SMS.defaultDeliveryOption |
“off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.SMS.off |
object | |
options.SMS.off.enabled |
boolean | (required) |
options.SMS.instant |
object | |
options.SMS.instant.enabled |
boolean | (required) |
options.SMS.hourly |
object | |
options.SMS.hourly.enabled |
boolean | (required) |
options.SMS.daily |
object | |
options.SMS.daily.enabled |
boolean | (required) |
options.SMS.daily.hour |
string | |
options.SMS.weekly |
object | |
options.SMS.weekly.enabled |
boolean | (required) |
options.SMS.weekly.hour |
string | |
options.SMS.weekly.day |
string | |
options.SMS.monthly |
object | |
options.SMS.monthly.enabled |
boolean | (required) |
options.SMS.monthly.hour |
string | |
options.SMS.monthly.date |
“first” | “last” | |
options.CALL |
object | |
options.CALL.defaultDeliveryOption |
“off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.CALL.off |
object | |
options.CALL.off.enabled |
boolean | (required) |
options.CALL.instant |
object | |
options.CALL.instant.enabled |
boolean | (required) |
options.CALL.hourly |
object | |
options.CALL.hourly.enabled |
boolean | (required) |
options.CALL.daily |
object | |
options.CALL.daily.enabled |
boolean | (required) |
options.CALL.daily.hour |
string | |
options.CALL.weekly |
object | |
options.CALL.weekly.enabled |
boolean | (required) |
options.CALL.weekly.hour |
string | |
options.CALL.weekly.day |
string | |
options.CALL.monthly |
object | |
options.CALL.monthly.enabled |
boolean | (required) |
options.CALL.monthly.hour |
string | |
options.CALL.monthly.date |
“first” | “last” | |
options.PUSH |
object | |
options.PUSH.defaultDeliveryOption |
“off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.PUSH.off |
object | |
options.PUSH.off.enabled |
boolean | (required) |
options.PUSH.instant |
object | |
options.PUSH.instant.enabled |
boolean | (required) |
options.PUSH.hourly |
object | |
options.PUSH.hourly.enabled |
boolean | (required) |
options.PUSH.daily |
object | |
options.PUSH.daily.enabled |
boolean | (required) |
options.PUSH.daily.hour |
string | |
options.PUSH.weekly |
object | |
options.PUSH.weekly.enabled |
boolean | (required) |
options.PUSH.weekly.hour |
string | |
options.PUSH.weekly.day |
string | |
options.PUSH.monthly |
object | |
options.PUSH.monthly.enabled |
boolean | (required) |
options.PUSH.monthly.hour |
string | |
options.PUSH.monthly.date |
“first” | “last” | |
options.WEB_PUSH |
object | |
options.WEB_PUSH.defaultDeliveryOption |
“off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.WEB_PUSH.off |
object | |
options.WEB_PUSH.off.enabled |
boolean | (required) |
options.WEB_PUSH.instant |
object | |
options.WEB_PUSH.instant.enabled |
boolean | (required) |
options.WEB_PUSH.hourly |
object | |
options.WEB_PUSH.hourly.enabled |
boolean | (required) |
options.WEB_PUSH.daily |
object | |
options.WEB_PUSH.daily.enabled |
boolean | (required) |
options.WEB_PUSH.daily.hour |
string | |
options.WEB_PUSH.weekly |
object | |
options.WEB_PUSH.weekly.enabled |
boolean | (required) |
options.WEB_PUSH.weekly.hour |
string | |
options.WEB_PUSH.weekly.day |
string | |
options.WEB_PUSH.monthly |
object | |
options.WEB_PUSH.monthly.enabled |
boolean | (required) |
options.WEB_PUSH.monthly.hour |
string | |
options.WEB_PUSH.monthly.date |
“first” | “last” | |
options.SLACK |
object | |
options.SLACK.defaultDeliveryOption |
“off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
options.SLACK.off |
object | |
options.SLACK.off.enabled |
boolean | (required) |
options.SLACK.instant |
object | |
options.SLACK.instant.enabled |
boolean | (required) |
options.SLACK.hourly |
object | |
options.SLACK.hourly.enabled |
boolean | (required) |
options.SLACK.daily |
object | |
options.SLACK.daily.enabled |
boolean | (required) |
options.SLACK.daily.hour |
string | |
options.SLACK.weekly |
object | |
options.SLACK.weekly.enabled |
boolean | (required) |
options.SLACK.weekly.hour |
string | |
options.SLACK.weekly.day |
string | |
options.SLACK.monthly |
object | |
options.SLACK.monthly.enabled |
boolean | (required) |
options.SLACK.monthly.hour |
string | |
options.SLACK.monthly.date |
“first” | “last” |
TypesDeleteNotificationType()
Delete a notification
notificationId := // The notification ID
_, err := client.TypesAPI.TypesDeleteNotificationType(ctx, notificationId).Execute()if err != nil { // handle error}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| notificationId | string | The notification ID | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
TypesGetNotificationType()
Get a specific notification by ID
notificationId := // The notification ID
resp, _, err := client.TypesAPI.TypesGetNotificationType(ctx, notificationId).Execute()if err != nil { // handle error}// resp is []GetNotificationsResponseInnerParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| notificationId | string | The notification ID | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
TypesListNotificationTypes()
Get all notifications for an account with their templates
resp, _, err := client.TypesAPI.TypesListNotificationTypes(ctx).Execute()if err != nil { // handle error}// resp is []GetNotificationsResponseInnerParameters
This endpoint does not need any parameter.
TypesUpdateNotificationType()
Update a notification’s settings
notificationId := // The notification IDnotificationPatchRequest := *pingram.NewNotificationPatchRequest() // NotificationPatchRequest
resp, _, err := client.TypesAPI.TypesUpdateNotificationType(ctx, notificationId).NotificationPatchRequest(notificationPatchRequest).Execute()if err != nil { // handle error}// resp is NotificationParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| notificationId | string | The notification ID | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
Request Body Properties
| Name | Type | Description |
| —————————————— | –––––––––––––––––––––––––––––––––––––––– | ———– | — |
| title | string | |
| channels | (“EMAIL” | “INAPP_WEB” | “SMS” | “CALL” | “PUSH” | “WEB_PUSH” | “SLACK”)[] | |
| enabled | boolean | |
| deduplication | object | |
| deduplication.duration | number | (required) |
| throttling | object | |
| throttling.max | number | (required) |
| throttling.period | number | (required) |
| throttling.unit | “seconds” | “minutes” | “hours” | “days” | “months” | “years” | (required) |
| throttling.forever | boolean | (required) |
| throttling.scope | (“userId” | “notificationId”)[] | (required) |
| retention | number | null | |
| options | object | |
| options.EMAIL | object | |
| options.EMAIL.defaultDeliveryOption | “off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
| options.EMAIL.off | object | |
| options.EMAIL.off.enabled | boolean | (required) |
| options.EMAIL.instant | object | |
| options.EMAIL.instant.enabled | boolean | (required) |
| options.EMAIL.hourly | object | |
| options.EMAIL.hourly.enabled | boolean | (required) |
| options.EMAIL.daily | object | |
| options.EMAIL.daily.enabled | boolean | (required) |
| options.EMAIL.daily.hour | string | |
| options.EMAIL.weekly | object | |
| options.EMAIL.weekly.enabled | boolean | (required) |
| options.EMAIL.weekly.hour | string | |
| options.EMAIL.weekly.day | string | |
| options.EMAIL.monthly | object | |
| options.EMAIL.monthly.enabled | boolean | (required) |
| options.EMAIL.monthly.hour | string | |
| options.EMAIL.monthly.date | “first” | “last” | |
| options.INAPP_WEB | object | |
| options.INAPP_WEB.defaultDeliveryOption | “off” | “instant” | (required) |
| options.INAPP_WEB.off | object | |
| options.INAPP_WEB.off.enabled | boolean | (required) |
| options.INAPP_WEB.instant | object | |
| options.INAPP_WEB.instant.enabled | boolean | (required) |
| options.INAPP_WEB.instant.batching | boolean | |
| options.INAPP_WEB.instant.batchingKey | string | |
| options.INAPP_WEB.instant.batchingWindow | number | |
| options.SMS | object | |
| options.SMS.defaultDeliveryOption | “off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
| options.SMS.off | object | |
| options.SMS.off.enabled | boolean | (required) |
| options.SMS.instant | object | |
| options.SMS.instant.enabled | boolean | (required) |
| options.SMS.hourly | object | |
| options.SMS.hourly.enabled | boolean | (required) |
| options.SMS.daily | object | |
| options.SMS.daily.enabled | boolean | (required) |
| options.SMS.daily.hour | string | |
| options.SMS.weekly | object | |
| options.SMS.weekly.enabled | boolean | (required) |
| options.SMS.weekly.hour | string | |
| options.SMS.weekly.day | string | |
| options.SMS.monthly | object | |
| options.SMS.monthly.enabled | boolean | (required) |
| options.SMS.monthly.hour | string | |
| options.SMS.monthly.date | “first” | “last” | |
| options.CALL | object | |
| options.CALL.defaultDeliveryOption | “off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
| options.CALL.off | object | |
| options.CALL.off.enabled | boolean | (required) |
| options.CALL.instant | object | |
| options.CALL.instant.enabled | boolean | (required) |
| options.CALL.hourly | object | |
| options.CALL.hourly.enabled | boolean | (required) |
| options.CALL.daily | object | |
| options.CALL.daily.enabled | boolean | (required) |
| options.CALL.daily.hour | string | |
| options.CALL.weekly | object | |
| options.CALL.weekly.enabled | boolean | (required) |
| options.CALL.weekly.hour | string | |
| options.CALL.weekly.day | string | |
| options.CALL.monthly | object | |
| options.CALL.monthly.enabled | boolean | (required) |
| options.CALL.monthly.hour | string | |
| options.CALL.monthly.date | “first” | “last” | |
| options.PUSH | object | |
| options.PUSH.defaultDeliveryOption | “off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
| options.PUSH.off | object | |
| options.PUSH.off.enabled | boolean | (required) |
| options.PUSH.instant | object | |
| options.PUSH.instant.enabled | boolean | (required) |
| options.PUSH.hourly | object | |
| options.PUSH.hourly.enabled | boolean | (required) |
| options.PUSH.daily | object | |
| options.PUSH.daily.enabled | boolean | (required) |
| options.PUSH.daily.hour | string | |
| options.PUSH.weekly | object | |
| options.PUSH.weekly.enabled | boolean | (required) |
| options.PUSH.weekly.hour | string | |
| options.PUSH.weekly.day | string | |
| options.PUSH.monthly | object | |
| options.PUSH.monthly.enabled | boolean | (required) |
| options.PUSH.monthly.hour | string | |
| options.PUSH.monthly.date | “first” | “last” | |
| options.WEB_PUSH | object | |
| options.WEB_PUSH.defaultDeliveryOption | “off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
| options.WEB_PUSH.off | object | |
| options.WEB_PUSH.off.enabled | boolean | (required) |
| options.WEB_PUSH.instant | object | |
| options.WEB_PUSH.instant.enabled | boolean | (required) |
| options.WEB_PUSH.hourly | object | |
| options.WEB_PUSH.hourly.enabled | boolean | (required) |
| options.WEB_PUSH.daily | object | |
| options.WEB_PUSH.daily.enabled | boolean | (required) |
| options.WEB_PUSH.daily.hour | string | |
| options.WEB_PUSH.weekly | object | |
| options.WEB_PUSH.weekly.enabled | boolean | (required) |
| options.WEB_PUSH.weekly.hour | string | |
| options.WEB_PUSH.weekly.day | string | |
| options.WEB_PUSH.monthly | object | |
| options.WEB_PUSH.monthly.enabled | boolean | (required) |
| options.WEB_PUSH.monthly.hour | string | |
| options.WEB_PUSH.monthly.date | “first” | “last” | |
| options.SLACK | object | |
| options.SLACK.defaultDeliveryOption | “off” | “instant” | “hourly” | “daily” | “weekly” | “monthly” | (required) |
| options.SLACK.off | object | |
| options.SLACK.off.enabled | boolean | (required) |
| options.SLACK.instant | object | |
| options.SLACK.instant.enabled | boolean | (required) |
| options.SLACK.hourly | object | |
| options.SLACK.hourly.enabled | boolean | (required) |
| options.SLACK.daily | object | |
| options.SLACK.daily.enabled | boolean | (required) |
| options.SLACK.daily.hour | string | |
| options.SLACK.weekly | object | |
| options.SLACK.weekly.enabled | boolean | (required) |
| options.SLACK.weekly.hour | string | |
| options.SLACK.weekly.day | string | |
| options.SLACK.monthly | object | |
| options.SLACK.monthly.enabled | boolean | (required) |
| options.SLACK.monthly.hour | string | |
| options.SLACK.monthly.date | “first” | “last” | |
User
UserGetAccountMetadata()
Get account-level metadata including logo, VAPID key, and web push status
resp, _, err := client.UserAPI.UserGetAccountMetadata(ctx).Execute()if err != nil { // handle error}// resp is GetAccountMetadataResponseParameters
This endpoint does not need any parameter.
UserGetAvailableSlackChannels()
Get list of Slack channels and users for the authenticated user
userId := // User ID
_, err := client.UserAPI.UserGetAvailableSlackChannels(ctx, userId).Execute()if err != nil { // handle error}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| userId | string | User ID | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
UserGetInAppNotifications()
Get in-app notifications for a user
before := "before_example" // string (optional)count := float32(8.14) // float32 (optional)
resp, _, err := client.UserAPI.UserGetInAppNotifications(ctx).Before(before).Count(count).Execute()if err != nil { // handle error}// resp is GetInappNotificationsResponseParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| before | string | Timestamp or ISO date to fetch notifications before | |
| count | float32 | Number of notifications to return (default 10) |
UserGetInAppUnreadCount()
Get the count of unread in-app notifications for a user
resp, _, err := client.UserAPI.UserGetInAppUnreadCount(ctx).Execute()if err != nil { // handle error}// resp is InappUnreadCountResponseParameters
This endpoint does not need any parameter.
UserGetUser()
Get a user by ID. All users exist implicitly, returns basic user object if not found in DB.
userId := // User ID
resp, _, err := client.UserAPI.UserGetUser(ctx, userId).Execute()if err != nil { // handle error}// resp is UserParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| userId | string | User ID | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
UserIdentify()
Create or update a user with the given ID. Updates lastSeenTime automatically.
userId := // User IDpostUserRequest := *pingram.NewPostUserRequest() // PostUserRequest
resp, _, err := client.UserAPI.UserIdentify(ctx, userId).PostUserRequest(postUserRequest).Execute()if err != nil { // handle error}// resp is UserParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| userId | string | User ID | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
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[] |
UserMarkInAppNotificationsAsSeen()
Mark in-app web notifications as seen/read for a user
inAppNotificationUnreadClearRequest := *pingram.NewInAppNotificationUnreadClearRequest() // InAppNotificationUnreadClearRequest
resp, _, err := client.UserAPI.UserMarkInAppNotificationsAsSeen(ctx).InAppNotificationUnreadClearRequest(inAppNotificationUnreadClearRequest).Execute()if err != nil { // handle error}// resp is SuccessResponseParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
notificationId |
string | |
trackingId |
string |
UserUpdateInAppNotificationStatus()
Update in-app web notification status (opened, archived, clicked, etc.)
inAppNotificationPatchRequest := *pingram.NewInAppNotificationPatchRequest([]string{"TrackingIds_example"}) // InAppNotificationPatchRequest
resp, _, err := client.UserAPI.UserUpdateInAppNotificationStatus(ctx).InAppNotificationPatchRequest(inAppNotificationPatchRequest).Execute()if err != nil { // handle error}// resp is SuccessResponseParameters
| Name | Type | Description | Notes |
|---|
Request Body Properties
| Name | Type | Description |
|---|---|---|
trackingIds |
string[] | (required) |
opened |
string | |
clicked |
string | |
archived |
string | |
actioned1 |
string | |
actioned2 |
string | |
reply |
object | |
reply.date |
string | (required) |
reply.message |
string | (required) |
replies |
object[] | |
replies[].date |
string | (required) |
replies[].message |
string | (required) |
Users
UsersDeleteUser()
Delete a user and all associated data (in-app notifications, preferences, and user record)
userId := // User IDenvId := "envId_example" // string (optional)
resp, _, err := client.UsersAPI.UsersDeleteUser(ctx, userId).EnvId(envId).Execute()if err != nil { // handle error}// resp is DeleteUserResponseParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| userId | string | User ID | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
envId | string | Environment ID (required when using JWT auth) |
UsersListUsers()
Get all users for an environment with pagination support
limit := float32(8.14) // float32nextToken := "nextToken_example" // stringenvId := "envId_example" // string (optional)
resp, _, err := client.UsersAPI.UsersListUsers(ctx).Limit(limit).NextToken(nextToken).EnvId(envId).Execute()if err != nil { // handle error}// resp is GetUsersResponseParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| limit | float32 | Maximum number of users to return (default | |
| nextToken | string | Pagination token for next page | |
| envId | string | Environment ID (required when using JWT auth) |
UsersRemoveUserFromSuppression()
Remove user suppression status for a specific channel
userId := // User IDchannel := // Channel type (EMAIL)envId := "envId_example" // string (optional)
resp, _, err := client.UsersAPI.UsersRemoveUserFromSuppression(ctx, userId, channel).EnvId(envId).Execute()if err != nil { // handle error}// resp is UserSuppressionDeleteResponseParameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| userId | string | User ID | |
| channel | string | Channel type (EMAIL) | |
| Name | Type | Description | Notes |
| ———–– | ———–– | ———–– | ———–– |
envId | string | Environment ID (required when using JWT auth) |