AuthenticatedXrpcBlueskyApi
Wrapper around XrpcBlueskyApi to transparently manage session tokens on the user's behalf.
This class is responsible for saving and restoring session tokens from the server's responses. The session will also automatically be refreshed and retried using the refresh token if any method call results in an ExpiredToken error. Use of one of the following methods will automatically start a session and save the tokens:
A session can also be manually activated by invoking the activateBearerTokens or activateOAuth methods.
Use of deleteSession (for Bearer auth) or deleteOAuthSession (for OAuth) will clear the session. The session can also be manually cleared by calling clearCredentials which will remove, but not invalidate, the current session tokens.
Constructors
Creates a new instance of AuthenticatedXrpcBlueskyApi
Properties
Functions
Marks a conversation as accepted, so it is shown in the list of accepted convos instead on the request convos.
Activates a currently deactivated account. Used to finalize account migration after the account's repo is imported and identity is setup.
Activates the Bearer session using the provided tokens. This will save the access and refresh tokens. Rotation of the tokens is handled automatically.
Activates the OAuth session using the provided OAuthToken. This will save the OAuth access and refresh tokens, as well as the PDS URL, key pair, client ID, and nonce. Rotation of the DPoP nonce is handled automatically.
Add a member to the ozone team. Requires admin role.
NOTE: This is under active development and should be considered unstable while this note is here. Adds members to a group. The members are added in 'request' status, so they have to accept it. This creates convo memberships.
Adds an emoji reaction to a message. Requires authentication. It is idempotent, so multiple calls from the same user with the same emoji result in a single reaction.
Add a handle to the set of reserved handles.
Add a new URL safety rule
Add values to a specific set. Attempting to add values to a set that does not exist will result in an error.
Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS.
NOTE: This is under active development and should be considered unstable while this note is here. Approves a request to join a group (via join link) the user owns. Action taken by the group owner.
Assign a user to a queue.
Assign a report to a user. Defaults to the caller. Admins may assign to any moderator.
Initiate Age Assurance for an account.
Cancel all pending scheduled moderation actions for specified subjects
Returns the status of an account, especially as pertaining to import or recovery. Can be called many times over the course of an account migration. Requires auth and can only be called pertaining to oneself.
Checks whether the provided handle is available. If the handle is not available, available suggestions will be returned. Optional inputs will be used to generate suggestions.
Check accounts location in signup queue.
Clears the current session tokens, effectively logging the user out. Note that any previously-cached tokens are not invalidated on the server side, unlike calling deleteSession.
Confirm an email using a token from com.atproto.server.requestEmailConfirmation.
Create an account. Implemented by PDS.
Register an activity on a report. For state-change activity types, validates the transition and updates report.status atomically.
Create an App Password.
Creates a private bookmark for the specified record. Currently, only app.bsky.feed.post records are supported. Requires authentication.
Inserts a draft using private storage (stash). An upper limit of drafts might be enforced. Requires authentication.
NOTE: This is under active development and should be considered unstable while this note is here. Creates a group convo, specifying the members to be added to it. Unlike getConvoForMembers, this isn't idempotent. It will create new groups even if the membership is identical to pre-existing groups. Will create 'request' membership for all members, except the owner who is 'accepted'.
Create an invite code.
Create invite codes.
NOTE: This is under active development and should be considered unstable while this note is here. Creates a join link for the group convo.
Create a new moderation queue. Will fail if the queue configuration conflicts with an existing queue.
Create a single new repository record. Requires auth, implemented by PDS.
Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth.
Create an authentication session.
Administrative action to create a new, re-usable communication (email for now) template.
Deactivates a currently active account. Stops serving of repo, and future writes to repo until reactivated. Used to finalize account migration with the old host after the account has been activated on the new host.
Delete a user account as an administrator.
Delete an actor's account with a token and password. Can only be called after requesting a deletion token. Requires auth.
Deletes a private bookmark for the specified record. Currently, only app.bsky.feed.post records are supported. Requires authentication.
Deletes a draft by ID. Requires authentication.
Delete a member from ozone team. Requires admin role.
Marks a message as deleted for the viewer, so they won't see that message in future enumerations.
Revoke the current oauthToken using the OAuth server's revocation endpoint.
Delete a moderation queue. Optionally migrate reports to another queue.
Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS.
Delete the current session. Requires auth using the 'refreshJwt' (not the 'accessJwt').
Delete an entire set. Attempting to delete a set that does not exist will result in an error.
Delete a communication template.
Delete values from a specific set. Attempting to delete values that are not in the set will not result in an error
Allows finding the oauth permission scope from a reference
Get information about a feed generator, including policies and offered feed URIs. Does not require auth; implemented by Feed Generator services (not App View).
Get information about an account and repository, including the list of collections. Does not require auth.
Describes the server's account creation requirements and capabilities. Implemented by PDS.
Disable an account from receiving new invite codes, but does not invalidate existing codes.
Disable some set of codes and/or all codes associated with a set of users.
NOTE: This is under active development and should be considered unstable while this note is here. Disables the active join link for the group convo.
Removes a match that was found via contact import. It shouldn't appear again if the same contact is re-imported. Requires authentication.
NOTE: This is under active development and should be considered unstable while this note is here. Edits group settings.
NOTE: This is under active development and should be considered unstable while this note is here. Edits the existing join link settings for the group convo.
Take a moderation action on an actor.
Re-enable an account's ability to receive invite codes.
NOTE: This is under active development and should be considered unstable while this note is here. Re-enables a previously disabled join link for the group convo.
Find all correlated threat signatures between 2 or more accounts.
Get accounts that share some matching threat signatures with the root account.
Get account history, e.g. log of updated email addresses or other identity information.
Get details about an account.
Get details about some accounts.
Get all invite codes for the current account. Requires auth.
Get timeline of all available events of an account. This includes moderation events, account history and did history.
Get a list of feeds (feed generator records) created by the actor (in the actor's repo).
Get a list of posts liked by an actor. Requires auth, actor must be the requesting account.
Get a list of starter packs created by the actor.
Returns the current state of the age assurance process for an account. This is used to check if the user has completed age assurance or if further action is required.
Get moderator assignments, optionally filtered by active status, queue, or moderator.
Get assignments for reports.
Get a view of an actor's 'author feed' (post and reposts by the author). Does not require auth.
Get a blob associated with a given account. Returns the full blob as originally uploaded. Does not require auth; implemented by PDS.
Enumerates which accounts the requesting account is currently blocking. Requires auth.
Get data blocks from a given repo, by CID. For example, intermediate MST nodes, or records. Does not require auth; implemented by PDS.
Gets views of records bookmarked by the authenticated user. Requires authentication.
Returns Age Assurance configuration for use on the client.
Get details about ozone's server configuration.
Get miscellaneous runtime configuration.
Gets an existing conversation by its ID.
NOTE: This is under active development and should be considered unstable while this note is here. Gets an existing conversation by its ID, for moderation purposes. Does not require the requester to be a member of the conversation.
Check whether the requester and the other members can start a 1-1 chat. Only applicable to direct (non-group) conversations. If an existing convo is found for these members, it is returned. Does not create a new convo if it doesn't exist.
Get or create a 1-1 conversation for the given members. Always returns the same direct (non-group) conversation. To create a group conversation, use createGroup.
Returns a paginated list of members from a conversation.
NOTE: This is under active development and should be considered unstable while this note is here. Returns a paginated list of members from a conversation, for moderation purposes. Does not require the requester to be a member of the conversation.
NOTE: This is under active development and should be considered unstable while this note is here. Gets existing conversations by their IDs, for moderation purposes. Does not require the requester to be a member of the conversations. Unknown IDs are silently omitted from the response.
Gets views of user drafts. Requires authentication.
Resolve one or more AT-URIs into the data needed to render an enhanced external embed. Returns associatedRefs (strongRefs to embed into a post's external.associatedRefs), the raw associatedRecords, and a hydrated view. The response is empty ({}) when no records were resolvable, or when validation determined the resolved records don't actually back the requested URL; clients should fall back to their own link-card rendering in that case and skip writing strongRefs to the post.
Get details about a moderation event.
Get a hydrated feed from an actor's selected feed generator. Implemented by App View.
Get information about a feed generator. Implemented by AppView.
Get information about a list of feed generators.
Get a skeleton of a feed provided by a feed generator. Auth is optional, depending on provider requirements, and provides the DID of the requester. Implemented by Feed Generator Service.
Enumerates accounts which follow a specified account (actor).
Enumerates accounts which a specified account (actor) follows.
Get historical daily report statistics. Returns a paginated list of daily stat snapshots, newest first. Filter by queue, moderator, or report type.
Returns information about a specified upstream host, as consumed by the server. Implemented by relays.
Get an admin view of invite codes.
Get status details for a video processing job.
NOTE: This is under active development and should be considered unstable while this note is here. Get public information about groups from join links. The output array matches the input codes one-to-one by position (and each view also carries its 'code'). Disabled codes return a disabledJoinLinkPreviewView, and codes that do not map to a previewable link return an invalidJoinLinkPreviewView.
Enumerates accounts which follow a specified account (actor) and are followed by the viewer.
Get the current commit CID & revision of the specified repo. Does not require auth.
Get the most recent report.
Get like records which reference a subject (by AT-URI and CID).
Gets a 'view' (with additional context) of a specified list.
Get mod lists that the requesting account (actor) is blocking. Requires auth.
Get a feed of recent posts from a list (posts and reposts from any actors on the list). Does not require auth.
Enumerates mod lists that the requesting account (actor) currently has muted. Requires auth.
Enumerates the lists created by a specified account (actor).
Enumerates the lists created by the session user, and includes membership information about actor in those lists. Only supports curation and moderation lists (no reference lists, used in starter packs). Requires auth.
Get live report statistics from the past 24 hours. Filter by queue, moderator, or report type. Omit all parameters for aggregate stats.
Returns the matched contacts (contacts that were mutually imported). Excludes dismissed matches. Requires authentication.
Returns a page of messages from a conversation.
Enumerates accounts that the requesting account (actor) currently has muted. Requires auth.
Get a skeleton of suggested starterpacks for onboarding. Intended to be called and hydrated by app.bsky.unspecced.getOnboardingSuggestedStarterPacks
Get a list of suggested starterpacks for onboarding
Get a skeleton of suggested users for onboarding. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedOnboardingUsers
An unspecced view of globally popular feed generators.
Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'.
Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed requests.
(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of unspecced or your application WILL break) Get additional posts under a thread e.g. replies hidden by threadgate. Based on an anchor post at any depth of the tree, returns top-level replies below that anchor. It does not include ancestors nor the anchor itself. This should be called after exhausting app.bsky.unspecced.getPostThreadV2. Does not require auth, but additional metadata and filtering will be applied for authed requests.
(NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of unspecced or your application WILL break) Get posts in a thread. It is based in an anchor post at any depth of the tree, and returns posts above it (recursively resolving the parent, without further branching to their replies) and below it (recursive replies, with branching to their replies). Does not require auth, but additional metadata and filtering will be applied for authed requests.
Get private preferences attached to the current account. Expected use is synchronization between multiple devices, and import/export during account migration. Requires auth.
Get notification-related preferences for an account. Requires auth.
Get detailed profile view of an actor. Does not require auth, but contains relevant metadata with auth.
Get detailed profile views of multiple actors.
Get detailed profile views of multiple actors, hydrating social proof (known followers) only for a subset of them. Intended for internal service-to-service use.
Get a list of quotes for a given post.
Describe the credentials that should be included in the DID doc of an account that is migrating to this service.
Get a single record from a repository. Does not require auth.
Get data blocks needed to prove the existence or non-existence of record in the current version of repo. Does not require auth.
Get details about a record.
Get details about some records.
Enumerates public relationships between one account, and a list of other accounts. Does not require auth.
Download a repository export as CAR file. Optionally only a 'diff' since a previous revision. Does not require auth; implemented by PDS.
Get details about a repository.
Get details about a single moderation report by ID.
Get reporter stats for a list of users.
Get details about some repositories.
Get the hosting status for a repository, on this server. Expected to be implemented by PDS and Relay.
Get a list of reposts for a given post.
Get a signed token on behalf of the requesting DID for the requested service.
Get information about a list of labeler services.
Get information about the current auth session. Requires auth.
Gets a view of a starter pack.
Get views for a list of starter packs.
Enumerates the starter packs created by the session user, and includes membership information about actor in those starter packs. Requires auth.
Returns server-computed Age Assurance state, if available, and any additional metadata needed to compute Age Assurance state client-side.
Get the authenticated viewer's chat status: whether their account is chat-disabled and whether their group-membership additions are restricted to accounts they follow.
Get details about subjects.
Get the service-specific admin status of a subject (account, record, or blob).
Get a list of suggested feeds (feed generators) for the requesting account.
Get a skeleton of suggested feeds. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedFeeds
Get a list of suggested feeds
Enumerates follows similar to a given account (actor). Expected use is to recommend additional accounts immediately after following one account.
Get a list of suggested users for onboarding
Get a skeleton of suggested starterpacks. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedStarterpacks
Get a list of suggested starterpacks
Get a skeleton of suggested users for the Discover page. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedUsersForDiscover
Get a list of suggested users for the Discover page
Get a skeleton of suggested users for the Explore page. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedUsersForExplore
Get a list of suggested users for the Explore page
Get a skeleton of suggested users for the See More page. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedUsersForSeeMore
Get a list of suggested users for the See More page
Get a skeleton of suggested users. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedUsers
Get a list of suggested users
Get a list of suggested actors. Expected use is discovery of accounts to follow during new account onboarding.
Get a skeleton of suggested actors. Intended to be called and then hydrated through app.bsky.actor.getSuggestions
Gets the user's current contact import status. Requires authentication.
Get a list of suggestions (feeds and users) tagged with categories
Get a view of the requesting account's home timeline. This is expected to be some form of reverse-chronological feed.
Get a list of trending topics
Get the skeleton of trends on the network. Intended to be called and then hydrated through app.bsky.unspecced.getTrends
Get the current trends on the network
Count the number of unread notifications for the requesting account. Requires auth.
Returns unread conversation counts equivalent to one page of chat.bsky.convo.listConvos with readState=unread and lockStatus=unlocked, split by convo status. The combined total is capped at 31, where 31 means more than 30.
Get video upload limits for the authenticated user.
Get a specific set and its values
Grant verifications to multiple subjects. Allows batch processing of up to 100 verifications at once.
Import contacts for securely matching with other users. This follows the protocol explained in https://docs.bsky.app/blog/contact-import-rfc. Requires authentication.
Import a repo in the form of a CAR file. Requires Content-Length HTTP header to be set.
Initiate age assurance for an account. This is a one-time action that will start the process of verifying the user's age.
Leaves a conversation (direct or group). For group, this effectively removes membership. For direct, membership is never removed, only changed to remove from enumerations by the user who left.
List all activities for a report, sorted most-recent-first.
Enumerate all accounts to which the requesting account is subscribed to receive notifications for. Requires auth.
List all App Passwords.
List blob CIDs for an account, since some repo revision. Does not require auth; implemented by PDS.
NOTE: This is under active development and should be considered unstable while this note is here. Returns a page of incoming conversation requests for the user. Direct convo requests are returned as convoView; group join requests made by the user are returned as joinRequestConvoView.
Returns a page of conversations (direct or group) for the user.
Enumerates upstream hosts (eg, PDS or relay instances) that this service consumes from. Implemented by relays.
NOTE: This is under active development and should be considered unstable while this note is here. Lists a page of request to join a group (via join link) the user owns. Shows the data from the owner's point of view.
List all members with access to the ozone service.
Returns a list of missing blobs for the requesting account. Intended to be used in the account migration flow.
NOTE: This is under active development and should be considered unstable while this note is here. Returns a page of group conversations that both the requester and the specified actor are members of.
Enumerate notifications for the requesting account. Requires auth.
List settings with optional filtering
List all configured moderation queues with statistics.
List a range of records in a repository, matching a specific collection. Does not require auth.
Enumerates all the DID, rev, and commit CID for all repos hosted by this service. Does not require auth; implemented by PDS and Relay.
Enumerates all the DIDs which have records with the given collection NSID.
List scheduled moderation actions with optional filtering
Get list of all communication templates.
List verifications
NOTE: This is under active development and should be considered unstable while this note is here. Locks a group convo so no more content (messages, reactions) can be added to it.
Creates a mute relationship for the specified account. Mutes are private in Bluesky. Requires auth.
Creates a mute relationship for the specified list of accounts. Mutes are private in Bluesky. Requires auth.
Mutes a conversation, preventing notifications related to it.
Mutes a thread preventing notifications from the thread and any of its children. Mutes are private in Bluesky. Requires auth.
Notify a crawling service of a recent update, and that crawling should resume. Intended use is after a gap between repo stream events caused the crawling service to disconnect. Does not require auth; implemented by Relay. DEPRECATED: just use com.atproto.sync.requestCrawl
Puts an activity subscription entry. The key should be omitted for creation and provided for updates. Requires auth.
Set the private preferences attached to the account.
Set notification-related preferences for an account. Requires auth.
Set notification-related preferences for an account. Requires auth.
Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS.
List moderation events related to a subject.
Query URL safety audit events
Find labels relevant to the provided AT-URI patterns. Public endpoint for moderation services, though may return different or additional results with auth.
View moderation reports. Reports are individual instances of content being reported, as opposed to subject statuses which aggregate reports at the subject level.
Query URL safety rules
Query available sets
View moderation statuses of subjects (record or repo).
Manually reassign a report to a different queue (or unassign it). Records a queueActivity entry on the report.
Request that the server re-resolve an identity (DID and handle). The server may ignore this request, or require authentication, depending on the role, implementation, and policy of the server.
Refresh an authentication session. Requires auth using the 'refreshJwt' (not the 'accessJwt').
Recompute report statistics for a date range. Useful for backfilling after failures or data corrections.
Register to receive push notifications, via a specified service, for the requesting account. Requires auth.
NOTE: This is under active development and should be considered unstable while this note is here. Rejects a request to join a group (via join link) the user owns. Action taken by the group owner.
Removes all stored hashes used for contact matching, existing matches, and sync status. Requires authentication.
NOTE: This is under active development and should be considered unstable while this note is here. Removes members from a group. This deletes convo memberships, doesn't just set a status.
Delete settings by key
Removes an emoji reaction from a message. Requires authentication. It is idempotent, so multiple calls from the same user with the same emoji result in that reaction not being present, even if it already wasn't.
Remove an existing URL safety rule
Initiate a user account deletion via email.
Request a service to persistently crawl hosted repos. Expected use is new PDS instances declaring their existence to Relays. Does not require auth.
Request an email with a code to confirm ownership of email.
Request a token in order to update email.
NOTE: This is under active development and should be considered unstable while this note is here. Sends a request to join a group (via join link) to the group owner. Action taken by the prospective group member.
Initiate a user account password reset via email.
Request a verification code to be sent to the supplied phone number
Request an email with a code to in order to request a signed PLC operation. Requires Auth.
Reserve a repo signing key, for use with account creation. Necessary so that a DID PLC update operation can be constructed during an account migraiton. Public and does not require auth; implemented by PDS. NOTE: this endpoint may change when full account migration is implemented.
Reset a user account password using a token.
Resolves DID to DID document. Does not bi-directionally verify handle.
Resolves an atproto handle (hostname) to a DID. Does not necessarily bi-directionally verify against the the DID document.
Resolves an identity (DID or Handle) to a full identity (DID document and verified handle).
Resolves an atproto lexicon (NSID) to a schema.
Revoke sessions, password, and app passwords associated with account. May be resolved by a password reset.
Revoke an App Password by name.
Revoke previously granted verifications in batches of up to 100.
Route reports within an ID range to matching queues based.
Schedule a moderation action to be executed at a future time
Get list of accounts that matches your search query.
Search for accounts that match one or more threat signature values.
Find actors (profiles) matching search criteria. Does not require auth.
Backend Actors (profile) search, returns only skeleton.
Find actor suggestions for a prefix search term. Expected use is for auto-completion during text field entry. Does not require auth.
Find posts matching search criteria, returning views of those posts. Note that this API endpoint may require authentication (eg, not public) for some service providers and implementations.
Backend Posts search, returns only skeleton
Find repositories based on a search term.
Find starter packs matching search criteria. Does not require auth.
Backend Starter Pack search, returns only skeleton.
Send email to a user's account email address.
Send information about interactions with feed items back to the feed generator that served them.
Sends a message to a conversation.
Sends a batch of messages to a conversation.
System endpoint to send notifications related to contact imports. Requires role authentication.
Signs a PLC operation to update some value(s) in the requesting DID's document.
Starts a phone verification flow. The phone passed will receive a code via SMS that should be passed to app.bsky.contact.verifyPhone. Requires authentication.
Validates a PLC operation to ensure that it doesn't violate a service's constraints or get the identity into a bad state, then submits it to the PLC registry
Subscribe to stream of labels (and negations). Public endpoint implemented by mod services. Uses same sequencing scheme as repo event stream.
Subscribe to stream of chat events targeted to moderation. Private endpoint.
Repository event stream, aka Firehose endpoint. Outputs repo commits with diff data, and identity update events, for all repositories on the current server. See the atproto specifications for details around stream sequencing, repo versioning, CAR diff format, and more. Public and does not require auth; implemented by PDS and Relay.
Remove a user's assignment from a queue.
Remove report assignment.
NOTE: This is under active development and should be considered unstable while this note is here. Unlocks a group convo so it is able to receive new content.
Unmutes the specified account. Requires auth.
Unmutes the specified list of accounts. Requires auth.
Unmutes a conversation, allowing notifications related to it.
Unmutes the specified thread. Requires auth.
The inverse of registerPush - inform a specified service that push notifications should no longer be sent to the given token for the requesting account. Requires auth.
Administrative action to update an account's email.
Administrative action to update an account's handle.
Update the password for a user account as an administrator.
Administrative action to update an account's signing key in their Did document.
Sets conversations from a user as read to the latest message, with filters.
Updates a draft using private storage (stash). If the draft ID points to a non-existing ID, the update will be silently ignored. This is done because updates don't enforce draft limit, so it accepts all writes, but will ignore invalid ones. Requires authentication.
Update an account's email.
Updates the current account's handle. Verifies handle validity, and updates did:plc document if necessary. Implemented by PDS, and requires auth.
NOTE: This is under active development and should be considered unstable while this note is here. Marks all join requests as read for the group owner.
Update a member in the ozone service. Requires admin role.
Update queue properties. Currently only supports updating the name and enabled status to prevent configuration conflicts.
Updates the read state of a conversation from, optionally specifying the last read message.
Update an existing URL safety rule
Notify server that the requesting account has seen notifications. Requires auth.
Update the service-specific admin status of a subject (account, record, or blob).
Administrative action to update an existing communication template. Allows passing partial fields to patch specific fields only.
Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS.
Upload a video to be processed then stored on the PDS.
Create or update setting option
Create or update set metadata
Verifies control over a phone number with a code received via SMS and starts a contact import session. Requires authentication.
NOTE: This is under active development and should be considered unstable while this note is here. Withdraws a pending request to join a group. Action taken by the prospective member who originally requested to join.