Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface MegalodonInterface

Hierarchy

  • MegalodonInterface

Implemented by

Index

Methods

Methods

acceptFollowRequest

  • POST /api/v1/follow_requests/:id/authorize

    Parameters

    • id: string

      Target account ID.

    Returns Promise<Response<Relationship>>

    Relationship.

addAccountsToList

  • addAccountsToList(id: string, account_ids: string[]): Promise<Response<{}>>
  • POST /api/v1/lists/:id/accounts

    Parameters

    • id: string

      Target list ID.

    • account_ids: string[]

      Array of account IDs to add to the list.

    Returns Promise<Response<{}>>

blockAccount

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

    Parameters

    • id: string

      The account ID.

    Returns Promise<Response<Relationship>>

    Relationship

blockDomain

  • blockDomain(domain: string): Promise<Response<{}>>
  • POST/api/v1/domain_blocks

    Parameters

    • domain: string

      Domain to block.

    Returns Promise<Response<{}>>

bookmarkStatus

  • POST /api/v1/statuses/:id/bookmark

    Parameters

    • id: string

      The target status id.

    Returns Promise<Response<Entity.Status>>

    Status.

cancel

  • cancel(): void
  • Cancel all requests in this instance.

    Returns void

    void

cancelScheduledStatus

  • cancelScheduledStatus(id: string): Promise<Response<{}>>
  • DELETE /api/v1/scheduled_statuses/:id

    Parameters

    • id: string

      Target scheduled status ID.

    Returns Promise<Response<{}>>

createApp

  • createApp(client_name: string, options: Partial<{ redirect_uris: string; scopes: string[]; website: string }>): Promise<AppData>
  • 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>

createEmojiReaction

  • Parameters

    • id: string
    • emoji: string

    Returns Promise<Response<Entity.Status>>

createFeaturedTag

  • POST /api/v1/featured_tags

    Parameters

    • name: string

      Target hashtag name.

    Returns Promise<Response<FeaturedTag>>

    FeaturedTag.

createFilter

  • createFilter(phrase: string, context: string[], options?: { expires_in?: string; irreversible?: boolean; whole_word?: boolean }): Promise<Response<Filter>>
  • 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.

    • Optional options: { expires_in?: string; irreversible?: boolean; whole_word?: boolean }
      • Optional expires_in?: string

        ISO 8601 Datetime for when the filter expires.

      • Optional irreversible?: boolean

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

      • Optional whole_word?: boolean

        Consider word boundaries?

    Returns Promise<Response<Filter>>

    Filter

createList

  • POST /api/v1/lists

    Parameters

    • title: string

      List name.

    Returns Promise<Response<List>>

    List.

deleteAccountsFromList

  • deleteAccountsFromList(id: string, account_ids: string[]): Promise<Response<{}>>
  • DELETE /api/v1/lists/:id/accounts

    Parameters

    • id: string

      Target list ID.

    • account_ids: string[]

      Array of account IDs to add to the list.

    Returns Promise<Response<{}>>

deleteConversation

  • deleteConversation(id: string): Promise<Response<{}>>
  • DELETE /api/v1/conversations/:id

    Parameters

    • id: string

      Target conversation ID.

    Returns Promise<Response<{}>>

deleteEmojiReaction

  • Parameters

    • id: string
    • emoji: string

    Returns Promise<Response<Entity.Status>>

deleteFeaturedTag

  • deleteFeaturedTag(id: string): Promise<Response<{}>>
  • DELETE /api/v1/featured_tags/:id

    Parameters

    • id: string

      Target featured tag id.

    Returns Promise<Response<{}>>

    Empty

deleteFilter

  • DELETE /api/v1/filters/:id

    Parameters

    • id: string

      The filter ID.

    Returns Promise<Response<Filter>>

    Removed filter.

deleteList

  • deleteList(id: string): Promise<Response<{}>>
  • DELETE /api/v1/lists/:id

    Parameters

    • id: string

      Target list ID.

    Returns Promise<Response<{}>>

