Skip to main content
POST
/
brands
/
{slug}
/
tokens
Store a platform token
curl --request POST \
  --url https://app.autoposting.ai/api-proxy/brands/{slug}/tokens \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "platform": "x",
  "accessToken": "ya29.a0...",
  "platformUserId": "x_12345",
  "refreshToken": "<string>",
  "expiresAt": "2025-01-01T00:00:00Z"
}
'
{
  "success": true,
  "data": {
    "tokenId": "tok_01HXYZ",
    "platformUserId": "x_12345",
    "username": "@acmecorp",
    "scopes": [
      "tweet.read",
      "tweet.write"
    ],
    "expiresAt": "2025-01-01T00:00:00Z",
    "lastUsedAt": null,
    "status": "active"
  }
}

Authorizations

Authorization
string
header
required

API key as Authorization: Bearer sk-social-...

Path Parameters

slug
string
required

Brand slug.

Example:

"acme-corp"

Body

application/json
platform
enum<string>
required

Platform identifier.

Available options:
x,
linkedin,
instagram,
threads,
youtube
Example:

"x"

accessToken
string
required

Platform access token.

Example:

"ya29.a0..."

platformUserId
string
required

User/page ID on the platform.

Example:

"x_12345"

refreshToken
string

Platform refresh token (if applicable).

expiresAt
string<date-time>

Token expiry datetime.

Example:

"2025-01-01T00:00:00Z"

Response

Token stored.

success
boolean
Example:

true

data
object

Stored platform token details.