Push Notifications

Push notifications are used to notify users of events that occur in the background, such as incoming messages or calls.

After authenticating, a mobile client can register a device push notification token with the server using the Register Device endpoint. This token is then used to send push notifications to the client's device.

Registering Tokens

A client registers its device's token with the Register Device endpoint, or with Sync Devices when several accounts share the device. It also keeps the token it was given by the operating system, and attaches it to requests that provision a new authentication token, so the device stays registered across the change without a second round trip.

Currently, these endpoints are Modify Current User and Reset Password.

Push Notification Provider
ValueDescription
gcmFirebase Cloud Messaging (Android)
meta_horizonMeta Horizon OS push notifications (Meta Quest)
apnsApple Push Notification Service (iOS)
apns_internalApple Push Notification Service (iOS internal)
apns_local 1Apple Push Notification Service (iOS local)
apns_voip 2VOIP Apple Push Notification Service (iOS)
apns_internal_voip 2VOIP Apple Push Notification Service (iOS internal)
apns_local_voip 1 2VOIP Apple Push Notification Service (iOS local)

1 Local providers are only used by locally-built clients, identified by a com.hammerandchisel.discord.local bundle ID prefix.

2 VOIP-specific push notification providers are used to provide rich notifications for VOIP calls on iOS.

Push Notification Payloads

Push notifications are delivered as data-only messages. The payload carries the entities the event concerns, and the client renders, groups, and routes the notification itself. Which fields are present depends on the type of push notification.

On iOS, the payload's fields are sent as top-level siblings of the standard APNs aps dictionary. On Android, they are sent as an FCM data message; there is no notification block, so notifications are always rendered by the client rather than by the system.

Only type is guaranteed to be present. Every other field is optional, and a client that receives a type it does not recognize is expected to ignore the notification. The fields belonging to a notification's type are sent alongside the ones below rather than nested in an object of their own.

Push Notification Structure
FieldTypeDescription
typestringThe type of push notification
receiving_user_id? 1snowflakeThe ID of the user the notification is intended for
notif_type_id?integerThe type of notification that produced the push notification
notif_instance_id?stringThe ID of this specific delivery of the notification
tracking_type?stringThe tracking type the notification is reported under in analytics
notification_channel? (deprecated) 2stringThe notification channel the notification belongs to
title?stringThe title to display, overriding the one the client would derive
subtitle?stringThe subtitle to display
expand_subtitle?booleanWhether the subtitle should be displayed expanded (default false)
icon_url?stringThe URL of the icon to display
silent?booleanWhether the notification should be delivered without alerting the user (default false)
sent_at_ms? 3integerUnix timestamp (in milliseconds) of when the notification was sent
channel_ids?array[snowflake]The IDs of the channels the notification acknowledges
mention_type?stringThe type of mention that triggered the notification, used for analytics
join_id?stringAn opaque identifier reported alongside the notification in analytics

1 Used on devices with multiple accounts logged in. The client switches to this account before acting on the notification. See Sync Devices for more information.

2 Android only. Modern clients derive the notification channel from notif_type_id instead; see notification channels.

3 Used as the last acknowledged timestamp when a notification acknowledges channels. Clients that do not receive this field fall back to the time the push was sent.

Push Notification Type
ValueDescriptionExtra Data
MESSAGE_CREATEA message was sent in a channel the user is notified aboutmessage create object
FORUM_THREAD_CREATEDA thread was created in a forum channel the user is notified aboutforum thread created object
RELATIONSHIP_ADDA relationship with the user was createdrelationship add object
FRIEND_SUGGESTION_CREATEA friend suggestion was created for the userfriend suggestion create object
CALL_RINGThe user is being rung in a callcall ring object
CALL_RING_END 1The user is no longer being rung in a call—
CALL_ACK 1The call the user was being rung in was answered elsewhere—
CALL_CONNECTThe user should join a callcall connect object
CHANNEL_ACK 1Channels were read elsewhere—
ACTIVITY_STARTA friend started an activityactivity start object
APPLICATION_LIBRARY_INSTALL_COMPLETEAn application finished installingapplication library install complete object
STAGE_INSTANCE_CREATEA stage instance the user is notified about was createdstage instance create object
GUILD_SCHEDULED_EVENT_UPDATEA guild scheduled event the user is interested in startedguild scheduled event update object
GUILD_STREAM_STARTA user started streaming in a guild the user is notified aboutguild stream start object
GENERIC_PUSH_NOTIFICATION_SENT 2A notification with no dedicated payload was sentgeneric push notification object