deletePushSubscription

  • deletePushSubscription(): Promise<Response<{}>>
  • DELETE /api/v1/push/subscription

    Returns Promise<Response<{}>>

deleteStatus

  • deleteStatus(id: string): Promise<Response<{}>>
  • DELETE /api/v1/statuses/:id

    Parameters

    • id: string

      The target status id.

    Returns Promise<Response<{}>>

    Status

directSocket

directStream

dismissNotification

  • dismissNotification(id: string): Promise<Response<{}>>
  • POST /api/v1/notifications/:id/dismiss

    Parameters

    • id: string

      Target notification ID.

    Returns Promise<Response<{}>>

dismissNotifications

  • dismissNotifications(): Promise<Response<{}>>
  • POST /api/v1/notifications/clear

    Returns Promise<Response<{}>>

favouriteStatus

  • POST /api/v1/statuses/:id/favourite

    Parameters

    • id: string

      The target status id.

    Returns Promise<Response<Entity.Status>>

    Status.

fetchAccessToken

  • fetchAccessToken(client_id: null | string, client_secret: string, code: string, redirect_uri?: string): Promise<TokenData>
  • 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

    • Optional redirect_uri: string

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

    Returns Promise<TokenData>

followAccount

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

    Parameters

    • id: string

      The account ID.

    • Optional options: { reblog?: boolean }
      • Optional reblog?: boolean

    Returns Promise<Response<Relationship>>

    Relationship

getAccount

  • GET /api/v1/accounts/:id

    Parameters

    • id: string

      The account ID.

    Returns Promise<Response<Entity.Account>>

    An account.

getAccountFavourites

  • getAccountFavourites(id: string, options?: { limit?: number; max_id?: string; since_id?: string }): Promise<Response<Entity.Status[]>>
  • GET /api/v1/pleroma/accounts/:id/favourites

    Parameters

    • id: string

      Target account ID.

    • Optional options: { limit?: number; max_id?: string; since_id?: string }
      • Optional limit?: number

        Max number of results to return.

      • Optional max_id?: string

        Return results order than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Status[]>>

    Array of statuses.

getAccountFollowers

  • getAccountFollowers(id: string, options?: { limit?: number; max_id?: string; since_id?: string }): Promise<Response<Entity.Account[]>>
  • GET /api/v1/accounts/:id/followers

    Parameters

    • id: string

      The account ID.

    • Optional options: { limit?: number; max_id?: string; since_id?: string }
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Account[]>>

    The array of accounts.

getAccountFollowing

  • getAccountFollowing(id: string, options?: { limit?: number; max_id?: string; since_id?: string }): Promise<Response<Entity.Account[]>>
  • GET /api/v1/accounts/:id/following

    Parameters

    • id: string

      The account ID.

    • Optional options: { limit?: number; max_id?: string; since_id?: string }
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Account[]>>

    The array of accounts.

getAccountLists

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

    Parameters

    • id: string

      The account ID.

    Returns Promise<Response<List[]>>

    The array of lists.

getAccountStatuses

  • getAccountStatuses(id: string, options?: { exclude_reblogs?: boolean; exclude_replies?: boolean; limit?: number; max_id?: string; only_media?: boolean; pinned?: boolean; since_id?: string }): Promise<Response<Entity.Status[]>>
  • GET /api/v1/accounts/:id/statuses

    Parameters

    • id: string

      The account ID.

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

        Return statuses which exclude reblogs.

      • Optional exclude_replies?: boolean

        Return statuses which exclude replies.

      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional max_id?: string

        Return results older than ID.

      • Optional only_media?: boolean

        Show only statuses with media attached? Defaults to false.

      • Optional pinned?: boolean

        Return statuses which include pinned statuses.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Status[]>>

    Account's statuses.

getAccountsInList

  • getAccountsInList(id: string, options?: { limit?: number; max_id?: string; since_id?: string }): Promise<Response<Entity.Account[]>>
  • GET /api/v1/lists/:id/accounts

    Parameters

    • id: string

      Target list ID.

    • Optional options: { limit?: number; max_id?: string; since_id?: string }
      • Optional limit?: number

        Max number of results to return.

      • Optional max_id?: string

        Return results older than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Account[]>>

    Array of accounts.

