Skip to content
Connect an agent

Accounts

Change an account's settings

Sets the default Pinterest board, or whether comments and mentions are read into the inbox.

PATCH/v1/accounts/{id}

TL;DR

QuestionAnswer
What does it do?Change an account's settings.
What does it need?An API key or an OAuth access token.
What does it take?A JSON body with the fields below, and id in the path.
What does it return?Status 200 with a body of type Account.
In the SDK?flung.accounts.update()
What can go wrong?401 Missing, unknown, revoked or expired API key; 404 No such account in this workspace; 422 The request failed validation; 429 Too many requests for this credential; wait for retry-after seconds. Every failure has the same error shape.

Example

bash
curl -X PATCH 'https://api.flung.dev/v1/accounts/acct_aaaaaaaaaaaaaaaaaaaaaaaa' \  --header "Authorization: Bearer $FLUNG_API_KEY" \  --header 'Content-Type: application/json' \  --data '{}'

A successful answer looks like this:

json
{  "id": "acct_aaaaaaaaaaaaaaaaaaaaaaaa",  "platform": "x",  "platformUserId": "string",  "username": "string",  "profileId": "string",  "status": "active",  "renewal": "automatic",  "tokenExpiresAt": "2026-11-01T09:00:00.000Z",  "reconnectBy": "2026-11-01T09:00:00.000Z",  "defaultBoard": {    "id": "string",    "name": "string"  },  "inbox": {    "enabled": true,    "readAt": "2026-11-01T09:00:00.000Z",    "error": "string"  },  "createdAt": "2026-11-01T09:00:00.000Z",  "updatedAt": "2026-11-01T09:00:00.000Z"}

Path parameters

FieldTypeRequiredDescription
idstringyes

Request body

The body has the type an object, with the fields below.

FieldTypeRequiredDescription
defaultBoardIdstringnoPinterest only: the board pins go to by default; one of GET /v1/accounts/{id}/boards. at least 1 character; at most 64 characters.
inboxEnabledboolean | nullnoRead comments and mentions (true), stop (false), or go back to the platform's default (null).

Responses

StatusMeaningBody
200The account.Account
401Missing, unknown, revoked or expired API key.Error
404No such account in this workspace.Error
422The request failed validation.Error
429Too many requests for this credential; wait for retry-after seconds.Error

Response body

A 200 answer has the type Account.

FieldTypeRequiredDescription
idstringyes
platformPlatformyes
platformUserIdstringyes
usernamestring | nullyes
profileIdstring | nullyes
status"active" | "needs_reconnect" | "disconnected"yesneeds_reconnect: the platform refused the token; start a reconnect.
renewal"automatic" | "manual" | "not_needed"yesautomatic: Flung refreshes the token before it expires, until reconnectBy if set. manual: only a reconnect renews it, by reconnectBy. not_needed: the token does not expire.
tokenExpiresAtstring | nullyesWhen the current access token expires. Flung renews automatic ones about a day before.
reconnectBystring | nullyesThe last moment the account works without a reconnect; null when it renews indefinitely. Flung sends account.reconnect_required_soon a week before.
defaultBoardobject | nullyesPinterest only: where pins go unless a post picks another board.
defaultBoard.idstringyes
defaultBoard.namestring | nullyes
inboxobjectyesReading comments and mentions into GET /v1/inbox.
inbox.enabledboolean | nullyesWhether comments and mentions are read. null is the platform's default: on, except X, where reading costs money.
inbox.readAtstring | nullyes
inbox.errorstring | nullyesWhy the last read failed, such as a missing permission.
createdAtstringyes
updatedAtstringyes

See also

DocWhy
API referenceEvery endpoint
SchemasEvery request and response type
ErrorsEvery error code and what to do about it