V2 API Reference

Broadcasts

GET/broadcasts
Auth Type: ProjectAuth

Retrieves a paginated list of broadcasts for the project. Returns basic information about each broadcast including its creation time and status.

Operation ID: 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
  }
}
POST/broadcasts
Auth Type: ProjectAuth

Creates a new broadcast message. When a broadcast is created, it generates individual notifications for relevant users within the project.

Operation ID: create_broadcast

Request Properties

id "string"

The unique id for this broadcast.

title "string"
required
Min length: 1 • Max length: 255
action_url ["null","string"]
Max length: 2048
topic ["string","null"]
Max length: 255
Pattern: ^[A-Za-z0-9_\.\-/:]+$
custom_attributes ["null","object"]
recipients ["null","array"]
required
Show array item schema
↳ (array item) "object"
content ["null","string"]
Max length: 10485760
created_at "string" readonly format: date-time

The timestamp when the broadcast was created.

category ["string","null"]
Max length: 255
Pattern: ^[A-Za-z0-9_\.\-/:]+$
overrides ["object","null"]
Show nested properties
↳ channels "object"
Show nested properties
↳ in_app "object"
Show nested properties
↳ title "string"
Min length: 1 • Max length: 255
↳ content "string"
Max length: 1048576
↳ action_url ["null","string"]
Max length: 2048
↳ mobile_push "object"
Show nested properties
↳ content "string"
Max length: 1048576
↳ action_url ["null","string"]
Max length: 2048
↳ title "string"
Min length: 1 • Max length: 255
↳ web_push "object"
Show nested properties
↳ content "string"
Max length: 1048576
↳ action_url ["null","string"]
Max length: 2048
↳ title "string"
Min length: 1 • Max length: 255
↳ email "object"
Show nested properties
↳ title "string"
Min length: 1 • Max length: 255
↳ content "string"
Max length: 1048576
↳ action_url ["null","string"]
Max length: 2048
↳ slack "object"
Show nested properties
↳ title "string"
Min length: 1 • Max length: 255
↳ content "string"
Max length: 1048576
↳ action_url ["null","string"]
Max length: 2048
↳ sms "object"
Show nested properties
↳ title "string"
Min length: 1 • Max length: 255
↳ content "string"
Max length: 1048576
↳ action_url ["null","string"]
Max length: 2048
↳ providers "object"
Show nested properties
↳ mailgun "object"
↳ amazon_ses "object"
↳ android "object"
↳ ios "object"
↳ slack "object"
↳ sendgrid "object"
↳ postmark "object"
status ["object","null"]
Show nested properties
↳ status "string" readonly
required
Allowed values:
"enqueued""processing""processed"
↳ summary "object"
required
Show nested properties
↳ total "integer" readonly
required

The number of recipients that the broadcast was sent to.

↳ failures "integer" readonly
required

The number of failures while processing the broadcast.

↳ errors ["array","null"]
required
Show array item schema
↳ (array item) "object"
Show nested properties
↳ message "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"
}
GET/broadcasts/{broadcast_id}
Auth Type: ProjectAuth

Retrieves detailed information about a specific broadcast by its ID. Includes the broadcast's configuration and current status.

Operation ID: fetch_broadcast

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Broadcasts.FetchBroadcast(context.Background(), "broadcastId")
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "action_url": "https://example.com",
  "category": "example",
  "content": "Hello, World!",
  "custom_attributes": {},
  "id": "d1b3b3b3-3b3b-3b3b-3b3b-3b3b3b3b3b3b",
  "overrides": {},
  "recipients": [
    {
      "custom_attributes": {
        "plan": "enterprise",
        "preferred_pronoun": "They",
        "pricing_version": "v10"
      },
      "email": "test@example.com",
      "external_id": "83d987a-83fd034",
      "first_name": "Person",
      "last_name": "Doe",
      "phone_numbers": [
        "+1 5005550001"
      ]
    }
  ],
  "title": "Hello, World!",
  "topic": "example"
}

Channels

GET/channels/deliveryconfig
Auth Type: ProjectAuth
Operation ID: get_deliveryconfig

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

  "github.com/magicbell/magicbell-go/pkg/project-client/channels"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)


params := channels.GetDeliveryconfigRequestParams{

}

response, err := client.Channels.GetDeliveryconfig(context.Background(), params)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "channels": [
    {
      "channel": "in_app"
    },
    {
      "channel": "email",
      "if": "{{notification.unseen}} == false"
    }
  ],
  "key": "project"
}
PUT/channels/deliveryconfig
Auth Type: ProjectAuth
Operation ID: save_deliveryconfig

Request Properties

channels "array"
required
Show array item schema
↳ (array item) "object"
Show nested properties
↳ channel "string"
required
Allowed values:
"in_app""slack""web_push""mobile_push""teams""email""sms"
↳ delay "integer"
Min: 0
↳ if ["string","null"]
key "string"
required
Min length: 3
Pattern: ^[A-Za-z0-9_.\-:/]+$
disabled "boolean"

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"
  "github.com/magicbell/magicbell-go/pkg/project-client/util"
  "github.com/magicbell/magicbell-go/pkg/project-client/channels"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)

channel := channels.CHANNEL_IN_APP

categoryDeliveryConfigChannels := channels.CategoryDeliveryConfigChannels{
  Channel: &channel,
  Delay: util.ToPointer(int64(123)),
  If_: util.ToPointer(util.Nullable[string]{ Value: "If_" }),
}

request := channels.CategoryDeliveryConfig{
  Channels: []channels.CategoryDeliveryConfigChannels{categoryDeliveryConfigChannels},
  Disabled: util.ToPointer(true),
  Key: util.ToPointer("Key"),
}

response, err := client.Channels.SaveDeliveryconfig(context.Background(), request)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "channels": [
    {
      "channel": "in_app"
    },
    {
      "channel": "email",
      "if": "{{notification.unseen}} == false"
    }
  ],
  "key": "project"
}

Deliveryplanner

GET/notifications/{notification_id}/deliveryplan
Auth Type: ProjectAuth

Get the delivery plan for a notification.

Operation ID: get_deliveryplan

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Notifications.GetDeliveryplan(context.Background(), "notificationId")
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "data": [
    {
      "channels": [
        {
          "channel": "email"
        }
      ],
      "id": "00000000-0000-0000-0000-000000000000",
      "user_id": "00000000-0000-0000-0000-000000000000"
    }
  ],
  "links": {
    "first": "https://api.magicbell.com/v1/example",
    "next": "https://api.magicbell.com/v1/example?page_next=abc",
    "prev": null
  }
}

Tokens

GET/channels/slack/tokens/{token_id}
Auth Type: UserAuth

Retrieves details of a specific slack token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens.

Operation ID: get_slack_token
Tags: slack

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"
  }
}
GET/channels/teams/tokens/{token_id}
Auth Type: UserAuth

Retrieves details of a specific teams token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens.

