V2 API Reference
Broadcasts
/broadcasts
List all 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
Create a broadcast
Creates a new broadcast. When a broadcast is created, it generates individual notifications for relevant users within the project.
create_broadcast
Request Properties
["null","string"]
["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"
"string"
["null","string"]
"object"
Show nested properties
"object"
"object"
"object"
"object"
"object"
"object"
"object"
"object"
"object"
"object"
["null","string"]
"string"
readonly format: date-timeThe timestamp when the broadcast was created.
["string","null"]
^[A-Za-z0-9_\.\-/:]+$
["string","null"]
^[A-Za-z0-9_\.\-/:]+$
["null","object"]
"array"
Show array item schema
"object"
"object"
Show nested properties
"string"
readonly "enqueued"
"processing"
"processed"
"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"
format: uuidThe unique id for this broadcast.
"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/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}
Fetch a broadcast
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"
}
Tokens
/users/{user_id}/channels/slack/tokens
List all 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.
list_user_slack_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/teams/tokens
List all 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.
list_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
}
}
/users/{user_id}/channels/web_push/tokens
List all 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.
list_user_web_push_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
List all 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.
list_user_teams_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
}
}
/channels/slack/tokens
List all 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.
list_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
List all 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.
list_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
}
}
/channels/slack/tokens/{token_id}
Delete a Slack token
Deletes 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.
delete_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}
Delete a Web Push token
Deletes 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.
delete_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}
Delete user a Slack token
Deletes 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.
delete_user_slack_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"
}
/users/{user_id}/channels/web_push/tokens/{token_id}
Delete user a Web Push token
Deletes 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.
delete_user_web_push_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"
}
/users/{user_id}/channels/teams/tokens/{token_id}
Delete user a Teams token
Deletes 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.
delete_user_teams_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/teams/tokens/{token_id}
Delete a Teams token
Deletes 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.
delete_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"
}
/users/{user_id}/channels/slack/tokens/{token_id}
Fetch a Slack token
Fetches 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.
fetch_user_slack_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}
Fetch a Slack token
Fetches 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.
fetch_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}
Fetch a Web Push token
Fetches 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.
fetch_user_web_push_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"
}
/channels/teams/tokens/{token_id}
Fetch a Teams token
Fetches 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.
fetch_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"
}
/channels/web_push/tokens
Save a Web Push token
Saves the 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
"object"
The encryption keys from the PushSubscription.getKey() method, needed to encrypt push messages for this subscription.
Show nested properties
"string"
The P-256 ECDH public key obtained from PushSubscription.getKey('p256dh'). Used to encrypt push messages for this subscription.
"string"
The authentication secret obtained from PushSubscription.getKey('auth'). Used to encrypt push messages for this subscription.
"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.
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
Save a Teams token
Saves the 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"
Response
{}
/users/{user_id}/channels/teams/tokens/{token_id}
Fetch a Teams token
Fetches 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.
fetch_user_teams_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/slack/tokens
Save a Slack token
Saves the 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"
Response
{
"webhook": {
"url": "https://example.com/webhook"
}
}
/channels/web_push/tokens/{token_id}
Fetch a Web Push token
Fetches 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.
fetch_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"
}
Apns
/users/{user_id}/channels/mobile_push/apns/tokens
List all APNs tokens
Lists all APNs 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.
list_user_apns_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
List all APNs tokens
Lists all APNs tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.
list_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
}
}
/users/{user_id}/channels/mobile_push/apns/tokens/{token_id}
Delete user an APNs token
Deletes a specific user's APNs 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.
delete_user_apns_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}
Delete an APNs token
Deletes one of the authenticated user's APNs 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.
delete_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"
}
/channels/mobile_push/apns/tokens
Save an APNs token
Saves the APNs 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_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]+)*$
Response
{
"device_token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"installation_id": "development"
}
/users/{user_id}/channels/mobile_push/apns/tokens/{token_id}
Fetch an APNs token
Fetches a specific APNs 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.
fetch_user_apns_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}
Fetch an APNs token
Fetches details of a specific APNs 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.
fetch_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"
}
Expo
/users/{user_id}/channels/mobile_push/expo/tokens
List all Expo tokens
Lists all Expo 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.
list_user_expo_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": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]",
"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/mobile_push/expo/tokens
List all Expo tokens
Lists all Expo tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.
list_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": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]",
"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}
Delete user an Expo token
Deletes a specific user's Expo 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.
delete_user_expo_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}
Delete an Expo token
Deletes one of the authenticated user's Expo 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.
delete_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
Save an Expo token
Saves the Expo 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_expo_token
Request Properties
"string"
Response
{
"device_token": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]"
}
/users/{user_id}/channels/mobile_push/expo/tokens/{token_id}
Fetch an Expo token
Fetches a specific Expo 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.
fetch_user_expo_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": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"updated_at": "2021-01-01T00:00:00Z"
}
/channels/mobile_push/expo/tokens/{token_id}
Fetch an Expo token
Fetches details of a specific Expo 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.
fetch_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": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]",
"discarded_at": "2021-01-01T00:00:00Z",
"id": "123",
"updated_at": "2021-01-01T00:00:00Z"
}
Fcm
/users/{user_id}/channels/mobile_push/fcm/tokens
List all FCM tokens
Lists all FCM 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.
list_user_fcm_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
List all FCM tokens
Lists all FCM tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.
list_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}
Delete user a FCM token
Deletes a specific user's FCM 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.
delete_user_fcm_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}
Delete a FCM token
Deletes one of the authenticated user's FCM 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.
delete_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"
}
/users/{user_id}/channels/mobile_push/fcm/tokens/{token_id}
Fetch a FCM token
Fetches a specific FCM 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.
fetch_user_fcm_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"
}
/channels/mobile_push/fcm/tokens/{token_id}
Fetch a FCM token
Fetches details of a specific FCM 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.
fetch_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"
}
/channels/mobile_push/fcm/tokens
Save a FCM token
Saves the FCM 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_fcm_token
Request Properties
"string"
"string"
"development"
"production"
Response
{
"device_token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
"installation_id": "development"
}
Inbox
/users/{user_id}/channels/in_app/inbox/tokens
List all Inbox tokens
Lists all Inbox 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.
list_user_inbox_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
List all Inbox tokens
Lists all Inbox tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.
list_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
}
}
/users/{user_id}/channels/in_app/inbox/tokens/{token_id}
Delete user an Inbox token
Deletes a specific user's Inbox 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.
delete_user_inbox_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}
Delete an Inbox token
Deletes one of the authenticated user's Inbox 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.
delete_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"
}
/channels/in_app/inbox/tokens
Save an Inbox token
Saves the Inbox 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_inbox_token
Request Properties
"string"
["string","null"]
Response
{
"token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt"
}
/users/{user_id}/channels/in_app/inbox/tokens/{token_id}
Fetch an Inbox token
Fetches a specific Inbox 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.
fetch_user_inbox_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}
Fetch an Inbox token
Fetches details of a specific Inbox 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.
fetch_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"
}
Events
/events
List all 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
}
}
/events/{event_id}
Fetch an event
Fetches a project event by its ID.
fetch_event
Response
{
"id": "123",
"timestamp": "2021-01-01T00:00:00Z",
"type": "example_type"
}
Integrations
/integrations
List all 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
List all APNs integrations
Retrieves the current APNs integration configurations for a specific integration type in the project. Returns configuration details and status information.
list_apns_integrations
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
Delete an APNs integration
Deletes the 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
Save an APNs integration
Updates or creates the APNs integration for the project.
save_apns_integration
Request Properties
"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?$
"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)
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
List all Expo integrations
Retrieves the current Expo integration configurations for a specific integration type in the project. Returns configuration details and status information.
list_expo_integrations
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
Delete an Expo integration
Deletes the 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
Save an Expo integration
Updates or creates the Expo integration for the project.
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
List all FCM integrations
Retrieves the current FCM integration configurations for a specific integration type in the project. Returns configuration details and status information.
list_fcm_integrations
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
Delete a FCM integration
Deletes the 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
Save a FCM integration
Updates or creates the FCM integration for the project.
save_fcm_integration
Request Properties
"string"
"service_account"
"string"
"string"
"string"
"string"
"string"
"string"
"string"
"string"
^-+?\s?BEGIN[A-Z ]+-+\n([A-Za-z0-9+/\r\n]+={0,2})\n-+\s?END[A-Z ]+-+\n?$
"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
Start an Inbox installation
Initiates the installation flow for an 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
List all Mailgun integrations
Retrieves the current Mailgun integration configurations for a specific integration type in the project. Returns configuration details and status information.
list_mailgun_integrations
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
Delete a Mailgun integration
Deletes the 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
Save a Mailgun integration
Updates or creates the Mailgun integration for the project.
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
List all Ping Email integrations
Retrieves the current Ping Email integration configurations for a specific integration type in the project. Returns configuration details and status information.
list_ping_email_integrations
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
Delete a Ping Email integration
Deletes the 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
Save a Ping Email integration
Updates or creates the Ping Email integration for the project.
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
List all SendGrid integrations
Retrieves the current SendGrid integration configurations for a specific integration type in the project. Returns configuration details and status information.
list_sendgrid_integrations
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
Delete a SendGrid integration
Deletes the 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
Save a SendGrid integration
Updates or creates the SendGrid integration for the project.
save_sendgrid_integration
Request Properties
"string"
The API key for Sendgrid
"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
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
List all Amazon SES integrations
Retrieves the current Amazon SES integration configurations for a specific integration type in the project. Returns configuration details and status information.
list_ses_integrations
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
Delete an Amazon SES integration
Deletes the Amazon 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
Save an Amazon SES integration
Updates or creates the Amazon SES integration for the project.
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
Save a Slack installation
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"
"boolean"
"object"
Show nested properties
"string"
"string"
"string"
"string"
"integer"
"string"
^[A-Z0-9]+-.*$
"string"
"string"
"object"
Show nested properties
"string"
"string"
"string"
"object"
Show nested properties
"string"
"string"
"string"
"integer"
"string"
"string"
"object"
Show nested properties
"string"
"string"
"string"
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
Finish a Slack installation
Completes the installation flow for the Slack integration. This endpoint is typically called after the user has completed any required authorization steps with Slack.
finish_slack_installation
Request Properties
"string"
"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.
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
Start a Slack installation
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
Save a Templates installation
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"]
Response
{
"channel": "email",
"text": "Installation"
}
Twilio
/integrations/twilio
List all Twilio integrations
Retrieves the current Twilio integration configurations for a specific integration type in the project. Returns configuration details and status information.
list_twilio_integrations
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
Delete a Twilio integration
Deletes the 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
Save a Twilio integration
Updates or creates the Twilio integration for the project.
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
Start a Web Push installation
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"
}
Notifications
/notifications
List all 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/read
Mark all notifications read
Marks all notifications as read.
mark_all_notifications_read
Request Properties
No properties defined
Response
{}
/notifications/{notification_id}/read
Mark a notification 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
{}
/notifications/{notification_id}/unread
Mark a notification 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
Archive all notifications
Archive all notifications.
archive_all_notifications
Request Properties
No properties defined
Response
{}
/notifications/{notification_id}/archive
Archive a notification
Archive 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
Unarchive a notification
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/{notification_id}
Fetch a notification
Gets a notification by ID.
fetch_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"
}
Users
/users
List all users
Lists all users in the project.
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/{user_id}
Delete a user
Removes a user and all associated data from the project.
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)
Response
{}
/users
Save a user
Creates or updates a user with the provided details. The user will be associated with the project specified in the request context.
save_user
Request Properties
["string","null"]
["string","null"]
format: date-time["string","null"]
["string","null"]
["string","null"]
["string","null"]
format: date-time["string","null"]
format: date-time["string","null"]
format: date-time"string"
format: uuid["object","null"]
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"
}