1 These types retract notifications instead of displaying one; see acknowledging notifications.

2 This is used for notification types that have no dedicated handling in the client.

Message Create Structure
FieldTypeDescription
message? 1partial message objectThe message that was sent
message_idsnowflakeThe ID of the message that was sent
message_type_integerThe type of message that was sent
message_contentstringThe content of the message
message_flags?integerThe message's flags
message_reference_type?integerThe type of reference on the message
message_activity_type?integerThe type of activity request in the message
message_application_name?stringThe name of the application attached to the message
channel_idsnowflakeThe ID of the channel the message was sent in
channel_typeintegerThe type of channel the message was sent in
channel_namestringThe name of the channel the message was sent in
channel_icon??stringThe group DM's icon hash
is_spoiler_channel?booleanWhether the channel is a spoiler channel, meaning contents should be hidden until the notification is opened (default false)
app_dm?booleanWhether the channel is a DM with an application (default false)
guild_id?snowflakeThe ID of the guild the message was sent in
guild_name?stringThe name of the guild the message was sent in
guild_icon??stringThe guild's icon hash
user_idsnowflakeThe ID of the message's author
user_usernamestringThe username of the message's author
user_global_name??stringThe display name of the message's author
user_discriminator??integerThe author's discriminator
user_avatar??stringThe author's avatar hash
user_guild_avatar??stringThe author's guild avatar hash
is_from_current_user?booleanWhether the message was sent by the receiving user (default false)
__category?stringWhether the notification can be replied to inline (value of can_reply)
poll_question?stringThe question of the poll attached to the message
image_url?stringThe URL of the message's image attachment
image_url_ergo_android?stringThe URL of the message's image attachment, sized for Android
image_count?integerThe number of image attachments on the message
video_count?integerThe number of video attachments on the message
attachment_text_variant?integerThe attachment summary to display in place of the message's content
invite_guild_name? 2stringThe name of the guild the message invites the user to
invite_channel_name? 2stringThe name of the channel the message invites the user to
invite_title_variant? 2integerThe invite title to display in place of the author's name

1 Contains only the author, mentions, embeds, components, sticker_items, and poll fields.

2 Only sent for messages in a DM that invite the user to a guild.

Attachment Text Variant

Sent when the message's own content should not be shown.

