megalodon
    Preparing search index...

    Class Pleroma

    Implements

    Index

    Constructors

    Properties

    Methods

    acceptFollowRequest addAccountsToList addReactionToAnnouncement blockAccount blockDomain bookmarkStatus cancel cancelScheduledStatus createApp createEmojiReaction createFeaturedTag createFilter createList deleteAccountsFromList deleteConversation deleteEmojiReaction deleteFeaturedTag deleteFilter deleteList deletePushSubscription deleteStatus directStreaming dismissInstanceAnnouncement dismissNotification dismissNotifications editStatus favouriteStatus fetchAccessToken followAccount followTag generateAuthUrl getAccount getAccountFavourites getAccountFollowers getAccountFollowing getAccountLists getAccountsInList getAccountStatuses getBlocks getBookmarks getConversationTimeline getDomainBlocks getEmojiReaction getEmojiReactions getEndorsements getFavourites getFeaturedTags getFilter getFilters getFollowedTags getFollowRequests getHomeTimeline getIdentityProof getInstance getInstanceActivity getInstanceAnnouncements getInstanceCustomEmojis getInstanceDirectory getInstancePeers getInstanceTrends getList getLists getListTimeline getLocalTimeline getMarkers getMedia getMutes getNotification getNotifications getPoll getPreferences getPublicTimeline getPushSubscription getRelationship getRelationships getScheduledStatus getScheduledStatuses getStatus getStatusContext getStatusFavouritedBy getStatusRebloggedBy getStatusSource getSuggestedTags getSuggestions getTag getTagTimeline listStreaming localStreaming lookupAccount muteAccount muteStatus pinAccount pinStatus postStatus publicStreaming readConversation readNotifications reblogStatus refreshToken registerAccount registerApp rejectFollowRequest removeReactionFromAnnouncement report revokeToken saveMarkers scheduleStatus search searchAccount setAccountNote streamingURL subscribeAccount subscribePushNotification tagStreaming unblockAccount unblockDomain unbookmarkStatus unfavouriteStatus unfollowAccount unfollowTag unmuteAccount unmuteStatus unpinAccount unpinStatus unreblogStatus unsubscribeAccount updateCredentials updateFilter updateList updateMedia updatePushSubscription uploadMedia userStreaming verifyAccountCredentials verifyAppCredentials votePoll

    Constructors

    • Parameters

      • baseUrl: string

        hostname or base URL

      • accessToken: null | string = null

        access token from OAuth2 authorization

      • userAgent: null | string = DEFAULT_UA

        UserAgent is specified in header on request.

      Returns Pleroma

    Properties

    baseUrl: string
    client: Interface

    Methods

    • Call /api/v1/apps

      Create an application.

      Parameters

      • client_name: string

        your application's name

      • options: Partial<{ redirect_uris: string; scopes: string[]; website: string }>

        Form Data

      Returns Promise<AppData>

    • POST /api/v1/filters

      Parameters

      • phrase: string

        Text to be filtered.

      • context: string[]

        Array of enumerable strings home, notifications, public, thread, account. At least one context must be specified.

      • Optionaloptions: { expires_in?: string; irreversible?: boolean; whole_word?: boolean }
        • Optionalexpires_in?: string

          ISO 8601 Datetime for when the filter expires.

        • Optionalirreversible?: boolean

          Should the server irreversibly drop matching entities from home and notifications?

        • Optionalwhole_word?: boolean

          Consider word boundaries?

      Returns Promise<Response<Filter>>

      Filter

    • PUT /api/v1/statuses/:id * *

      Parameters

      • id: string

        The target status id. *

      • options: {
            media_ids?: string[];
            poll?: {
                expires_in?: number;
                hide_totals?: boolean;
                multiple?: boolean;
                options?: string[];
            };
            sensitive?: boolean;
            spoiler_text?: string;
            status?: string;
        }

      Returns Promise<Response<Status>>

      Status

    • POST /oauth/token

      Fetch OAuth access token. Get an access token based client_id and client_secret and authorization code.

      Parameters

      • client_id: null | string

        will be generated by #createApp or #registerApp

      • client_secret: string

        will be generated by #createApp or #registerApp

      • code: string

        will be generated by the link of #generateAuthUrl or #registerApp

      • redirect_uri: string = NO_REDIRECT

        must be the same uri as the time when you register your OAuth application

      Returns Promise<TokenData>

    • Generate authorization url using OAuth2.

      Parameters

      • clientId: string

        your OAuth app's client ID

      • clientSecret: string

        your OAuth app's client Secret

      • options: Partial<{ redirect_uri: string | null; scope: string[] }>

        as property, redirect_uri and scope are available, and must be the same as when you register your app

      Returns Promise<string>

    • GET /api/v1/pleroma/accounts/:id/favourites

      Parameters

      • id: string

        Target account ID.

      • Optionaloptions: { limit?: number; max_id?: string; since_id?: string }
        • Optionallimit?: number

          Max number of results to return.

        • Optionalmax_id?: string

          Return results order than ID.

        • Optionalsince_id?: string

          Return results newer than ID.

      Returns Promise<Response<Status[]>>

      Array of statuses.

    • GET /api/v1/accounts/:id/followers

      Parameters

      • id: string

        The account ID.

      • Optionaloptions: { limit?: number; max_id?: string; since_id?: string }
        • Optionallimit?: number

          Max number of results to return. Defaults to 40.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalsince_id?: string

          Return results newer than ID.

      Returns Promise<Response<Account[]>>

      The array of accounts.

    • GET /api/v1/accounts/:id/following

      Parameters

      • id: string

        The account ID.

      • Optionaloptions: { limit?: number; max_id?: string; since_id?: string }
        • Optionallimit?: number

          Max number of results to return. Defaults to 40.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalsince_id?: string

          Return results newer than ID.

      Returns Promise<Response<Account[]>>

      The array of accounts.

    • GET /api/v1/lists/:id/accounts

      Parameters

      • id: string

        Target list ID.

      • Optionaloptions: { limit?: number; max_id?: string; since_id?: string }
        • Optionallimit?: number

          Max number of results to return.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalsince_id?: string

          Return results newer than ID.

      Returns Promise<Response<Account[]>>

      Array of accounts.

    • GET /api/v1/accounts/:id/statuses

      Parameters

      • id: string

        The account ID.

      • Optionaloptions: {
            exclude_reblogs?: boolean;
            exclude_replies?: boolean;
            limit?: number;
            max_id?: string;
            only_media?: boolean;
            pinned?: boolean;
            since_id?: string;
        }
        • Optionalexclude_reblogs?: boolean

          Return statuses which exclude reblogs.

        • Optionalexclude_replies?: boolean

          Return statuses which exclude replies.

        • Optionallimit?: number

          Max number of results to return. Defaults to 20.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalonly_media?: boolean

          Show only statuses with media attached? Defaults to false.

        • Optionalpinned?: boolean

          Return statuses which include pinned statuses.

        • Optionalsince_id?: string

          Return results newer than ID but starting with most recent.

      Returns Promise<Response<Status[]>>

      Account's statuses.

    • GET /api/v1/blocks

      Parameters

      • Optionaloptions: { limit?: number; max_id?: string; min_id?: string }
        • Optionallimit?: number

          Max number of results to return. Defaults to 40.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalmin_id?: string

          Return results immediately newer than ID.

      Returns Promise<Response<Account[]>>

      Array of accounts.

    • GET /api/v1/bookmarks

      Parameters

      • Optionaloptions: { limit?: number; max_id?: string; min_id?: string; since_id?: string }
        • Optionallimit?: number

          Max number of results to return. Defaults to 40.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalmin_id?: string

          Return results immediately newer than ID.

        • Optionalsince_id?: string

          Return results newer than ID.

      Returns Promise<Response<Status[]>>

      Array of statuses.

    • GET /api/v1/conversations

      Parameters

      • Optionaloptions: { limit?: number; max_id?: string; min_id?: string; since_id?: string }
        • Optionallimit?: number

          Max number of results to return. Defaults to 20.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalmin_id?: string

          Return results immediately newer than ID.

        • Optionalsince_id?: string

          Return results newer than ID.

      Returns Promise<Response<Conversation[]>>

      Array of statuses.

    • GET /api/v1/domain_blocks

      Parameters

      • Optionaloptions: { limit?: number; max_id?: string; min_id?: string }
        • Optionallimit?: number

          Max number of results to return. Defaults to 40.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalmin_id?: string

          Return results immediately newer than ID.

      Returns Promise<Response<string[]>>

      Array of domain name.

    • GET /api/v1/pleroma/statuses/:status_id/reactions/:emoji

      Parameters

      • id: string

        Target status ID.

      • emoji: string

        Reaction emoji string. This string is raw unicode emoji or custom emoji name (not shortcode).

      Returns Promise<Response<Reaction>>

    • GET /api/v1/endorsements

      Parameters

      • Optionaloptions: { limit?: number; max_id?: string; since_id?: string }
        • Optionallimit?: number

          Max number of results to return. Defaults to 40.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalsince_id?: string

          Return results newer than ID.

      Returns Promise<Response<Account[]>>

      Array of accounts.

    • GET /api/v1/favourites

      Parameters

      • Optionaloptions: { limit?: number; max_id?: string; min_id?: string }
        • Optionallimit?: number

          Max number of results to return. Defaults to 40.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalmin_id?: string

          Return results immediately newer than ID.

      Returns Promise<Response<Status[]>>

      Array of statuses.

    • GET /api/v1/timelines/home

      Parameters

      • Optionaloptions: {
            limit?: number;
            local?: boolean;
            max_id?: string;
            min_id?: string;
            since_id?: string;
        }
        • Optionallimit?: number

          Max number of results to return. Defaults to 20.

        • Optionallocal?: boolean

          Show only local statuses? Defaults to false.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalmin_id?: string

          Return results immediately newer than ID.

        • Optionalsince_id?: string

          Return results newer than ID.

      Returns Promise<Response<Status[]>>

      Array of statuses.

    • GET /api/v1/directory

      Parameters

      • Optionaloptions: { limit?: number; local?: boolean; offset?: number; order?: "active" | "new" }
        • Optionallimit?: number

          How many accounts to load. Default 40.

        • Optionallocal?: boolean

          Only return local accounts.

        • Optionaloffset?: number

          How many accounts to skip before returning results. Default 0.

        • Optionalorder?: "active" | "new"

          Order of results.

      Returns Promise<Response<Account[]>>

      Array of accounts.

    • GET /api/v1/timelines/list/:list_id

      Parameters

      • list_id: string

        Local ID of the list in the database.

      • Optionaloptions: { limit?: number; max_id?: string; min_id?: string; since_id?: string }
        • Optionallimit?: number

          Max number of results to return. Defaults to 20.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalmin_id?: string

          Return results immediately newer than ID.

        • Optionalsince_id?: string

          Return results newer than ID.

      Returns Promise<Response<Status[]>>

      Array of statuses.

    • GET /api/v1/timelines/public

      Parameters

      • Optionaloptions: {
            limit?: number;
            max_id?: string;
            min_id?: string;
            only_media?: boolean;
            since_id?: string;
        }
        • Optionallimit?: number

          Max number of results to return. Defaults to 20.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalmin_id?: string

          Return results immediately newer than ID.

        • Optionalonly_media?: boolean

          Show only statuses with media attached? Defaults to false.

        • Optionalsince_id?: string

          Return results newer than ID.

      Returns Promise<Response<Status[]>>

      Array of statuses.

    • GET /api/v1/mutes

      Parameters

      • Optionaloptions: { limit?: number; max_id?: string; min_id?: string }
        • Optionallimit?: number

          Max number of results to return. Defaults to 40.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalmin_id?: string

          Return results immediately newer than ID.

      Returns Promise<Response<Account[]>>

      Array of accounts.

    • GET /api/v1/notifications

      Parameters

      • Optionaloptions: {
            account_id?: string;
            exclude_types?: string[];
            limit?: number;
            max_id?: string;
            min_id?: string;
            since_id?: string;
        }
        • Optionalaccount_id?: string

          Return only notifications received from this account.

        • Optionalexclude_types?: string[]

          Array of types to exclude.

        • Optionallimit?: number

          Max number of results to return. Defaults to 20.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalmin_id?: string

          Return results immediately newer than ID.

        • Optionalsince_id?: string

          Return results newer than ID.

      Returns Promise<Response<Notification[]>>

      Array of notifications.

    • GET /api/v1/timelines/public

      Parameters

      • Optionaloptions: {
            limit?: number;
            max_id?: string;
            min_id?: string;
            only_media?: boolean;
            since_id?: string;
        }
        • Optionallimit?: number

          Max number of results to return. Defaults to 20.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalmin_id?: string

          Return results immediately newer than ID.

        • Optionalonly_media?: boolean

          Show only statuses with media attached? Defaults to false.

        • Optionalsince_id?: string

          Return results newer than ID.

      Returns Promise<Response<Status[]>>

      Array of statuses.

    • GET /api/v1/scheduled_statuses

      Parameters

      • Optionaloptions: {
            limit?: null | number;
            max_id?: null | string;
            min_id?: null | string;
            since_id?: null | string;
        }
        • Optionallimit?: null | number

          Max number of results to return. Defaults to 20.

        • Optionalmax_id?: null | string

          Return results older than ID.

        • Optionalmin_id?: null | string

          Return results immediately newer than ID.

        • Optionalsince_id?: null | string

          Return results newer than ID.

      Returns Promise<Response<ScheduledStatus[]>>

      Array of scheduled statuses.

    • GET /api/v1/statuses/:id/context

      Get parent and child statuses.

      Parameters

      • id: string

        The target status id.

      • Optionaloptions: { limit?: number; max_id?: string; since_id?: string }

      Returns Promise<Response<Context>>

      Context

    • GET /api/v1/timelines/tag/:hashtag

      Parameters

      • hashtag: string

        Content of a #hashtag, not including # symbol.

      • Optionaloptions: {
            limit?: number;
            local?: boolean;
            max_id?: string;
            min_id?: string;
            only_media?: boolean;
            since_id?: string;
        }
        • Optionallimit?: number

          Max number of results to return. Defaults to 20.

        • Optionallocal?: boolean

          Show only local statuses? Defaults to false.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalmin_id?: string

          Return results immediately newer than ID.

        • Optionalonly_media?: boolean

          Show only statuses with media attached? Defaults to false.

        • Optionalsince_id?: string

          Return results newer than ID.

      Returns Promise<Response<Status[]>>

      Array of statuses.

    • POST /api/v1/accounts/:id/mute

      Parameters

      • id: string

        The account ID.

      • notifications: boolean = true

        Mute notifications in addition to statuses.

      Returns Promise<Response<Relationship>>

      Relationship

    • POST /api/v1/statuses

      Parameters

      • status: string

        Text content of status.

      • options: {
            in_reply_to_id?: string;
            language?: string;
            media_ids?: string[];
            poll?: {
                expires_in: number;
                hide_totals?: boolean;
                multiple?: boolean;
                options: string[];
            };
            quote_id?: string;
            scheduled_at?: string;
            sensitive?: boolean;
            spoiler_text?: string;
            visibility?: "direct"
            | "private"
            | "public"
            | "unlisted";
        }
        • Optionalin_reply_to_id?: string

          ID of the status being replied to, if status is a reply.

        • Optionallanguage?: string

          ISO 639 language code for this status.

        • Optionalmedia_ids?: string[]

          Array of Attachment ids.

        • Optionalpoll?: {
              expires_in: number;
              hide_totals?: boolean;
              multiple?: boolean;
              options: string[];
          }

          Poll object.

        • Optionalquote_id?: string

          ID of the status being quoted to, if status is a quote.

        • Optionalscheduled_at?: string

          ISO 8601 Datetime at which to schedule a status.

        • Optionalsensitive?: boolean

          Mark status and attached media as sensitive?

        • Optionalspoiler_text?: string

          Text to be shown as a warning or subject before the actual content.

        • Optionalvisibility?: "direct" | "private" | "public" | "unlisted"

          Visibility of the posted status.

      Returns Promise<Response<Status | ScheduledStatus>>

      Status. When options.scheduled_at is present, ScheduledStatus is returned instead.

    • POST /oauth/token

      Refresh OAuth access token. Send refresh token and get new access token.

      Parameters

      • client_id: string

        will be generated by #createApp or #registerApp

      • client_secret: string

        will be generated by #createApp or #registerApp

      • refresh_token: string

        will be get #fetchAccessToken

      Returns Promise<TokenData>

    • POST /api/v1/accounts

      Parameters

      • username: string

        Username for the account.

      • email: string

        Email for the account.

      • password: string

        Password for the account.

      • agreement: boolean

        Whether the user agrees to the local rules, terms, and policies.

      • locale: string

        The language of the confirmation email that will be sent

      • Optionalreason: null | string

        Text that will be reviewed by moderators if registrations require manual approval.

      Returns Promise<Response<Token>>

      An account token.

    • First, call createApp to get client_id and client_secret. Next, call generateAuthUrl to get authorization url.

      Parameters

      • client_name: string

        Form Data, which is sent to /api/v1/apps

      • options: Partial<{ redirect_uris: string; scopes: string[]; website: string }>

        Form Data, which is sent to /api/v1/apps. and properties should be snake_case

      Returns Promise<AppData>

    • POST /api/v1/reports

      Parameters

      • account_id: string

        Target account ID.

      • Optionaloptions: {
            category?: Category;
            comment: string;
            forward?: boolean;
            rule_ids?: number[];
            status_ids?: string[];
        }
        • Optionalcategory?: Category

          Specify if the report is due to spam, violation of enumerated instance rules, or some other reason. Defaults to other. Will be set to violation if rule_ids[] is provided (regardless of any category value you provide).

        • comment: string

          The reason for the report. Default maximum of 1000 characters.

        • Optionalforward?: boolean

          If the account is remote, should the report be forwarded to the remote admin?

        • Optionalrule_ids?: number[]

          For violation category reports, specify the ID of the exact rules broken. Rules and their IDs are available via GET /api/v1/instance/rules and GET /api/v1/instance.

        • Optionalstatus_ids?: string[]

          Array of Statuses ids to attach to the report.

      Returns Promise<Response<Report>>

      Report

    • POST /oauth/revoke

      Revoke an OAuth token.

      Parameters

      • client_id: string

        will be generated by #createApp or #registerApp

      • client_secret: string

        will be generated by #createApp or #registerApp

      • token: string

        will be get #fetchAccessToken

      Returns Promise<Response<{}>>

    • POST /api/v1/markers

      Parameters

      • Optionaloptions: { home?: { last_read_id: string }; notifications?: { last_read_id: string } }
        • Optionalhome?: { last_read_id: string }

          Marker position of the last read status ID in home timeline.

        • Optionalnotifications?: { last_read_id: string }

          Marker position of the last read notification ID in notifications.

      Returns Promise<Response<Marker>>

      Marker.

    • PUT /api/v1/scheduled_statuses/:id

      Parameters

      • id: string

        Target scheduled status ID.

      • Optionalscheduled_at: null | string

        ISO 8601 Datetime at which the status will be published.

      Returns Promise<Response<ScheduledStatus>>

      ScheduledStatus.

    • GET /api/v2/search

      Parameters

      • q: string

        The search query.

      • Optionaloptions: {
            account_id?: string;
            exclude_unreviewed?: boolean;
            following?: boolean;
            limit?: number;
            max_id?: string;
            min_id?: string;
            offset?: number;
            resolve?: boolean;
            type?: "accounts" | "hashtags" | "statuses";
        }
        • Optionalaccount_id?: string

          If provided, statuses returned will be authored only by this account.

        • Optionalexclude_unreviewed?: boolean

          Filter out unreviewed tags? Defaults to false.

        • Optionalfollowing?: boolean

          Only include accounts that the user is following. Defaults to false.

        • Optionallimit?: number

          Maximum number of results to load, per type. Defaults to 20. Max 40.

        • Optionalmax_id?: string

          Return results older than this id.

        • Optionalmin_id?: string

          Return results immediately newer than this id.

        • Optionaloffset?: number
        • Optionalresolve?: boolean

          Attempt WebFinger lookup. Defaults to false.

        • Optionaltype?: "accounts" | "hashtags" | "statuses"

          Enum of search target.

      Returns Promise<Response<Results>>

      Results.

    • GET /api/v1/accounts/search

      Parameters

      • q: string

        Search query.

      • Optionaloptions: {
            following?: boolean;
            limit?: number;
            max_id?: string;
            resolve?: boolean;
            since_id?: string;
        }
        • Optionalfollowing?: boolean
        • Optionallimit?: number

          Max number of results to return. Defaults to 40.

        • Optionalmax_id?: string

          Return results older than ID.

        • Optionalresolve?: boolean
        • Optionalsince_id?: string

          Return results newer than ID.

      Returns Promise<Response<Account[]>>

      The array of accounts.

    • POST /api/v1/push/subscription

      Parameters

      • subscription: { endpoint: string; keys: { auth: string; p256dh: string } }
      • Optionaldata:
            | null
            | {
                alerts: {
                    favourite?: boolean;
                    follow?: boolean;
                    mention?: boolean;
                    poll?: boolean;
                    reblog?: boolean;
                };
            }

      Returns Promise<Response<PushSubscription>>

      PushSubscription.

    • PATCH /api/v1/accounts/update_credentials

      Parameters

      • Optionaloptions: {
            avatar?: string;
            bot?: boolean;
            discoverable?: boolean;
            display_name?: string;
            fields_attributes?: { name: string; value: string }[];
            header?: string;
            locked?: boolean;
            note?: string;
            source?: { language?: string; privacy?: string; sensitive?: boolean };
        }

      Returns Promise<Response<Account>>

      An account.

    • PUT /api/v1/filters/:id

      Parameters

      • id: string

        The filter ID.

      • phrase: string

        Text to be filtered.

      • context: string[]

        Array of enumerable strings home, notifications, public, thread, account. At least one context must be specified.

      • Optionaloptions: { expires_in?: string; irreversible?: boolean; whole_word?: boolean }
        • Optionalexpires_in?: string

          ISO 8601 Datetime for when the filter expires.

        • Optionalirreversible?: boolean

          Should the server irreversibly drop matching entities from home and notifications?

        • Optionalwhole_word?: boolean

          Consider word boundaries?

      Returns Promise<Response<Filter>>

      Filter

    • PUT /api/v1/media/:id

      Parameters

      • id: string

        Target media ID.

      • Optionaloptions: { description?: string; file?: any; focus?: string }
        • Optionaldescription?: string

          A plain-text description of the media.

        • Optionalfile?: any

          The file to be attached, using multipart form data.

        • Optionalfocus?: string

          Two floating points (x,y), comma-delimited, ranging from -1.0 to 1.0.

      Returns Promise<Response<Attachment>>

      Attachment

    • PUT /api/v1/push/subscription

      Parameters

      • Optionaldata:
            | null
            | {
                alerts: {
                    favourite?: boolean;
                    follow?: boolean;
                    mention?: boolean;
                    poll?: boolean;
                    reblog?: boolean;
                };
            }

      Returns Promise<Response<PushSubscription>>

      PushSubscription.

    • POST /api/v2/media

      Parameters

      • file: any

        The file to be attached, using multipart form data.

      • Optionaloptions: { description?: string; focus?: string }
        • Optionaldescription?: string

          A plain-text description of the media.

        • Optionalfocus?: string

          Two floating points (x,y), comma-delimited, ranging from -1.0 to 1.0.

      Returns Promise<Response<Attachment | AsyncAttachment>>

      Attachment