Skip to main content

Overview

The API Management page is your central hub for:
  • API Keys - Authenticate external API calls
  • Enrollment Tokens - Register new driver machines
  • VM Machines - Monitor connected drivers
API Management page

API Keys

API keys authenticate requests to your public endpoints.

Creating an API Key

1

Click Create API Key

In the API Keys section, click + Create Key
2

Name Your Key

Give it a descriptive name like “Production Backend” or “CI/CD Pipeline”
3

Copy the Key

Important: Copy the key immediately. It’s only shown once!
gk_live_a1b2c3d4e5f6g7h8i9j0...
Store your API key securely. It grants full access to run automations. If compromised, revoke it immediately and create a new one.

Using API Keys

Include the key in the X-Granite-API-Key header:
curl -X POST "https://api.getgranite.ai/api/your-org/endpoint" \
  -H "X-Granite-API-Key: gk_live_abc123..."

Managing Keys

ActionHow
ViewSee key name, creation date, last used
RevokeClick the trash icon to delete
You can have multiple API keys for different services or environments.

API Key Best Practices

Create distinct keys for production, staging, and different integrations. If one is compromised, you only revoke that one.
Every 90 days, create a new key and phase out the old one.
Use environment variables or secret managers instead.
Check Analytics to see if keys are being used unexpectedly.

Enrollment Tokens

Enrollment tokens are one-time-use codes for registering new driver machines.

Creating an Enrollment Token

1

Click Create Token

In the Enrollment Tokens section, click + Create Token
2

Copy the Token

A new token is generated:
enroll_x7y8z9a1b2c3...
3

Use on Driver Machine

Run the driver with this token to register it to your organization

Token Properties

PropertyDescription
One-time useToken is consumed after enrollment
24-hour expiryUnused tokens expire after 24 hours
Organization-boundDriver joins your specific org

Revoking Tokens

If a token hasn’t been used yet, you can revoke it:
  1. Find the token in the list
  2. Click the trash icon
  3. Confirm revocation

VM Machines (Drivers)

View all driver machines connected to your organization.

Machine List

Each entry shows:
FieldDescription
NameMachine identifier
StatusOnline (green), Offline (gray), Busy (yellow)
Last SeenWhen it last communicated
Current JobWhat it’s working on (if busy)

Machine Status

Online

Ready to accept jobs

Busy

Currently running an automation

Offline

Not connected

Managing Machines

From the machine detail view, you can:
  • View details - IP address, OS version, capabilities
  • See job history - What it has run recently
  • Remove machine - Unregister from your organization
Removing a machine means it can’t run automations for your organization anymore. You’ll need a new enrollment token to re-add it.

Queue Status

The API Management page also shows queue metrics:
MetricDescription
Jobs QueuedAutomations waiting for a driver
Avg Wait TimeHow long jobs wait in queue
Active DriversNumber of online machines
If wait times are high and you have many queued jobs, consider adding more driver machines.

SDK Example

Manage API keys programmatically:
import { client } from '@getgraniteai/ts-sdk';

// List API keys
const keys = await client.listApiKeys({
  organizationId: 'org_123'
});

// Create new key
const newKey = await client.createApiKey({
  organizationId: 'org_123',
  name: 'Production Backend'
});

// Revoke key
await client.revokeApiKey({
  organizationId: 'org_123',
  keyId: 'key_abc'
});

Next Steps