ValueNameDescription
1SENT_AN_IMAGEThe message has a single image attachment
2SENT_IMAGESThe message has several image attachments, counted by image_count
3SENT_A_GIFThe message has a GIF attachment
4SENT_A_VIDEOThe message has a single video attachment
5SENT_VIDEOSThe message has several video attachments, counted by video_count
Invite Title Variant
ValueNameDescription
1SENDER_ONLYTitled as an invite from the message's author
2EMOJITitled as an invite from the message's author, with an emoji
Forum Thread Created Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the thread that was created
channel_namestringThe name of the thread that was created
parent_idsnowflakeThe ID of the forum channel the thread was created in
parent_namestringThe name of the forum channel the thread was created in
user_idsnowflakeThe ID of the user who created the thread
user_usernamestringThe username of the user who created the thread
user_avatar??stringThe user's avatar hash
user_guild_avatar??stringThe user's guild avatar hash
user_discriminator??integerThe user's discriminator
guild_id?snowflakeThe ID of the guild the thread was created in
guild_name?stringThe name of the guild the thread was created in
guild_icon??stringThe guild's icon hash
Relationship Add Structure
FieldTypeDescription
rel_typeintegerThe type of relationship that was created
user_idsnowflakeThe ID of the user the relationship is with
user_usernamestringThe username of the user the relationship is with
user_global_name??stringThe display name of the user the relationship is with
user_avatar??stringThe user's avatar hash
notification_type?stringThe tracking type of the reminder that produced the notification
since?ISO8601 timestampWhen the relationship was created
Friend Suggestion Create Structure
FieldTypeDescription
user_idsnowflakeThe ID of the suggested user
user_usernamestringThe username of the suggested user
user_avatar??stringThe suggested user's avatar hash
platform_typestringThe type of connection the suggestion is from
platform_name??stringThe name of the connection the suggestion is from
platform_user_usernamestringThe username of the suggested user on the connected account
Call Ring Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel the call is in
channel_typeintegerThe type of channel the call is in
channel_namestringThe name of the channel the call is in
channel_icon??stringThe channel's icon hash
rtc_region??stringThe voice region the call is hosted in
user_idsnowflakeThe ID of the user who is ringing
user_usernamestringThe username of the user who is ringing
user_avatar??stringThe ringing user's avatar hash
Call Connect Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel to join
guild_id?snowflakeThe ID of the guild the channel is in
user_id?snowflakeThe ID of the user who rang
is_fullscreen_call_ui? 1booleanWhether the call was answered from the system's full-screen call UI (default false)

1 Android only.

Activity Start Structure
FieldTypeDescription
activity_typeintegerThe type of activity that was started
activity_namestringThe name of the activity that was started
activity_instance_id?stringThe composite ID of the launched activity instance
application_id?snowflakeThe ID of the application the activity belongs to
application_name?stringThe name of the application the activity belongs to
application_icon??stringThe application's icon hash
user_id?snowflakeThe ID of the user who started the activity
user_username?stringThe username of the user who started the activity
user_avatar??stringThe user's avatar hash
Application Library Install Complete Structure
FieldTypeDescription
application_idsnowflakeThe ID of the application that finished installing
application_namestringThe name of the application that finished installing
application_icon??stringThe application's icon hash
Stage Instance Create Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the stage channel
guild_idsnowflakeThe ID of the guild the stage channel is in
stage_instance_topic?stringThe topic of the stage instance
Guild Stream Start Structure
FieldTypeDescription
channel_idsnowflakeThe ID of the channel being streamed in
guild_idsnowflakeThe ID of the guild the channel is in
user_idsnowflakeThe ID of the user who started streaming
Guild Scheduled Event Update Structure
FieldTypeDescription
guild_scheduled_event_idsnowflakeThe ID of the guild scheduled event
guild_scheduled_event_entity_typeintegerThe type of entity the event is hosted at
guild_idsnowflakeThe ID of the guild the event is in
channel_id? 1snowflakeThe ID of the channel the event is hosted in
channel_name?stringThe name of the channel the event is hosted in
channel_type?integerThe type of channel the event is hosted in
guild_scheduled_event_entity_id?snowflakeThe ID of the entity the event is hosted at
guild_scheduled_event_entity_name?stringThe name of the entity the event is hosted at
guild_name?stringThe name of the guild the event is in
guild_icon??stringThe guild's icon hash

1 Always present for events with a STAGE_INSTANCE or VOICE entity type. Clients ignore events hosted at any other kind of entity.

Generic Push Notification Structure
FieldTypeDescription
notification_type?stringThe type of notification that produced the push notification
deeplink? 1stringThe deep link to open when the notification is tapped
notification_id?stringThe ID of the notification
notification_center_id?snowflakeThe ID of the notification center item the notification was created from
guild_id?snowflakeThe ID of the guild the notification concerns
channel_id?snowflakeThe ID of the channel the notification concerns
message_id?snowflakeThe ID of the message the notification concerns
user_id?snowflakeThe ID of the user the notification concerns
status_text? 2stringThe custom status text of the user the notification concerns
status_emoji_id? 2 3?snowflakeThe ID of the custom emoji in the user's custom status
status_emoji_name? 2?stringThe unicode character of the emoji in the user's custom status
status_emoji_animated? 2booleanWhether the emoji in the user's custom status is animated (default false)

