Using the API
Build custom integrations and automations using the Rolebase GraphQL API.
Overview
Rolebase exposes a GraphQL API backed by Hasura. You can use this API to build custom integrations, scripts, or dashboards that interact with your organizational data.
API Access
- The API endpoint is available at your Nhost project's GraphQL URL.
- Authentication is handled via API keys.
- Refer to the GraphQL API for available queries, mutations, and entity schemas.
Authentication
API requests are authenticated with an API key, created from the Settings > API keys page in the app. A key carries the permissions of the user who created it, across all the organizations that user belongs to.
Send it in the x-api-key header:
x-api-key: <your-api-key>The same key authenticates the GraphQL API and the tRPC API.
Example Use Cases
- Sync tasks with an external project management tool (Jira, Asana, Trello).
- Build a Slack bot that posts meeting summaries to a channel.
- Create a custom dashboard that aggregates data across organizations.
- Automate role assignments based on external HR data.
- Export meeting history and decisions to a reporting tool.
Example: Fetching Organization Roles
query GetRoles($orgId: uuid!) { role(where: { orgId: { _eq: $orgId } }) { id name purpose domain accountabilities parentRoleId }}Example: Creating a Task
mutation CreateTask($input: task_insert_input!) { insert_task_one(object: $input) { id title status }}For large organizations migrating from another tool, writing a script that reads your existing data and creates entities via the GraphQL API is the most flexible approach.
User Apps
Rolebase supports user apps (OAuth-connected applications like calendar integrations). If you are building an integration that needs to act on behalf of a user, you can use the user app framework.
See the GraphQL API for details on the user_app and api_key entities.
Next Steps
- Browse the GraphQL API for the full schema documentation.
- Set up the development environment to explore the codebase.