Operation ID: get_teams_token
Tags: teams

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"
}
GET/users/{user_id}/channels/slack/tokens
Auth Type: ProjectAuth

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.

Operation ID: get_slack_user_tokens
Tags: slack

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
  }
}
GET/channels/slack/tokens
Auth Type: UserAuth

Lists all slack tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.

Operation ID: get_slack_tokens
Tags: slack

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
  }
}
GET/users/{user_id}/channels/web_push/tokens/{token_id}
Auth Type: ProjectAuth

Retrieves a specific web_push token by its ID for a given user. This endpoint is available to project administrators and requires project-level authentication. Use this to inspect token details including its status, creation date, and associated metadata.

Operation ID: get_web_push_user_token
Tags: web_push

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"
}
GET/channels/web_push/tokens/{token_id}
Auth Type: UserAuth

Retrieves details of a specific web_push token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens.

Operation ID: get_web_push_token
Tags: web_push

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"
}
GET/users/{user_id}/channels/teams/tokens/{token_id}
Auth Type: ProjectAuth

Retrieves a specific teams token by its ID for a given user. This endpoint is available to project administrators and requires project-level authentication. Use this to inspect token details including its status, creation date, and associated metadata.

Operation ID: get_teams_user_token
Tags: teams

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"
}
GET/users/{user_id}/channels/teams/tokens
Auth Type: ProjectAuth

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.

Operation ID: get_teams_user_tokens
Tags: teams

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
  }
}
GET/users/{user_id}/channels/web_push/tokens
Auth Type: ProjectAuth

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.

Operation ID: get_web_push_user_tokens
Tags: web_push

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
  }
}
GET/channels/web_push/tokens
Auth Type: UserAuth

Lists all web_push tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.

Operation ID: get_web_push_tokens
Tags: web_push

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
  }
}
GET/channels/teams/tokens
Auth Type: UserAuth

Lists all teams tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.

Operation ID: get_teams_tokens
Tags: teams

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
  }
}
GET/users/{user_id}/channels/slack/tokens/{token_id}
Auth Type: ProjectAuth

Retrieves a specific slack token by its ID for a given user. This endpoint is available to project administrators and requires project-level authentication. Use this to inspect token details including its status, creation date, and associated metadata.

Operation ID: get_slack_user_token
Tags: slack

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"
  }
}
DELETE/channels/web_push/tokens/{token_id}
Auth Type: UserAuth

Revokes one of the authenticated user's web_push tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens.

Operation ID: discard_web_push_token
Tags: web_push

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"
}
POST/channels/teams/tokens
Auth Type: UserAuth

Saves a teams token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel.

Operation ID: save_teams_token
Tags: teams

Request Properties

webhook "object"
Show nested properties
↳ url "string"

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/user-client/client"
  "github.com/magicbell/magicbell-go/pkg/user-client/util"
  "github.com/magicbell/magicbell-go/pkg/user-client/channels"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)


teamsTokenPayloadWebhook := channels.TeamsTokenPayloadWebhook{
  Url: util.ToPointer("Url"),
}

request := channels.TeamsTokenPayload{
  Webhook: &teamsTokenPayloadWebhook,
}

response, err := client.Channels.SaveTeamsToken(context.Background(), request)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{}
DELETE/channels/teams/tokens/{token_id}
Auth Type: UserAuth

Revokes one of the authenticated user's teams tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens.

Operation ID: discard_teams_token
Tags: teams

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"
}
POST/channels/slack/tokens
Auth Type: UserAuth

Saves a slack token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel.

Operation ID: save_slack_token
Tags: slack

Request Properties

webhook "object"

Obtained directly from the incoming_webhook object in the installation response from the Slack API.

Show nested properties
↳ url "string" format: uri
required
Min length: 1
oauth "object"
Show nested properties
↳ scope "string"
↳ channel_id "string"
required
↳ installation_id "string"
required

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/user-client/client"
  "github.com/magicbell/magicbell-go/pkg/user-client/util"
  "github.com/magicbell/magicbell-go/pkg/user-client/channels"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)


slackTokenPayloadOauth := channels.SlackTokenPayloadOauth{
  ChannelId: util.ToPointer("ChannelId"),
  InstallationId: util.ToPointer("InstallationId"),
  Scope: util.ToPointer("Scope"),
}


slackTokenPayloadWebhook := channels.SlackTokenPayloadWebhook{
  Url: util.ToPointer("Url"),
}

request := channels.SlackTokenPayload{
  Oauth: &slackTokenPayloadOauth,
  Webhook: &slackTokenPayloadWebhook,
}

response, err := client.Channels.SaveSlackToken(context.Background(), request)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "webhook": {
    "url": "https://example.com/webhook"
  }
}
DELETE/users/{user_id}/channels/slack/tokens/{token_id}
Auth Type: ProjectAuth

Revokes a specific user's slack token. This endpoint is available to project administrators and permanently invalidates the specified token. Once revoked, the token can no longer be used to access channel features. This action cannot be undone.

Operation ID: discard_slack_user_token
Tags: slack

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"
}
DELETE/channels/slack/tokens/{token_id}
Auth Type: UserAuth

Revokes one of the authenticated user's slack tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens.

Operation ID: discard_slack_token
Tags: slack

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"
}
POST/channels/web_push/tokens
Auth Type: UserAuth

Saves a web_push token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel.

Operation ID: save_web_push_token
Tags: web_push

Request Properties

keys "object"
required

The encryption keys from the PushSubscription.getKey() method, needed to encrypt push messages for this subscription.

Show nested properties
↳ p256dh "string"
required

The P-256 ECDH public key obtained from PushSubscription.getKey('p256dh'). Used to encrypt push messages for this subscription.

↳ auth "string"
required

The authentication secret obtained from PushSubscription.getKey('auth'). Used to encrypt push messages for this subscription.

endpoint "string" format: uri
required

The 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.

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/user-client/client"
  "github.com/magicbell/magicbell-go/pkg/user-client/util"
  "github.com/magicbell/magicbell-go/pkg/user-client/shared"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)


webPushTokenPayloadKeys := shared.WebPushTokenPayloadKeys{
  Auth: util.ToPointer("Auth"),
  P256dh: util.ToPointer("P256dh"),
}

request := shared.WebPushTokenPayload{
  Endpoint: util.ToPointer("Endpoint"),
  Keys: &webPushTokenPayloadKeys,
}

response, err := client.Channels.SaveWebPushToken(context.Background(), request)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "endpoint": "https://fcm.googleapis.com/fcm/send/fZhR0fsr0zw:APA91bE4pM-qo1KBJDU_Zp2N9nDP-Jdmwugm-v4KNL_NlJvYCrJeJUzPXmMyAXqAE0m6BFOrkSWT0ArGbUjEEpxQEYZLado8JeW1PZA5CHB8R6C7HT6-MD6Qs8ZaCn8_ffLGGU7WuvtN",
  "keys": {
    "auth": "GoIO2ulhtQuyBM64lZuFuw",
    "p256dh": "BICAe4KtLhhPNFvynlqMRxjvpRnr94881QeuTCr8kCwJf-Fssj3FLIlnfFMjj7T1yNg5l6cn14350323_NSGZh0"
  }
}
DELETE/users/{user_id}/channels/teams/tokens/{token_id}
Auth Type: ProjectAuth

