Introduction
The Copera Public API supports two authentication methods: Personal Access Tokens and Integration API Keys. Each method is suited to different use cases. All API requests must include a valid token in theAuthorization header using the Bearer scheme.
Personal Access Tokens
Personal Access Tokens (PATs) allow you to authenticate as yourself when calling the API. They are prefixed withcp_pat_.
Generating a Token
- Open your Workspace Settings.
- Navigate to Integrations.
- Select the Personal Tokens tab.
- Click Create new token.
- Set a name and expiration date (maximum 1 year).
- Copy the token immediately — it appears only once.
Characteristics
- Workspace-scoped — each token is tied to a specific workspace.
- Acts as your identity — API requests made with a PAT are attributed to you.
- Has an expiration — tokens expire after the configured duration, up to a maximum of 1 year.
Example Request
Integration API Keys
Integration API Keys are the existing method for authenticating bots and integrations. They are prefixed withcp_key_.
Characteristics
- Bot identity — requests are attributed to the integration, not a specific user.
- Used for boards and channels — designed for interacting with board and channel endpoints.
- Requires explicit permissions — the integration must be granted access to specific resources.
When to Use Which
| Method | Prefix | Best for |
|---|---|---|
| Personal Access Token | cp_pat_ | Scripts, CI pipelines, personal automation acting as yourself |
| Integration API Key | cp_key_ | Bots, integrations with a separate identity |
Security Best Practices
- Store tokens securely — use environment variables or secret managers, never hardcode tokens in your application.
- Set short expiration dates — use the shortest practical expiration for your use case.
- Rotate tokens regularly — generate new tokens periodically and revoke old ones.
- Never commit tokens to source control — add token files to
.gitignoreand use CI/CD secrets management. - Use the minimum required scope — only request the permissions your integration needs.