1 Deep links are a URL using either the discord:// protocol or a Discord hostname.

2 Only sent with ICYMI_SUMMARY notifications.

3 A value of 0 should be treated the same as a null value.

Notification Type

Every notification Discord can send has a type, independent of the push notification type used to deliver it. It is sent as notif_type_id, and determines which notification channel the notification is posted to and which user notification settings suppress it. Types with no dedicated handling in the client are delivered as GENERIC_PUSH_NOTIFICATION_SENT push notifications, which name their type in notification_type instead.

ValueNameDescription
1MESSAGE_CREATEA message was sent
2CALL_RINGThe user is being rung in a call
3RELATIONSHIP_ADDA relationship with the user was created
4FRIEND_SUGGESTION_CREATEA friend suggestion was created for the user
5APPLICATION_LIBRARY_INSTALL_COMPLETEAn application finished installing
6GUILD_STREAM_STARTA user started streaming in a guild
7STAGE_INSTANCE_CREATEA stage instance was created
8GUILD_SCHEDULED_EVENT_UPDATEA guild scheduled event started
9FORUM_THREAD_CREATEDA thread was created in a forum channel
10TOP_MESSAGES_PUSHA digest of top messages from a frequently read guild
11MISSED_MESSAGE_PUSHMissed messages from a frequently read channel
13FRIEND_REQUEST_REMINDER_PUSHA reminder about pending friend requests
14HOME_LIFECYCLE_PUSHA new user tutorial item
15POLL_ENDED_PUSHA poll the user participated in ended
16NUDGE_NEW_FRIEND_DM_PUSHA reminder to message a new friend
17FAMILY_CENTER_REQUEST_SENDA family center link request was sent
18FAMILY_CENTER_REQUEST_ACCEPTEDA family center link request was accepted
19FAMILY_CENTER_REQUEST_DECLINEDA family center link request was declined
20FAMILY_CENTER_DISCONNECTEDA family center link was disconnected
21GUILD_JOIN_REQUEST_APPROVEDA guild join request was approved
22GUILD_JOIN_REQUEST_REJECTEDA guild join request was rejected
23REACTIONS_PUSH_NOTIFICATIONA reaction was added to the user's message
24RAID_DETECTEDA raid was detected in a guild the user moderates
25MENTION_RAID_DETECTEDA mention raid was detected in a guild the user moderates
26DM_SPAM_DETECTEDDM spam was detected in a guild the user moderates
27SUSPICIOUS_SESSIONA suspicious session was detected on the user's account
28NEW_USER_SESSIONA new session was started on the user's account
29MESSAGE_REMINDER_DUEA message reminder the user set is due
30ICYMI_SUMMARYA summary of activity the user missed
31CHANNEL_PROMPT_DEADCHATA prompt to revive an inactive channel
32REACTION_TRENDING_PUSH_NOTIFICATIONA reaction on the user's message is trending
33SUMMONS_DIRECTUnknown
34ADMIN_NOTIFICATION_PUSHA notification sent by a guild's administrators
35VOICE_CHANNEL_ACTIVITYFriends are active in a voice channel
36MISSED_MESSAGE_EMAIL 1Missed messages from a frequently read channel
37CUSTOM_STATUS_UPDATEA friend updated their custom status
38GO_LIVE_NOTIFICATIONA friend started streaming
39FRIEND_GAMING_ACTIVITY_PUSHA friend started playing a game
40USER_RESURRECTION_NOTIFICATIONA friend returned to Discord after a long break
41FRIEND_ONLINE_PUSHA friend came online
42INVITE_REMINDER_PUSHUnknown
43SERVER_TRENDING_NOTIFICATIONA guild is trending
44MESSAGE_PINA message was pinned
45PROFILE_UPDATES_NOTIFICATIONA friend updated their profile
46SUMMARY_REMINDERA reminder about a recent conversation summary
47TRIAL_FOR_ALL_REMINDERA reminder about an on-going trial promotion
48FRIENDS_PLAYING_GAMEFriends are playing a game
49REFERRAL_PROGRAM_PUSH_NOTIF_ENTRYPOINT_REMINDERA reminder about the referral program
50REFERRAL_PROGRAM_NOTIF_CENTER_ENTRYPOINT_REMINDERA notification center reminder about the referral program
51GAME_UPDATEOne of the user's games was updated
52VOICE_CHANNEL_INVITEThe user was invited to a voice channel
53GUILD_SCHEDULED_EVENT_UPCOMINGA guild scheduled event is starting soon
54FAMILY_CENTER_RESTRICTED_SCHEDULE_UPDATEDA family center restricted schedule was updated
55VOICE_CHANNEL_ACTIVITY_PEAK_AFFINITYThe user's closest friends are active in a voice channel
56PARENTAL_CONSENT_FINAL_WARNINGA final warning about outstanding parental consent
57MESSAGE_REQUESTThe user received a message request
58FRIENDS_PLAYING_TRENDING_GAMEFriends are playing a trending game