Revokes a specific user's teams token. This endpoint is available to project administrators and permanently invalidates the specified token. Once revoked, the token can no longer be used to access channel features. This action cannot be undone.

Operation ID: discard_teams_user_token
Tags: teams

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"
}
DELETE/users/{user_id}/channels/web_push/tokens/{token_id}
Auth Type: ProjectAuth

Revokes a specific user's web_push token. This endpoint is available to project administrators and permanently invalidates the specified token. Once revoked, the token can no longer be used to access channel features. This action cannot be undone.

Operation ID: discard_web_push_user_token
Tags: web_push

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"
}

Apns

GET/users/{user_id}/channels/mobile_push/apns/tokens
Auth Type: ProjectAuth

Lists all mobile_push tokens associated with a specific user. This endpoint is available to project administrators and returns a paginated list of tokens, including both active and revoked tokens.

Operation ID: get_mobile_push_apns_user_tokens
Tags: mobile_pushapns

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
  }
}
GET/channels/mobile_push/apns/tokens
Auth Type: UserAuth

Lists all mobile_push tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.

Operation ID: get_mobile_push_apns_tokens
Tags: mobile_pushapns

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
  }
}
GET/users/{user_id}/channels/mobile_push/apns/tokens/{token_id}
Auth Type: ProjectAuth

Retrieves a specific mobile_push token by its ID for a given user. This endpoint is available to project administrators and requires project-level authentication. Use this to inspect token details including its status, creation date, and associated metadata.

Operation ID: get_mobile_push_apns_user_token
Tags: mobile_pushapns

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"
}
GET/channels/mobile_push/apns/tokens/{token_id}
Auth Type: UserAuth

Retrieves details of a specific mobile_push token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens.

Operation ID: get_mobile_push_apns_token
Tags: mobile_pushapns

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"
}
DELETE/users/{user_id}/channels/mobile_push/apns/tokens/{token_id}
Auth Type: ProjectAuth

Revokes a specific user's mobile_push token. This endpoint is available to project administrators and permanently invalidates the specified token. Once revoked, the token can no longer be used to access channel features. This action cannot be undone.

Operation ID: discard_mobile_push_apns_user_token
Tags: mobile_pushapns

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"
}
DELETE/channels/mobile_push/apns/tokens/{token_id}
Auth Type: UserAuth

Revokes one of the authenticated user's mobile_push tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens.

Operation ID: discard_mobile_push_apns_token
Tags: mobile_pushapns

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"
}
POST/channels/mobile_push/apns/tokens
Auth Type: UserAuth

Saves a mobile_push token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel.

Operation ID: save_mobile_push_apns_token
Tags: mobile_pushapns

Request Properties

device_token "string"
required
Min length: 64
installation_id "string"

(Optional) The APNs environment the token is registered for. If none is provided we assume the token is used in `production`.

Allowed values:
"development""production"
app_id "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.

Pattern: ^[a-zA-Z0-9]+(.[a-zA-Z0-9]+)*$

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/user-client/client"
  "github.com/magicbell/magicbell-go/pkg/user-client/util"
  "github.com/magicbell/magicbell-go/pkg/user-client/channels"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)

apnsTokenPayloadInstallationId := channels.APNS_TOKEN_PAYLOAD_INSTALLATION_ID_DEVELOPMENT

request := channels.ApnsTokenPayload{
  AppId: util.ToPointer("AppId"),
  DeviceToken: util.ToPointer("DeviceToken"),
  InstallationId: &apnsTokenPayloadInstallationId,
}

response, err := client.Channels.SaveMobilePushApnsToken(context.Background(), request)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "device_token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
  "installation_id": "development"
}

Expo

GET/users/{user_id}/channels/mobile_push/expo/tokens
Auth Type: ProjectAuth

Lists all mobile_push tokens associated with a specific user. This endpoint is available to project administrators and returns a paginated list of tokens, including both active and revoked tokens.

Operation ID: get_mobile_push_expo_user_tokens
Tags: mobile_pushexpo

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

  "github.com/magicbell/magicbell-go/pkg/project-client/channels"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)


params := channels.GetMobilePushExpoUserTokensRequestParams{

}

response, err := client.Channels.GetMobilePushExpoUserTokens(context.Background(), "userId", params)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "data": [
    {
      "created_at": "2021-01-01T00:00:00Z",
      "device_token": "expo-device-id",
      "discarded_at": "2021-01-01T00:00:00Z",
      "id": "123",
      "updated_at": "2021-01-01T00:00:00Z"
    }
  ],
  "links": {
    "first": "https://api.magicbell.com/v1/example",
    "next": "https://api.magicbell.com/v1/example?page_next=abc",
    "prev": null
  }
}
GET/channels/mobile_push/expo/tokens
Auth Type: UserAuth

Lists all mobile_push tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.

Operation ID: get_mobile_push_expo_tokens
Tags: mobile_pushexpo

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/user-client/client"

  "github.com/magicbell/magicbell-go/pkg/user-client/channels"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)


params := channels.GetMobilePushExpoTokensRequestParams{

}

response, err := client.Channels.GetMobilePushExpoTokens(context.Background(), params)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "data": [
    {
      "created_at": "2021-01-01T00:00:00Z",
      "device_token": "expo-device-id",
      "discarded_at": "2021-01-01T00:00:00Z",
      "id": "123",
      "updated_at": "2021-01-01T00:00:00Z"
    }
  ],
  "links": {
    "first": "https://api.magicbell.com/v1/example",
    "next": "https://api.magicbell.com/v1/example?page_next=abc",
    "prev": null
  }
}
GET/users/{user_id}/channels/mobile_push/expo/tokens/{token_id}
Auth Type: ProjectAuth

Retrieves a specific mobile_push token by its ID for a given user. This endpoint is available to project administrators and requires project-level authentication. Use this to inspect token details including its status, creation date, and associated metadata.

Operation ID: get_mobile_push_expo_user_token
Tags: mobile_pushexpo

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Channels.GetMobilePushExpoUserToken(context.Background(), "userId", "tokenId")
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "created_at": "2021-01-01T00:00:00Z",
  "device_token": "expo-device-id",
  "discarded_at": "2021-01-01T00:00:00Z",
  "id": "123",
  "updated_at": "2021-01-01T00:00:00Z"
}
GET/channels/mobile_push/expo/tokens/{token_id}
Auth Type: UserAuth

Retrieves details of a specific mobile_push token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens.

