Skip to content

Profiles API Reference

The Profiles API allows you to retrieve and manage connected social media profiles. Profiles represent authenticated connections to social media platforms.

MethodEndpointDescription
GET/api/profilesList all profiles
GET/api/profiles/:idGet a single profile
DELETE/api/profiles/:idDelete/disconnect a profile

A profile represents a connected social media account.

FieldTypeDescription
idstringUnique profile identifier (hashid)
namestringDisplay name of the connected account
statusstringPlatform connection status: active, expired, inactive (might be disconnected or suspended on a platform)
platformstringPlatform identifier
profile_group_idstringID of the profile group this belongs to
expires_atstring|nullISO 8601 timestamp when the connection expires (if applicable)
post_countintegerNumber of posts made through this profile
PlatformAccount type
facebookFacebook Page
instagramInstagram Business/Creator Account
tiktokTikTok Account
linkedinLinkedIn Profile or Company Page
youtubeYouTube Channel
twitterX (Twitter) Account
threadsThreads Account

GET /api/profiles

Retrieves all profiles in the current profile group.

NameTypeRequiredDefaultDescription
profile_group_idstringNo-Filter by profile group (hashid)
Terminal window
curl -X GET "https://api.postproxy.dev/api/profiles" \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"data": [
{
"id": "prof123abc",
"name": "My Company Page",
"platform": "facebook",
"status": "active",
"profile_group_id": "grp456xyz",
"expires_at": null,
"post_count": 42
},
{
"id": "prof789def",
"name": "@mycompany",
"platform": "instagram",
"status": "expired",
"profile_group_id": "grp456xyz",
"expires_at": "2024-03-15T00:00:00.000Z",
"post_count": 38
},
{
"id": "prof321ghi",
"name": "John Doe",
"platform": "linkedin",
"status": "inactive",
"profile_group_id": "grp456xyz",
"expires_at": null,
"post_count": 15
},
{
"id": "prof654jkl",
"name": "@mycompany",
"platform": "twitter",
"status": "active",
"profile_group_id": "grp456xyz",
"expires_at": null,
"post_count": 127
}
]
}

GET /api/profiles/:id

Retrieves a single profile by its ID.

NameTypeRequiredDescription
idstringYesProfile hashid
Terminal window
curl -X GET "https://api.postproxy.dev/api/profiles/prof123abc" \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"id": "prof123abc",
"name": "My Company Page",
"platform": "facebook",
"status": "active",
"profile_group_id": "grp456xyz",
"expires_at": null,
"post_count": 42
}

DELETE /api/profiles/:id

Disconnects and removes a profile from the account. This does not affect posts already published through this profile.

NameTypeRequiredDescription
idstringYesProfile hashid
Terminal window
curl -X DELETE "https://api.postproxy.dev/api/profiles/prof123abc" \
-H "Authorization: Bearer YOUR_API_KEY"

Response:

{
"success": true
}

Some platforms issue access tokens that expire. The expires_at field indicates when the connection will expire and require re-authentication.

BehaviorDescription
expires_at: nullToken does not expire or has a refresh token
expires_at: "2024-..."Token expires at the specified time

When a token expires:

  • Posts to that profile will fail
  • The user needs to reconnect the profile through the web dashboard
  • Use the Initialize Connection endpoint to generate a new connection URL

Profiles cannot be created directly via the API. To connect a new social media account:

  1. Use the Initialize Connection endpoint to get an OAuth URL
  2. Redirect the user to that URL to authenticate
  3. User is redirected back to your redirect_url after authentication
  4. The profile is automatically created and associated with the profile group

When creating posts, reference profiles by:

  1. Profile ID: Use the id hashid directly
  2. Platform name: Use the platform string (e.g., "twitter") to automatically select the profile for that platform
{
"profiles": ["prof123abc", "twitter", "linkedin"]
}

If multiple profiles exist for the same platform in a profile group, using the platform name selects the first one. Use the profile ID for explicit selection.