getBlocks

  • getBlocks(options?: { limit?: number; max_id?: string; min_id?: string }): Promise<Response<Entity.Account[]>>
  • GET /api/v1/blocks

    Parameters

    • Optional options: { limit?: number; max_id?: string; min_id?: string }
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

    Returns Promise<Response<Entity.Account[]>>

    Array of accounts.

getBookmarks

  • getBookmarks(options?: { limit?: number; max_id?: string; min_id?: string; since_id?: string }): Promise<Response<Entity.Status[]>>
  • GET /api/v1/bookmarks

    Parameters

    • Optional options: { limit?: number; max_id?: string; min_id?: string; since_id?: string }
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Status[]>>

    Array of statuses.

getConversationTimeline

  • getConversationTimeline(options?: { limit?: number; max_id?: string; min_id?: string; since_id?: string }): Promise<Response<Conversation[]>>
  • GET /api/v1/conversations

    Parameters

    • Optional options: { limit?: number; max_id?: string; min_id?: string; since_id?: string }
      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Conversation[]>>

    Array of statuses.

getDomainBlocks

  • getDomainBlocks(options?: { limit?: number; max_id?: string; min_id?: string }): Promise<Response<string[]>>
  • GET /api/v1/domain_blocks

    Parameters

    • Optional options: { limit?: number; max_id?: string; min_id?: string }
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

    Returns Promise<Response<string[]>>

    Array of domain name.

getEmojiReaction

  • Parameters

    • id: string
    • emoji: string

    Returns Promise<Response<Reaction>>

getEmojiReactions

  • Parameters

    • id: string

    Returns Promise<Response<Reaction[]>>

getEndorsements

  • getEndorsements(options?: { limit?: number; max_id?: string; since_id?: string }): Promise<Response<Entity.Account[]>>
  • GET /api/v1/endorsements

    Parameters

    • Optional options: { limit?: number; max_id?: string; since_id?: string }
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Account[]>>

    Array of accounts.

getFavourites

  • getFavourites(options?: { limit?: number; max_id?: string; min_id?: string }): Promise<Response<Entity.Status[]>>
  • GET /api/v1/favourites

    Parameters

    • Optional options: { limit?: number; max_id?: string; min_id?: string }
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

    Returns Promise<Response<Entity.Status[]>>

    Array of statuses.

getFeaturedTags

  • GET /api/v1/featured_tags

    Returns Promise<Response<FeaturedTag[]>>

    Array of featured tag.

getFilter

  • GET /api/v1/filters/:id

    Parameters

    • id: string

      The filter ID.

    Returns Promise<Response<Filter>>

    Filter.

getFilters

  • GET /api/v1/filters

    Returns Promise<Response<Filter[]>>

    Array of filters.

getFollowRequests

  • GET /api/v1/follow_requests

    Parameters

    • Optional limit: number

      Maximum number of results.

    Returns Promise<Response<Entity.Account[]>>

    Array of account.

getHomeTimeline

  • getHomeTimeline(options?: { limit?: number; local?: boolean; max_id?: string; min_id?: string; since_id?: string }): Promise<Response<Entity.Status[]>>
  • GET /api/v1/timelines/home

    Parameters

    • Optional options: { limit?: number; local?: boolean; max_id?: string; min_id?: string; since_id?: string }
      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional local?: boolean

        Show only local statuses? Defaults to false.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Status[]>>

    Array of statuses.

getIdentityProof

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

    Parameters

    • id: string

      The account ID.

    Returns Promise<Response<IdentityProof[]>>

    Array of IdentityProof

getInstance

  • GET /api/v1/instance

    Returns Promise<Response<Instance>>

getInstanceActivity

  • GET /api/v1/instance/activity

    Returns Promise<Response<Activity[]>>

getInstanceCustomEmojis

  • GET /api/v1/custom_emojis

    Returns Promise<Response<Emoji[]>>

    Array of emojis.

