lists

View and manage lists. See also: /api/v1/timelines/list/id for loading a list timeline.

Show user's lists

GET https://mastodon.example/api/v1/lists

Fetch all lists that the user owns. Returns: Array of List OAuth: User token + read:lists Version history: 2.1.0 - added

Headers

Name
Type
Description

Authorization

string

Bearer <user token>

Show a single list

GET https://mastodon.example/api/v1/lists/:id

Fetch the list with the given ID. Used for verifying the title of a list. Returns: List OAuth: User token + read:lists Version history: 2.1.0 - added

Path Parameters

Name
Type
Description

:id

string

ID of the list in the database

Headers

Name
Type
Description

Authorization

string

Bearer <user token>

{
  "id": "12249",
  "title": "Friends"
}

Create a list

POST https://mastodon.example/api/v1/lists

Create a new list. Returns: List OAuth: User token + write:lists Version history: 2.1.0 - added

Headers

Name
Type
Description

Authorization

string

Bearer <user token>

Request Body

Name
Type
Description

title

string

The title of the list to be created.

{
  "id": "13585",
  "title": "test"
}

Update a list

PUT https://mastodon.example/api/v1/lists/:id

Change the title of a list. Returns: List OAuth: User token + write:lists Version history: 2.1.0 - added

Path Parameters

Name
Type
Description

:id

string

ID of the list in the database

Headers

Name
Type
Description

Authorization

string

Bearer <user token>

Request Body

Name
Type
Description

title

string

The title of the list to be updated.

{
  "id": "13585",
  "title": "testing"
}

Delete a list

DELETE https://mastodon.example/api/v1/lists/:id

Returns: empty object OAuth: User token + write:lists Version history: 2.1.0 - added

Path Parameters

Name
Type
Description

:id

string

ID of the list in the database

Headers

Name
Type
Description

Authorization

string

Bearer <user token>

{}

Accounts in a list

View accounts in list

GET https://mastodon.example/api/v1/lists/:id/accounts

Returns: Array of Account OAuth: User token + read:lists Version history: 2.1.0 - added

Path Parameters

Name
Type
Description

:id

string

ID of the list in the database

Query Parameters

Name
Type
Description

max_id

string

Internal parameter. Use HTTP Link header for pagination.

since_id

string

Internal parameter. Use HTTP Link header for pagination.

limit

number

Maximum number of results. Defaults to 40. Max 40. Set to 0 in order to get all accounts without pagination. Pagination is done with the HTTP Link header.

Headers

Name
Type
Description

Authorization

string

Bearer <user token>

[
  {
    "id": "952529",
    ...
  },
  {
    "id": "917388",
    ...
  },
  {
    "id": "869022",
    ...
  },
  {
    "id": "832844",
    ...
  },
  {
    "id": "482403",
    ...
  }
]

Add accounts to list

POST https://mastodon.example/api/v1/lists/:id/accounts

Add accounts to the given list. Note that the user must be following these accounts. Returns: empty object OAuth: User token + write:lists Version history: 2.1.0 - added

Path Parameters

Name
Type
Description

:id

string

ID of the list in the database

Headers

Name
Type
Description

Authorization

string

Bearer <user token>

Request Body

Name
Type
Description

account_ids

array

Array of account IDs to add to the list.

{}

Remove accounts from list

DELETE https://mastodon.example/api/v1/lists/:id/accounts

Remove accounts from the given list. Returns: empty object OAuth: User token + write:lists Version history: 2.1.0 - added

Path Parameters

Name
Type
Description

:id

string

ID of the list in the database

Headers

Name
Type
Description

Authorization

string

Bearer <user token>

Request Body

Name
Type
Description

account_ids

array

Array of account IDs to remove from the list.

{}

Last updated

Was this helpful?