POST
/
users
/
{id}
/
sdk-token
curl --request POST \
  --url https://api.tapti.ai/users/{id}/sdk-token \
  --header 'Content-Type: application/json' \
  --data '{
  "user_platforms": [
    "YOUTUBE",
    "TIKTOK"
  ],
  "enabled_scopes": [
    "PROFILE_READ"
  ]
}'
{
  "sdk_token": "8pjBUEbqcA3bkKEBTmZ2WsduYwMH6UU23byRiU2rs........."
}

Create a SDK token for a user. This token is required for client-side operations and OAuth portal access.

OAuth Portal Integration

The SDK token is essential for using Tapti’s OAuth Portal, where your users can securely connect their social media accounts:

// 1. Generate SDK token on your backend
const sdkToken = await tapti.user().createSDKToken(userId);

// 2. Redirect user to OAuth Portal
const oauthUrl = `https://oauth.tapti.dev?sdk_token=${sdkToken}`;
// Optional: Specify platform to skip selection screen
const youtubeOauthUrl = `https://oauth.tapti.dev?sdk_token=${sdkToken}&platform=youtube`;

The OAuth Portal provides a secure, branded experience for connecting social media accounts without requiring you to implement complex OAuth flows.

Security Considerations

  • SDK tokens are short-lived and user-specific - Never store tokens in localStorage or expose them in client-side source code - Generate new tokens just before redirecting to the OAuth Portal - Include only necessary platform permissions

Path Parameters

id
any
required

The ID of the user to create a SDK token for

Body

application/json

The SDK token to create

The body is of type object.

Response

200
application/json

SDK token created successfully

The response is of type object.