getInstanceDirectory

  • getInstanceDirectory(options?: { limit?: number; local?: boolean; offset?: number; order?: "active" | "new" }): Promise<Response<Entity.Account[]>>
  • GET /api/v1/directory

    Parameters

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

        How many accounts to load. Default 40.

      • Optional local?: boolean

        Only return local accounts.

      • Optional offset?: number

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

      • Optional order?: "active" | "new"

        Order of results.

    Returns Promise<Response<Entity.Account[]>>

    Array of accounts.

getInstancePeers

  • getInstancePeers(): Promise<Response<string[]>>
  • GET /api/v1/instance/peers

    Returns Promise<Response<string[]>>

getInstanceTrends

  • getInstanceTrends(limit?: null | number): Promise<Response<Tag[]>>
  • GET /api/v1/trends

    Parameters

    • Optional limit: null | number

      Maximum number of results to return. Defaults to 10.

    Returns Promise<Response<Tag[]>>

getList

  • GET /api/v1/lists/:id

    Parameters

    • id: string

      Target list ID.

    Returns Promise<Response<List>>

    List.

getListTimeline

  • getListTimeline(list_id: string, options?: { limit?: number; max_id?: string; min_id?: string; since_id?: string }): Promise<Response<Entity.Status[]>>
  • GET /api/v1/timelines/list/:list_id

    Parameters

    • list_id: string

      Local ID of the list in the database.

    • Optional options: { limit?: number; max_id?: string; min_id?: string; since_id?: string }
      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Status[]>>

    Array of statuses.

getLists

  • GET /api/v1/lists

    Returns Promise<Response<List[]>>

    Array of lists.

getLocalTimeline

  • getLocalTimeline(options?: { limit?: number; max_id?: string; min_id?: string; only_media?: boolean; since_id?: string }): Promise<Response<Entity.Status[]>>
  • GET /api/v1/timelines/public

    Parameters

    • Optional options: { limit?: number; max_id?: string; min_id?: string; only_media?: boolean; since_id?: string }
      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional only_media?: boolean

        Show only statuses with media attached? Defaults to false.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Status[]>>

    Array of statuses.

getMarkers

  • GET /api/v1/markers

    Parameters

    • timeline: string[]

    Returns Promise<Response<{} | Marker>>

    Marker or empty object.

getMutes

  • getMutes(options?: { limit?: number; max_id?: string; min_id?: string }): Promise<Response<Entity.Account[]>>
  • GET /api/v1/mutes

    Parameters

    • Optional options: { limit?: number; max_id?: string; min_id?: string }
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

    Returns Promise<Response<Entity.Account[]>>

    Array of accounts.

getNotification

  • GET /api/v1/notifications/:id

    Parameters

    • id: string

      Target notification ID.

    Returns Promise<Response<Notification>>

    Notification.

getNotifications

  • getNotifications(options?: { account_id?: string; exclude_types?: string[]; limit?: number; max_id?: string; min_id?: string; since_id?: string }): Promise<Response<Notification[]>>
  • GET /api/v1/notifications

    Parameters

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

        Return only notifications received from this account.

      • Optional exclude_types?: string[]

        Array of types to exclude.

      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Notification[]>>

    Array of notifications.

getPoll

  • GET /api/v1/polls/:id

    Parameters

    • id: string

      Target poll ID.

    Returns Promise<Response<Poll>>

    Poll

getPreferences

  • GET /api/v1/preferences

    Returns Promise<Response<Preferences>>

    Preferences.

getPublicTimeline

  • getPublicTimeline(options?: { limit?: number; max_id?: string; min_id?: string; only_media?: boolean; since_id?: string }): Promise<Response<Entity.Status[]>>
  • GET /api/v1/timelines/public

    Parameters

    • Optional options: { limit?: number; max_id?: string; min_id?: string; only_media?: boolean; since_id?: string }
      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional only_media?: boolean

        Show only statuses with media attached? Defaults to false.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Status[]>>

    Array of statuses.

