V2 API Reference
Broadcasts
/broadcasts
Retrieves a paginated list of broadcasts for the project. Returns basic information about each broadcast including its creation time and status.
list_broadcasts
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/broadcasts"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := broadcasts.ListBroadcastsRequestParams{
}
response, err := client.Broadcasts.ListBroadcasts(context.Background(), params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"action_url": "https://example.com",
"category": "example",
"content": "Hello, World!",
"custom_attributes": {},
"id": "d1b3b3b3-3b3b-3b3b-3b3b-3b3b3b3b3b3b",
"overrides": {},
"recipients": [
{
"custom_attributes": {
"plan": "enterprise",
"preferred_pronoun": "They",
"pricing_version": "v10"
},
"email": "test@example.com",
"external_id": "83d987a-83fd034",
"first_name": "Person",
"last_name": "Doe",
"phone_numbers": [
"+1 5005550001"
]
}
],
"title": "Hello, World!",
"topic": "example"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/broadcasts
Creates a new broadcast message. When a broadcast is created, it generates individual notifications for relevant users within the project.
create_broadcast
Request Properties
"string"
The unique id for this broadcast.
"string"
["null","string"]
["string","null"]
^[A-Za-z0-9_\.\-/:]+$
["null","array"]
Show array item schema
"object"
["object","null"]
Show nested properties
"object"
Show nested properties
"object"
Show nested properties
"string"
"string"
["null","string"]
"object"
Show nested properties
"string"
"string"
["null","string"]
"object"
Show nested properties
"string"
"string"
["null","string"]
"object"
Show nested properties
"string"
["null","string"]
"string"
"object"
Show nested properties
["null","string"]
"string"
"string"
"object"
Show nested properties
"string"
"string"
["null","string"]
"object"
Show nested properties
"object"
"object"
"object"
"object"
"object"
"object"
"object"
["object","null"]
Show nested properties
"object"
Show nested properties
"integer"
readonly The number of recipients that the broadcast was sent to.
"integer"
readonly The number of failures while processing the broadcast.
["array","null"]
Show array item schema
"object"
Show nested properties
"string"
"string"
readonly "enqueued"
"processing"
"processed"
["null","string"]
"string"
readonly format: date-timeThe timestamp when the broadcast was created.
["string","null"]
^[A-Za-z0-9_\.\-/:]+$
["null","object"]
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/util"
"github.com/magicbell/magicbell-go/pkg/project-client/broadcasts"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
email := broadcasts.Email{
ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "ActionUrl" }),
Content: util.ToPointer("Content"),
Title: util.ToPointer("Title"),
}
inApp := broadcasts.InApp{
ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "ActionUrl" }),
Content: util.ToPointer("Content"),
Title: util.ToPointer("Title"),
}
mobilePush := broadcasts.MobilePush{
ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "ActionUrl" }),
Content: util.ToPointer("Content"),
Title: util.ToPointer("Title"),
}
slack := broadcasts.Slack{
ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "ActionUrl" }),
Content: util.ToPointer("Content"),
Title: util.ToPointer("Title"),
}
sms := broadcasts.Sms{
ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "ActionUrl" }),
Content: util.ToPointer("Content"),
Title: util.ToPointer("Title"),
}
webPush := broadcasts.WebPush{
ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "ActionUrl" }),
Content: util.ToPointer("Content"),
Title: util.ToPointer("Title"),
}
overridesChannels := broadcasts.OverridesChannels{
Email: &email,
InApp: &inApp,
MobilePush: &mobilePush,
Slack: &slack,
Sms: &sms,
WebPush: &webPush,
}
providers := broadcasts.Providers{
AmazonSes: []byte{},
Android: []byte{},
Ios: []byte{},
Mailgun: []byte{},
Postmark: []byte{},
Sendgrid: []byte{},
Slack: []byte{},
}
overrides := broadcasts.Overrides{
Channels: &overridesChannels,
Providers: &providers,
}
errors := broadcasts.Errors{
Message: util.ToPointer("Message"),
}
statusStatus := broadcasts.STATUS_STATUS_ENQUEUED
summary := broadcasts.Summary{
Failures: util.ToPointer(int64(123)),
Total: util.ToPointer(int64(123)),
}
broadcastStatus := broadcasts.BroadcastStatus{
Errors: []broadcasts.Errors{errors},
Status: &statusStatus,
Summary: &summary,
}
request := broadcasts.Broadcast{
ActionUrl: util.ToPointer(util.Nullable[string]{ Value: "ActionUrl" }),
Category: util.ToPointer(util.Nullable[string]{ Value: "Category" }),
Content: util.ToPointer(util.Nullable[string]{ Value: "Content" }),
CreatedAt: util.ToPointer("CreatedAt"),
CustomAttributes: []byte{},
Id: util.ToPointer("Id"),
Overrides: &overrides,
Recipients: []any{},
Status: &broadcastStatus,
Title: util.ToPointer("Title"),
Topic: util.ToPointer(util.Nullable[string]{ Value: "Topic" }),
}
response, err := client.Broadcasts.CreateBroadcast(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"action_url": "https://example.com",
"category": "example",
"content": "Hello, World!",
"custom_attributes": {},
"id": "d1b3b3b3-3b3b-3b3b-3b3b-3b3b3b3b3b3b",
"overrides": {},
"recipients": [
{
"custom_attributes": {
"plan": "enterprise",
"preferred_pronoun": "They",
"pricing_version": "v10"
},
"email": "test@example.com",
"external_id": "83d987a-83fd034",
"first_name": "Person",
"last_name": "Doe",
"phone_numbers": [
"+1 5005550001"
]
}
],
"title": "Hello, World!",
"topic": "example"
}
/broadcasts/{broadcast_id}
Retrieves detailed information about a specific broadcast by its ID. Includes the broadcast's configuration and current status.
fetch_broadcast
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Broadcasts.FetchBroadcast(context.Background(), "broadcastId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"action_url": "https://example.com",
"category": "example",
"content": "Hello, World!",
"custom_attributes": {},
"id": "d1b3b3b3-3b3b-3b3b-3b3b-3b3b3b3b3b3b",
"overrides": {},
"recipients": [
{
"custom_attributes": {
"plan": "enterprise",
"preferred_pronoun": "They",
"pricing_version": "v10"
},
"email": "test@example.com",
"external_id": "83d987a-83fd034",
"first_name": "Person",
"last_name": "Doe",
"phone_numbers": [
"+1 5005550001"
]
}
],
"title": "Hello, World!",
"topic": "example"
}
Channels
/channels/deliveryconfig
get_deliveryconfig
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := channels.GetDeliveryconfigRequestParams{
}
response, err := client.Channels.GetDeliveryconfig(context.Background(), params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"channels": [
{
"channel": "in_app"
},
{
"channel": "email",
"if": "{{notification.unseen}} == false"
}
],
"key": "project"
}
/channels/deliveryconfig
save_deliveryconfig
Request Properties
"array"
Show array item schema
"object"
Show nested properties
"string"
"in_app"
"slack"
"web_push"
"mobile_push"
"teams"
"email"
"sms"
"integer"
["string","null"]
"string"
^[A-Za-z0-9_.\-:/]+$
"boolean"
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/util"
"github.com/magicbell/magicbell-go/pkg/project-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
channel := channels.CHANNEL_IN_APP
categoryDeliveryConfigChannels := channels.CategoryDeliveryConfigChannels{
Channel: &channel,
Delay: util.ToPointer(int64(123)),
If_: util.ToPointer(util.Nullable[string]{ Value: "If_" }),
}
request := channels.CategoryDeliveryConfig{
Channels: []channels.CategoryDeliveryConfigChannels{categoryDeliveryConfigChannels},
Disabled: util.ToPointer(true),
Key: util.ToPointer("Key"),
}
response, err := client.Channels.SaveDeliveryconfig(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"channels": [
{
"channel": "in_app"
},
{
"channel": "email",
"if": "{{notification.unseen}} == false"
}
],
"key": "project"
}
Deliveryplanner
/notifications/{notification_id}/deliveryplan
Get the delivery plan for a notification.
get_deliveryplan
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Notifications.GetDeliveryplan(context.Background(), "notificationId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"channels": [
{
"channel": "email"
}
],
"id": "00000000-0000-0000-0000-000000000000",
"user_id": "00000000-0000-0000-0000-000000000000"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
Tokens
/users/{user_id}/channels/teams/tokens/{token_id}
Retrieves a specific teams token by its ID for a given user. This endpoint is available to project administrators and requires project-level authentication. Use this to inspect token details including its status, creation date, and associated metadata.
get_teams_user_token
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.GetTeamsUserToken(context.Background(), "userId", "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"updated_at": "2021-01-01T00:00:00Z"
}
/channels/teams/tokens
Lists all teams tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.
get_teams_tokens
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := channels.GetTeamsTokensRequestParams{
}
response, err := client.Channels.GetTeamsTokens(context.Background(), params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/channels/teams/tokens/{token_id}
Retrieves details of a specific teams token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens.
get_teams_token
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.GetTeamsToken(context.Background(), "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"updated_at": "2021-01-01T00:00:00Z"
}
/users/{user_id}/channels/slack/tokens/{token_id}
Retrieves a specific slack token by its ID for a given user. This endpoint is available to project administrators and requires project-level authentication. Use this to inspect token details including its status, creation date, and associated metadata.
get_slack_user_token
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.GetSlackUserToken(context.Background(), "userId", "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"updated_at": "2021-01-01T00:00:00Z",
"webhook": {
"url": "https://example.com/webhook"
}
}
/channels/slack/tokens/{token_id}
Retrieves details of a specific slack token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens.
get_slack_token
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.GetSlackToken(context.Background(), "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"updated_at": "2021-01-01T00:00:00Z",
"webhook": {
"url": "https://example.com/webhook"
}
}
/users/{user_id}/channels/web_push/tokens/{token_id}
Retrieves a specific web_push token by its ID for a given user. This endpoint is available to project administrators and requires project-level authentication. Use this to inspect token details including its status, creation date, and associated metadata.
get_web_push_user_token
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.GetWebPushUserToken(context.Background(), "userId", "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"endpoint": "https://fcm.googleapis.com/fcm/send/fZhR0fsr0zw:APA91bE4pM-qo1KBJDU_Zp2N9nDP-Jdmwugm-v4KNL_NlJvYCrJeJUzPXmMyAXqAE0m6BFOrkSWT0ArGbUjEEpxQEYZLado8JeW1PZA5CHB8R6C7HT6-MD6Qs8ZaCn8_ffLGGU7WuvtN",
"id": "123",
"keys": {
"auth": "GoIO2ulhtQuyBM64lZuFuw",
"p256dh": "BICAe4KtLhhPNFvynlqMRxjvpRnr94881QeuTCr8kCwJf-Fssj3FLIlnfFMjj7T1yNg5l6cn14350323_NSGZh0"
},
"updated_at": "2021-01-01T00:00:00Z"
}
/users/{user_id}/channels/web_push/tokens
Lists all web_push tokens associated with a specific user. This endpoint is available to project administrators and returns a paginated list of tokens, including both active and revoked tokens.
get_web_push_user_tokens
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := channels.GetWebPushUserTokensRequestParams{
}
response, err := client.Channels.GetWebPushUserTokens(context.Background(), "userId", params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"endpoint": "https://fcm.googleapis.com/fcm/send/fZhR0fsr0zw:APA91bE4pM-qo1KBJDU_Zp2N9nDP-Jdmwugm-v4KNL_NlJvYCrJeJUzPXmMyAXqAE0m6BFOrkSWT0ArGbUjEEpxQEYZLado8JeW1PZA5CHB8R6C7HT6-MD6Qs8ZaCn8_ffLGGU7WuvtN",
"id": "123",
"keys": {
"auth": "GoIO2ulhtQuyBM64lZuFuw",
"p256dh": "BICAe4KtLhhPNFvynlqMRxjvpRnr94881QeuTCr8kCwJf-Fssj3FLIlnfFMjj7T1yNg5l6cn14350323_NSGZh0"
},
"updated_at": "2021-01-01T00:00:00Z"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/users/{user_id}/channels/teams/tokens
Lists all teams tokens associated with a specific user. This endpoint is available to project administrators and returns a paginated list of tokens, including both active and revoked tokens.
get_teams_user_tokens
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := channels.GetTeamsUserTokensRequestParams{
}
response, err := client.Channels.GetTeamsUserTokens(context.Background(), "userId", params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/users/{user_id}/channels/slack/tokens
Lists all slack tokens associated with a specific user. This endpoint is available to project administrators and returns a paginated list of tokens, including both active and revoked tokens.
get_slack_user_tokens
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := channels.GetSlackUserTokensRequestParams{
}
response, err := client.Channels.GetSlackUserTokens(context.Background(), "userId", params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"updated_at": "2021-01-01T00:00:00Z",
"webhook": {
"url": "https://example.com/webhook"
}
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/channels/slack/tokens
Lists all slack tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.
get_slack_tokens
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := channels.GetSlackTokensRequestParams{
}
response, err := client.Channels.GetSlackTokens(context.Background(), params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"updated_at": "2021-01-01T00:00:00Z",
"webhook": {
"url": "https://example.com/webhook"
}
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/channels/web_push/tokens/{token_id}
Retrieves details of a specific web_push token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens.
get_web_push_token
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.GetWebPushToken(context.Background(), "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"endpoint": "https://fcm.googleapis.com/fcm/send/fZhR0fsr0zw:APA91bE4pM-qo1KBJDU_Zp2N9nDP-Jdmwugm-v4KNL_NlJvYCrJeJUzPXmMyAXqAE0m6BFOrkSWT0ArGbUjEEpxQEYZLado8JeW1PZA5CHB8R6C7HT6-MD6Qs8ZaCn8_ffLGGU7WuvtN",
"id": "123",
"keys": {
"auth": "GoIO2ulhtQuyBM64lZuFuw",
"p256dh": "BICAe4KtLhhPNFvynlqMRxjvpRnr94881QeuTCr8kCwJf-Fssj3FLIlnfFMjj7T1yNg5l6cn14350323_NSGZh0"
},
"updated_at": "2021-01-01T00:00:00Z"
}
/channels/web_push/tokens
Lists all web_push tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.
get_web_push_tokens
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := channels.GetWebPushTokensRequestParams{
}
response, err := client.Channels.GetWebPushTokens(context.Background(), params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"endpoint": "https://fcm.googleapis.com/fcm/send/fZhR0fsr0zw:APA91bE4pM-qo1KBJDU_Zp2N9nDP-Jdmwugm-v4KNL_NlJvYCrJeJUzPXmMyAXqAE0m6BFOrkSWT0ArGbUjEEpxQEYZLado8JeW1PZA5CHB8R6C7HT6-MD6Qs8ZaCn8_ffLGGU7WuvtN",
"id": "123",
"keys": {
"auth": "GoIO2ulhtQuyBM64lZuFuw",
"p256dh": "BICAe4KtLhhPNFvynlqMRxjvpRnr94881QeuTCr8kCwJf-Fssj3FLIlnfFMjj7T1yNg5l6cn14350323_NSGZh0"
},
"updated_at": "2021-01-01T00:00:00Z"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/users/{user_id}/channels/web_push/tokens/{token_id}
Revokes a specific user's web_push token. This endpoint is available to project administrators and permanently invalidates the specified token. Once revoked, the token can no longer be used to access channel features. This action cannot be undone.
discard_web_push_user_token
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.DiscardWebPushUserToken(context.Background(), "userId", "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123"
}
/channels/slack/tokens
Saves a slack token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel.
save_slack_token
Request Properties
"object"
Obtained directly from the incoming_webhook object in the installation response from the Slack API.
Show nested properties
"string"
format: uri"object"
Show nested properties
"string"
"string"
"string"
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/util"
"github.com/magicbell/magicbell-go/pkg/user-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
slackTokenPayloadOauth := channels.SlackTokenPayloadOauth{
ChannelId: util.ToPointer("ChannelId"),
InstallationId: util.ToPointer("InstallationId"),
Scope: util.ToPointer("Scope"),
}
slackTokenPayloadWebhook := channels.SlackTokenPayloadWebhook{
Url: util.ToPointer("Url"),
}
request := channels.SlackTokenPayload{
Oauth: &slackTokenPayloadOauth,
Webhook: &slackTokenPayloadWebhook,
}
response, err := client.Channels.SaveSlackToken(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"webhook": {
"url": "https://example.com/webhook"
}
}
/users/{user_id}/channels/teams/tokens/{token_id}
Revokes a specific user's teams token. This endpoint is available to project administrators and permanently invalidates the specified token. Once revoked, the token can no longer be used to access channel features. This action cannot be undone.
discard_teams_user_token
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.DiscardTeamsUserToken(context.Background(), "userId", "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123"
}
/channels/web_push/tokens
Saves a web_push token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel.
save_web_push_token
Request Properties
"string"
format: uriThe push subscription URL obtained from PushSubscription.endpoint after calling registration.pushManager.subscribe(). This is the unique URL for this device that push messages will be sent to.
"object"
The encryption keys from the PushSubscription.getKey() method, needed to encrypt push messages for this subscription.
Show nested properties
"string"
The authentication secret obtained from PushSubscription.getKey('auth'). Used to encrypt push messages for this subscription.
"string"
The P-256 ECDH public key obtained from PushSubscription.getKey('p256dh'). Used to encrypt push messages for this subscription.
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/util"
"github.com/magicbell/magicbell-go/pkg/user-client/shared"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
webPushTokenPayloadKeys := shared.WebPushTokenPayloadKeys{
Auth: util.ToPointer("Auth"),
P256dh: util.ToPointer("P256dh"),
}
request := shared.WebPushTokenPayload{
Endpoint: util.ToPointer("Endpoint"),
Keys: &webPushTokenPayloadKeys,
}
response, err := client.Channels.SaveWebPushToken(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"endpoint": "https://fcm.googleapis.com/fcm/send/fZhR0fsr0zw:APA91bE4pM-qo1KBJDU_Zp2N9nDP-Jdmwugm-v4KNL_NlJvYCrJeJUzPXmMyAXqAE0m6BFOrkSWT0ArGbUjEEpxQEYZLado8JeW1PZA5CHB8R6C7HT6-MD6Qs8ZaCn8_ffLGGU7WuvtN",
"keys": {
"auth": "GoIO2ulhtQuyBM64lZuFuw",
"p256dh": "BICAe4KtLhhPNFvynlqMRxjvpRnr94881QeuTCr8kCwJf-Fssj3FLIlnfFMjj7T1yNg5l6cn14350323_NSGZh0"
}
}
/channels/teams/tokens
Saves a teams token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel.
save_teams_token
Request Properties
"object"
Show nested properties
"string"
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/util"
"github.com/magicbell/magicbell-go/pkg/user-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
teamsTokenPayloadWebhook := channels.TeamsTokenPayloadWebhook{
Url: util.ToPointer("Url"),
}
request := channels.TeamsTokenPayload{
Webhook: &teamsTokenPayloadWebhook,
}
response, err := client.Channels.SaveTeamsToken(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{}
/channels/teams/tokens/{token_id}
Revokes one of the authenticated user's teams tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens.
discard_teams_token
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.DiscardTeamsToken(context.Background(), "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123"
}
/channels/slack/tokens/{token_id}
Revokes one of the authenticated user's slack tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens.
discard_slack_token
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.DiscardSlackToken(context.Background(), "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123"
}
/channels/web_push/tokens/{token_id}
Revokes one of the authenticated user's web_push tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens.
discard_web_push_token
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.DiscardWebPushToken(context.Background(), "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123"
}
/users/{user_id}/channels/slack/tokens/{token_id}
Revokes a specific user's slack token. This endpoint is available to project administrators and permanently invalidates the specified token. Once revoked, the token can no longer be used to access channel features. This action cannot be undone.
discard_slack_user_token
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.DiscardSlackUserToken(context.Background(), "userId", "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123"
}
Apns
/users/{user_id}/channels/mobile_push/apns/tokens/{token_id}
Retrieves a specific mobile_push token by its ID for a given user. This endpoint is available to project administrators and requires project-level authentication. Use this to inspect token details including its status, creation date, and associated metadata.
get_mobile_push_apns_user_token
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.GetMobilePushApnsUserToken(context.Background(), "userId", "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"created_at": "2021-01-01T00:00:00Z",
"device_token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"installation_id": "development",
"updated_at": "2021-01-01T00:00:00Z"
}
/channels/mobile_push/apns/tokens/{token_id}
Retrieves details of a specific mobile_push token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens.
get_mobile_push_apns_token
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.GetMobilePushApnsToken(context.Background(), "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"created_at": "2021-01-01T00:00:00Z",
"device_token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"installation_id": "development",
"updated_at": "2021-01-01T00:00:00Z"
}
/users/{user_id}/channels/mobile_push/apns/tokens
Lists all mobile_push tokens associated with a specific user. This endpoint is available to project administrators and returns a paginated list of tokens, including both active and revoked tokens.
get_mobile_push_apns_user_tokens
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := channels.GetMobilePushApnsUserTokensRequestParams{
}
response, err := client.Channels.GetMobilePushApnsUserTokens(context.Background(), "userId", params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"created_at": "2021-01-01T00:00:00Z",
"device_token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"installation_id": "development",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/channels/mobile_push/apns/tokens
Lists all mobile_push tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.
get_mobile_push_apns_tokens
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := channels.GetMobilePushApnsTokensRequestParams{
}
response, err := client.Channels.GetMobilePushApnsTokens(context.Background(), params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"created_at": "2021-01-01T00:00:00Z",
"device_token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"installation_id": "development",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/channels/mobile_push/apns/tokens
Saves a mobile_push token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel.
save_mobile_push_apns_token
Request Properties
"string"
"string"
(Optional) The APNs environment the token is registered for. If none is provided we assume the token is used in `production`.
"development"
"production"
"string"
(Optional) The bundle identifier of the application that is registering this token. Use this field to override the default identifier specified in the projects APNs integration.
^[a-zA-Z0-9]+(.[a-zA-Z0-9]+)*$
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/util"
"github.com/magicbell/magicbell-go/pkg/user-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
apnsTokenPayloadInstallationId := channels.APNS_TOKEN_PAYLOAD_INSTALLATION_ID_DEVELOPMENT
request := channels.ApnsTokenPayload{
AppId: util.ToPointer("AppId"),
DeviceToken: util.ToPointer("DeviceToken"),
InstallationId: &apnsTokenPayloadInstallationId,
}
response, err := client.Channels.SaveMobilePushApnsToken(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"device_token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"installation_id": "development"
}
/users/{user_id}/channels/mobile_push/apns/tokens/{token_id}
Revokes a specific user's mobile_push token. This endpoint is available to project administrators and permanently invalidates the specified token. Once revoked, the token can no longer be used to access channel features. This action cannot be undone.
discard_mobile_push_apns_user_token
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.DiscardMobilePushApnsUserToken(context.Background(), "userId", "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123"
}
/channels/mobile_push/apns/tokens/{token_id}
Revokes one of the authenticated user's mobile_push tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens.
discard_mobile_push_apns_token
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.DiscardMobilePushApnsToken(context.Background(), "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123"
}
Expo
/channels/mobile_push/expo/tokens
Lists all mobile_push tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.
get_mobile_push_expo_tokens
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := channels.GetMobilePushExpoTokensRequestParams{
}
response, err := client.Channels.GetMobilePushExpoTokens(context.Background(), params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"created_at": "2021-01-01T00:00:00Z",
"device_token": "expo-device-id",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/users/{user_id}/channels/mobile_push/expo/tokens/{token_id}
Retrieves a specific mobile_push token by its ID for a given user. This endpoint is available to project administrators and requires project-level authentication. Use this to inspect token details including its status, creation date, and associated metadata.
get_mobile_push_expo_user_token
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.GetMobilePushExpoUserToken(context.Background(), "userId", "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"created_at": "2021-01-01T00:00:00Z",
"device_token": "expo-device-id",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"updated_at": "2021-01-01T00:00:00Z"
}
/channels/mobile_push/expo/tokens/{token_id}
Retrieves details of a specific mobile_push token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens.
get_mobile_push_expo_token
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.GetMobilePushExpoToken(context.Background(), "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"created_at": "2021-01-01T00:00:00Z",
"device_token": "expo-device-id",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"updated_at": "2021-01-01T00:00:00Z"
}
/users/{user_id}/channels/mobile_push/expo/tokens
Lists all mobile_push tokens associated with a specific user. This endpoint is available to project administrators and returns a paginated list of tokens, including both active and revoked tokens.
get_mobile_push_expo_user_tokens
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := channels.GetMobilePushExpoUserTokensRequestParams{
}
response, err := client.Channels.GetMobilePushExpoUserTokens(context.Background(), "userId", params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"created_at": "2021-01-01T00:00:00Z",
"device_token": "expo-device-id",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/users/{user_id}/channels/mobile_push/expo/tokens/{token_id}
Revokes a specific user's mobile_push token. This endpoint is available to project administrators and permanently invalidates the specified token. Once revoked, the token can no longer be used to access channel features. This action cannot be undone.
discard_mobile_push_expo_user_token
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.DiscardMobilePushExpoUserToken(context.Background(), "userId", "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123"
}
/channels/mobile_push/expo/tokens/{token_id}
Revokes one of the authenticated user's mobile_push tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens.
discard_mobile_push_expo_token
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.DiscardMobilePushExpoToken(context.Background(), "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123"
}
/channels/mobile_push/expo/tokens
Saves a mobile_push token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel.
save_mobile_push_expo_token
Request Properties
"string"
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/util"
"github.com/magicbell/magicbell-go/pkg/user-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
request := channels.ExpoTokenPayload{
DeviceToken: util.ToPointer("DeviceToken"),
}
response, err := client.Channels.SaveMobilePushExpoToken(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"device_token": "expo-device-id"
}
Fcm
/channels/mobile_push/fcm/tokens/{token_id}
Retrieves details of a specific mobile_push token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens.
get_mobile_push_fcm_token
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.GetMobilePushFcmToken(context.Background(), "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"created_at": "2021-01-01T00:00:00Z",
"device_token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"installation_id": "development",
"updated_at": "2021-01-01T00:00:00Z"
}
/users/{user_id}/channels/mobile_push/fcm/tokens
Lists all mobile_push tokens associated with a specific user. This endpoint is available to project administrators and returns a paginated list of tokens, including both active and revoked tokens.
get_mobile_push_fcm_user_tokens
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := channels.GetMobilePushFcmUserTokensRequestParams{
}
response, err := client.Channels.GetMobilePushFcmUserTokens(context.Background(), "userId", params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"created_at": "2021-01-01T00:00:00Z",
"device_token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"installation_id": "development",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/channels/mobile_push/fcm/tokens
Lists all mobile_push tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.
get_mobile_push_fcm_tokens
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := channels.GetMobilePushFcmTokensRequestParams{
}
response, err := client.Channels.GetMobilePushFcmTokens(context.Background(), params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"created_at": "2021-01-01T00:00:00Z",
"device_token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"installation_id": "development",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/users/{user_id}/channels/mobile_push/fcm/tokens/{token_id}
Retrieves a specific mobile_push token by its ID for a given user. This endpoint is available to project administrators and requires project-level authentication. Use this to inspect token details including its status, creation date, and associated metadata.
get_mobile_push_fcm_user_token
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.GetMobilePushFcmUserToken(context.Background(), "userId", "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"created_at": "2021-01-01T00:00:00Z",
"device_token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"installation_id": "development",
"updated_at": "2021-01-01T00:00:00Z"
}
/users/{user_id}/channels/mobile_push/fcm/tokens/{token_id}
Revokes a specific user's mobile_push token. This endpoint is available to project administrators and permanently invalidates the specified token. Once revoked, the token can no longer be used to access channel features. This action cannot be undone.
discard_mobile_push_fcm_user_token
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.DiscardMobilePushFcmUserToken(context.Background(), "userId", "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123"
}
/channels/mobile_push/fcm/tokens/{token_id}
Revokes one of the authenticated user's mobile_push tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens.
discard_mobile_push_fcm_token
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.DiscardMobilePushFcmToken(context.Background(), "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123"
}
/channels/mobile_push/fcm/tokens
Saves a mobile_push token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel.
save_mobile_push_fcm_token
Request Properties
"string"
"string"
"development"
"production"
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/util"
"github.com/magicbell/magicbell-go/pkg/user-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
fcmTokenPayloadInstallationId := channels.FCM_TOKEN_PAYLOAD_INSTALLATION_ID_DEVELOPMENT
request := channels.FcmTokenPayload{
DeviceToken: util.ToPointer("DeviceToken"),
InstallationId: &fcmTokenPayloadInstallationId,
}
response, err := client.Channels.SaveMobilePushFcmToken(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"device_token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"installation_id": "development"
}
Inbox
/users/{user_id}/channels/in_app/inbox/tokens/{token_id}
Retrieves a specific in_app token by its ID for a given user. This endpoint is available to project administrators and requires project-level authentication. Use this to inspect token details including its status, creation date, and associated metadata.
get_in_app_inbox_user_token
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.GetInAppInboxUserToken(context.Background(), "userId", "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"updated_at": "2021-01-01T00:00:00Z"
}
/channels/in_app/inbox/tokens/{token_id}
Retrieves details of a specific in_app token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens.
get_in_app_inbox_token
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.GetInAppInboxToken(context.Background(), "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"updated_at": "2021-01-01T00:00:00Z"
}
/users/{user_id}/channels/in_app/inbox/tokens
Lists all in_app tokens associated with a specific user. This endpoint is available to project administrators and returns a paginated list of tokens, including both active and revoked tokens.
get_in_app_inbox_user_tokens
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := channels.GetInAppInboxUserTokensRequestParams{
}
response, err := client.Channels.GetInAppInboxUserTokens(context.Background(), "userId", params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/channels/in_app/inbox/tokens
Lists all in_app tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.
get_in_app_inbox_tokens
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := channels.GetInAppInboxTokensRequestParams{
}
response, err := client.Channels.GetInAppInboxTokens(context.Background(), params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"updated_at": "2021-01-01T00:00:00Z"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/channels/in_app/inbox/tokens
Saves a in_app token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel.
save_in_app_inbox_token
Request Properties
"string"
["string","null"]
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/util"
"github.com/magicbell/magicbell-go/pkg/user-client/channels"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
request := channels.InboxToken{
ConnectionId: util.ToPointer(util.Nullable[string]{ Value: "ConnectionId" }),
Token: util.ToPointer("Token"),
}
response, err := client.Channels.SaveInAppInboxToken(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt"
}
/users/{user_id}/channels/in_app/inbox/tokens/{token_id}
Revokes a specific user's in_app token. This endpoint is available to project administrators and permanently invalidates the specified token. Once revoked, the token can no longer be used to access channel features. This action cannot be undone.
discard_in_app_inbox_user_token
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.DiscardInAppInboxUserToken(context.Background(), "userId", "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123"
}
/channels/in_app/inbox/tokens/{token_id}
Revokes one of the authenticated user's in_app tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens.
discard_in_app_inbox_token
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Channels.DiscardInAppInboxToken(context.Background(), "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123"
}
Events
/events/{id}
Retrieves a project event by its ID.
get_event
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Events.GetEvent(context.Background(), "id")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"id": "123",
"timestamp": "2021-01-01T00:00:00Z",
"type": "example_type"
}
/events
Retrieves a paginated list of events for the project.
list_events
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/events"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := events.ListEventsRequestParams{
}
response, err := client.Events.ListEvents(context.Background(), params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"id": "123",
"timestamp": "2021-01-01T00:00:00Z",
"type": "example_type"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
Integrations
/integrations
List Integrations
Lists all available and configured integrations for the project. Returns a summary of each integration including its type, status, and basic configuration information.
list_integrations
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/integrations"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := integrations.ListIntegrationsRequestParams{
}
response, err := client.Integrations.ListIntegrations(context.Background(), params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"config": {
"webhook_url": "https://example.com/webhook"
},
"id": "123",
"name": "\u003cprovider-name\u003e"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
Apns
/integrations/apns
Retrieves the current apns integration configurations for a specific integration type in the project. Returns configuration details and status information.
get_apns_integration
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.GetApnsIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"config": {
"app_id": "com.example.myapp",
"badge": "unread",
"certificate": "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgHnr4B2P+by++FGu/th0a44E8chJl5v5Vo4gq0YHw6e6gCgYIKoZIzj0DAQehRANCAARCg1MRibnfyeX5mx6+Rtfzzn7UhJP/oaqL4RzSmDuTsd3BTX33cuQ0gWHe20R2m1bLAkI1wrp+zbWOlAOAD7KX\n-----END PRIVATE KEY-----",
"key_id": "ABCD1234EF",
"team_id": "ABCD1234EF"
},
"id": "123",
"name": "\u003cprovider-name\u003e"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/integrations/apns
Removes a apns integration configuration from the project. This will disable the integration's functionality within the project.
delete_apns_integration
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeleteApnsIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/apns/{id}
Removes a specific apns integration instance by ID from the project.
delete_apns_integration_by_id
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeleteApnsIntegrationById(context.Background(), "id")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/apns
Creates or updates a apns integration for the project. Only administrators can configure integrations.
save_apns_integration
Request Properties
"string"
"string"
"string"
"unread"
"unseen"
"string"
"1"
"2"
"string"
The default bundle identifier of the application that is configured with this project. It can be overriden on a per token basis, when registering device tokens.
^[a-zA-Z0-9]+(.[a-zA-Z0-9]+)*$
"string"
The APNs certificate in P8 format. Generate it at [developer.apple.com](https://developer.apple.com/account/resources/authkeys/add) with the 'Apple Push Notification service (APNs)' option selected.
^-+?\s?BEGIN PRIVATE KEY-+\n([A-Za-z0-9+/\r\n]+={0,2})\n-+\s?END PRIVATE KEY+-+\n?$
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/util"
"github.com/magicbell/magicbell-go/pkg/project-client/integrations"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
badge := integrations.BADGE_UNREAD
payloadVersion := integrations.PAYLOAD_VERSION_1
request := integrations.ApnsConfigPayload{
AppId: util.ToPointer("AppId"),
Badge: &badge,
Certificate: util.ToPointer("Certificate"),
KeyId: util.ToPointer("KeyId"),
PayloadVersion: &payloadVersion,
TeamId: util.ToPointer("TeamId"),
}
response, err := client.Integrations.SaveApnsIntegration(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"app_id": "com.example.myapp",
"badge": "unread",
"certificate": "-----BEGIN PRIVATE KEY-----\nMIGTAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBHkwdwIBAQQgHnr4B2P+by++FGu/th0a44E8chJl5v5Vo4gq0YHw6e6gCgYIKoZIzj0DAQehRANCAARCg1MRibnfyeX5mx6+Rtfzzn7UhJP/oaqL4RzSmDuTsd3BTX33cuQ0gWHe20R2m1bLAkI1wrp+zbWOlAOAD7KX\n-----END PRIVATE KEY-----",
"key_id": "ABCD1234EF",
"team_id": "ABCD1234EF"
}
Expo
/integrations/expo
Retrieves the current expo integration configurations for a specific integration type in the project. Returns configuration details and status information.
get_expo_integration
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.GetExpoIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"config": {
"access_token": "expo_access_token"
},
"id": "123",
"name": "\u003cprovider-name\u003e"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/integrations/expo
Removes a expo integration configuration from the project. This will disable the integration's functionality within the project.
delete_expo_integration
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeleteExpoIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/expo/{id}
Removes a specific expo integration instance by ID from the project.
delete_expo_integration_by_id
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeleteExpoIntegrationById(context.Background(), "id")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/expo
Creates or updates a expo integration for the project. Only administrators can configure integrations.
save_expo_integration
Request Properties
"string"
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/util"
"github.com/magicbell/magicbell-go/pkg/project-client/integrations"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
request := integrations.ExpoConfigPayload{
AccessToken: util.ToPointer("AccessToken"),
}
response, err := client.Integrations.SaveExpoIntegration(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"access_token": "expo_access_token"
}
Fcm
/integrations/fcm
Retrieves the current fcm integration configurations for a specific integration type in the project. Returns configuration details and status information.
get_fcm_integration
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.GetFcmIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"config": {
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"client_email": "firebase-adminsdk-qwhtp@platform-development.iam.gserviceaccount.com",
"client_id": "117893100789081023083",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-qwhtp%40magicbell-development.iam.gserviceaccount.com",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC7/GBHM4AK4/8c\nZyvJfdzjBzfA48tV9T3N4hBCb4E66jIz+oztH9oSngEfIVO/L1dWjK1OlN0cqJ0f\nQaKq1eycSjmwfTR3HGNjQQyoGQ4BFBdyqT5rRDDZLPI2LoR0dtQXcBtiFpJF2t8e\niDmpl3d/ipuKMtBRzjYPqzP0qv3YkPmw2v5FqKK9EIaHRtOhd2R28F5FE+kF1dvB\nt7fEeVtKcQJcSwDUQ8HEshlWSx6azGd4jxf9jHRXWumXYfTA6NMA7EUTDJVus3vU\ny9MCv2KwZO/dzlQygY0BM9FHPSzZRIiHUx+DH6gYl2uWJatluHz58lj3r5mo/Ssc\nyP3TrqOnAgMBAAECggEAWAnDe0UCt9b8QGyPBK/V1VspgMQOE+UlOzkenUaEUreg\nqFg0TM8ofaSS6OXeR0DgGdALUCyGeyf6YcuG55QFWlKmvuF8QzY/05mA2G7XcKjc\nrF3Xtju61tLmYnqZnMOT46AkquTgPyfYa3+n5aVimRAsdOYESvOUvPTUgcbc2GGK\nC2h2MUCoRKuhzbGx847XJmINRE+xaht4hDMhzhMBVrgGGyQ3sIdbCxpbiQR6QH2H\npITrSnd4hlKRPREWS/D4FUKP/ucXdORP9SUi0R64NRZ3GvT1HvpVZ9fOXwIACdAG\n9fpIQbsmIgxhgZ5ZjuGz/nFi2KQ2Y8rEycQmnHd4QQKBgQD4LVFL93E4qwr7Eruj\nFjyxGYYi2PhVxvrpiSD6ziK3HUjAxat6OcoElJx7WEFWHmi7KRgehqcl40A8Coav\n9DGBwnSM2AYKgzOqMqzjK71TFOQsJdGEYThnhiL2FoQeptgskVS7J9MMBPTnyl7D\nYObINwGbg9auVp66rj5W+dymZwKBgQDB6VdpxJpU9hXBW+8nJESduhzpYiHoe1kN\nyka90dQDOe2b/R7bnF1Ggte6Ll1dMs3xLhN1Mm2XTcX2zmzM15C0E4+1t1LXXzAo\nO2P+riEmCIUc1i0yNMVgEKXiOBBYgKauE3fT88c4dw2JAT0QlifJ0h8kRPNhUaq9\nespjleNQwQKBgHUzwZ7knn2qmSb1M9PTHppseWJfoPexXrGHZyHK064ykDcpos+4\nFuWO4U+G4GQxPDiXMaLI6IsGBUHVnsHdyruC/9O7+S5hw7Zu9CLcdy6TQSZwPcAM\nwbxyJnSdMYvgM1roz2ELb6nPdXE5qwMN8i8/euzcmDgBBDkZLKuamE+lAoGBAKb7\nvd7DAvPvBkUAWi2mub/pqUQA0ZpVvhZ1/f0wWBZ/J/KQQqZzPI+f1Q3rJ1M+kMIE\nH5Vo257TxooGsQKlD2NDBRpCx//XZK0Al9eVM86Av8BZX4pAj0dujqsEBG9yOhbl\nhObsor4pJ2q3ulIyPAk7/L1K8xr3LMUGnIqtZJcBAoGAEQffqGbnaOG8Ue3++bLP\nN6XlAyt5UajAd1CycIHgDvbW0CkWoI70Bg7QNqMYJe6DareH4vRpdB3tw6zNP7qN\n0Bd04L8+zUYN+VqNJ70d7Xn+k2rY7STlgU3vwOzHFwu4wK2A7e+aAZ8AjC+Sr0ZM\nps+wuWO8MN5yQTBZvAEIfQs=\n-----END PRIVATE KEY-----\n",
"private_key_id": "1935e74178f6ef0bbc23fb3538255f8281093bf2",
"project_id": "platform-development",
"token_uri": "https://oauth2.googleapis.com/token",
"type": "service_account",
"universe_domain": "googleapis.com"
},
"id": "123",
"name": "\u003cprovider-name\u003e"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/integrations/fcm
Removes a fcm integration configuration from the project. This will disable the integration's functionality within the project.
delete_fcm_integration
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeleteFcmIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/fcm/{id}
Removes a specific fcm integration instance by ID from the project.
delete_fcm_integration_by_id
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeleteFcmIntegrationById(context.Background(), "id")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/fcm
Creates or updates a fcm integration for the project. Only administrators can configure integrations.
save_fcm_integration
Request Properties
"string"
"string"
"string"
^-+?\s?BEGIN[A-Z ]+-+\n([A-Za-z0-9+/\r\n]+={0,2})\n-+\s?END[A-Z ]+-+\n?$
"string"
"string"
"string"
"string"
"string"
"service_account"
"string"
"string"
"string"
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/util"
"github.com/magicbell/magicbell-go/pkg/project-client/integrations"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
type_ := integrations.TYPE_SERVICE_ACCOUNT
request := integrations.FcmConfigPayload{
AuthProviderX509CertUrl: util.ToPointer("AuthProviderX509CertUrl"),
AuthUri: util.ToPointer("AuthUri"),
ClientEmail: util.ToPointer("ClientEmail"),
ClientId: util.ToPointer("ClientId"),
ClientX509CertUrl: util.ToPointer("ClientX509CertUrl"),
PrivateKey: util.ToPointer("PrivateKey"),
PrivateKeyId: util.ToPointer("PrivateKeyId"),
ProjectId: util.ToPointer("ProjectId"),
TokenUri: util.ToPointer("TokenUri"),
Type_: &type_,
UniverseDomain: util.ToPointer("UniverseDomain"),
}
response, err := client.Integrations.SaveFcmIntegration(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"client_email": "firebase-adminsdk-qwhtp@platform-development.iam.gserviceaccount.com",
"client_id": "117893100789081023083",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-qwhtp%40magicbell-development.iam.gserviceaccount.com",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC7/GBHM4AK4/8c\nZyvJfdzjBzfA48tV9T3N4hBCb4E66jIz+oztH9oSngEfIVO/L1dWjK1OlN0cqJ0f\nQaKq1eycSjmwfTR3HGNjQQyoGQ4BFBdyqT5rRDDZLPI2LoR0dtQXcBtiFpJF2t8e\niDmpl3d/ipuKMtBRzjYPqzP0qv3YkPmw2v5FqKK9EIaHRtOhd2R28F5FE+kF1dvB\nt7fEeVtKcQJcSwDUQ8HEshlWSx6azGd4jxf9jHRXWumXYfTA6NMA7EUTDJVus3vU\ny9MCv2KwZO/dzlQygY0BM9FHPSzZRIiHUx+DH6gYl2uWJatluHz58lj3r5mo/Ssc\nyP3TrqOnAgMBAAECggEAWAnDe0UCt9b8QGyPBK/V1VspgMQOE+UlOzkenUaEUreg\nqFg0TM8ofaSS6OXeR0DgGdALUCyGeyf6YcuG55QFWlKmvuF8QzY/05mA2G7XcKjc\nrF3Xtju61tLmYnqZnMOT46AkquTgPyfYa3+n5aVimRAsdOYESvOUvPTUgcbc2GGK\nC2h2MUCoRKuhzbGx847XJmINRE+xaht4hDMhzhMBVrgGGyQ3sIdbCxpbiQR6QH2H\npITrSnd4hlKRPREWS/D4FUKP/ucXdORP9SUi0R64NRZ3GvT1HvpVZ9fOXwIACdAG\n9fpIQbsmIgxhgZ5ZjuGz/nFi2KQ2Y8rEycQmnHd4QQKBgQD4LVFL93E4qwr7Eruj\nFjyxGYYi2PhVxvrpiSD6ziK3HUjAxat6OcoElJx7WEFWHmi7KRgehqcl40A8Coav\n9DGBwnSM2AYKgzOqMqzjK71TFOQsJdGEYThnhiL2FoQeptgskVS7J9MMBPTnyl7D\nYObINwGbg9auVp66rj5W+dymZwKBgQDB6VdpxJpU9hXBW+8nJESduhzpYiHoe1kN\nyka90dQDOe2b/R7bnF1Ggte6Ll1dMs3xLhN1Mm2XTcX2zmzM15C0E4+1t1LXXzAo\nO2P+riEmCIUc1i0yNMVgEKXiOBBYgKauE3fT88c4dw2JAT0QlifJ0h8kRPNhUaq9\nespjleNQwQKBgHUzwZ7knn2qmSb1M9PTHppseWJfoPexXrGHZyHK064ykDcpos+4\nFuWO4U+G4GQxPDiXMaLI6IsGBUHVnsHdyruC/9O7+S5hw7Zu9CLcdy6TQSZwPcAM\nwbxyJnSdMYvgM1roz2ELb6nPdXE5qwMN8i8/euzcmDgBBDkZLKuamE+lAoGBAKb7\nvd7DAvPvBkUAWi2mub/pqUQA0ZpVvhZ1/f0wWBZ/J/KQQqZzPI+f1Q3rJ1M+kMIE\nH5Vo257TxooGsQKlD2NDBRpCx//XZK0Al9eVM86Av8BZX4pAj0dujqsEBG9yOhbl\nhObsor4pJ2q3ulIyPAk7/L1K8xr3LMUGnIqtZJcBAoGAEQffqGbnaOG8Ue3++bLP\nN6XlAyt5UajAd1CycIHgDvbW0CkWoI70Bg7QNqMYJe6DareH4vRpdB3tw6zNP7qN\n0Bd04L8+zUYN+VqNJ70d7Xn+k2rY7STlgU3vwOzHFwu4wK2A7e+aAZ8AjC+Sr0ZM\nps+wuWO8MN5yQTBZvAEIfQs=\n-----END PRIVATE KEY-----\n",
"private_key_id": "1935e74178f6ef0bbc23fb3538255f8281093bf2",
"project_id": "platform-development",
"token_uri": "https://oauth2.googleapis.com/token",
"type": "service_account",
"universe_domain": "googleapis.com"
}
Start
/integrations/inbox/installations/start
Initiates the installation flow for a inbox integration. This is the first step in a multi-step installation process where user authorization or external service configuration may be required.
start_inbox_installation
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.StartInboxInstallation(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"images": {
"emptyInboxUrl": ""
},
"locale": "de",
"theme": {
"banner": {
"backgroundColor": "#F8F5FF",
"fontSize": "14px",
"textColor": "#3A424D"
},
"dialog": {
"accentColor": "#5225C1",
"backgroundColor": "#F5F5F5",
"textColor": "#313131"
},
"footer": {
"backgroundColor": "#FFFFFF",
"borderRadius": "16px",
"fontFamily": "inherit",
"fontSize": "15px",
"textColor": "#5225C1"
},
"header": {
"backgroundColor": "#FFFFFF",
"borderRadius": "16px",
"fontFamily": "inherit",
"fontSize": "15px",
"textColor": "#5225C1"
},
"icon": {
"borderColor": "#EDEDEF",
"width": "24px"
},
"unseenBadge": {
"backgroundColor": "#F80808"
}
}
}
Mailgun
/integrations/mailgun
Retrieves the current mailgun integration configurations for a specific integration type in the project. Returns configuration details and status information.
get_mailgun_integration
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.GetMailgunIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"config": {
"api_key": "key-3ax6xnjp29jd6fds4gc373sgvjxteol0",
"domain": "example.com",
"from": {
"email": "hello@example.com",
"name": "Example"
},
"region": "us"
},
"id": "123",
"name": "\u003cprovider-name\u003e"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/integrations/mailgun
Removes a mailgun integration configuration from the project. This will disable the integration's functionality within the project.
delete_mailgun_integration
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeleteMailgunIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/mailgun/{id}
Removes a specific mailgun integration instance by ID from the project.
delete_mailgun_integration_by_id
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeleteMailgunIntegrationById(context.Background(), "id")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/mailgun
Creates or updates a mailgun integration for the project. Only administrators can configure integrations.
save_mailgun_integration
Request Properties
"object"
Show nested properties
"string"
format: emailThe email address to send from
["string","null"]
The name to send from
"string"
"string"
"us"
"eu"
"string"
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/util"
"github.com/magicbell/magicbell-go/pkg/project-client/integrations"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
mailgunConfigPayloadFrom := integrations.MailgunConfigPayloadFrom{
Email: util.ToPointer("Email"),
Name: util.ToPointer(util.Nullable[string]{ Value: "Name" }),
}
region := integrations.REGION_US
request := integrations.MailgunConfigPayload{
ApiKey: util.ToPointer("ApiKey"),
Domain: util.ToPointer("Domain"),
From: &mailgunConfigPayloadFrom,
Region: ®ion,
}
response, err := client.Integrations.SaveMailgunIntegration(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"api_key": "key-3ax6xnjp29jd6fds4gc373sgvjxteol0",
"domain": "example.com",
"from": {
"email": "hello@example.com",
"name": "Example"
},
"region": "us"
}
Ping Email
/integrations/ping_email
Retrieves the current ping_email integration configurations for a specific integration type in the project. Returns configuration details and status information.
get_ping_email_integration
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.GetPingEmailIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"config": {
"url": "https://example.com/webhook"
},
"id": "123",
"name": "\u003cprovider-name\u003e"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/integrations/ping_email
Removes a ping_email integration configuration from the project. This will disable the integration's functionality within the project.
delete_ping_email_integration
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeletePingEmailIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/ping_email/{id}
Removes a specific ping_email integration instance by ID from the project.
delete_ping_email_integration_by_id
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeletePingEmailIntegrationById(context.Background(), "id")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/ping_email
Creates or updates a ping_email integration for the project. Only administrators can configure integrations.
save_ping_email_integration
Request Properties
"string"
format: uriURL to ping
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/util"
"github.com/magicbell/magicbell-go/pkg/project-client/integrations"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
request := integrations.PingConfigPayload{
Url: util.ToPointer("Url"),
}
response, err := client.Integrations.SavePingEmailIntegration(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"url": "https://example.com/webhook"
}
Sendgrid
/integrations/sendgrid
Retrieves the current sendgrid integration configurations for a specific integration type in the project. Returns configuration details and status information.
get_sendgrid_integration
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.GetSendgridIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"config": {
"api_key": "SG.1234567890",
"from": {
"email": "matt@magicbell.com",
"name": "Matt"
},
"reply_to": {
"email": "hana@magicbell.com",
"name": "Hana"
}
},
"id": "123",
"name": "\u003cprovider-name\u003e"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/integrations/sendgrid/{id}
Removes a specific sendgrid integration instance by ID from the project.
delete_sendgrid_integration_by_id
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeleteSendgridIntegrationById(context.Background(), "id")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/sendgrid
Removes a sendgrid integration configuration from the project. This will disable the integration's functionality within the project.
delete_sendgrid_integration
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeleteSendgridIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/sendgrid
Creates or updates a sendgrid integration for the project. Only administrators can configure integrations.
save_sendgrid_integration
Request Properties
"object"
Show nested properties
"string"
format: emailThe email address to send from
["string","null"]
The name to send from
"object"
Show nested properties
"string"
format: emailThe email address to reply to
["string","null"]
The name to reply to
"string"
The API key for Sendgrid
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/util"
"github.com/magicbell/magicbell-go/pkg/project-client/integrations"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
sendgridConfigPayloadFrom := integrations.SendgridConfigPayloadFrom{
Email: util.ToPointer("Email"),
Name: util.ToPointer(util.Nullable[string]{ Value: "Name" }),
}
replyTo := integrations.ReplyTo{
Email: util.ToPointer("Email"),
Name: util.ToPointer(util.Nullable[string]{ Value: "Name" }),
}
request := integrations.SendgridConfigPayload{
ApiKey: util.ToPointer("ApiKey"),
From: &sendgridConfigPayloadFrom,
ReplyTo: &replyTo,
}
response, err := client.Integrations.SaveSendgridIntegration(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"api_key": "SG.1234567890",
"from": {
"email": "matt@magicbell.com",
"name": "Matt"
},
"reply_to": {
"email": "hana@magicbell.com",
"name": "Hana"
}
}
Ses
/integrations/ses
Retrieves the current ses integration configurations for a specific integration type in the project. Returns configuration details and status information.
get_ses_integration
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.GetSesIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"config": {
"from": {
"email": "person@example.com",
"name": "Person Name"
},
"key_id": "MY_FAKE_AWS_ACCESS_KEY_ID",
"region": "eu-west-1",
"secret_key": "MY_FAKE_AWS_SECRET_KEY"
},
"id": "123",
"name": "\u003cprovider-name\u003e"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/integrations/ses
Removes a ses integration configuration from the project. This will disable the integration's functionality within the project.
delete_ses_integration
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeleteSesIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/ses/{id}
Removes a specific ses integration instance by ID from the project.
delete_ses_integration_by_id
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeleteSesIntegrationById(context.Background(), "id")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/ses
Creates or updates a ses integration for the project. Only administrators can configure integrations.
save_ses_integration
Request Properties
"string"
AWS Access Key ID
"string"
AWS Secret Key
"string"
AWS Region
"object"
Show nested properties
"string"
format: emailThe email address to send from
["string","null"]
The name to send from
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/util"
"github.com/magicbell/magicbell-go/pkg/project-client/integrations"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
sesConfigPayloadFrom := integrations.SesConfigPayloadFrom{
Email: util.ToPointer("Email"),
Name: util.ToPointer(util.Nullable[string]{ Value: "Name" }),
}
request := integrations.SesConfigPayload{
From: &sesConfigPayloadFrom,
KeyId: util.ToPointer("KeyId"),
Region: util.ToPointer("Region"),
SecretKey: util.ToPointer("SecretKey"),
}
response, err := client.Integrations.SaveSesIntegration(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"from": {
"email": "person@example.com",
"name": "Person Name"
},
"key_id": "MY_FAKE_AWS_ACCESS_KEY_ID",
"region": "eu-west-1",
"secret_key": "MY_FAKE_AWS_SECRET_KEY"
}
Installations
/integrations/slack/installations
Creates a new installation of a slack integration for a user. This endpoint is used when an integration needs to be set up with user-specific credentials or configuration.
save_slack_installation
Request Properties
"string"
"object"
Show nested properties
"string"
"string"
"string"
"string"
^[A-Z0-9]+-.*$
"string"
"object"
Show nested properties
"string"
"string"
"string"
"object"
Show nested properties
"string"
"string"
"string"
"integer"
"string"
"string"
"string"
"boolean"
"string"
"integer"
"string"
"object"
Show nested properties
"string"
"string"
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/util"
"github.com/magicbell/magicbell-go/pkg/user-client/integrations"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
authedUser := integrations.AuthedUser{
AccessToken: util.ToPointer("AccessToken"),
ExpiresIn: util.ToPointer(int64(123)),
Id: util.ToPointer("Id"),
RefreshToken: util.ToPointer("RefreshToken"),
Scope: util.ToPointer("Scope"),
TokenType: util.ToPointer("TokenType"),
}
enterprise := integrations.Enterprise{
Id: util.ToPointer("Id"),
Name: util.ToPointer("Name"),
}
incomingWebhook := integrations.IncomingWebhook{
Channel: util.ToPointer("Channel"),
ConfigurationUrl: util.ToPointer("ConfigurationUrl"),
Url: util.ToPointer("Url"),
}
team := integrations.Team{
Id: util.ToPointer("Id"),
Name: util.ToPointer("Name"),
}
request := integrations.SlackInstallation{
AccessToken: util.ToPointer("AccessToken"),
AppId: util.ToPointer("AppId"),
AuthedUser: &authedUser,
BotUserId: util.ToPointer("BotUserId"),
Enterprise: &enterprise,
ExpiresIn: util.ToPointer(int64(123)),
Id: util.ToPointer("Id"),
IncomingWebhook: &incomingWebhook,
IsEnterpriseInstall: util.ToPointer(true),
RefreshToken: util.ToPointer("RefreshToken"),
Scope: util.ToPointer("Scope"),
Team: &team,
TokenType: util.ToPointer("TokenType"),
}
response, err := client.Integrations.SaveSlackInstallation(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"access_token": "xoxb-123456789012-1234567890123-12345678901234567890abcdef123456",
"app_id": "A12345678",
"authed_user": {
"id": "U12345678",
"scope": "identify,commands"
},
"bot_user_id": "U12345678",
"enterprise_id": "E12345678",
"enterprise_name": "Enterprise Grid, Inc.",
"id": "A12345678-T123",
"incoming_webhook": {
"channel": "C12345678",
"channel_id": "C12345678",
"configuration_url": "https://teamname.slack.com/services/B12345678",
"url": "https://hooks.slack.com/services/T12345678/B12345678/123456789012345678901234"
},
"scope": "identify,commands,bot",
"team": {
"id": "T123",
"name": "Team Installing Your App"
},
"team_id": "T12345678",
"team_name": "Team Installing Your App"
}
Finish
/integrations/slack/installations/finish
Completes the installation flow for a slack integration. This endpoint is typically called after the user has completed any required authorization steps with slack.
finish_slack_installation
Request Properties
"string"
The app ID of the Slack app that was originally configured at the project-level.
"string"
The code that was returned from the OAuth flow, and found in the query string of the redirect URL.
"string"
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/util"
"github.com/magicbell/magicbell-go/pkg/user-client/integrations"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
request := integrations.SlackFinishInstallResponse{
AppId: util.ToPointer("AppId"),
Code: util.ToPointer("Code"),
RedirectUrl: util.ToPointer("RedirectUrl"),
}
response, err := client.Integrations.FinishSlackInstallation(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"access_token": "xoxb-123456789012-1234567890123-12345678901234567890abcdef123456",
"app_id": "A12345678",
"authed_user": {
"id": "U12345678",
"scope": "identify,commands"
},
"bot_user_id": "U12345678",
"enterprise_id": "E12345678",
"enterprise_name": "Enterprise Grid, Inc.",
"id": "A12345678-T123",
"incoming_webhook": {
"channel": "C12345678",
"channel_id": "C12345678",
"configuration_url": "https://teamname.slack.com/services/B12345678",
"url": "https://hooks.slack.com/services/T12345678/B12345678/123456789012345678901234"
},
"scope": "identify,commands,bot",
"team": {
"id": "T123",
"name": "Team Installing Your App"
},
"team_id": "T12345678",
"team_name": "Team Installing Your App"
}
Start
/integrations/slack/installations/start
Initiates the installation flow for a slack integration. This is the first step in a multi-step installation process where user authorization or external service configuration may be required.
start_slack_installation
Request Properties
"string"
"string"
"string"
"array"
Show array item schema
"string"
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/util"
"github.com/magicbell/magicbell-go/pkg/user-client/integrations"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
request := integrations.SlackStartInstall{
AppId: util.ToPointer("AppId"),
AuthUrl: util.ToPointer("AuthUrl"),
ExtraScopes: []string{},
RedirectUrl: util.ToPointer("RedirectUrl"),
}
response, err := client.Integrations.StartSlackInstallation(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"app_id": "app-id",
"auth_url": "https://slack.com/oauth/v2/authorize?client_id=app-id\u0026scope=channels:read,chat:write",
"scopes": [
"channels:read",
"chat:write"
]
}
Installations
/integrations/templates/installations
Creates a new installation of a templates integration for a user. This endpoint is used when an integration needs to be set up with user-specific credentials or configuration.
save_templates_installation
Request Properties
"string"
"string"
["string","null"]
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/util"
"github.com/magicbell/magicbell-go/pkg/user-client/integrations"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
request := integrations.TemplatesInstallation{
Category: util.ToPointer(util.Nullable[string]{ Value: "Category" }),
Channel: util.ToPointer("Channel"),
Text: util.ToPointer("Text"),
}
response, err := client.Integrations.SaveTemplatesInstallation(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"channel": "email",
"text": "Installation"
}
Twilio
/integrations/twilio
Retrieves the current twilio integration configurations for a specific integration type in the project. Returns configuration details and status information.
get_twilio_integration
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.GetTwilioIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"config": {
"account_sid": "ACXXXXXXXX",
"api_key": "SKXXXXXXXX",
"api_secret": "your_api_secret",
"from": "+15017122661"
},
"id": "123",
"name": "\u003cprovider-name\u003e"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/integrations/twilio
Removes a twilio integration configuration from the project. This will disable the integration's functionality within the project.
delete_twilio_integration
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeleteTwilioIntegration(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/twilio/{id}
Removes a specific twilio integration instance by ID from the project.
delete_twilio_integration_by_id
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.DeleteTwilioIntegrationById(context.Background(), "id")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/integrations/twilio
Creates or updates a twilio integration for the project. Only administrators can configure integrations.
save_twilio_integration
Request Properties
"string"
A US1 API key for Twilio- - https://www.twilio.com/docs/iam/api-keys
"string"
The API Secret for Twilio
"string"
The phone number to send from, in E.164 format
^\+[0-9]{1,14}$
"string"
The SID for your Twilio account
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/util"
"github.com/magicbell/magicbell-go/pkg/project-client/integrations"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
request := integrations.TwilioConfigPayload{
AccountSid: util.ToPointer("AccountSid"),
ApiKey: util.ToPointer("ApiKey"),
ApiSecret: util.ToPointer("ApiSecret"),
From: util.ToPointer("From"),
}
response, err := client.Integrations.SaveTwilioIntegration(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"account_sid": "ACXXXXXXXX",
"api_key": "SKXXXXXXXX",
"api_secret": "your_api_secret",
"from": "+15017122661"
}
Start
/integrations/web_push/installations/start
Initiates the installation flow for a web_push integration. This is the first step in a multi-step installation process where user authorization or external service configuration may be required.
start_web_push_installation
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Integrations.StartWebPushInstallation(context.Background())
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"auth_token": "eyGhb...GA2Bw",
"public_key": "BHaJd...gRHDk"
}
Webhooks Incoming
/integrations/stripe/webhooks/incoming/{id}
Receives and processes incoming webhook events from the stripe integration. Each integration can define its own webhook payload format and handling logic.
handle_stripe_webhook
Request Properties
"string"
Unique identifier for the webhook event
"string"
Description of the webhook event
Response
{
"description": "example event",
"id": "evt_1J4J9v2eZvKYlo2C1J4J9v2e",
"type": "invoice.created"
}
/integrations/github/webhooks/incoming/{id}
Receives and processes incoming webhook events from the github integration. Each integration can define its own webhook payload format and handling logic.
handle_github_webhook
Request Properties
"object"
"string"
"string"
Response
{
"description": "example event",
"payload": {},
"type": "ping"
}
/integrations/awssns/webhooks/incoming/{id}
Receives and processes incoming webhook events from the awssns integration. Each integration can define its own webhook payload format and handling logic.
handle_awssns_webhook
Request Properties
"string"
"string"
["object","null"]
Response
{
"payload": {},
"type": "ping"
}
/integrations/eventsource/webhooks/incoming/{id}
Receives and processes incoming webhook events from the eventsource integration. Each integration can define its own webhook payload format and handling logic.
handle_eventsource_webhook
Request Properties
"string"
["object","null"]
Response
{
"payload": {
"key": "value"
},
"type": "customer.event.type"
}
Jwt Token
/jwt/project
Creates a new project-level JWT token. These tokens provide project-wide access and should be carefully managed. Only administrators can create project tokens. The returned token should be securely stored as it cannot be retrieved again after creation.
create_project_jwt
Request Properties
["integer","null"]
The duration for which the token is valid (in seconds)
"string"
The name of the token.
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/util"
"github.com/magicbell/magicbell-go/pkg/project-client/jwt"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
request := jwt.CreateProjectTokenRequest{
Expiry: util.ToPointer(util.Nullable[int64]{ Value: int64(123) }),
Name: util.ToPointer("Name"),
}
response, err := client.Jwt.CreateProjectJwt(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"created_at": "2021-01-01T00:00:00Z",
"token": "eY.......",
"token_id": "019b1b1e-7b1b-4b1b-8b1b-1b1b1b1b1b1b"
}
/jwt/project
Retrieves a list of all active project-level JWT tokens. Returns a paginated list showing token metadata including creation date, last used date, and expiration time. For security reasons, the actual token values are not included in the response.
fetch_project_tokens
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/jwt"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := jwt.FetchProjectTokensRequestParams{
}
response, err := client.Jwt.FetchProjectTokens(context.Background(), params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"created_at": "2021-01-01T00:00:00Z",
"discarded_at": "2021-01-01T00:00:00Z",
"expires_at": "2021-01-01T00:00:00Z",
"id": "00000000-0000-0000-0000-000000000000",
"name": "My Token"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/jwt/project/{token_id}
Immediately revokes a project-level JWT token. Once revoked, any requests using this token will be rejected. This action is immediate and cannot be undone. Active sessions using this token will be terminated.
discard_project_jwt
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Jwt.DiscardProjectJwt(context.Background(), "tokenId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"discarded_at": "2021-01-01T00:00:00Z",
"token_id": "550e8400-e29b-41d4-a716-446655440000"
}
Notifications
/notifications/{notification_id}
Gets a notification by ID.
get_notification
Response
{
"aasm_state": "unseen",
"action_url": null,
"archived_at": null,
"category_id": null,
"created_at": "2024-09-11T11:14:42.165Z",
"custom_attributes": {
"key": "value",
"obj_key": {
"one": "two"
}
},
"discarded_at": null,
"id": "4b6efd21-f0f6-4051-8922-cc8c90a3dc5d",
"in_app": true,
"metadata": {},
"notification_broadcast_id": "6a8b1e23-f54b-4c65-95b2-78f288d7f247",
"overrides": {},
"project_id": 7,
"read_at": null,
"seen_at": null,
"title": "Example Notification",
"topic_id": null,
"updated_at": "2024-09-11T11:14:42.165Z",
"user_id": "d4121424-097e-40b0-9cc8-357060d004b2"
}
/notifications
Lists all notifications for a user.
list_notifications
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
"github.com/magicbell/magicbell-go/pkg/user-client/notifications"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := notifications.ListNotificationsRequestParams{
}
response, err := client.Notifications.ListNotifications(context.Background(), params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"aasm_state": "unseen",
"action_url": null,
"archived_at": null,
"category_id": null,
"created_at": "2024-09-11T11:14:42.165Z",
"custom_attributes": {
"key": "value",
"obj_key": {
"one": "two"
}
},
"discarded_at": null,
"id": "4b6efd21-f0f6-4051-8922-cc8c90a3dc5d",
"in_app": true,
"metadata": {},
"notification_broadcast_id": "6a8b1e23-f54b-4c65-95b2-78f288d7f247",
"overrides": {},
"project_id": 7,
"read_at": null,
"seen_at": null,
"title": "Example Notification",
"topic_id": null,
"updated_at": "2024-09-11T11:14:42.165Z",
"user_id": "d4121424-097e-40b0-9cc8-357060d004b2"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/notifications/{notification_id}/unread
Marks a notification as unread.
mark_notification_unread
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Notifications.MarkNotificationUnread(context.Background(), "notificationId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/notifications/archive
Archives all notifications.
archive_notifications
Request Properties
No properties defined
Response
/notifications/{notification_id}/archive
Archives a notification.
archive_notification
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Notifications.ArchiveNotification(context.Background(), "notificationId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/notifications/{notification_id}/unarchive
Unarchives a notification.
unarchive_notification
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Notifications.UnarchiveNotification(context.Background(), "notificationId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
/notifications/read
Marks all notifications as read.
mark_notifications_read
Request Properties
No properties defined
Response
/notifications/{notification_id}/read
Marks a notification as read.
mark_notification_read
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/user-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Notifications.MarkNotificationRead(context.Background(), "notificationId")
if err != nil {
panic(err)
}
fmt.Println(response)
Response
Users
/users
list_users
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/users"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
params := users.ListUsersRequestParams{
}
response, err := client.Users.ListUsers(context.Background(), params)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"data": [
{
"custom_attributes": {
"key": "value"
},
"email": "dan@example.com",
"external_id": "external-id",
"first_name": "Dan",
"id": "8a038704-acc1-47f9-81b0-7523886cbeae",
"last_name": "Example"
}
],
"links": {
"first": "https://api.magicbell.com/v1/example",
"next": "https://api.magicbell.com/v1/example?page_next=abc",
"prev": null
}
}
/users
Creates a user with the provided details. The user will be associated with the project specified in the request context.
create_user
Request Properties
"string"
format: uuid["string","null"]
["string","null"]
["string","null"]
["string","null"]
["string","null"]
format: date-time["string","null"]
format: date-time["object","null"]
["string","null"]
format: date-time["string","null"]
format: date-timeRequest
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
"github.com/magicbell/magicbell-go/pkg/project-client/util"
"github.com/magicbell/magicbell-go/pkg/project-client/users"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
request := users.User{
CreatedAt: util.ToPointer(util.Nullable[string]{ Value: "CreatedAt" }),
CustomAttributes: []byte{},
Email: util.ToPointer(util.Nullable[string]{ Value: "Email" }),
ExternalId: util.ToPointer(util.Nullable[string]{ Value: "ExternalId" }),
FirstName: util.ToPointer(util.Nullable[string]{ Value: "FirstName" }),
Id: util.ToPointer("Id"),
LastName: util.ToPointer(util.Nullable[string]{ Value: "LastName" }),
LastNotifiedAt: util.ToPointer(util.Nullable[string]{ Value: "LastNotifiedAt" }),
LastSeenAt: util.ToPointer(util.Nullable[string]{ Value: "LastSeenAt" }),
UpdatedAt: util.ToPointer(util.Nullable[string]{ Value: "UpdatedAt" }),
}
response, err := client.Users.CreateUser(context.Background(), request)
if err != nil {
panic(err)
}
fmt.Println(response)
Response
{
"custom_attributes": {
"key": "value"
},
"email": "dan@example.com",
"external_id": "external-id",
"first_name": "Dan",
"id": "8a038704-acc1-47f9-81b0-7523886cbeae",
"last_name": "Example"
}
/users/{user_id}
delete_user
Request Properties
No properties defined
Request
import (
"fmt"
"encoding/json"
"github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
"github.com/magicbell/magicbell-go/pkg/project-client/client"
)
config := clientconfig.NewConfig()
client := client.NewClient(config)
response, err := client.Users.DeleteUser(context.Background(), "userId")
if err != nil {
panic(err)
}
fmt.Println(response)