Operation ID: get_mobile_push_expo_token
Tags: mobile_pushexpo

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/user-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Channels.GetMobilePushExpoToken(context.Background(), "tokenId")
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "created_at": "2021-01-01T00:00:00Z",
  "device_token": "expo-device-id",
  "discarded_at": "2021-01-01T00:00:00Z",
  "id": "123",
  "updated_at": "2021-01-01T00:00:00Z"
}
DELETE/users/{user_id}/channels/mobile_push/expo/tokens/{token_id}
Auth Type: ProjectAuth

Revokes a specific user's mobile_push token. This endpoint is available to project administrators and permanently invalidates the specified token. Once revoked, the token can no longer be used to access channel features. This action cannot be undone.

Operation ID: discard_mobile_push_expo_user_token
Tags: mobile_pushexpo

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"
}
DELETE/channels/mobile_push/expo/tokens/{token_id}
Auth Type: UserAuth

Revokes one of the authenticated user's mobile_push tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens.

Operation ID: discard_mobile_push_expo_token
Tags: mobile_pushexpo

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"
}
POST/channels/mobile_push/expo/tokens
Auth Type: UserAuth

Saves a mobile_push token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel.

Operation ID: save_mobile_push_expo_token
Tags: mobile_pushexpo

Request Properties

device_token "string"
required
Min length: 1

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/user-client/client"
  "github.com/magicbell/magicbell-go/pkg/user-client/util"
  "github.com/magicbell/magicbell-go/pkg/user-client/channels"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)


request := channels.ExpoTokenPayload{
  DeviceToken: util.ToPointer("DeviceToken"),
}

response, err := client.Channels.SaveMobilePushExpoToken(context.Background(), request)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "device_token": "expo-device-id"
}

Fcm

GET/users/{user_id}/channels/mobile_push/fcm/tokens/{token_id}
Auth Type: ProjectAuth

Retrieves a specific mobile_push token by its ID for a given user. This endpoint is available to project administrators and requires project-level authentication. Use this to inspect token details including its status, creation date, and associated metadata.

Operation ID: get_mobile_push_fcm_user_token
Tags: mobile_pushfcm

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"
}
GET/channels/mobile_push/fcm/tokens/{token_id}
Auth Type: UserAuth

Retrieves details of a specific mobile_push token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens.

Operation ID: get_mobile_push_fcm_token
Tags: mobile_pushfcm

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"
}
GET/users/{user_id}/channels/mobile_push/fcm/tokens
Auth Type: ProjectAuth

Lists all mobile_push tokens associated with a specific user. This endpoint is available to project administrators and returns a paginated list of tokens, including both active and revoked tokens.

Operation ID: get_mobile_push_fcm_user_tokens
Tags: mobile_pushfcm

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
  }
}
GET/channels/mobile_push/fcm/tokens
Auth Type: UserAuth

Lists all mobile_push tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.

Operation ID: get_mobile_push_fcm_tokens
Tags: mobile_pushfcm

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
  }
}
POST/channels/mobile_push/fcm/tokens
Auth Type: UserAuth

Saves a mobile_push token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel.

Operation ID: save_mobile_push_fcm_token
Tags: mobile_pushfcm

Request Properties

device_token "string"
required
Min length: 64
installation_id "string"
Allowed values:
"development""production"

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/user-client/client"
  "github.com/magicbell/magicbell-go/pkg/user-client/util"
  "github.com/magicbell/magicbell-go/pkg/user-client/channels"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)

fcmTokenPayloadInstallationId := channels.FCM_TOKEN_PAYLOAD_INSTALLATION_ID_DEVELOPMENT

request := channels.FcmTokenPayload{
  DeviceToken: util.ToPointer("DeviceToken"),
  InstallationId: &fcmTokenPayloadInstallationId,
}

response, err := client.Channels.SaveMobilePushFcmToken(context.Background(), request)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "device_token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt",
  "installation_id": "development"
}
DELETE/users/{user_id}/channels/mobile_push/fcm/tokens/{token_id}
Auth Type: ProjectAuth

Revokes a specific user's mobile_push token. This endpoint is available to project administrators and permanently invalidates the specified token. Once revoked, the token can no longer be used to access channel features. This action cannot be undone.

Operation ID: discard_mobile_push_fcm_user_token
Tags: mobile_pushfcm

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"
}
DELETE/channels/mobile_push/fcm/tokens/{token_id}
Auth Type: UserAuth

Revokes one of the authenticated user's mobile_push tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens.

Operation ID: discard_mobile_push_fcm_token
Tags: mobile_pushfcm

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"
}

Inbox

GET/channels/in_app/inbox/tokens/{token_id}
Auth Type: UserAuth

Retrieves details of a specific in_app token belonging to the authenticated user. Returns information about the token's status, creation date, and any associated metadata. Users can only access their own tokens.

Operation ID: get_in_app_inbox_token
Tags: in_appinbox

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"
}
GET/users/{user_id}/channels/in_app/inbox/tokens
Auth Type: ProjectAuth

Lists all in_app tokens associated with a specific user. This endpoint is available to project administrators and returns a paginated list of tokens, including both active and revoked tokens.

Operation ID: get_in_app_inbox_user_tokens
Tags: in_appinbox

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
  }
}
GET/channels/in_app/inbox/tokens
Auth Type: UserAuth

Lists all in_app tokens belonging to the authenticated user. Returns a paginated list of tokens, including their status, creation dates, and associated metadata.

Operation ID: get_in_app_inbox_tokens
Tags: in_appinbox

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
  }
}
GET/users/{user_id}/channels/in_app/inbox/tokens/{token_id}
Auth Type: ProjectAuth

Retrieves a specific in_app token by its ID for a given user. This endpoint is available to project administrators and requires project-level authentication. Use this to inspect token details including its status, creation date, and associated metadata.

Operation ID: get_in_app_inbox_user_token
Tags: in_appinbox

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"
}
DELETE/users/{user_id}/channels/in_app/inbox/tokens/{token_id}
Auth Type: ProjectAuth

Revokes a specific user's in_app token. This endpoint is available to project administrators and permanently invalidates the specified token. Once revoked, the token can no longer be used to access channel features. This action cannot be undone.

Operation ID: discard_in_app_inbox_user_token
Tags: in_appinbox

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"
}
DELETE/channels/in_app/inbox/tokens/{token_id}
Auth Type: UserAuth

Revokes one of the authenticated user's in_app tokens. This permanently invalidates the specified token, preventing it from being used for future channel access. This action cannot be undone. Users can only revoke their own tokens.

Operation ID: discard_in_app_inbox_token
Tags: in_appinbox

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"
}
POST/channels/in_app/inbox/tokens
Auth Type: UserAuth

Saves a in_app token for the authenticated user. This token serves as a credential for accessing channel-specific functionality. Each token is unique to the user and channel combination, allowing for direct communication with the user via the channel.

Operation ID: save_in_app_inbox_token
Tags: in_appinbox

Request Properties

token "string"
required
Min length: 64
connection_id ["string","null"]

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/user-client/client"
  "github.com/magicbell/magicbell-go/pkg/user-client/util"
  "github.com/magicbell/magicbell-go/pkg/user-client/channels"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)