getPushSubscription

  • GET /api/v1/push/subscription

    Returns Promise<Response<PushSubscription>>

    PushSubscription.

getRelationship

  • GET /api/v1/accounts/relationships

    Parameters

    • id: string

      The account ID.

    Returns Promise<Response<Relationship>>

    Relationship

getRelationships

  • Get multiple relationships in one method

    Parameters

    • ids: string[]

      Array of account IDs.

    Returns Promise<Response<Relationship[]>>

    Array of Relationship.

getScheduledStatus

  • GET /api/v1/scheduled_statuses/:id

    Parameters

    • id: string

      Target status ID.

    Returns Promise<Response<ScheduledStatus>>

    ScheduledStatus.

getScheduledStatuses

  • getScheduledStatuses(options?: { limit?: number; max_id?: string; min_id?: string; since_id?: string }): Promise<Response<ScheduledStatus[]>>
  • GET /api/v1/scheduled_statuses

    Parameters

    • Optional options: { limit?: number; max_id?: string; min_id?: string; since_id?: string }
      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<ScheduledStatus[]>>

    Array of scheduled statuses.

getStatus

  • GET /api/v1/statuses/:id

    Parameters

    • id: string

      The target status id.

    Returns Promise<Response<Entity.Status>>

    Status

getStatusContext

  • getStatusContext(id: string, options?: { limit?: number; max_id?: string; since_id?: string }): Promise<Response<Context>>
  • GET /api/v1/statuses/:id/context

    Get parent and child statuses.

    Parameters

    • id: string

      The target status id.

    • Optional options: { limit?: number; max_id?: string; since_id?: string }
      • Optional limit?: number
      • Optional max_id?: string
      • Optional since_id?: string

    Returns Promise<Response<Context>>

    Context

getStatusFavouritedBy

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

    Parameters

    • id: string

      The target status id.

    Returns Promise<Response<Entity.Account[]>>

    Array of accounts.

getStatusRebloggedBy

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

    Parameters

    • id: string

      The target status id.

    Returns Promise<Response<Entity.Account[]>>

    Array of accounts.

getSuggestedTags

  • GET /api/v1/featured_tags/suggestions

    Returns Promise<Response<Tag[]>>

    Array of tag.

getSuggestions

  • GET /api/v1/suggestions

    Parameters

    • Optional limit: number

      Maximum number of results.

    Returns Promise<Response<Entity.Account[]>>

    Array of accounts.

getTagTimeline

  • getTagTimeline(hashtag: string, options?: { limit?: number; local?: boolean; max_id?: string; min_id?: string; only_media?: boolean; since_id?: string }): Promise<Response<Entity.Status[]>>
  • GET /api/v1/timelines/tag/:hashtag

    Parameters

    • hashtag: string

      Content of a #hashtag, not including # symbol.

    • Optional options: { limit?: number; local?: boolean; max_id?: string; min_id?: string; only_media?: boolean; since_id?: string }
      • Optional limit?: number

        Max number of results to return. Defaults to 20.

      • Optional local?: boolean

        Show only local statuses? Defaults to false.

      • Optional max_id?: string

        Return results older than ID.

      • Optional min_id?: string

        Return results immediately newer than ID.

      • Optional only_media?: boolean

        Show only statuses with media attached? Defaults to false.

      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Status[]>>

    Array of statuses.

listSocket

  • Parameters

    • list_id: string

    Returns WebSocketInterface

listStream

localSocket

localStream

muteAccount

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

    Parameters

    • id: string

      The account ID.

    • notifications: boolean

      Mute notifications in addition to statuses.

    Returns Promise<Response<Relationship>>

    Relationship

muteStatus

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

    Parameters

    • id: string

      The target status id.

    Returns Promise<Response<Entity.Status>>

    Status

pinAccount

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

    Parameters

    • id: string

      The account ID.

    Returns Promise<Response<Relationship>>

    Relationship

pinStatus

  • POST /api/v1/statuses/:id/pin

    Parameters

    • id: string

      The target status id.

    Returns Promise<Response<Entity.Status>>

    Status

