Mastodon
  • What is Mastodon?
  • Using Mastodon
    • Signing up for an account
    • Setting up your profile
    • Posting toots
    • 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
      • 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
    • Guidelines and best practices
    • 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
    • OAuth Scopes
    • Rate limits
  • API Methods
    • apps
      • oauth
    • accounts
      • bookmarks
      • favourites
      • mutes
      • blocks
      • domain_blocks
      • filters
      • reports
      • follow_requests
      • endorsements
      • featured_tags
      • preferences
      • suggestions
    • statuses
      • media
      • polls
      • scheduled_statuses
    • timelines
      • conversations
      • lists
      • markers
      • streaming
    • notifications
      • push
    • search
    • instance
      • trends
      • directory
      • custom_emojis
    • admin
    • announcements
    • proofs
    • oembed
  • API Entities
    • Account
    • Activity
    • Admin::Account
    • Admin::Report
    • Announcement
    • AnnouncementReaction
    • Application
    • Attachment
    • Card
    • Context
    • Conversation
    • Emoji
    • Error
    • FeaturedTag
    • Field
    • Filter
    • History
    • IdentityProof
    • Instance
    • List
    • Marker
    • Mention
    • Notification
    • Poll
    • Preferences
    • PushSubscription
    • Relationship
    • Report
    • Results
    • ScheduledStatus
    • Source
    • Status
    • Tag
    • Token

follow_requests

View and manage follow requests.

get
Pending Follows

https://mastodon.example/api/v1/follow_requests

Returns: Array of Account
OAuth: User token + read:follows or follow
Version history:
0.0.0 - added

Request

Headers
Authorization
required
string
Bearer <user token>
Query Parameters
limit
optional
string
Maximum number of results to return. Defaults to 40. Paginate using the HTTP Link header.

Response

200: Success

Accounts that are requesting a follow

Link: <https://mastodon.social/api/v1/follow_requests?max_id=23716836>; rel="next", <https://mastodon.social/api/v1/follow_requests?min_id=23716978>; rel="prev"

[
  {
    "id": "8889777",
    "username": "example",
    "acct": "example@social.example",
    ...
  }
]

401: Unauthorized

Invalid or missing Authorization header

{
  "error": "The access token is invalid"
}

post
Accept Follow

https://mastodon.example/api/v1/follow_requests/:id/authorize

Returns: Relationship
OAuth: User token + write:follows or follow
Version history:
0.0.0 - added
3.0.0 - now returns Relationship instead of nothing

Request

Path Parameters
:id
optional
string
ID of the account in the database
Headers
Authorization
required
string
Bearer <user token>

Response

200: Success

Your Relationship with this account should be updated so that you are followed_by this account.

{
  "id": "8889777",
  "following": false,
  "showing_reblogs": false,
  "followed_by": true,
  "blocking": false,
  "blocked_by": false,
  "muting": false,
  "muting_notifications": false,
  "requested": false,
  "domain_blocking": false,
  "endorsed": false
}

401: Unauthorized

Invalid or missing Authorization header

{
  "error": "The access token is invalid"
}

404: Not Found

No pending follow request from that user ID

{
  "error": "Record not found"
}

post
Reject Follow

https://mastodon.example/api/v1/follow_requests/:id/reject

Returns: Relationship
OAuth: User token + write:follows or follow
Version history:
0.0.0 - added
3.0.0 - now returns Relationship instead of nothing

Request

Path Parameters
:id
optional
string
ID of the account in the database
Headers
Authorization
required
string
Bearer <user token>

Response

200: Success

Your Relationship with this Account should be unchanged.

{
  "id": "8889777",
  "following": false,
  "showing_reblogs": false,
  "followed_by": false,
  "blocking": false,
  "blocked_by": false,
  "muting": false,
  "muting_notifications": false,
  "requested": false,
  "domain_blocking": false,
  "endorsed": false
}

401: Unauthorized

Invalid or missing Authorization header

{
  "error": "The access token is invalid"
}

404: Not Found

No pending follow request for that user ID

{
  "error": "Record not found"
}

Last updated December 27, 2020 · Improve this page

Sponsored by

Dotcom-Monitor LoadView Stephen Tures Swayable

Join Mastodon · Blog · ·

View source · CC BY-SA 4.0 · Imprint