V2 API Reference

Broadcasts

GET/broadcasts
Auth Type: ProjectAuth

List all broadcasts

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

Create a broadcast

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

Operation ID: create_broadcast

Request Properties

id "string" format: uuid

The unique id for this broadcast.

action_url ["null","string"]
Max length: 2048
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_\.\-/:]+$
topic ["string","null"]
Max length: 255
Pattern: ^[A-Za-z0-9_\.\-/:]+$
custom_attributes ["null","object"]
recipients "array"
required
Show array item schema
↳ (array item) "object"
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
↳ title "string"
Min length: 1 • Max length: 255
↳ content "string"
Max length: 1048576
↳ action_url ["null","string"]
Max length: 2048
↳ 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
↳ 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
↳ sendgrid "object"
↳ twilio "object"
↳ ses "object"
↳ expo "object"
↳ slack "object"
↳ teams "object"
↳ mailgun "object"
↳ fcm "object"
↳ apns "object"
↳ web_push "object"
title "string"
required
Min length: 1 • Max length: 255
content ["null","string"]
Max length: 10485760
status "object"
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

Fetch a broadcast

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

Tokens

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

List all Web Push tokens

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

Operation ID: list_user_web_push_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/teams/tokens
Auth Type: UserAuth

List all Teams tokens

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

Operation ID: list_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/teams/tokens
Auth Type: ProjectAuth

List all Teams tokens

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

Operation ID: list_user_teams_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/slack/tokens
Auth Type: ProjectAuth

List all Slack tokens

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

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

List all Slack tokens

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

Operation ID: list_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/channels/web_push/tokens
Auth Type: UserAuth

List all Web Push tokens

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

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

Delete a Slack token

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

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

Delete a Web Push token

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

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

Delete user a Teams token

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

Operation ID: delete_user_teams_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/slack/tokens/{token_id}
Auth Type: ProjectAuth

Delete user a Slack token

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

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

Delete user a Web Push token

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

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

Delete a Teams token

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

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

Fetch a Web Push token

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

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

Fetch a Teams token

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

Operation ID: fetch_user_teams_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/channels/slack/tokens/{token_id}
Auth Type: UserAuth

Fetch a Slack token

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

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

Fetch a Web Push token

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

Operation ID: fetch_user_web_push_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"
}
PUT/channels/slack/tokens
Auth Type: UserAuth

Save a Slack token

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

Operation ID: save_slack_token
Tags: slack

Request Properties

oauth "object"
Show nested properties
↳ scope "string"
↳ channel_id "string"
required
↳ installation_id "string"
required
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

Response

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

Fetch a Slack token

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

Operation ID: fetch_user_slack_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"
  }
}
PUT/channels/web_push/tokens
Auth Type: UserAuth

Save a Web Push token

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

Operation ID: save_web_push_token
Tags: web_push

Request Properties

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.

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.

Response

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

Fetch a Teams token

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

Operation ID: fetch_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"
}
PUT/channels/teams/tokens
Auth Type: UserAuth

Save a Teams token

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

Operation ID: save_teams_token
Tags: teams

Request Properties

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

Response

{}

Apns

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

List all APNs tokens

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

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

List all APNs tokens

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

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

Delete an APNs token

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

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

Delete user an APNs token

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

Operation ID: delete_user_apns_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"
}
PUT/channels/mobile_push/apns/tokens
Auth Type: UserAuth

Save an APNs token

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

Operation ID: save_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]+)*$

Response

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

Fetch an APNs token

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

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

Fetch an APNs token

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

Operation ID: fetch_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"
}

Expo

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

List all Expo tokens

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

Operation ID: list_user_expo_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": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]",
      "discarded_at": "2021-01-01T00:00:00Z",
      "id": "123",
      "updated_at": "2021-01-01T00:00:00Z"
    }
  ],
  "links": {
    "first": "https://api.magicbell.com/v1/example",
    "next": "https://api.magicbell.com/v1/example?page_next=abc",
    "prev": null
  }
}
GET/channels/mobile_push/expo/tokens
Auth Type: UserAuth