request := channels.InboxToken{
  ConnectionId: util.ToPointer(util.Nullable[string]{ Value: "ConnectionId" }),
  Token: util.ToPointer("Token"),
}

response, err := client.Channels.SaveInAppInboxToken(context.Background(), request)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt"
}

Events

GET/events/{id}
Auth Type: ProjectAuth

Retrieves a project event by its ID.

Operation ID: get_event

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Events.GetEvent(context.Background(), "id")
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "id": "123",
  "timestamp": "2021-01-01T00:00:00Z",
  "type": "example_type"
}
GET/events
Auth Type: ProjectAuth

Retrieves a paginated list of events for the project.

Operation ID: list_events

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

  "github.com/magicbell/magicbell-go/pkg/project-client/events"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)


params := events.ListEventsRequestParams{

}

response, err := client.Events.ListEvents(context.Background(), params)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "data": [
    {
      "id": "123",
      "timestamp": "2021-01-01T00:00:00Z",
      "type": "example_type"
    }
  ],
  "links": {
    "first": "https://api.magicbell.com/v1/example",
    "next": "https://api.magicbell.com/v1/example?page_next=abc",
    "prev": null
  }
}

Integrations

GET/integrations
Auth Type: ProjectAuth

List Integrations

Lists all available and configured integrations for the project. Returns a summary of each integration including its type, status, and basic configuration information.

Operation ID: 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

GET/integrations/apns
Auth Type: ProjectAuth

Retrieves the current apns integration configurations for a specific integration type in the project. Returns configuration details and status information.

Operation ID: get_apns_integration
Tags: apnschannel/mobile_push

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
  }
}
DELETE/integrations/apns
Auth Type: ProjectAuth

Removes a apns integration configuration from the project. This will disable the integration's functionality within the project.

Operation ID: delete_apns_integration
Tags: apnschannel/mobile_push

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

No data
DELETE/integrations/apns/{id}
Auth Type: ProjectAuth

Removes a specific apns integration instance by ID from the project.

Operation ID: delete_apns_integration_by_id
Tags: apnschannel/mobile_push

Request Properties

No properties defined

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Integrations.DeleteApnsIntegrationById(context.Background(), "id")
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

No data
PUT/integrations/apns
Auth Type: ProjectAuth

Creates or updates a apns integration for the project. Only administrators can configure integrations.

Operation ID: save_apns_integration
Tags: apnschannel/mobile_push

Request Properties

app_id "string"
required

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.

Pattern: ^[a-zA-Z0-9]+(.[a-zA-Z0-9]+)*$
certificate "string"
required

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.

Pattern: ^-+?\s?BEGIN PRIVATE KEY-+\n([A-Za-z0-9+/\r\n]+={0,2})\n-+\s?END PRIVATE KEY+-+\n?$
key_id "string"
required
Min length: 10 • Max length: 10
team_id "string"
required
Min length: 10 • Max length: 10
badge "string"
required
Allowed values:
"unread""unseen"
payload_version "string"
Allowed values:
"1""2"

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

GET/integrations/expo
Auth Type: ProjectAuth

Retrieves the current expo integration configurations for a specific integration type in the project. Returns configuration details and status information.

Operation ID: get_expo_integration
Tags: expochannel/mobile_push

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
  }
}
DELETE/integrations/expo
Auth Type: ProjectAuth

Removes a expo integration configuration from the project. This will disable the integration's functionality within the project.

Operation ID: delete_expo_integration
Tags: expochannel/mobile_push

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

No data
DELETE/integrations/expo/{id}
Auth Type: ProjectAuth

Removes a specific expo integration instance by ID from the project.

Operation ID: delete_expo_integration_by_id
Tags: expochannel/mobile_push

Request Properties

No properties defined

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Integrations.DeleteExpoIntegrationById(context.Background(), "id")
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

No data
PUT/integrations/expo
Auth Type: ProjectAuth

Creates or updates a expo integration for the project. Only administrators can configure integrations.

Operation ID: save_expo_integration
Tags: expochannel/mobile_push

Request Properties

access_token "string"
required
Min length: 1

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

GET/integrations/fcm
Auth Type: ProjectAuth

Retrieves the current fcm integration configurations for a specific integration type in the project. Returns configuration details and status information.

Operation ID: get_fcm_integration
Tags: fcmchannel/mobile_push

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
  }
}
DELETE/integrations/fcm
Auth Type: ProjectAuth

Removes a fcm integration configuration from the project. This will disable the integration's functionality within the project.

Operation ID: delete_fcm_integration
Tags: fcmchannel/mobile_push

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

No data
DELETE/integrations/fcm/{id}
Auth Type: ProjectAuth

Removes a specific fcm integration instance by ID from the project.

Operation ID: delete_fcm_integration_by_id
Tags: fcmchannel/mobile_push

Request Properties

No properties defined

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Integrations.DeleteFcmIntegrationById(context.Background(), "id")
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

No data
PUT/integrations/fcm
Auth Type: ProjectAuth

Creates or updates a fcm integration for the project. Only administrators can configure integrations.

Operation ID: save_fcm_integration
Tags: fcmchannel/mobile_push

Request Properties

client_id "string"
required
token_uri "string"
required
auth_provider_x509_cert_url "string"
required
universe_domain "string"
required
type "string"
required
Allowed values:
"service_account"
client_email "string"
required
auth_uri "string"
required
client_x509_cert_url "string"
required
project_id "string"
required
private_key_id "string"
required
private_key "string"
required
Pattern: ^-+?\s?BEGIN[A-Z ]+-+\n([A-Za-z0-9+/\r\n]+={0,2})\n-+\s?END[A-Z ]+-+\n?$

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"
  "github.com/magicbell/magicbell-go/pkg/project-client/util"
  "github.com/magicbell/magicbell-go/pkg/project-client/integrations"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)

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

POST/integrations/inbox/installations/start
Auth Type: UserAuth

Initiates the installation flow for a inbox integration. This is the first step in a multi-step installation process where user authorization or external service configuration may be required.

Operation ID: start_inbox_installation
Tags: inbox

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

GET/integrations/mailgun
Auth Type: ProjectAuth

Retrieves the current mailgun integration configurations for a specific integration type in the project. Returns configuration details and status information.

Operation ID: get_mailgun_integration
Tags: mailgunchannel/email

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
  }
}
DELETE/integrations/mailgun
Auth Type: ProjectAuth

Removes a mailgun integration configuration from the project. This will disable the integration's functionality within the project.

Operation ID: delete_mailgun_integration
Tags: mailgunchannel/email

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

No data
DELETE/integrations/mailgun/{id}
Auth Type: ProjectAuth

Removes a specific mailgun integration instance by ID from the project.

Operation ID: delete_mailgun_integration_by_id
Tags: mailgunchannel/email

Request Properties

No properties defined

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Integrations.DeleteMailgunIntegrationById(context.Background(), "id")
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

No data
PUT/integrations/mailgun
Auth Type: ProjectAuth

