Documentation Index
Fetch the complete documentation index at: https://mintlify.com/JeffreyLin1/agility/llms.txt
Use this file to discover all available pages before exploring further.
Introduction
Agility provides a set of Edge Functions powered by Supabase that enable workflow automation through various integrations. These serverless functions handle operations like text generation, email management, Discord messaging, and GitHub integration.Base URL
All API endpoints are hosted on your Supabase instance:Authentication
All Edge Functions require authentication using a Supabase JWT token passed in theAuthorization header.
Header Format
Getting Your Token
You can obtain a JWT token by:- Authenticating through Supabase Auth
- Using the Supabase client library’s
getSession()method - Extracting the token from the authenticated user’s session
Authentication Errors
| Status Code | Error | Description |
|---|---|---|
| 401 | No authorization header | Authorization header is missing |
| 401 | Not authenticated | Invalid or expired JWT token |
Common Request Patterns
CORS Support
All endpoints support CORS with the following headers:Access-Control-Allow-Origin: *Access-Control-Allow-Methods: POST, OPTIONSAccess-Control-Allow-Headers: Content-Type, Authorization
Request Format
All requests should use:- Method:
POST - Content-Type:
application/json - Body: JSON payload with required parameters
Response Format
Successful responses return JSON with a 200 status code:Common Parameters
Many endpoints share these common parameters:The unique identifier for the workflow element. This links the API call to a specific agent configuration in your workflow.
Error Codes
| Status Code | Meaning |
|---|---|
| 200 | Success - Request completed successfully |
| 204 | No Content - Request successful, no response body |
| 400 | Bad Request - Missing or invalid parameters |
| 401 | Unauthorized - Authentication required or failed |
| 404 | Not Found - Resource or configuration not found |
| 500 | Internal Server Error - Server-side error occurred |
Rate Limiting
Rate limits depend on your Supabase plan. Check your Supabase dashboard for current limits.Agent Configuration
Most Edge Functions work with agent configurations stored in theagent_configs table. These configurations include:
- API keys and credentials (encrypted)
- Agent-specific settings
- Connection parameters
elementId parameter.
Placeholder System
Many endpoints support dynamic placeholder substitution in text fields using the format:{{input.text}}- References text from a previous agent{{input.emailBody}}- References email body from Gmail reader{{input.messages.0.body}}- References first message body
Security Considerations
- Credentials: API keys and OAuth tokens are encrypted using XOR encryption with an
ENCRYPTION_KEYenvironment variable - User Isolation: All queries are filtered by
user_idto ensure data isolation - Token Validation: JWT tokens are validated on every request
- HTTPS Only: All API calls must use HTTPS
Next Steps
Explore the individual endpoint documentation: Workflow Management:- Run Workflow - Execute workflow sequences
- Generate Workflow - AI-powered workflow generation
- Manage Workflows - Save and load workflows
- Manage Agent Configs - Agent configuration storage
- Manage Connections - Workflow connection management
- Generate Text - AI text generation
- Read Gmail - Fetch emails
- Send Gmail - Send emails
- Send Discord - Send Discord messages
- Read GitHub - Fetch GitHub commits