List all Expo tokens

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

Operation ID: list_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": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]",
      "discarded_at": "2021-01-01T00:00:00Z",
      "id": "123",
      "updated_at": "2021-01-01T00:00:00Z"
    }
  ],
  "links": {
    "first": "https://api.magicbell.com/v1/example",
    "next": "https://api.magicbell.com/v1/example?page_next=abc",
    "prev": null
  }
}
DELETE/users/{user_id}/channels/mobile_push/expo/tokens/{token_id}
Auth Type: ProjectAuth

Delete user an Expo token

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

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

Delete an Expo token

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

Operation ID: delete_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"
}
PUT/channels/mobile_push/expo/tokens
Auth Type: UserAuth

Save an Expo token

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

Operation ID: save_expo_token
Tags: mobile_pushexpo

Request Properties

device_token "string"
required
Min length: 1

Response

{
  "device_token": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]"
}
GET/users/{user_id}/channels/mobile_push/expo/tokens/{token_id}
Auth Type: ProjectAuth

Fetch an Expo token

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

Operation ID: fetch_user_expo_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": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]",
  "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

Fetch an Expo token

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

Operation ID: fetch_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": "ExponentPushToken[xxxxxxxxxxxxxxxxxxxxxx]",
  "discarded_at": "2021-01-01T00:00:00Z",
  "id": "123",
  "updated_at": "2021-01-01T00:00:00Z"
}

Fcm

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

List all FCM tokens

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

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

List all FCM tokens

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

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

Delete a FCM token

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

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

Delete user a FCM token

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

Operation ID: delete_user_fcm_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"
}
PUT/channels/mobile_push/fcm/tokens
Auth Type: UserAuth

Save a FCM token

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

Operation ID: save_fcm_token
Tags: mobile_pushfcm

Request Properties

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

Response

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

Fetch a FCM token

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

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

Fetch a FCM token

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

Operation ID: fetch_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"
}

Inbox

GET/users/{user_id}/channels/in_app/inbox/tokens
Auth Type: ProjectAuth

List all Inbox tokens

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

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

List all Inbox tokens

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

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

Delete user an Inbox token

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

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

Delete an Inbox token

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

Operation ID: delete_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"
}
PUT/channels/in_app/inbox/tokens
Auth Type: UserAuth

Save an Inbox token

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

Operation ID: save_inbox_token
Tags: in_appinbox

Request Properties

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

Response

{
  "token": "eH0fLhuiRj2Np7UQ-opXAm:APA91bGtC-wH4sgW1jWkMKIZf7FYkm_RTQb7Jid7DfSJnCgivGYoRzhLrGxpcIF6yPjmbzAr6CKF-6phZkBasFUUfZmfdgcqfA_ZlZdVk6pSnon3LGzMumCzEJE0zgWoo_RUmVUVJUAt"
}
GET/users/{user_id}/channels/in_app/inbox/tokens/{token_id}
Auth Type: ProjectAuth

Fetch an Inbox token

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

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

Fetch an Inbox token

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

Operation ID: fetch_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"
}

Events

GET/events
Auth Type: ProjectAuth

List all events

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
  }
}
GET/events/{event_id}
Auth Type: ProjectAuth

Fetch an event

Fetches a project event by its ID.

Operation ID: fetch_event

Response

{
  "id": "123",
  "timestamp": "2021-01-01T00:00:00Z",
  "type": "example_type"
}

Integrations

GET/integrations
Auth Type: ProjectAuth

List all integrations

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

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

List all APNs integrations

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

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

Delete an APNs integration

Deletes the 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

{}
PUT/integrations/apns
Auth Type: ProjectAuth

Save an APNs integration

Updates or creates the APNs integration for the project.

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

List all Expo integrations

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

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

Delete an Expo integration

Deletes the 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

{}
PUT/integrations/expo
Auth Type: ProjectAuth

Save an Expo integration

Updates or creates the Expo integration for the project.

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

List all FCM integrations

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

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

Delete a FCM integration

Deletes the 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

{}
PUT/integrations/fcm
Auth Type: ProjectAuth