Creates or updates a mailgun integration for the project. Only administrators can configure integrations.

Operation ID: save_mailgun_integration
Tags: mailgunchannel/email

Request Properties

api_key "string"
required
Min length: 1
region "string"
required
Allowed values:
"us""eu"
domain "string"
required
Min length: 1
from "object"
Show nested properties
↳ email "string" format: email
required

The email address to send from

↳ name ["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)


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: &region,
}

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

GET/integrations/ping_email
Auth Type: ProjectAuth

Retrieves the current ping_email integration configurations for a specific integration type in the project. Returns configuration details and status information.

Operation ID: get_ping_email_integration
Tags: ping_emailchannel/email

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
  }
}
DELETE/integrations/ping_email
Auth Type: ProjectAuth

Removes a ping_email integration configuration from the project. This will disable the integration's functionality within the project.

Operation ID: delete_ping_email_integration
Tags: ping_emailchannel/email

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

No data
DELETE/integrations/ping_email/{id}
Auth Type: ProjectAuth

Removes a specific ping_email integration instance by ID from the project.

Operation ID: delete_ping_email_integration_by_id
Tags: ping_emailchannel/email

Request Properties

No properties defined

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Integrations.DeletePingEmailIntegrationById(context.Background(), "id")
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

No data
PUT/integrations/ping_email
Auth Type: ProjectAuth

Creates or updates a ping_email integration for the project. Only administrators can configure integrations.

Operation ID: save_ping_email_integration
Tags: ping_emailchannel/email

Request Properties

url "string" format: uri
required

URL to ping

Min length: 1 • Max length: 100

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

GET/integrations/sendgrid
Auth Type: ProjectAuth

Retrieves the current sendgrid integration configurations for a specific integration type in the project. Returns configuration details and status information.

Operation ID: get_sendgrid_integration
Tags: sendgridchannel/email

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
  }
}
DELETE/integrations/sendgrid
Auth Type: ProjectAuth

Removes a sendgrid integration configuration from the project. This will disable the integration's functionality within the project.

Operation ID: delete_sendgrid_integration
Tags: sendgridchannel/email

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

No data
DELETE/integrations/sendgrid/{id}
Auth Type: ProjectAuth

Removes a specific sendgrid integration instance by ID from the project.

Operation ID: delete_sendgrid_integration_by_id
Tags: sendgridchannel/email

Request Properties

No properties defined

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Integrations.DeleteSendgridIntegrationById(context.Background(), "id")
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

No data
PUT/integrations/sendgrid
Auth Type: ProjectAuth

Creates or updates a sendgrid integration for the project. Only administrators can configure integrations.

Operation ID: save_sendgrid_integration
Tags: sendgridchannel/email

Request Properties

api_key "string"
required

The API key for Sendgrid

from "object"
Show nested properties
↳ email "string" format: email
required

The email address to send from

↳ name ["string","null"]

The name to send from

reply_to "object"
Show nested properties
↳ email "string" format: email
required

The email address to reply to

↳ name ["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

GET/integrations/ses
Auth Type: ProjectAuth

Retrieves the current ses integration configurations for a specific integration type in the project. Returns configuration details and status information.

Operation ID: get_ses_integration
Tags: seschannel/email

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
  }
}
DELETE/integrations/ses
Auth Type: ProjectAuth

Removes a ses integration configuration from the project. This will disable the integration's functionality within the project.

Operation ID: delete_ses_integration
Tags: seschannel/email

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

No data
DELETE/integrations/ses/{id}
Auth Type: ProjectAuth

Removes a specific ses integration instance by ID from the project.

Operation ID: delete_ses_integration_by_id
Tags: seschannel/email

Request Properties

No properties defined

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Integrations.DeleteSesIntegrationById(context.Background(), "id")
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

No data
PUT/integrations/ses
Auth Type: ProjectAuth

Creates or updates a ses integration for the project. Only administrators can configure integrations.

Operation ID: save_ses_integration
Tags: seschannel/email

Request Properties

key_id "string"
required

AWS Access Key ID

Min length: 1
secret_key "string"
required

AWS Secret Key

Min length: 1
region "string"
required

AWS Region

Min length: 1
from "object"
Show nested properties
↳ email "string" format: email
required

The email address to send from

↳ name ["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

POST/integrations/slack/installations
Auth Type: UserAuth

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.

Operation ID: save_slack_installation
Tags: slack

Request Properties

authed_user "object"
required
Show nested properties
↳ token_type "string"
↳ expires_in "integer"
↳ scope "string"
↳ access_token "string"
↳ refresh_token "string"
↳ id "string"
required
enterprise "object"
Show nested properties
↳ name "string"
required
↳ id "string"
required
bot_user_id "string"
is_enterprise_install "boolean"
team "object"
required
Show nested properties
↳ id "string"
required
↳ name "string"
app_id "string"
required
expires_in "integer"
id "string"
Pattern: ^[A-Z0-9]+-.*$
access_token "string"
required
refresh_token "string"
incoming_webhook "object"
Show nested properties
↳ url "string"
required
↳ channel "string"
required
↳ configuration_url "string"
required
scope "string"
token_type "string"

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/user-client/client"
  "github.com/magicbell/magicbell-go/pkg/user-client/util"
  "github.com/magicbell/magicbell-go/pkg/user-client/integrations"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)


authedUser := integrations.AuthedUser{
  AccessToken: util.ToPointer("AccessToken"),
  ExpiresIn: util.ToPointer(int64(123)),
  Id: util.ToPointer("Id"),
  RefreshToken: util.ToPointer("RefreshToken"),
  Scope: util.ToPointer("Scope"),
  TokenType: util.ToPointer("TokenType"),
}


enterprise := integrations.Enterprise{
  Id: util.ToPointer("Id"),
  Name: util.ToPointer("Name"),
}


incomingWebhook := integrations.IncomingWebhook{
  Channel: util.ToPointer("Channel"),
  ConfigurationUrl: util.ToPointer("ConfigurationUrl"),
  Url: util.ToPointer("Url"),
}


team := integrations.Team{
  Id: util.ToPointer("Id"),
  Name: util.ToPointer("Name"),
}

request := integrations.SlackInstallation{
  AccessToken: util.ToPointer("AccessToken"),
  AppId: util.ToPointer("AppId"),
  AuthedUser: &authedUser,
  BotUserId: util.ToPointer("BotUserId"),
  Enterprise: &enterprise,
  ExpiresIn: util.ToPointer(int64(123)),
  Id: util.ToPointer("Id"),
  IncomingWebhook: &incomingWebhook,
  IsEnterpriseInstall: util.ToPointer(true),
  RefreshToken: util.ToPointer("RefreshToken"),
  Scope: util.ToPointer("Scope"),
  Team: &team,
  TokenType: util.ToPointer("TokenType"),
}

