Skip to main content
POST
/
auth
/
social
/
exchange
Exchange OAuth code
curl --request POST \
  --url https://app.autoposting.ai/api-proxy/auth/social/exchange \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "provider": "google",
  "code": "<string>"
}
'
{
  "success": true,
  "data": {
    "token": "sk-social-your-key",
    "user": {
      "id": "usr_01HXYZ",
      "email": "user@example.com",
      "name": "Jane Doe",
      "emailVerified": true
    }
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json
provider
enum<string>
required

OAuth provider: google or github.

Available options:
google,
github
Example:

"google"

code
string
required

Authorization code from the OAuth redirect.

Response

200 - application/json

Session created.

success
boolean
required
Example:

true

data
object
required