Accounts
Update Account
Changes the account's metadata. A string sets a key, null removes it, and keys you leave out keep their values.
BearerAuthorizationBearer <op_>Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.
id*string1 <= lengthapplication/json- body
metadata*|The metadata keys to set or remove. null removes every key.
Updated account
application/json- response
id*stringplatform*|The platform id. New platforms can be added, so handle a value you do not know.
displayName*stringhandle*stringThe account's handle on the platform, without a leading @. LinkedIn has no handles, so a LinkedIn account has its name here.
avatarUrl*|uristatus*|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*booleanWhether the authorization renews without the account owner signing in again.
tokenExpiresAt*|When the current authorization expires, or null when it does not.
date-timeprofile*|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*stringdate-timeupdatedAt*stringdate-timeimport { 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);{ "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"}