Go SDK

Setup & Initialization

  1. Install Package:
go get github.com/pingram-io/pingram-go
  1. Import:
import (
    pingram "github.com/pingram-io/pingram-go"
)
  1. Initialize:
client := pingram.NewClient("pingram_sk_your_api_key")
NameTypeDescription
apiKey*stringYour Pingram API key. You can get it from your dashboard under Environments.
baseURLstringOptional. 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

senderPostBody := *pingram.NewSenderPostBody() // SenderPostBody

resp, _, err := client.DefaultAPI.Send(ctx).SenderPostBody(senderPostBody).Execute()
if err != nil {
	// handle error
}
// resp is SenderPostResponse

Parameters

NameTypeDescriptionNotes

Request Body Properties

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

Addresses

AddressesCreateAddress()

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

createAddressRequest := *pingram.NewCreateAddressRequest("Prefix_example") // CreateAddressRequest

resp, _, err := client.AddressesAPI.AddressesCreateAddress(ctx).CreateAddressRequest(createAddressRequest).Execute()
if err != nil {
	// handle error
}
// resp is AddressResponse

Parameters

NameTypeDescriptionNotes

Request Body Properties

NameTypeDescription
prefixstring(required)
domainstring
displayNamestring

AddressesListAddresses()

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

resp, _, err := client.AddressesAPI.AddressesListAddresses(ctx).Execute()
if err != nil {
	// handle error
}
// resp is AccountAddressesResponse

Parameters

This endpoint does not need any parameter.

AddressesUpdateAddress()

Update an existing address

updateAddressRequest := *pingram.NewUpdateAddressRequest("FullAddress_example") // UpdateAddressRequest

resp, _, err := client.AddressesAPI.AddressesUpdateAddress(ctx).UpdateAddressRequest(updateAddressRequest).Execute()
if err != nil {
	// handle error
}
// resp is AddressResponse

Parameters

NameTypeDescriptionNotes

Request Body Properties

NameTypeDescription
fullAddressstring(required)
prefixstring
displayNamestring

Domains

DomainsAddDomain()

Request to verify a new sender domain

postSendersRequestBody := *pingram.NewPostSendersRequestBody("Sender_example") // PostSendersRequestBody

resp, _, err := client.DomainsAPI.DomainsAddDomain(ctx).PostSendersRequestBody(postSendersRequestBody).Execute()
if err != nil {
	// handle error
}
// resp is []GetSendersResponseInner

Parameters

NameTypeDescriptionNotes

Request Body Properties

NameTypeDescription
senderstring(required)

DomainsDeleteDomain()

Delete a sender domain or email address

sender :=  // Sender domain or email address (URL encoded)

resp, _, err := client.DomainsAPI.DomainsDeleteDomain(ctx, sender).Execute()
if err != nil {
	// handle error
}
// resp is SuccessResponse

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
senderstringSender domain or email address (URL encoded)
NameTypeDescriptionNotes
----------------------------------------------------

DomainsListDomains()

Get all sender domains configured for the account

resp, _, err := client.DomainsAPI.DomainsListDomains(ctx).Execute()
if err != nil {
	// handle error
}
// resp is []GetSendersResponseInner

Parameters

This endpoint does not need any parameter.

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 Environment

Parameters

NameTypeDescriptionNotes

Request Body Properties

NameTypeDescription
titlestring(required)

EnvironmentsListEnvironments()

Get all environments for the authenticated account

resp, _, err := client.EnvironmentsAPI.EnvironmentsListEnvironments(ctx).Execute()
if err != nil {
	// handle error
}
// resp is []GetEnvironmentsResponseInner

Parameters

This endpoint does not need any parameter.

EnvironmentsUpdateEnvironment()

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

clientId :=  // Environment client ID
environmentPatchRequest := *pingram.NewEnvironmentPatchRequest() // EnvironmentPatchRequest

resp, _, err := client.EnvironmentsAPI.EnvironmentsUpdateEnvironment(ctx, clientId).EnvironmentPatchRequest(environmentPatchRequest).Execute()
if err != nil {
	// handle error
}
// resp is Environment

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
clientIdstringEnvironment client ID
NameTypeDescriptionNotes
----------------------------------------------------

Request Body Properties

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

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 LogsRetentionResponse

Parameters

This endpoint does not need any parameter.

LogsGetLogs()

List logs for the authenticated account

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 GetLogsResponse

Parameters

