or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

accounts.mdauthentication.mdconversations.mdfilters.mdindex.mdinstance.mdlists.mdmedia.mdnotifications.mdpolls.mdreports.mdsearch.mdstatuses.mdstreaming.mdtags.mdtimelines.mdtypes.md
tile.json

accounts.mddocs/

Account Management

Complete account operations including profiles, relationships, and social actions.

Types

Account

type Account struct {
    ID             ID
    Username       string
    Acct           string
    DisplayName    string
    Locked         bool
    CreatedAt      time.Time
    FollowersCount int64
    FollowingCount int64
    StatusesCount  int64
    Note           string
    URL            string
    Avatar         string
    AvatarStatic   string
    Header         string
    HeaderStatic   string
    Emojis         []Emoji
    Moved          *Account
    Fields         []Field
    Bot            bool
    Discoverable   bool
    Source         *AccountSource
    FollowedTag    []FollowedTag
}

Account holds information for a mastodon account.

Fields:

  • ID - Unique account identifier
  • Username - Local username without domain
  • Acct - Full username with domain (e.g., user@domain.com)
  • DisplayName - Display name shown on profile
  • Locked - Whether account requires follow approval
  • CreatedAt - Account creation timestamp
  • FollowersCount - Number of followers
  • FollowingCount - Number of accounts followed
  • StatusesCount - Number of statuses posted
  • Note - Profile bio/description (HTML)
  • URL - Profile URL
  • Avatar - Avatar image URL
  • AvatarStatic - Static avatar URL (non-animated)
  • Header - Header image URL
  • HeaderStatic - Static header URL
  • Emojis - Custom emojis used in profile
  • Moved - New account if account has moved
  • Fields - Profile metadata fields
  • Bot - Whether this is a bot account
  • Discoverable - Whether account appears in discovery features
  • Source - Private account settings (only for own account)
  • FollowedTag - Tags followed by this account

AccountSource

type AccountSource struct {
    Privacy   *string
    Sensitive *bool
    Language  *string
    Note      *string
    Fields    *[]Field
}

AccountSource is a Mastodon account profile field containing private settings.

Fields:

  • Privacy - Default post visibility ("public", "unlisted", "private", "direct")
  • Sensitive - Whether to mark posts as sensitive by default
  • Language - Default posting language code
  • Note - Raw profile bio (plain text)
  • Fields - Profile metadata fields

Field

type Field struct {
    Name       string
    Value      string
    VerifiedAt time.Time
}

Field is a Mastodon account profile field (custom metadata displayed on profile).

Fields:

  • Name - Field label (e.g., "Website", "Pronouns")
  • Value - Field value (HTML, may contain links)
  • VerifiedAt - Timestamp when field link was verified (zero if not verified)

Profile

type Profile struct {
    DisplayName *string
    Note        *string
    Locked      *bool
    Fields      *[]Field
    Source      *AccountSource
    Avatar      string
    Header      string
}

Profile is a struct for updating user profiles. Nil pointer fields are not updated, empty strings/values update to empty.

Fields:

  • DisplayName - New display name (nil = no change, empty = clear)
  • Note - New bio text (nil = no change, empty = clear)
  • Locked - Require follow approval (nil = no change)
  • Fields - Profile metadata fields (nil = no change)
  • Source - Account source settings (nil = no change)
  • Avatar - Base64 encoded image string for new avatar
  • Header - Base64 encoded image string for new header

Relationship

type Relationship struct {
    ID                  ID
    Following           bool
    FollowedBy          bool
    Blocking            bool
    Muting              bool
    MutingNotifications bool
    Requested           bool
    DomainBlocking      bool
    ShowingReblogs      bool
    Endorsed            bool
}

Relationship holds information for relationship to another account.

Fields:

  • ID - Target account ID
  • Following - Whether you follow this account
  • FollowedBy - Whether this account follows you
  • Blocking - Whether you block this account
  • Muting - Whether you mute this account
  • MutingNotifications - Whether you mute notifications from this account
  • Requested - Whether you have a pending follow request
  • DomainBlocking - Whether you block this account's domain
  • ShowingReblogs - Whether you see this account's reblogs
  • Endorsed - Whether you endorse/feature this account

Account Retrieval

GetAccount { .api }

func (c *Client) GetAccount(ctx context.Context, id ID) (*Account, error)

Returns account by ID.

Parameters:

  • ctx - Context for cancellation/timeout
  • id - Account ID to retrieve

Returns: Account information or error

Example:

account, err := client.GetAccount(ctx, "123456")
if err != nil {
    log.Fatal(err)
}
fmt.Printf("@%s: %s\n", account.Acct, account.DisplayName)