postStatus

  • postStatus(status: string, 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?: "public" | "unlisted" | "private" | "direct" }): Promise<Response<Entity.Status>>
  • POST /api/v1/statuses

    Parameters

    • status: string

      Text content of status.

    • Optional 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?: "public" | "unlisted" | "private" | "direct" }
      • Optional in_reply_to_id?: string

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

      • Optional language?: string

        ISO 639 language code for this status.

      • Optional media_ids?: string[]

        Array of Attachment ids.

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

        Poll object.

        • expires_in: number
        • Optional hide_totals?: boolean
        • Optional multiple?: boolean
        • options: string[]
      • Optional quote_id?: string

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

      • Optional scheduled_at?: string

        ISO 8601 Datetime at which to schedule a status.

      • Optional sensitive?: boolean

        Mark status and attached media as sensitive?

      • Optional spoiler_text?: string

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

      • Optional visibility?: "public" | "unlisted" | "private" | "direct"

        Visibility of the posted status.

    Returns Promise<Response<Entity.Status>>

    Status

publicSocket

publicStream

readConversation

  • POST /api/v1/conversations/:id/read

    Parameters

    • id: string

      Target conversation ID.

    Returns Promise<Response<Conversation>>

    Conversation.

readNotifications

  • POST /api/v1/pleroma/notifcations/read

    Parameters

    • options: { id?: string; max_id?: string }
      • Optional id?: string
      • Optional max_id?: string

    Returns Promise<Response<Notification | Notification[]>>

    Array of notifications

reblogStatus

  • POST /api/v1/statuses/:id/reblog

    Parameters

    • id: string

      The target status id.

    Returns Promise<Response<Entity.Status>>

    Status.

refreshToken

  • refreshToken(client_id: string, client_secret: string, refresh_token: string): Promise<TokenData>
  • 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>

registerAccount

  • registerAccount(username: string, email: string, password: string, agreement: boolean, locale: string, reason?: null | string): Promise<Response<Token>>
  • 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

    • Optional reason: null | string

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

    Returns Promise<Response<Token>>

    An account token.

registerApp

  • registerApp(client_name: string, options: Partial<{ redirect_uris: string; scopes: string[]; website: string }>): Promise<AppData>
  • 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>

rejectFollowRequest

  • POST /api/v1/follow_requests/:id/reject

    Parameters

    • id: string

      Target account ID.

    Returns Promise<Response<Relationship>>

    Relationship.

report

  • report(account_id: string, comment: string, options?: { forward?: boolean; status_ids?: string[] }): Promise<Response<Report>>
  • POST /api/v1/reports

    Parameters

    • account_id: string

      Target account ID.

    • comment: string

      Reason of the report.

    • Optional options: { forward?: boolean; status_ids?: string[] }
      • Optional forward?: boolean

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

      • Optional status_ids?: string[]

        Array of Statuses ids to attach to the report.

    Returns Promise<Response<Report>>

    Report

revokeToken

  • revokeToken(client_id: string, client_secret: string, token: string): Promise<Response<{}>>
  • 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<{}>>

saveMarkers

  • saveMarkers(options?: { home?: { last_read_id: string }; notifications?: { last_read_id: string } }): Promise<Response<Marker>>
  • POST /api/v1/markers

    Parameters

    • Optional options: { home?: { last_read_id: string }; notifications?: { last_read_id: string } }
      • Optional home?: { last_read_id: string }

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

        • last_read_id: string
      • Optional notifications?: { last_read_id: string }

        Marker position of the last read notification ID in notifications.

        • last_read_id: string

    Returns Promise<Response<Marker>>

    Marker.

scheduleStatus

  • PUT /api/v1/scheduled_statuses/:id

    Parameters

    • id: string

      Target scheduled status ID.

    • Optional scheduled_at: null | string

      ISO 8601 Datetime at which the status will be published.

    Returns Promise<Response<ScheduledStatus>>

    ScheduledStatus.

