Question
Can I create an audience in the Segment Public API using a Profile API token? When attempting to call the createAudience endpoint with a Profile API token, the request fails with a 403 Forbidden error.
Product
Segment
Environment
Segment Console
Answer
No, you cannot use a Profile API token to create an audience in the Segment Public API. Profile API tokens only grant access to Profile API endpoints, whereas audience creation via the Public API requires a dedicated Public API token.
To resolve the 403 Forbidden error and create your audience, generate and authenticate with a Public API token:
- Log in to your Segment workspace.
- Navigate to Settings > Workspace Settings > User Management > Tokens
- Generate a new Public API token with the required permissions for your workspace.
- Replace the Profile API token in your request with the new Public API token.
- Resend your
createAudiencerequest.
Additional Information
For detailed instructions on generating API keys, refer to How to Create a Public API Token.