Accounts

Update Account

Changes the account's metadata. A string sets a key, null removes it, and keys you leave out keep their values.

PATCH
/v1/accounts/{id}

Authorization

Bearer
headerAuthorizationBearer <op_>

Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.

Path Parameters

id*string
Length1 <= length

Request Body

application/json
  1. body
metadata*|

The metadata keys to set or remove. null removes every key.

Response Body

Updated account

application/json
  1. response
id*string
platform*|

The platform id. New platforms can be added, so handle a value you do not know.

displayName*string
handle*string

The account's handle on the platform, without a leading @. LinkedIn has no handles, so a LinkedIn account has its name here.

avatarUrl*|
Formaturi
status*|

active works normally. expired, revoked and error need a reconnect before the account can publish again. expired also covers an authorization that ran out and cannot renew by itself. A disconnected account is no longer returned. The account.disconnected webhook sends it as a DisconnectedAccount. New values can be added, so handle a value you do not know.

canAutoRenew*boolean

Whether the authorization renews without the account owner signing in again.

tokenExpiresAt*|

When the current authorization expires, or null when it does not.

Formatdate-time
profile*|

The name of the profile the account is filed under. null when the account is in no profile.

metadata*

The metadata sent with the connect that added the account. An empty object when none was sent.

xSubscriptionType?|

X only, such as Premium. The account's X subscription, which sets its post length limit. Null when X does not report it, and left out for other platforms.

createdAt*string
Formatdate-time
updatedAt*string
Formatdate-time
Example Request
import { Configuration, AccountsApi } from "@onepostly/sdk";const accountsApi = new AccountsApi(  new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY }));const response = await accountsApi.updateAccount({  id: "acc_1699f4157fb643f49d2ac447491f32a8",  updateAccountBody: {    "metadata": {      "team": "marketing"    }  },});console.log(response);
Example Response
{  "id": "acc_1699f4157fb643f49d2ac447491f32a8",  "platform": "x",  "displayName": "Your Brand",  "handle": "yourbrand",  "avatarUrl": "https://cdn.onepostly.com/avatars/yourbrand.jpg",  "status": "active",  "canAutoRenew": true,  "tokenExpiresAt": "2027-05-14T10:00:00.000Z",  "profile": "Business",  "metadata": {    "userId": "user_8412",    "team": "marketing"  },  "xSubscriptionType": "None",  "createdAt": "2027-03-01T10:00:00.000Z",  "updatedAt": "2027-03-15T10:00:00.000Z"}