Create a key
You create API keys in Pharen Hub.1
Open API key settings
Go to Settings → API Keys in your workspace.
2
Name the key
Choose a short, specific name such as
calendar-sync-production or docs-import-worker.3
Choose the access target
Select Entire workspace for workspace-wide automation, or Selected teams when the integration should only work inside specific teams.
4
Select scopes
Choose the minimum permissions the integration needs. You can grant access to lists, docs, calendar, workflows, and agents separately.
5
Copy the key once
Copy the generated key immediately. Pharen only shows the full key once.
Try API key requests
The endpoint pages in this reference use Mintlify’s interactive playground. Add your key as a Bearer token, fill the parameters, and run a request directly from the docs. In Try it, paste the key into Authorization. The playground defaults baseUrl tohttps://pharen.app. To test a local backend, replace that value with http://localhost:8000.
List calendar events
Test a
calendar:read key against a read-only endpoint.Run workflow
Test a
workflows:run key against an execution endpoint.List documents
Test a
docs:read key against Pharen Docs.Chat with agent
Test an
agents:run key against an agent chat endpoint.Use a key
Send the key with every request. Bearer authentication is recommended:X-API-Key header for server-to-server tools that cannot set an Authorization header:
API keys generated by Pharen start with
phk_. Store the full value in a secrets manager or an environment variable such as PHAREN_API_KEY.Permission levels
Lists, Docs, and Calendar use four permission levels.
Workflows and Agents use focused run permissions.
Scope reference
A key can only do what both the key scopes and the creator’s account permissions allow. If the creator loses access, their keys lose that access too.
Workspace and team scope
Every key belongs to one workspace. A workspace-wide key can operate anywhere its scopes and creator permissions allow inside that workspace. Team-scoped keys are stricter. They only match requests that target one of the selected teams. Use team scope for production automations owned by a single team or department.Expiration and rotation
An expiration date is optional, but recommended for temporary jobs and vendor integrations. For long-running production jobs, rotate keys periodically.- Create a replacement key with the same or narrower scopes.
- Deploy the new key to your secrets manager.
- Confirm the integration works with the new key.
- Revoke the old key in Settings → API Keys.
Common errors
Best practices
- Create one key per integration or environment.
- Name keys by job and environment, not by person.
- Prefer Read or Write over Full access unless deletion is required.
- Use team scope when an automation belongs to one team.
- Store keys in a secrets manager.
- Revoke unused keys immediately.