search

  • search(q: string, type: "accounts" | "hashtags" | "statuses", options?: { account_id?: string; exclude_unreviewed?: boolean; following?: boolean; limit?: number; max_id?: string; min_id?: string; offset?: number; resolve?: boolean }): Promise<Response<Results>>
  • GET /api/v2/search

    Parameters

    • q: string

      The search query.

    • type: "accounts" | "hashtags" | "statuses"

      Enum of search target.

    • Optional options: { account_id?: string; exclude_unreviewed?: boolean; following?: boolean; limit?: number; max_id?: string; min_id?: string; offset?: number; resolve?: boolean }
      • Optional account_id?: string

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

      • Optional exclude_unreviewed?: boolean

        Filter out unreviewed tags? Defaults to false.

      • Optional following?: boolean

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

      • Optional limit?: number

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

      • Optional max_id?: string

        Return results older than this id.

      • Optional min_id?: string

        Return results immediately newer than this id.

      • Optional offset?: number
      • Optional resolve?: boolean

        Attempt WebFinger lookup. Defaults to false.

    Returns Promise<Response<Results>>

    Results.

searchAccount

  • searchAccount(q: string, options?: { following?: boolean; limit?: number; max_id?: string; resolve?: boolean; since_id?: string }): Promise<Response<Entity.Account[]>>
  • GET /api/v1/accounts/search

    Parameters

    • q: string

      Search query.

    • Optional options: { following?: boolean; limit?: number; max_id?: string; resolve?: boolean; since_id?: string }
      • Optional following?: boolean
      • Optional limit?: number

        Max number of results to return. Defaults to 40.

      • Optional max_id?: string

        Return results older than ID.

      • Optional resolve?: boolean
      • Optional since_id?: string

        Return results newer than ID.

    Returns Promise<Response<Entity.Account[]>>

    The array of accounts.

subscribeAccount

  • POST /api/v1/pleroma/accounts/:id/subscribe

    Parameters

    • id: string

      Target account ID.

    Returns Promise<Response<Relationship>>

    Relationship.

subscribePushNotification

  • subscribePushNotification(subscription: { endpoint: string; keys: { auth: string; p256dh: string } }, data?: null | { alerts: { favourite?: boolean; follow?: boolean; mention?: boolean; poll?: boolean; reblog?: boolean } }): Promise<Response<PushSubscription>>
  • POST /api/v1/push/subscription

    Parameters

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

    Returns Promise<Response<PushSubscription>>

    PushSubscription.

tagSocket

tagStream

unblockAccount

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

    Parameters

    • id: string

      The account ID.

    Returns Promise<Response<Relationship>>

    RElationship

unblockDomain

  • unblockDomain(domain: string): Promise<Response<{}>>
  • DELETE /api/v1/domain_blocks

    Parameters

    • domain: string

      Domain to unblock

    Returns Promise<Response<{}>>

unbookmarkStatus

  • POST /api/v1/statuses/:id/unbookmark

    Parameters

    • id: string

      The target status id.

    Returns Promise<Response<Entity.Status>>

    Status.

unfavouriteStatus

  • POST /api/v1/statuses/:id/unfavourite

    Parameters

    • id: string

      The target status id.

    Returns Promise<Response<Entity.Status>>

    Status.

unfollowAccount

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

    Parameters

    • id: string

      The account ID.

    Returns Promise<Response<Relationship>>

    Relationship

unmuteAccount

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

    Parameters

    • id: string

      The account ID.

    Returns Promise<Response<Relationship>>

    Relationship

unmuteStatus

  • POST /api/v1/statuses/:id/unmute

    Parameters

    • id: string

      The target status id.

    Returns Promise<Response<Entity.Status>>

    Status

unpinAccount

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

    Parameters

    • id: string

      The account ID.

    Returns Promise<Response<Relationship>>

    Relationship

unpinStatus

  • POST /api/v1/statuses/:id/unpin

    Parameters

    • id: string

      The target status id.

    Returns Promise<Response<Entity.Status>>

    Status

