Mastodon
  • What is Mastodon?
  • Using Mastodon
    • Signing up for an account
    • Setting up your profile
    • Posting to your profile
    • Using the network features
    • Dealing with unwanted content
    • Promoting yourself and others
    • Set your preferences
    • More settings
    • Using Mastodon externally
    • Moving or leaving accounts
    • Running your own server
  • Running Mastodon
    • Preparing your machine
    • Installing from source
    • Configuring your environment
    • Installing optional features
      • Full-text search
      • Configuring object storage
      • Hidden services
      • Single Sign On
    • Setting up your new instance
    • Using the admin CLI
    • Upgrading to a new release
    • Backing up your server
    • Migrating to a new machine
    • Scaling up your server
    • Moderation actions
    • Troubleshooting errors
      • Database index corruption
  • Developing Mastodon apps
    • Getting started with the API
    • Playing with public data
    • Obtaining client app access
    • Logging in with an account
    • Libraries and implementations
  • Contributing to Mastodon
    • Technical overview
    • Setting up a dev environment
    • Code structure
    • Routes
    • Bug bounties and responsible disclosure
  • Spec compliance
    • ActivityPub
    • WebFinger
    • Security
    • Microformats
    • OAuth
    • Bearcaps
  • REST API
    • Guidelines and best practices
    • OAuth Scopes
    • Rate limits
  • API Methods
    • apps
      • oauth
      • emails
    • accounts
      • bookmarks
      • favourites
      • mutes
      • blocks
      • domain_blocks
      • filters
      • reports
      • follow_requests
      • endorsements
      • featured_tags
      • preferences
      • followed_tags
      • suggestions
      • tags
    • statuses
      • media
      • polls
      • scheduled_statuses
    • timelines
      • conversations
      • lists
      • markers
      • streaming
    • notifications
      • push
    • search
    • instance
      • trends
      • directory
      • custom_emojis
      • announcements
    • admin
      • admin/accounts
      • admin/domain_blocks
      • admin/reports
      • admin/trends
      • canonical_email_blocks
      • dimensions
      • domain_allows
      • email_domain_blocks
      • ip_blocks
      • measures
      • retention
    • proofs
    • oembed
  • API Entities
    • Account
    • Admin::Account
    • Admin::CanonicalEmailBlock
    • Admin::Cohort
    • Admin::Dimension
    • Admin::DomainAllow
    • Admin::DomainBlock
    • Admin::EmailDomainBlock
    • Admin::Ip
    • Admin::IpBlock
    • Admin::Measure
    • Admin::Report
    • Announcement
    • Application
    • Context
    • Conversation
    • CustomEmoji
    • DomainBlock
    • Error
    • ExtendedDescription
    • FamiliarFollowers
    • FeaturedTag
    • Filter
    • FilterKeyword
    • FilterResult
    • FilterStatus
    • IdentityProof
    • Instance
    • List
    • Marker
    • MediaAttachment
    • Notification
    • Poll
    • Preferences
    • PreviewCard
    • Reaction
    • Relationship
    • Report
    • Role
    • Rule
    • ScheduledStatus
    • Search
    • Status
    • StatusEdit
    • StatusSource
    • Suggestion
    • Tag
    • Token
    • Translation
    • V1::Filter
    • V1::Instance
    • WebPushSubscription

WebPushSubscription

Represents a subscription to the push streaming server.

    • Example
    • Attributes
      • id
      • endpoint
      • server_key
      • alerts
    • See also

Example

{
  "id": 328183,
  "endpoint": "https://yourdomain.example/listener",
  "alerts": {
    "follow": false,
    "favourite": false,
    "reblog": false,
    "mention": true,
    "poll": false
  },
  "server_key": "BCk-QqERU0q-CfYZjcuB6lnyyOYfJ2AifKqfeGIm7Z-HiTU5T9eTG5GxVA0_OH5mMlI4UkkDTpaZwozy0TzdZ2M="
}

Attributes

id

Description: The ID of the Web Push subscription in the database.
Type: String (cast from an integer, but not guaranteed to be a number)
Version history:
2.4.0 - added

endpoint

Description: Where push alerts will be sent to.
Type: String (URL)
Version history:
2.4.0 - added

server_key

Description: The streaming server’s VAPID key.
Type: String
Version history:
2.4.0 - added

alerts

Description: Which alerts should be delivered to the endpoint.
Type: Hash
Version history:
2.4.0 - added
2.8.0 - added alerts[poll]
3.1.0 - added alerts[follow_request]
3.3.0 - added alerts[status]
3.5.0 - added alerts[update] and alerts[admin.sign_up]
4.0.0 - added alerts[admin.report]

alerts[mention]

Description: Receive a push notification when someone else has mentioned you in a status?
Type: Boolean
Version history:
2.4.0 - added

alerts[status]

Description: Receive a push notification when a subscribed account posts a status?
Type: Boolean
Version history:
3.3.0 - added

alerts[reblog]

Description: Receive a push notification when a status you created has been boosted by someone else?
Type: Boolean
Version history:
2.4.0 - added

alerts[follow]

Description: Receive a push notification when someone has followed you?
Type: Boolean
Version history:
2.4.0 - added

alerts[follow_request]

Description: Receive a push notification when someone has requested to followed you?
Type: Boolean
Version history:
3.1.0 - added

alerts[favourite]

Description: Receive a push notification when a status you created has been favourited by someone else?
Type: Boolean
Version history:
2.4.0 - added

alerts[poll]

Description: Receive a push notification when a poll you voted in or created has ended?
Type: Boolean
Version history:
2.8.0 - added

alerts[update]

Description: Receive a push notification when a status you interacted with has been edited?
Type: Boolean
Version history:
3.5.0 - added

alerts[admin.sign_up]

Description: Receive a push notification when a new user has signed up?
Type: Boolean
Version history:
3.5.0 - added

alerts[admin.report]

Description: Receive a push notification when a new report has been filed?
Type: Boolean
Version history:
4.0.0 - added

See also

push API methods
app/serializers/rest/web_push_subscription_serializer.rb

Last updated November 20, 2022 路 Improve this page

Sponsored by

Dotcom-Monitor LoadView Stephen Tures Swayable SponsorMotion

Join Mastodon 路 Blog 路 路

View source 路 CC BY-SA 4.0 路 Imprint