Accounts

Profiles

Group the accounts of your workspace into named profiles, and filter accounts and posts by profile.

A profile is a named group of accounts in your workspace. You name a profile when you connect an account, and you filter accounts and posts by that name.

import { Configuration, ProfilesApi } from "@onepostly/sdk";

const profilesApi = new ProfilesApi(
  new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY })
);

const response = await profilesApi.listProfiles();
console.log(response);
{
  "data": [
    {
      "name": "Default",
      "accountCount": 2,
      "createdAt": "2027-03-01T09:00:00.000Z",
      "updatedAt": "2027-03-01T09:00:00.000Z"
    },
    {
      "name": "Business",
      "accountCount": 3,
      "createdAt": "2027-03-01T10:00:00.000Z",
      "updatedAt": "2027-03-01T10:00:00.000Z"
    }
  ],
  "nextCursor": null,
  "hasMore": false
}

How Profiles Work

RuleDetail
IdentityA profile has no id. Its name identifies it
Names1 to 60 characters, unique in any letter case
Reservednone, the filter value for accounts without a profile
MembershipOne profile per account, or none. The account's profile is the name or null
accountCountConnected accounts only

The list is oldest first, 50 per page and up to 100 with limit. Pass nextCursor as cursor until hasMore is false. Any key can list profiles. Changes need a read_write key.

A key limited to some profiles lists only its own profiles and cannot change profiles.

The Default Profile

Every workspace starts with a profile named Default.

You connect an accountIt goes to
With a profile nameThat profile. It is created if it does not exist
Without a profileDefault. It is created again if you deleted it

This is the same in the dashboard and with an API key.

Create a Profile

You rarely need this call, because a connect with a new profile name creates the profile for you. Create one ahead of time when you want it to exist before its first account.

import { Configuration, ProfilesApi } from "@onepostly/sdk";

const profilesApi = new ProfilesApi(
  new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY })
);

const response = await profilesApi.createProfile({
  createProfileBody: {
    "name": "Business"
  },
});
console.log(response);
{
  "name": "Business",
  "accountCount": 0,
  "createdAt": "2027-03-15T09:00:00.000Z",
  "updatedAt": "2027-03-15T09:00:00.000Z"
}

The response is the new profile, with 201 and accountCount set to 0.

Add Accounts to a Profile

Send the profile name as profile when you connect the account.

Connect methodWhere profile goes
Connect sessionThe body of Create Connect Session
BlueskyThe body of Connect Bluesky

An account keeps its profile when it is reconnected. There is no call that moves a connected account to another profile. To move one, disconnect it and connect it again with the new profile.

A key limited to some profiles connects only into one of them. See Profile Access.

Rename a Profile

Send the current name URL-encoded in the path, such as Client%20Team, and the new name in the body.

import { Configuration, ProfilesApi } from "@onepostly/sdk";

const profilesApi = new ProfilesApi(
  new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY })
);

const response = await profilesApi.updateProfile({
  name: "Business",
  updateProfileBody: {
    "name": "Acme Business"
  },
});
console.log(response);
{
  "name": "Acme Business",
  "accountCount": 3,
  "createdAt": "2027-03-01T10:00:00.000Z",
  "updatedAt": "2027-03-15T10:00:00.000Z"
}

The accounts stay, and filters use the new name from then on. A rename can also change only the letter case.

Delete a Profile

import { Configuration, ProfilesApi } from "@onepostly/sdk";

const profilesApi = new ProfilesApi(
  new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY })
);

const response = await profilesApi.deleteProfile({
  name: "Business",
});
console.log(response);

It returns 204. The accounts stay connected with profile set to null, and their posts do not change.

While an API key is limited to the profile, the delete returns 409 PROFILE_IN_USE. Delete those keys first.

Filter by Profile

RequestReturns
GET /v1/accounts?profile=BusinessThe profile's connected accounts
GET /v1/posts?profile=BusinessThe profile's posts, disconnected accounts included
GET /v1/accounts?profile=noneAccounts with no profile
GET /v1/posts?profile=nonePosts of accounts with no profile

The filter ignores letter case. A name that matches no profile returns an empty list, not an error.

Your App's Users

Profiles are meant for a few groups, not one per user of your app. To know which of your users owns an account, keep that link in your own database. See Link Accounts to Your Users.

Errors

CodeHTTPCauseFix
VALIDATION_ERROR400The name is empty or over 60 charactersSend 1 to 60 characters
FORBIDDEN403A read_only key, or a key limited to some profiles, tried a changeUse a read_write key with access to all profiles
PROFILE_NOT_FOUND404No profile has this nameUse a current name
PROFILE_NAME_TAKEN409The name is taken in any letter case, or is noneChoose another name
PROFILE_IN_USE409An API key is limited to the profileDelete those keys first

See Errors for every other code.