GetAccountCurrentUser { .api }

func (c *Client) GetAccountCurrentUser(ctx context.Context) (*Account, error)

Returns the current user's account information.

Parameters:

  • ctx - Context for cancellation/timeout

Returns: Current user's Account or error

Example:

me, err := client.GetAccountCurrentUser(ctx)
if err != nil {
    log.Fatal(err)
}
fmt.Printf("Logged in as: %s\n", me.Acct)

AccountLookup { .api }

func (c *Client) AccountLookup(ctx context.Context, acct string) (*Account, error)

Returns account by acct URI (username@domain format).

Parameters:

  • ctx - Context for cancellation/timeout
  • acct - Account URI (e.g., user@mastodon.social)

Returns: Account information or error

Example:

account, err := client.AccountLookup(ctx, "gargron@mastodon.social")
if err != nil {
    log.Fatal(err)
}

Profile Management

AccountUpdate { .api }

func (c *Client) AccountUpdate(ctx context.Context, profile *Profile) (*Account, error)

Updates the current user's profile information.

Parameters:

  • ctx - Context for cancellation/timeout
  • profile - Profile updates (nil fields are not changed)

Returns: Updated Account or error

Example:

displayName := "New Display Name"
note := "Updated bio"
profile := &mastodon.Profile{
    DisplayName: &displayName,
    Note:        &note,
}
account, err := client.AccountUpdate(ctx, profile)
if err != nil {
    log.Fatal(err)
}

Account Content

GetAccountStatuses { .api }

func (c *Client) GetAccountStatuses(ctx context.Context, id ID, pg *Pagination) ([]*Status, error)

Returns statuses posted by the specified account.

Parameters:

  • ctx - Context for cancellation/timeout
  • id - Account ID
  • pg - Pagination parameters (optional, nil for defaults)

Returns: Slice of Status objects or error

GetAccountPinnedStatuses { .api }

func (c *Client) GetAccountPinnedStatuses(ctx context.Context, id ID) ([]*Status, error)

Returns statuses pinned by the specified account.

Parameters:

  • ctx - Context for cancellation/timeout
  • id - Account ID

Returns: Slice of pinned Status objects or error

Social Graph

GetAccountFollowers { .api }

func (c *Client) GetAccountFollowers(ctx context.Context, id ID, pg *Pagination) ([]*Account, error)

Returns the account's followers list.

Parameters:

  • ctx - Context for cancellation/timeout
  • id - Account ID
  • pg - Pagination parameters (optional)

Returns: Slice of follower Account objects or error

GetAccountFollowing { .api }

func (c *Client) GetAccountFollowing(ctx context.Context, id ID, pg *Pagination) ([]*Account, error)

Returns the account's following list.

Parameters:

  • ctx - Context for cancellation/timeout
  • id - Account ID
  • pg - Pagination parameters (optional)

Returns: Slice of followed Account objects or error

GetAccountRelationships { .api }

func (c *Client) GetAccountRelationships(ctx context.Context, ids []string) ([]*Relationship, error)

Returns relationships for the specified account IDs.

Parameters:

  • ctx - Context for cancellation/timeout
  • ids - Slice of account ID strings

Returns: Slice of Relationship objects or error

Example:

rels, err := client.GetAccountRelationships(ctx, []string{"123", "456", "789"})
if err != nil {
    log.Fatal(err)
}
for _, rel := range rels {
    fmt.Printf("Account %s: following=%v, followed_by=%v\n",
        rel.ID, rel.Following, rel.FollowedBy)
}

GetAccountLists { .api }

func (c *Client) GetAccountLists(ctx context.Context, id ID) ([]*List, error)

Returns lists containing the specified account.

Parameters:

  • ctx - Context for cancellation/timeout
  • id - Account ID

Returns: Slice of List objects containing this account or error

Follow Actions

AccountFollow { .api }

func (c *Client) AccountFollow(ctx context.Context, id ID) (*Relationship, error)

Follows the specified account.

Parameters:

  • ctx - Context for cancellation/timeout
  • id - Account ID to follow

Returns: Updated Relationship or error

AccountUnfollow { .api }

func (c *Client) AccountUnfollow(ctx context.Context, id ID) (*Relationship, error)

Unfollows the specified account.

Parameters:

  • ctx - Context for cancellation/timeout
  • id - Account ID to unfollow

Returns: Updated Relationship or error

FollowRemoteUser { .api }

func (c *Client) FollowRemoteUser(ctx context.Context, uri string) (*Account, error)

Sends a follow request to a remote user by URI.

