Skip to main content
This guide walks you through adding and removing bookmarks using the X API.
PrerequisitesBefore you begin, you’ll need:
  • A developer account with an approved App
  • User Access Token with bookmark.write scope (OAuth 2.0 PKCE)

Add a bookmark

1

Get your user ID

You need your authenticated user’s ID. You can find it using the /2/users/me endpoint or the user lookup endpoint.
2

Get the Post ID

Find the Post ID in the URL when viewing a Post:
https://x.com/XDevelopers/status/1460323737035677698
                                └── This is the Post ID
3

Add the bookmark

cURL
curl -X POST "https://api.x.com/2/users/2244994945/bookmarks" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"tweet_id": "1460323737035677698"}'
4

Review the response

{
  "data": {
    "bookmarked": true
  }
}

Remove a bookmark

Delete a Post from your bookmarks:
cURL
curl -X DELETE "https://api.x.com/2/users/2244994945/bookmarks/1460323737035677698" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN"
Response:
{
  "data": {
    "bookmarked": false
  }
}

Required scopes

When using OAuth 2.0 PKCE, your access token must have these scopes:
ScopeDescription
bookmark.writeAdd and remove bookmarks
tweet.readRead Post data
users.readRead user data

Next steps