Skip to main content

API Keys

Generate and manage API keys for programmatic access to RoleDream

Overview

What are API Keys?

API keys provide a simple way to authenticate your applications and scripts when accessing the RoleDream API. They are best suited for server-to-server integrations where you need programmatic access without user interaction.

Security Notice

API keys grant full access to your company's data. Keep them secure and never expose them in client-side code or public repositories.

Full API Reference

Explore all available endpoints, request/response formats, and test the API directly.

Open API Documentation
Setup

Creating API Keys

1

Navigate to Integrations

Go to Integrations > API Keys in the main navigation menu.

2

Create New Key

Click "Create API Key" and provide a descriptive name for your key (e.g., "Production Sync Script").

3

Copy Your Key

Copy the generated key immediately. For security, the full key is only shown once during creation.

Manage API Keys
In your code

Using API Keys

Include your API key in the X-API-Key header of your HTTP requests:

curl -X GET "https://your-api-domain.com/api/customer" \
  -H "X-API-Key: your_api_key_here" \
  -H "Content-Type: application/json"

JavaScript Example

const response = await fetch('https://your-api-domain.com/api/customer', {
  headers: {
    'X-API-Key': process.env.ROLEDREAM_API_KEY,
    'Content-Type': 'application/json'
  }
});
const customers = await response.json();
Lifecycle

Key Management

Regenerating Keys

If a key is compromised, regenerate it immediately. The old key will be invalidated and a new one will be generated.

Revoking Keys

Revoke keys that are no longer needed. This immediately invalidates the key and prevents further access.

Guidance

Best Practices

  • Use environment variables - Never hardcode API keys in your source code.
  • One key per integration - Create separate keys for different applications or environments.
  • Regular rotation - Periodically regenerate keys as a security measure.
  • Use descriptive names - Name keys clearly to identify their purpose later.