Save a FCM integration

Updates or creates the FCM integration for the project.

Operation ID: save_fcm_integration
Tags: fcmchannel/mobile_push

Request Properties

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

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

Start an Inbox installation

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

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

List all Mailgun integrations

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

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

Delete a Mailgun integration

Deletes the 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

{}
PUT/integrations/mailgun
Auth Type: ProjectAuth

Save a Mailgun integration

Updates or creates the Mailgun integration for the project.

Operation ID: save_mailgun_integration
Tags: mailgunchannel/email

Request Properties

from "object"
Show nested properties
↳ name ["string","null"]

The name to send from

↳ email "string" format: email
required

The email address to send from

api_key "string"
required
Min length: 1
region "string"
required
Allowed values:
"us""eu"
domain "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)


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

List all Ping Email integrations

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

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

Delete a Ping Email integration

Deletes the 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

{}
PUT/integrations/ping_email
Auth Type: ProjectAuth

Save a Ping Email integration

Updates or creates the Ping Email integration for the project.

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

List all SendGrid integrations

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

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

Delete a SendGrid integration

Deletes the 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

{}
PUT/integrations/sendgrid
Auth Type: ProjectAuth

Save a SendGrid integration

Updates or creates the SendGrid integration for the project.

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
↳ name ["string","null"]

The name to reply to

↳ email "string" format: email
required

The email address 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

List all Amazon SES integrations

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

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

Delete an Amazon SES integration

Deletes the Amazon 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

{}
PUT/integrations/ses
Auth Type: ProjectAuth

Save an Amazon SES integration

Updates or creates the Amazon SES integration for the project.

Operation ID: save_ses_integration
Tags: seschannel/email

Request Properties

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

The email address to send from

↳ name ["string","null"]

The name to send from

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

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

PUT/integrations/slack/installations
Auth Type: UserAuth

Save a Slack installation

Creates a new installation of a Slack integration for a user. This endpoint is used when an integration needs to be set up with user-specific credentials or configuration.

Operation ID: save_slack_installation
Tags: slack

Request Properties

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

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

Finish a Slack installation

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

Operation ID: finish_slack_installation
Tags: slack

Request Properties

redirect_url "string"
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.

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

Start a Slack installation

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

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

PUT/integrations/templates/installations
Auth Type: UserAuth

Save a Templates installation

Creates a new installation of a Templates integration for a user. This endpoint is used when an integration needs to be set up with user-specific credentials or configuration.

Operation ID: save_templates_installation
Tags: templates

Request Properties

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

Response

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

Twilio

GET/integrations/twilio
Auth Type: ProjectAuth

List all Twilio integrations

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

Operation ID: list_twilio_integrations
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
Auth Type: ProjectAuth

Delete a Twilio integration

Deletes the 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

{}
PUT/integrations/twilio
Auth Type: ProjectAuth

Save a Twilio integration

Updates or creates the Twilio integration for the project.

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

Start a Web Push installation

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

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

Notifications

GET/notifications
Auth Type: UserAuth

List all notifications

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/archive
Auth Type: UserAuth

Archive all notifications

Archive all notifications.

Operation ID: archive_all_notifications

Request Properties

No properties defined

Response

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

Archive a notification

Archive 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

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

Unarchive a notification

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

{}
GET/notifications/{notification_id}
Auth Type: UserAuth

Fetch a notification

Gets a notification by ID.

Operation ID: fetch_notification

Response

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

Mark all notifications read

Marks all notifications as read.

Operation ID: mark_all_notifications_read

Request Properties

No properties defined

Response

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

Mark a notification read

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

{}
POST/notifications/{notification_id}/unread
Auth Type: UserAuth

Mark a notification unread

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

{}

Users

GET/users
Auth Type: ProjectAuth

List all users

Lists all users in the project.

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
  }
}
DELETE/users/{user_id}
Auth Type: ProjectAuth

Delete a user

Removes a user and all associated data from the project.

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

{}
PUT/users
Auth Type: ProjectAuth

Save a user

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

Operation ID: save_user

Request Properties

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

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