NameTypeDescriptionNotes
limitfloat32Maximum number of logs to return (default
cursorstringPagination cursor for next page

LogsGetLogsByTrackingIds()

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

trackingIds :=  // Comma-separated tracking IDs (URL encoded)

resp, _, err := client.LogsAPI.LogsGetLogsByTrackingIds(ctx, trackingIds).Execute()
if err != nil {
	// handle error
}
// resp is LogsGetResponse

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
trackingIdsstringComma-separated tracking IDs (URL encoded)
NameTypeDescriptionNotes
----------------------------------------------------

LogsGetLogsQueryResult()

Get results from a query ID

queryId :=  // Query ID

resp, _, err := client.LogsAPI.LogsGetLogsQueryResult(ctx, queryId).Execute()
if err != nil {
	// handle error
}
// resp is LogsQueryResultResponse

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
queryIdstringQuery ID
NameTypeDescriptionNotes
----------------------------------------------------

LogsStartLogsQuery()

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

logQueryPostBody := *pingram.NewLogQueryPostBody() // LogQueryPostBody

resp, _, err := client.LogsAPI.LogsStartLogsQuery(ctx).LogQueryPostBody(logQueryPostBody).Execute()
if err != nil {
	// handle error
}
// resp is LogsQueryResponse

Parameters

NameTypeDescriptionNotes

Request Body Properties

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

LogsTailLogs()

Get last 100 logs from the stream

resp, _, err := client.LogsAPI.LogsTailLogs(ctx).Execute()
if err != nil {
	// handle error
}
// resp is LogsTailResponse

Parameters

This endpoint does not need any parameter.

Organization

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 OrganizationUsage

Parameters

This endpoint does not need any parameter.

OrganizationGetUsageHistory()

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

startDate := "startDate_example" // string
endDate := "endDate_example" // string

resp, _, err := client.OrganizationAPI.OrganizationGetUsageHistory(ctx).StartDate(startDate).EndDate(endDate).Execute()
if err != nil {
	// handle error
}
// resp is OrganizationUsageHistory

Parameters

NameTypeDescriptionNotes
startDatestringStart date (YYYY-MM-DD) for the range
endDatestringEnd date (YYYY-MM-DD) for the range

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 APNConfig

Parameters

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 PushSettingsFCMResponse

Parameters

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 APNConfig

Parameters

NameTypeDescriptionNotes

Request Body Properties

NameTypeDescription
KeyIdstring(required)
Keystring(required)
TeamIdstring(required)
Topicstring(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 PushSettingsFCMResponse

Parameters

NameTypeDescriptionNotes

Request Body Properties

NameTypeDescription
fcmConfigstring(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 MessageResponse

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
trackingIdstringThe tracking ID of the scheduled notification
NameTypeDescriptionNotes
----------------------------------------------------

SenderUpdateSchedule()

Update the body or schedule of an already scheduled notification.

trackingId :=  // The tracking ID of the scheduled notification
senderPostBody := *pingram.NewSenderPostBody() // SenderPostBody

resp, _, err := client.SenderAPI.SenderUpdateSchedule(ctx, trackingId).SenderPostBody(senderPostBody).Execute()
if err != nil {
	// handle error
}
// resp is MessageResponse

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
trackingIdstringThe tracking ID of the scheduled notification
NameTypeDescriptionNotes
----------------------------------------------------

Request Body Properties

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

Templates

TemplatesCreateTemplate()

Create a new template for a notification

notificationId :=  // Notification ID
channel :=  // Channel type
templatePostRequest := *pingram.NewTemplatePostRequest("TemplateId_example") // TemplatePostRequest

resp, _, err := client.TemplatesAPI.TemplatesCreateTemplate(ctx, notificationId, channel).TemplatePostRequest(templatePostRequest).Execute()
if err != nil {
	// handle error
}
// resp is Template

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
notificationIdstringNotification ID
channelstringChannel type
NameTypeDescriptionNotes
----------------------------------------------------

Request Body Properties

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

TemplatesDeleteTemplate()

Delete a template

notificationId :=  // Notification ID
channel :=  // Channel type
templateId :=  // Template ID

_, err := client.TemplatesAPI.TemplatesDeleteTemplate(ctx, notificationId, channel, templateId).Execute()
if err != nil {
	// handle error
}

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
notificationIdstringNotification ID
channelstringChannel type
templateIdstringTemplate ID
NameTypeDescriptionNotes
----------------------------------------------------

TemplatesGetTemplate()

Get a single template by ID

notificationId :=  // Notification ID
channel :=  // Channel type
templateId :=  // Template ID

resp, _, err := client.TemplatesAPI.TemplatesGetTemplate(ctx, notificationId, channel, templateId).Execute()
if err != nil {
	// handle error
}
// resp is GetTemplatesResponse

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
notificationIdstringNotification ID
channelstringChannel type
templateIdstringTemplate ID
NameTypeDescriptionNotes
----------------------------------------------------

TemplatesListTemplates()

List all templates for a notification and channel

notificationId :=  // Notification ID
channel :=  // Channel type

resp, _, err := client.TemplatesAPI.TemplatesListTemplates(ctx, notificationId, channel).Execute()
if err != nil {
	// handle error
}
// resp is []GetTemplatesListResponseInner

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
notificationIdstringNotification ID
channelstringChannel type
NameTypeDescriptionNotes
----------------------------------------------------

TemplatesSetDefaultTemplate()

Set a template as default for specific delivery modes

notificationId :=  // Notification ID
channel :=  // Channel type
setDefaultTemplateRequest := *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 Template

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
notificationIdstringNotification ID
channelstringChannel type
NameTypeDescriptionNotes
----------------------------------------------------

Request Body Properties

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

TemplatesUpdateTemplate()

Update a template’s properties

notificationId :=  // Notification ID
channel :=  // Channel type
templateId :=  // Template ID
templatePatchRequest := *pingram.NewTemplatePatchRequest() // TemplatePatchRequest

resp, _, err := client.TemplatesAPI.TemplatesUpdateTemplate(ctx, notificationId, channel, templateId).TemplatePatchRequest(templatePatchRequest).Execute()
if err != nil {
	// handle error
}
// resp is Template

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
notificationIdstringNotification ID
channelstringChannel type
templateIdstringTemplate ID
NameTypeDescriptionNotes
----------------------------------------------------

Request Body Properties

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

Types

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 Notification

Parameters

NameTypeDescriptionNotes

Request Body Properties

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

TypesDeleteNotificationType()

Delete a notification

notificationId :=  // The notification ID

_, err := client.TypesAPI.TypesDeleteNotificationType(ctx, notificationId).Execute()
if err != nil {
	// handle error
}

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
notificationIdstringThe notification ID
NameTypeDescriptionNotes
----------------------------------------------------

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 []GetNotificationsResponseInner

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
notificationIdstringThe notification ID
NameTypeDescriptionNotes
----------------------------------------------------

TypesListNotificationTypes()

Get all notifications for an account with their templates

resp, _, err := client.TypesAPI.TypesListNotificationTypes(ctx).Execute()
if err != nil {
	// handle error
}
// resp is []GetNotificationsResponseInner

Parameters

This endpoint does not need any parameter.

TypesUpdateNotificationType()

Update a notification’s settings

notificationId :=  // The notification ID
notificationPatchRequest := *pingram.NewNotificationPatchRequest() // NotificationPatchRequest

resp, _, err := client.TypesAPI.TypesUpdateNotificationType(ctx, notificationId).NotificationPatchRequest(notificationPatchRequest).Execute()
if err != nil {
	// handle error
}
// resp is Notification

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
notificationIdstringThe notification ID
NameTypeDescriptionNotes
----------------------------------------------------

Request Body Properties

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

User

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 GetAccountMetadataResponse

Parameters

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

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
userIdstringUser ID
NameTypeDescriptionNotes
----------------------------------------------------

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 GetInappNotificationsResponse

Parameters

NameTypeDescriptionNotes
beforestringTimestamp or ISO date to fetch notifications before
countfloat32Number 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 InappUnreadCountResponse

Parameters

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 User

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
userIdstringUser ID
NameTypeDescriptionNotes
----------------------------------------------------

UserIdentify()

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

userId :=  // User ID
postUserRequest := *pingram.NewPostUserRequest() // PostUserRequest

resp, _, err := client.UserAPI.UserIdentify(ctx, userId).PostUserRequest(postUserRequest).Execute()
if err != nil {
	// handle error
}
// resp is User

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
userIdstringUser ID
NameTypeDescriptionNotes
----------------------------------------------------

Request Body Properties

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

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 SuccessResponse

Parameters

NameTypeDescriptionNotes

Request Body Properties

NameTypeDescription
notificationIdstring
trackingIdstring

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 SuccessResponse

Parameters

NameTypeDescriptionNotes

Request Body Properties

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

Users

UsersDeleteUser()

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

userId :=  // User ID
envId := "envId_example" // string (optional)

resp, _, err := client.UsersAPI.UsersDeleteUser(ctx, userId).EnvId(envId).Execute()
if err != nil {
	// handle error
}
// resp is DeleteUserResponse

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
userIdstringUser ID
NameTypeDescriptionNotes
----------------------------------------------------

envId | string | Environment ID (required when using JWT auth) |

UsersListUsers()

Get all users for an environment with pagination support

limit := float32(8.14) // float32
nextToken := "nextToken_example" // string
envId := "envId_example" // string (optional)

resp, _, err := client.UsersAPI.UsersListUsers(ctx).Limit(limit).NextToken(nextToken).EnvId(envId).Execute()
if err != nil {
	// handle error
}
// resp is GetUsersResponse

Parameters

NameTypeDescriptionNotes
limitfloat32Maximum number of users to return (default
nextTokenstringPagination token for next page
envIdstringEnvironment ID (required when using JWT auth)

UsersRemoveUserFromSuppression()

Remove user suppression status for a specific channel

userId :=  // User ID
channel :=  // 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 UserSuppressionDeleteResponse

Parameters

NameTypeDescriptionNotes
ctxcontext.Contextcontext for authentication, logging, cancellation, deadlines, tracing, etc.
userIdstringUser ID
channelstringChannel type (EMAIL)
NameTypeDescriptionNotes
----------------------------------------------------

envId | string | Environment ID (required when using JWT auth) |

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 EventsWebhookResponse

Parameters

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 EventsWebhookResponse

Parameters

NameTypeDescriptionNotes

Request Body Properties

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