unreblogStatus

  • POST /api/v1/statuses/:id/unreblog

    Parameters

    • id: string

      The target status id.

    Returns Promise<Response<Entity.Status>>

    Status.

unsubscribeAccount

  • POST /api/v1/pleroma/accounts/:id/unsubscribe

    Parameters

    • id: string

      Target account ID.

    Returns Promise<Response<Relationship>>

    Relationship.

updateCredentials

  • updateCredentials(options?: { 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 } }): Promise<Response<Entity.Account>>
  • PATCH /api/v1/accounts/update_credentials

    Parameters

    • Optional options: { 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 } }
      • Optional avatar?: string
      • Optional bot?: boolean
      • Optional discoverable?: boolean
      • Optional display_name?: string
      • Optional fields_attributes?: { name: string; value: string }[]
      • Optional header?: string
      • Optional locked?: boolean
      • Optional note?: string
      • Optional source?: { language?: string; privacy?: string; sensitive?: boolean }
        • Optional language?: string
        • Optional privacy?: string
        • Optional sensitive?: boolean

    Returns Promise<Response<Entity.Account>>

    An account.

updateFilter

  • updateFilter(id: string, phrase: string, context: string[], options?: { expires_in?: string; irreversible?: boolean; whole_word?: boolean }): Promise<Response<Filter>>
  • 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.

    • Optional options: { expires_in?: string; irreversible?: boolean; whole_word?: boolean }
      • Optional expires_in?: string

        ISO 8601 Datetime for when the filter expires.

      • Optional irreversible?: boolean

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

      • Optional whole_word?: boolean

        Consider word boundaries?

    Returns Promise<Response<Filter>>

    Filter

updateList

  • updateList(id: string, title: string): Promise<Response<List>>
  • PUT /api/v1/lists/:id

    Parameters

    • id: string

      Target list ID.

    • title: string

      New list name.

    Returns Promise<Response<List>>

    List.

updateMedia

  • updateMedia(id: string, options?: { description?: string; file?: any; focus?: string; is_sensitive?: boolean }): Promise<Response<Attachment>>
  • PUT /api/v1/media/:id

    Parameters

    • id: string

      Target media ID.

    • Optional options: { description?: string; file?: any; focus?: string; is_sensitive?: boolean }
      • Optional description?: string

        A plain-text description of the media.

      • Optional file?: any

        The file to be attached, using multipart form data.

      • Optional focus?: string

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

      • Optional is_sensitive?: boolean

        Whether the media is sensitive.

    Returns Promise<Response<Attachment>>

    Attachment

updatePushSubscription

  • updatePushSubscription(data?: null | { alerts: { favourite?: boolean; follow?: boolean; mention?: boolean; poll?: boolean; reblog?: boolean } }): Promise<Response<PushSubscription>>
  • PUT /api/v1/push/subscription

    Parameters

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

    Returns Promise<Response<PushSubscription>>

    PushSubscription.

uploadMedia

  • uploadMedia(file: any, options?: { description?: string; focus?: string }): Promise<Response<Attachment>>
  • POST /api/v1/media

    Parameters

    • file: any

      The file to be attached, using multipart form data.

    • Optional options: { description?: string; focus?: string }
      • Optional description?: string

        A plain-text description of the media.

      • Optional focus?: string

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

    Returns Promise<Response<Attachment>>

    Attachment

userSocket

userStream

verifyAccountCredentials

  • GET /api/v1/accounts/verify_credentials

    Returns Promise<Response<Entity.Account>>

    Account.

verifyAppCredentials

  • GET /api/v1/apps/verify_credentials

    Returns Promise<Response<Application>>

    An Application

votePoll

  • votePoll(id: string, choices: number[], status_id?: null | string): Promise<Response<Poll>>
  • POST /api/v1/polls/:id/votes

    Parameters

    • id: string

      Target poll ID.

    • choices: number[]

      Array of own votes containing index for each option (starting from 0).

    • Optional status_id: null | string

    Returns Promise<Response<Poll>>

    Poll

Generated using TypeDoc