Civic Tokens
Civic tokens provide a way to authenticate with Civic from services that don’t support browser-based OAuth flows, such as OpenAI Agent Builder, workflow automation platforms, and custom applications.What are Civic Tokens?
Civic tokens are temporary access tokens that grant permission to use your Civic MCP servers from external services. They are:- Profile-scoped: Each token is tied to a specific Civic profile (toolkit)
- Time-limited: Tokens expire after a configurable period (up to 30 days)
- Delegated: Tokens are delegated credentials that allow external services to act on your behalf
- Secure: Tokens use industry-standard OAuth 2.0 token exchange (RFC 8693)
When to Use Tokens vs Browser Auth
Use Browser Authentication
Browser authentication works well for interactive use cases:Desktop AI Agents
Interactive Sessions
Use Token Authentication
Generate a token when you need to:Agent Builders
Automation Platforms
Custom Applications
Restricted Environments
- Run server-side without browser access for OAuth flows
- Require credentials configured ahead of time
- Can’t trigger interactive authentication during execution
- Need persistent authentication for automated operations
How to Generate a Token
Navigate to Install page
Select your toolkit
Click Install
Set token expiration
Copy and store securely
Using Tokens in Different Services
OpenAI Agent Builder
When setting up an OpenAI agent that needs to access your Civic tools:Create your agent
Add MCP server
Configure the connection
Test the connection
n8n Workflows
To use Civic in your n8n automations:Add HTTP Request node
Configure authentication
Set up MCP request
Other Automation Platforms
Similar to n8n, other workflow automation platforms can use Civic tokens with HTTP modules and Bearer token authentication. The general pattern is:Custom Applications
Include the token in the Authorization header of your HTTP requests:- cURL
- JavaScript
- Python
Credential Access with Tokens
Civic tokens always result in a locked profile. This means the token can only access credentials that have been explicitly assigned to the profile. Unassigned credentials — even ones that would otherwise match — are not available. New credentials authenticated through a token session are automatically assigned to the token’s profile.Token Expiration & Renewal
Expiration
- You can configure token expiration up to a maximum of 30 days
- Expired tokens return a
401 Unauthorizederror - You’ll receive no warning before expiration
- The expiration date is shown when you generate the token
Renewal
Tokens cannot be renewed. To continue access after expiration:Generate a new token
Update your service
Old token invalidated
Security Best Practices
Storage
Never commit tokens to version control
Never commit tokens to version control
.env to your .gitignore:Use secret management services
Use secret management services
- AWS Secrets Manager - For AWS deployments
- HashiCorp Vault - For multi-cloud or on-premises
- Google Secret Manager - For GCP deployments
- Azure Key Vault - For Azure deployments
Rotate tokens regularly
Rotate tokens regularly
- Generate new tokens before old ones expire
- Don’t wait until the last day
- Update services with new tokens proactively
- Test that the new token works before the old one expires
Rotate tokens before expiration
Rotate tokens before expiration
- Tokens can be configured for up to 30 days
- Set reminders to rotate tokens before they expire
- Generate new tokens proactively to avoid service interruption
- Use shorter expiration periods for better security
- Consider your organization’s security policies and compliance requirements
Access Control
One token per service
Use appropriate profiles
Use shorter expiration periods
Monitor token usage
Troubleshooting
403 Forbidden
403 Forbidden
- Verify the token was generated for the correct profile
- Check that the profile name in the MCP URL matches the token’s profile
- Ensure the profile has access to the MCP servers you’re trying to use
- Confirm the profile exists and is active in your Civic account
Token not working in automation platform
Token not working in automation platform
- Double-check the Authorization header:
Authorization: Bearer YOUR_TOKEN - Verify the MCP URL includes both accountId and profile parameters
- Ensure Content-Type header is set:
Content-Type: application/json - Test the token with a simple curl command first to isolate the issue
How do I know when my token expires?
How do I know when my token expires?
- Set a calendar reminder when you generate the token
- Note the expiration date in your documentation
- Implement monitoring in your application to detect 401 errors
- Use shorter expiration periods for sensitive integrations