1 Delivered by email rather than as a push notification.

Tracking Type
ValueDescription
generic_friend_request_reminderA reminder about pending friend requests
generic_home_featured_messageA featured message from a guild's home feed
generic_missed_messageMissed messages from a frequently read channel
GUILD_STREAM_STARTA user started streaming in a guild
home_lifecycle_pushA new user tutorial item
new_user_sessionA new session was started on the user's account
nudge_new_friend_dm_pushA reminder to message a new friend
poll_endedA poll the user participated in ended
reactions_push_notificationA reaction was added to the user's message
reminderA reminder about pending friend requests
suspicious_sessionA suspicious session was detected
top_messages_pushA digest of top messages
trending_content_pushA digest of trending content
Example Push Notification
{
"aps": {
"alert": { "title": "general (My Cool Server)", "body": "hey, are you around?" },
"sound": "default",
"badge": 3
},
"type": "MESSAGE_CREATE",
"notif_type_id": "1",
"notif_instance_id": "1536922843542192241",
"sent_at_ms": "1786502869340",
"channel_id": "1029315212521771020",
"channel_type": "0",
"channel_name": "general",
"guild_id": "1029315212005888060",
"guild_name": "My Cool Server",
"guild_icon": "546242649e3b09a97af7e8f29983837b",
"message_id": "1536922843542192240",
"message_type_": "0",
"message_content": "hey, are you around?",
"user_id": "852892297661906993",
"user_username": "dolfies",
"user_global_name": "Dolfies",
"user_avatar": "14733482e560d9267c0a414b21b2fb8d",
"__category": "can_reply"
}

Acknowledging Notifications

Discord retracts notifications it has already sent by sending another push notification. These types never display anything:

  • CHANNEL_ACK: the channels in channel_ids were read on another device
  • CALL_ACK: the call in the channels in channel_ids was answered on another device
  • CALL_RING_END: the user is no longer being rung in the channels in channel_ids

sent_at_ms is the acknowledgement time. Clients should convert it to a snowflake and dismiss the notifications for each acknowledged channel whose newest message is older than it, leaving anything that arrived after the acknowledgement was sent in place. A notification the user has already replied to inline is kept and re-rendered as replied rather than dismissed.

CALL_RING_END is handled differently: rather than being dismissed, the ringing notification is replaced with a silent missed call notification.

Notification Channels

Android requires every notification to be posted to a notification channel, which the user can configure or disable individually. Channels are gathered into groups in the system settings UI.

Clients register the channels below with the operating system on startup, and pick one for each notification from its notif_type_id.

