Skip to main content
The Pharen REST API lets trusted backend services, sync jobs, and internal tools work with your Pharen Hub workspace. The API reference uses Mintlify’s interactive playground, so you can inspect request parameters, generate code examples, and try scoped API-key calls from the docs.

Base URL

All API requests are made to the following base URL:
Every endpoint in this reference is relative to this base. For example, the full URL for listing calendar events is https://pharen.app/api/calendar/events/. Each endpoint page has a Try it panel. Set Authorization to your Bearer token, then use the baseUrl field in the request URL bar to choose the server you want to test. For local testing, replace the default https://pharen.app value with http://localhost:8000. Include http:// or https:// so the playground can build a valid URL. Playground requests are sent directly from your browser, so your local backend must be running and allow requests from the docs site.

Authentication

Create a scoped API key in Settings -> API Keys, then send it as a Bearer token:
If your client cannot set an Authorization header, send the same key through X-API-Key.

Create and scope keys

Learn how API key scopes, team targets, expiration, and rotation work.

List calendar events

Try a read-only API-key request in the interactive playground.

Request format

The API accepts JSON-encoded request bodies. For any request that includes a body (POST, PUT), you must set the Content-Type header to application/json.
All path and query parameters should be URL-encoded where applicable.

Response format

Every response from the API is JSON-encoded. Successful responses return the requested resource object or a list of resource objects. The Content-Type of all responses is application/json. A typical single-resource response looks like this:
List responses return an array of resource objects alongside pagination metadata:

HTTP status codes

The API uses standard HTTP status codes to communicate the outcome of every request.

Error objects

When a request fails (4xx or 5xx), the response body contains a structured error object to help you diagnose the problem:

Rate limiting

To ensure fair usage and platform stability, the API enforces rate limits on all endpoints. By default, your API key is limited to 1,000 requests per minute. When you exceed the rate limit, the API returns a 429 Too Many Requests response. The response includes the following headers to help you manage your request cadence:
Implement exponential backoff in your integration when you receive 429 responses. Continuing to send requests at a high rate after being rate-limited may result in temporary suspension of your API key.

Make your first request

Here’s a minimal example that authenticates and retrieves calendar events:
Replace YOUR_API_KEY with the key you generate in the Pharen Hub dashboard. See Authentication and API keys for the full setup flow.