Overview
Relvy supports REST API integration as a data source, allowing AI agents to query external APIs during issue investigation and analysis. This feature enables dynamic data retrieval from your existing services and third-party APIs to provide comprehensive context for troubleshooting.Security Recommendation - It is recommended to integrate APIs that are read-only to prevent unintended modifications during AI-driven investigations. If you must configure write operations (POST endpoints), ensure proper authentication, rate limiting, and careful consideration of the potential impact of automated API calls.
Core Concepts
REST API Groups
A REST API Group is a collection of related REST API endpoints that share common configuration such as:- Base URL
- Authentication settings
- Default headers
- Timeout and retry configurations
- Group-level variables
REST API Resources (Endpoints)
A REST API Resource represents a specific API endpoint within a group. Each resource defines:- HTTP method (GET or POST)
- Endpoint path
- Parameters
- Request body (for POST requests)
- Endpoint-specific variables
Variables
Variables are dynamic values that AI agents can populate when making API calls. There are two types:- Group Variables: Shared across all endpoints in the group (e.g.,
user_id
,tenant_id
) - Endpoint Variables: Specific to individual endpoints (e.g.,
order_id
for an order details endpoint)
{{variable_name}}
syntax in paths, parameters, and request bodies.
Setting Up REST API Integration
Creating a REST API Group
- Navigate to the configuration page
- Find the “Connect REST API” section
- Click “Add REST API Group”
- Fill in the required information:
Basic Configuration
- Group Name: Descriptive name for your API group
- Description: Context for AI agents about what this API provides
- Base URL: The root URL for all endpoints (e.g.,
https://api.example.com/v1
)
Authentication
Choose from the following authentication methods: No Authentication- Use when the API doesn’t require authentication
- Suitable for public APIs
- Provide username and password
- Used for APIs requiring HTTP Basic Auth
- Provide an API token
- Token is sent in the
Authorization: Bearer <token>
header
Optional Configuration
Default Headers- Request timeout in seconds (default: 30)
- Number of retry attempts for failed requests (default: 3)
Group Variables
Define reusable variables that can be used across all endpoints in this group:- Name: Variable identifier (e.g.,
user_id
) - Description: What this variable represents
- Default Value: Optional default value
- Example Value: Example for testing and AI understanding
Creating REST API Resources
After creating a group, add specific endpoints:- Navigate to the “API Endpoints” section
- Click the + button to add a new endpoint
- Configure the endpoint details:
Endpoint Configuration
Basic Details- Endpoint Name: Descriptive name (e.g., “Get User Profile”)
- HTTP Method: GET or POST
- Endpoint Path: Path relative to base URL (e.g.,
/users/{{user_id}}
) - Description: What this endpoint does and what data it returns
- Name: Parameter name
- Value: Static value or variable reference using
{{variable_name}}
- Default Value: Optional default
- Example Value: For testing and documentation
Supported HTTP Methods
GET Requests
GET requests are used for data retrieval. They support:- Path variables:
/users/{{user_id}}/orders/{{order_id}}
- Query parameters:
?status={{status}}&limit={{limit}}
- Custom headers
POST Requests
POST requests are used for data submission and actions. They support:- Path variables
- Query parameters
- Custom headers
- JSON request body with variable substitution
Variable System
Variable Usage
Variables can be used in: URL PathsTesting REST API Endpoints
Each configured endpoint can be tested directly from the UI:- Click the play button (▶) next to an endpoint
- Fill in values for any required variables
- Click “Test Endpoint”
- Review the response to ensure proper configuration
AI Integration
How AI Uses REST APIs
When investigating issues, AI agents can:- Identify Relevant APIs: Based on context and configured descriptions
- Determine Variable Values: Extract values from logs, metrics, or user input
- Execute API Calls: Make requests with appropriate variable substitution
- Analyze Responses: Incorporate API data into investigation results
Best Practices for AI Integration
Descriptive Naming- Use clear, descriptive names for groups and endpoints
- Include context about what data the API provides
- Explain what each endpoint does
- Describe the type of data returned
- Include when this API should be used
- Use descriptive variable names (
user_id
vsid
) - Provide clear descriptions for each variable
- Include example values
Example Configuration
E-commerce API Group
Group Configuration:-
Get User Profile
-
Get User Orders