Notification Channel
ValueGroupImportanceDescription
calls 1111_realtime4Incoming calls
mediaConnections111_realtime3Voice connected
gameDetection111_realtime1Game detection
directMessages222_social4Direct messages
friendRequests222_social4Friend requests
reactions222_social3Reactions
polls222_social3Polls
social222_social2Social
messages333_server4Messages
forumThreadCreated333_server4Forum notifications
guildEventLive333_server4Event notifications
guildHighlights333_server4Server highlights
stageLive333_server4Stage notifications
other333_server2Other server notifications
systemMessages444_other4Discord system messages
otherHighPriority444_other4Other (high priority)
default444_other2Other

1 Clients that support custom call ringtones register one channel per ringtone, named calls_{ringtone} (i.e. calls_default and calls_halloween).

Notification Channel Group
ValueDescription
111_realtimeReal-time
222_socialFriends and DMs
333_serverGuilds
444_otherEverything else
Default Notification Channel Mapping
Notification typeChannel
1directMessages in DMs, messages in guilds
3friendRequests
4, 6, 13, 16social
7stageLive
8guildEventLive
9forumThreadCreated
10, 11, 14other
15polls
23reactions
27, 28systemMessages
Anything elsedefault

CALL_RING and CALL_RING_END push notifications are always posted to the call channel, regardless of their notification type.

VOIP Notifications

Incoming calls on iOS are delivered over PushKit rather than APNs, so the system's native call UI can be presented before the app is running. These notifications use a payload of their own, unrelated to the one above.

VOIP Push Notification Structure
FieldTypeDescription
idstringThe UUID of the call, used as the CallKit call identifier
typestringThe type of VOIP push notification
channel_idsnowflakeThe ID of the channel the call is in
user_idsnowflakeThe ID of the user who is ringing
native_phone_namestringThe caller name to display in the system call UI
VOIP Push Notification Type
ValueDescription
CALL_RINGThe user is being rung in a call
CALL_RING_ENDThe user is no longer being rung

Clients register the call with the system as discord:{channel.id}.{channel.type}.{recipient.id} for DMs, and discord:{channel.id}.{channel.type}.{guild.id} otherwise.

Endpoints

Register Device

POST/users/@me/devices

Registers an FCM/APNs push notification token for the client's device. Returns a 204 empty response on success.

JSON Params
FieldTypeDescription
providerstringThe push notification provider of the device
tokenstringThe push notification token to register
voip_provider? 1stringThe VOIP push notification provider of the device
voip_token? 1stringThe VOIP push notification token to register
bypass_server_throttling_supported?booleanWhether the client supports bypassing server throttling for push notifications (default false)
bundle_id?stringThe bundle ID of the app (default com.discord)

1 VOIP-specific push notification tokens are only used with PushKit on iOS.

Unregister Device

DELETE/users/@me/devices

Unregisters an FCM/APNs push notification token for the client's device. Returns a 204 empty response on success.

JSON Params
FieldTypeDescription
providerstringThe push notification provider of the device
tokenstringThe push notification token to unregister

Get Device Sync Token

GET/users/@me/devices/sync-token

Returns a push notification sync token for the current user. This token can be used to synchronize push notification tokens across multiple accounts.

Response Body
FieldTypeDescription
tokenstringThe push notification sync token
Example Response
{ "token": "ODUyODkyMjk3NjYxOTA2OTkz.ZfoufA.rHvCtpfHjr9kdRab1ZTl83PRhhZ" }

Sync Devices

PUT/users/@me/devices/sync

Synchronizes the client's FCM/APNs push notification token across multiple accounts.

JSON Params
FieldTypeDescription
providerstringThe push notification provider of the device
tokenstringThe device push notification token
push_sync_tokens 1array[string]Device sync tokens for each account

1 A device sync token can be obtained for each account using the Get Device Sync Token endpoint.

Response Body
FieldTypeDescription
invalid_push_sync_tokensarray[string]Device sync tokens that are invalid
Example Response
{ "invalid_push_sync_tokens": ["ODUyODkyMjk3NjYxOTA2OTkz.ZfoufA.rHvCtpfHjr9kdRab1ZTl83PRhhZ"] }