Parameters:

  • ctx - Context for cancellation/timeout
  • uri - Remote user URI (e.g., user@remote.instance)

Returns: Account information or error

GetFollowRequests { .api }

func (c *Client) GetFollowRequests(ctx context.Context, pg *Pagination) ([]*Account, error)

Returns pending follow requests for locked accounts.

Parameters:

  • ctx - Context for cancellation/timeout
  • pg - Pagination parameters (optional)

Returns: Slice of Account objects with pending requests or error

FollowRequestAuthorize { .api }

func (c *Client) FollowRequestAuthorize(ctx context.Context, id ID) error

Authorizes a follow request.

Parameters:

  • ctx - Context for cancellation/timeout
  • id - Account ID of requester

Returns: Error if operation fails

FollowRequestReject { .api }

func (c *Client) FollowRequestReject(ctx context.Context, id ID) error

Rejects a follow request.

Parameters:

  • ctx - Context for cancellation/timeout
  • id - Account ID of requester

Returns: Error if operation fails

Block Actions

AccountBlock { .api }

func (c *Client) AccountBlock(ctx context.Context, id ID) (*Relationship, error)

Blocks the specified account.

Parameters:

  • ctx - Context for cancellation/timeout
  • id - Account ID to block

Returns: Updated Relationship or error

AccountUnblock { .api }

func (c *Client) AccountUnblock(ctx context.Context, id ID) (*Relationship, error)

Unblocks the specified account.

Parameters:

  • ctx - Context for cancellation/timeout
  • id - Account ID to unblock

Returns: Updated Relationship or error

GetBlocks { .api }

func (c *Client) GetBlocks(ctx context.Context, pg *Pagination) ([]*Account, error)

Returns the block list for the current user.

Parameters:

  • ctx - Context for cancellation/timeout
  • pg - Pagination parameters (optional)

Returns: Slice of blocked Account objects or error

Mute Actions

AccountMute { .api }

func (c *Client) AccountMute(ctx context.Context, id ID) (*Relationship, error)

Mutes the specified account.

Parameters:

  • ctx - Context for cancellation/timeout
  • id - Account ID to mute

Returns: Updated Relationship or error

AccountUnmute { .api }

func (c *Client) AccountUnmute(ctx context.Context, id ID) (*Relationship, error)

Unmutes the specified account.

Parameters:

  • ctx - Context for cancellation/timeout
  • id - Account ID to unmute

Returns: Updated Relationship or error

GetMutes { .api }

func (c *Client) GetMutes(ctx context.Context, pg *Pagination) ([]*Account, error)

Returns the list of muted accounts for the current user.

Parameters:

  • ctx - Context for cancellation/timeout
  • pg - Pagination parameters (optional)

Returns: Slice of muted Account objects or error

Search

AccountsSearch { .api }

func (c *Client) AccountsSearch(ctx context.Context, q string, limit int64) ([]*Account, error)

Searches for accounts matching the query.

Parameters:

  • ctx - Context for cancellation/timeout
  • q - Search query string
  • limit - Maximum number of results (0 for default)

Returns: Slice of matching Account objects or error

Example:

accounts, err := client.AccountsSearch(ctx, "mastodon", 20)
if err != nil {
    log.Fatal(err)
}
for _, account := range accounts {
    fmt.Printf("@%s: %s\n", account.Acct, account.DisplayName)
}

AccountsSearchResolve { .api }

func (c *Client) AccountsSearchResolve(ctx context.Context, q string, limit int64, resolve bool) ([]*Account, error)

Searches for accounts with optional remote resolution.

Parameters:

  • ctx - Context for cancellation/timeout
  • q - Search query string
  • limit - Maximum number of results (0 for default)
  • resolve - Whether to resolve remote accounts via WebFinger

Returns: Slice of matching Account objects or error

Profile Features

GetEndorsements { .api }

func (c *Client) GetEndorsements(ctx context.Context, pg *Pagination) ([]*Account, error)

Returns accounts currently featured on the user's profile.

Parameters:

  • ctx - Context for cancellation/timeout
  • pg - Pagination parameters (optional)

Returns: Slice of endorsed Account objects or error

GetFollowedTags { .api }

func (c *Client) GetFollowedTags(ctx context.Context, pg *Pagination) ([]*FollowedTag, error)

Returns the list of hashtags followed by the user.

Parameters:

  • ctx - Context for cancellation/timeout
  • pg - Pagination parameters (optional)

Returns: Slice of FollowedTag objects or error

Related Types

See also:

  • Status - For account statuses
  • Lists - For list management
  • Tags - For followed tags
  • Types - For common types like ID, Pagination, Emoji