response, err := client.Integrations.SaveSlackInstallation(context.Background(), request)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "access_token": "xoxb-123456789012-1234567890123-12345678901234567890abcdef123456",
  "app_id": "A12345678",
  "authed_user": {
    "id": "U12345678",
    "scope": "identify,commands"
  },
  "bot_user_id": "U12345678",
  "enterprise_id": "E12345678",
  "enterprise_name": "Enterprise Grid, Inc.",
  "id": "A12345678-T123",
  "incoming_webhook": {
    "channel": "C12345678",
    "channel_id": "C12345678",
    "configuration_url": "https://teamname.slack.com/services/B12345678",
    "url": "https://hooks.slack.com/services/T12345678/B12345678/123456789012345678901234"
  },
  "scope": "identify,commands,bot",
  "team": {
    "id": "T123",
    "name": "Team Installing Your App"
  },
  "team_id": "T12345678",
  "team_name": "Team Installing Your App"
}

Finish

POST/integrations/slack/installations/finish
Auth Type: UserAuth

Completes the installation flow for a slack integration. This endpoint is typically called after the user has completed any required authorization steps with slack.

Operation ID: finish_slack_installation
Tags: slack

Request Properties

app_id "string"
required

The app ID of the Slack app that was originally configured at the project-level.

code "string"
required

The code that was returned from the OAuth flow, and found in the query string of the redirect URL.

redirect_url "string"

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/user-client/client"
  "github.com/magicbell/magicbell-go/pkg/user-client/util"
  "github.com/magicbell/magicbell-go/pkg/user-client/integrations"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)


request := integrations.SlackFinishInstallResponse{
  AppId: util.ToPointer("AppId"),
  Code: util.ToPointer("Code"),
  RedirectUrl: util.ToPointer("RedirectUrl"),
}

response, err := client.Integrations.FinishSlackInstallation(context.Background(), request)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "access_token": "xoxb-123456789012-1234567890123-12345678901234567890abcdef123456",
  "app_id": "A12345678",
  "authed_user": {
    "id": "U12345678",
    "scope": "identify,commands"
  },
  "bot_user_id": "U12345678",
  "enterprise_id": "E12345678",
  "enterprise_name": "Enterprise Grid, Inc.",
  "id": "A12345678-T123",
  "incoming_webhook": {
    "channel": "C12345678",
    "channel_id": "C12345678",
    "configuration_url": "https://teamname.slack.com/services/B12345678",
    "url": "https://hooks.slack.com/services/T12345678/B12345678/123456789012345678901234"
  },
  "scope": "identify,commands,bot",
  "team": {
    "id": "T123",
    "name": "Team Installing Your App"
  },
  "team_id": "T12345678",
  "team_name": "Team Installing Your App"
}

Start

POST/integrations/slack/installations/start
Auth Type: UserAuth

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.

Operation ID: start_slack_installation
Tags: slack

Request Properties

app_id "string"
required
auth_url "string"
redirect_url "string"
extra_scopes "array"
Show array item schema
↳ (array item) "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

POST/integrations/templates/installations
Auth Type: UserAuth

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.

Operation ID: save_templates_installation
Tags: templates

Request Properties

text "string"
required
channel "string"
required
category ["string","null"]

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/user-client/client"
  "github.com/magicbell/magicbell-go/pkg/user-client/util"
  "github.com/magicbell/magicbell-go/pkg/user-client/integrations"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)


request := integrations.TemplatesInstallation{
  Category: util.ToPointer(util.Nullable[string]{ Value: "Category" }),
  Channel: util.ToPointer("Channel"),
  Text: util.ToPointer("Text"),
}

response, err := client.Integrations.SaveTemplatesInstallation(context.Background(), request)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "channel": "email",
  "text": "Installation"
}

Twilio

GET/integrations/twilio
Auth Type: ProjectAuth

Retrieves the current twilio integration configurations for a specific integration type in the project. Returns configuration details and status information.

Operation ID: get_twilio_integration
Tags: twiliochannel/sms

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
  }
}
DELETE/integrations/twilio/{id}
Auth Type: ProjectAuth

Removes a specific twilio integration instance by ID from the project.

Operation ID: delete_twilio_integration_by_id
Tags: twiliochannel/sms

Request Properties

No properties defined

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Integrations.DeleteTwilioIntegrationById(context.Background(), "id")
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

No data
DELETE/integrations/twilio
Auth Type: ProjectAuth

Removes a twilio integration configuration from the project. This will disable the integration's functionality within the project.

Operation ID: delete_twilio_integration
Tags: twiliochannel/sms

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

No data
PUT/integrations/twilio
Auth Type: ProjectAuth

Creates or updates a twilio integration for the project. Only administrators can configure integrations.

Operation ID: save_twilio_integration
Tags: twiliochannel/sms

Request Properties

account_sid "string"
required

The SID for your Twilio account

Min length: 1 • Max length: 100
api_key "string"
required

A US1 API key for Twilio- - https://www.twilio.com/docs/iam/api-keys

Min length: 1 • Max length: 100
api_secret "string"
required

The API Secret for Twilio

Min length: 1 • Max length: 100
from "string"
required

The phone number to send from, in E.164 format

Min length: 1 • Max length: 100
Pattern: ^\+[0-9]{1,14}$

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

POST/integrations/web_push/installations/start
Auth Type: UserAuth

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.

Operation ID: start_web_push_installation
Tags: web_push

Request Properties

No properties defined

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/user-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/user-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Integrations.StartWebPushInstallation(context.Background())
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "auth_token": "eyGhb...GA2Bw",
  "public_key": "BHaJd...gRHDk"
}

Webhooks Incoming

POST/integrations/awssns/webhooks/incoming/{id}

Receives and processes incoming webhook events from the awssns integration. Each integration can define its own webhook payload format and handling logic.

Operation ID: handle_awssns_webhook
Tags: awssns

Request Properties

payload ["object","null"]
type "string"
description "string"

Response

{
  "payload": {},
  "type": "ping"
}
POST/integrations/eventsource/webhooks/incoming/{id}

Receives and processes incoming webhook events from the eventsource integration. Each integration can define its own webhook payload format and handling logic.

Operation ID: handle_eventsource_webhook
Tags: eventsource

Request Properties

payload ["object","null"]
required
type "string"
required

Response

{
  "payload": {
    "key": "value"
  },
  "type": "customer.event.type"
}
POST/integrations/stripe/webhooks/incoming/{id}

Receives and processes incoming webhook events from the stripe integration. Each integration can define its own webhook payload format and handling logic.

Operation ID: handle_stripe_webhook
Tags: stripe

Request Properties

id "string"
required

Unique identifier for the webhook event

description "string"
required

Description of the webhook event

Response

{
  "description": "example event",
  "id": "evt_1J4J9v2eZvKYlo2C1J4J9v2e",
  "type": "invoice.created"
}
POST/integrations/github/webhooks/incoming/{id}

Receives and processes incoming webhook events from the github integration. Each integration can define its own webhook payload format and handling logic.

Operation ID: handle_github_webhook
Tags: github

Request Properties

type "string"
description "string"
payload "object"

Response

