Overview
API keys provide a secure way to authenticate API requests without requiring user credentials. They are particularly useful for server-to-server communication and for integrating with the workflow system.API Key Structure
- Format:
sk-{random_string}
- Example:
sk-ABCDEFGhijklmnoPQRSTuvwxyz1234567890ABCDEFG
API Key Properties
- Name: Human-readable name for the key
- Organization: Associated organization
- Team: Optional team association
- Workflow ID: Optional specific workflow restriction
- Expiration: Optional expiry date
Creating an API Key
Accessing the API Key Page
- Log into your Gaife account
- Navigate to your organization dashboard
- In the left sidebar menu, find and click on “Developer API” or “API Keys”
- The path follows this structure:
/organizations/[orgId]/api-access
Creating a New API Key
- On the API Keys page, click the ”+ Create new API key” button in the top-right corner
- A dialog will appear asking you to name your key
- Enter a descriptive name for your API key (e.g., “Production API”, “Development Testing”, etc.)
- Click “Generate Key”
- Your new API key will be displayed - copy it
Using API Keys in Requests
API keys are sent as Bearer tokens in the Authorization header:Example: Developer Workflow Triggers
Endpoint
Description
Triggers a workflow synchronouslyHeaders
Request Body
Example: Developer Workflow Status
Endpoint
Description
Gets the status of a workflow instanceHeaders
API Key Restrictions
- Organization Restriction: API keys can only be used for the organization they belong to
- Workflow Restriction: If a workflow_id is specified when creating the key, the key can only be used for that specific workflow
- Expiration: Keys with an expiration date will be invalidated after that date
Security Considerations
- Keep API Keys Secure: Store them securely and never expose them in client-side code
- Use Workflow-Specific Keys: For improved security, create keys with workflow_id restrictions
- Rotation: Regularly rotate API keys to minimize security risks
- Monitor Usage: The system tracks the last_used_at timestamp for auditing
Error Responses
Invalid API Key
Unauthorized Workflow Access
Missing API Key
Best Practices
- Create different API keys for different integrations to easily revoke access if needed
- Use team-specific keys when appropriate to limit access scope
- Specify a workflow_id when the key will only be used for a specific workflow
- Set expiration dates on keys that are meant for temporary use