Manage X Communities
List, add, and remove Communities saved for a connected X account.
List, add, and remove Communities saved for a connected X account.
/api/v1/social/accounts/{accountId}/x-communitiesList the Communities saved for a connected X account.
Use an X account ID returned by List Accounts.
curl -H "x-api-key: <apiKey>" \
https://dopost.co/api/v1/social/accounts/<xAccountId>/x-communitiescurl -H "x-api-key: <apiKey>" \
https://dopost.co/api/v1/social/accounts/<xAccountId>/x-communities{
"account": {
"id": "<xAccountId>",
"platform": "X",
"platformUsername": "creator"
},
"communities": [
{
"communityId": "1493446837214187523",
"name": "Builders Community",
"description": "A Community for builders",
"thumbnailUrl": "https://media.dopost.co/x-communities/example.webp",
"isValid": true,
"lastError": null,
"lastVerifiedAt": "2026-09-13T18:00:00.000Z",
"lastUsedAt": "2026-09-13T18:00:00.000Z"
}
]
}{
"account": {
"id": "<xAccountId>",
"platform": "X",
"platformUsername": "creator"
},
"communities": [
{
"communityId": "1493446837214187523",
"name": "Builders Community",
"description": "A Community for builders",
"thumbnailUrl": "https://media.dopost.co/x-communities/example.webp",
"isValid": true,
"lastError": null,
"lastVerifiedAt": "2026-09-13T18:00:00.000Z",
"lastUsedAt": "2026-09-13T18:00:00.000Z"
}
]
}Choose an entry with isValid: true and pass its communityId to the Publish Post endpoint:
{
"accountId": "<xAccountId>",
"text": "Community update",
"platformOptions": {
"communityId": "1493446837214187523",
"shareWithFollowers": false
}
}{
"accountId": "<xAccountId>",
"text": "Community update",
"platformOptions": {
"communityId": "1493446837214187523",
"shareWithFollowers": false
}
}An empty communities array means no Communities have been saved for this X account. Communities are saved from the dopost composer.
Send a numeric Community ID or an x.com Community URL. dopost validates the Community, saves its metadata, and caches its thumbnail. Adding the same Community again does not create a duplicate.
curl -X POST \
-H "x-api-key: <apiKey>" \
-H "Content-Type: application/json" \
-d '{"community":"https://x.com/i/communities/1493446837214187523"}' \
https://dopost.co/api/v1/social/accounts/<xAccountId>/x-communitiescurl -X POST \
-H "x-api-key: <apiKey>" \
-H "Content-Type: application/json" \
-d '{"community":"https://x.com/i/communities/1493446837214187523"}' \
https://dopost.co/api/v1/social/accounts/<xAccountId>/x-communitiesThe response uses 201 Created for a new saved Community and 200 OK when it was already saved.
Send either communityName or communityId. A name is accepted when it uniquely identifies one saved Community.
curl -X DELETE \
-H "x-api-key: <apiKey>" \
-H "Content-Type: application/json" \
-d '{"communityName":"Builders Community"}' \
https://dopost.co/api/v1/social/accounts/<xAccountId>/x-communitiescurl -X DELETE \
-H "x-api-key: <apiKey>" \
-H "Content-Type: application/json" \
-d '{"communityName":"Builders Community"}' \
https://dopost.co/api/v1/social/accounts/<xAccountId>/x-communities| Status | Error | Cause |
|---|---|---|
400 | Saved X Communities are supported only for X accounts | The selected account belongs to another platform |
400 | Use either communityName or communityId | A removal request has no selector or sends both selectors |
401 | Invalid or missing API key | Bad or missing x-api-key header |
403 | API credential does not have permission for this action | The credential lacks social:accounts for listing or posts:create for changes |
404 | Account not found | The account does not exist, is inactive, or belongs to an inaccessible workspace |
409 | More than one saved X Community has this name | Use communityId to disambiguate the removal |
502 | Provider validation error | X could not validate the Community while adding it |
429 | Rate limit exceeded | Too many requests |