{
  "description": "example event",
  "payload": {},
  "type": "ping"
}

Jwt Token

POST/jwt/project
Auth Type: ProjectAuth

Creates a new project-level JWT token. These tokens provide project-wide access and should be carefully managed. Only administrators can create project tokens. The returned token should be securely stored as it cannot be retrieved again after creation.

Operation ID: create_project_jwt

Request Properties

expiry ["integer","null"]

The duration for which the token is valid (in seconds)

Min: 1
name "string"
required

The name of the token.

Max length: 255

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"
  "github.com/magicbell/magicbell-go/pkg/project-client/util"
  "github.com/magicbell/magicbell-go/pkg/project-client/jwt"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)


request := jwt.CreateProjectTokenRequest{
  Expiry: util.ToPointer(util.Nullable[int64]{ Value: int64(123) }),
  Name: util.ToPointer("Name"),
}

response, err := client.Jwt.CreateProjectJwt(context.Background(), request)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "created_at": "2021-01-01T00:00:00Z",
  "token": "eY.......",
  "token_id": "019b1b1e-7b1b-4b1b-8b1b-1b1b1b1b1b1b"
}
GET/jwt/project
Auth Type: ProjectAuth

Retrieves a list of all active project-level JWT tokens. Returns a paginated list showing token metadata including creation date, last used date, and expiration time. For security reasons, the actual token values are not included in the response.

Operation ID: fetch_project_tokens

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

  "github.com/magicbell/magicbell-go/pkg/project-client/jwt"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)


params := jwt.FetchProjectTokensRequestParams{

}

response, err := client.Jwt.FetchProjectTokens(context.Background(), params)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "data": [
    {
      "created_at": "2021-01-01T00:00:00Z",
      "discarded_at": "2021-01-01T00:00:00Z",
      "expires_at": "2021-01-01T00:00:00Z",
      "id": "00000000-0000-0000-0000-000000000000",
      "name": "My Token"
    }
  ],
  "links": {
    "first": "https://api.magicbell.com/v1/example",
    "next": "https://api.magicbell.com/v1/example?page_next=abc",
    "prev": null
  }
}
DELETE/jwt/project/{token_id}
Auth Type: ProjectAuth

Immediately revokes a project-level JWT token. Once revoked, any requests using this token will be rejected. This action is immediate and cannot be undone. Active sessions using this token will be terminated.

Operation ID: discard_project_jwt

Request Properties

No properties defined

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Jwt.DiscardProjectJwt(context.Background(), "tokenId")
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "discarded_at": "2021-01-01T00:00:00Z",
  "token_id": "550e8400-e29b-41d4-a716-446655440000"
}

Notifications

GET/notifications/{notification_id}
Auth Type: UserAuth

Gets a notification by ID.

Operation ID: get_notification

Response

{
  "aasm_state": "unseen",
  "action_url": null,
  "archived_at": null,
  "category_id": null,
  "created_at": "2024-09-11T11:14:42.165Z",
  "custom_attributes": {
    "key": "value",
    "obj_key": {
      "one": "two"
    }
  },
  "discarded_at": null,
  "id": "4b6efd21-f0f6-4051-8922-cc8c90a3dc5d",
  "in_app": true,
  "metadata": {},
  "notification_broadcast_id": "6a8b1e23-f54b-4c65-95b2-78f288d7f247",
  "overrides": {},
  "project_id": 7,
  "read_at": null,
  "seen_at": null,
  "title": "Example Notification",
  "topic_id": null,
  "updated_at": "2024-09-11T11:14:42.165Z",
  "user_id": "d4121424-097e-40b0-9cc8-357060d004b2"
}
GET/notifications
Auth Type: UserAuth

Lists all notifications for a user.

Operation ID: 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
  }
}
POST/notifications/{notification_id}/unread
Auth Type: UserAuth

Marks a notification as unread.

Operation ID: 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

No data
POST/notifications/archive
Auth Type: UserAuth

Archives all notifications.

Operation ID: archive_notifications

Request Properties

No properties defined

Response

No data
POST/notifications/{notification_id}/archive
Auth Type: UserAuth

Archives a notification.

Operation ID: 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

No data
POST/notifications/{notification_id}/unarchive
Auth Type: UserAuth

Unarchives a notification.

Operation ID: 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

No data
POST/notifications/read
Auth Type: UserAuth

Marks all notifications as read.

Operation ID: mark_notifications_read

Request Properties

No properties defined

Response

No data
POST/notifications/{notification_id}/read
Auth Type: UserAuth

Marks a notification as read.

Operation ID: 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

No data

Users

GET/users
Auth Type: ProjectAuth
Operation ID: 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
  }
}
POST/users
Auth Type: ProjectAuth

Creates a user with the provided details. The user will be associated with the project specified in the request context.

Operation ID: create_user

Request Properties

custom_attributes ["object","null"]
first_name ["string","null"]
last_name ["string","null"]
updated_at ["string","null"] format: date-time
last_seen_at ["string","null"] format: date-time
last_notified_at ["string","null"] format: date-time
id "string" format: uuid
external_id ["string","null"]
email ["string","null"]
created_at ["string","null"] format: date-time

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/users"
)

config := clientconfig.NewConfig()
client := client.NewClient(config)


request := users.User{
  CreatedAt: util.ToPointer(util.Nullable[string]{ Value: "CreatedAt" }),
  CustomAttributes: []byte{},
  Email: util.ToPointer(util.Nullable[string]{ Value: "Email" }),
  ExternalId: util.ToPointer(util.Nullable[string]{ Value: "ExternalId" }),
  FirstName: util.ToPointer(util.Nullable[string]{ Value: "FirstName" }),
  Id: util.ToPointer("Id"),
  LastName: util.ToPointer(util.Nullable[string]{ Value: "LastName" }),
  LastNotifiedAt: util.ToPointer(util.Nullable[string]{ Value: "LastNotifiedAt" }),
  LastSeenAt: util.ToPointer(util.Nullable[string]{ Value: "LastSeenAt" }),
  UpdatedAt: util.ToPointer(util.Nullable[string]{ Value: "UpdatedAt" }),
}

response, err := client.Users.CreateUser(context.Background(), request)
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

{
  "custom_attributes": {
    "key": "value"
  },
  "email": "dan@example.com",
  "external_id": "external-id",
  "first_name": "Dan",
  "id": "8a038704-acc1-47f9-81b0-7523886cbeae",
  "last_name": "Example"
}
DELETE/users/{user_id}
Auth Type: ProjectAuth
Operation ID: delete_user

Request Properties

No properties defined

Request

import (
  "fmt"
  "encoding/json"
  "github.com/magicbell/magicbell-go/pkg/project-client/clientconfig"
  "github.com/magicbell/magicbell-go/pkg/project-client/client"

)

config := clientconfig.NewConfig()
client := client.NewClient(config)

response, err := client.Users.DeleteUser(context.Background(), "userId")
if err != nil {
  panic(err)
}

fmt.Println(response)

Response

No data