# Postman Collection

> Ready-to-use Postman collection for testing RevRag AI Voice Calling Agent APIs. Import and start testing all Single Trigger APIs instantly.

URL: /api-reference/postman-collection
Markdown: /api-reference/postman-collection.md



# Postman Collection [#postman-collection]

**🚀 Ready-to-use Postman Collection for all Single Trigger APIs**

We've created a complete Postman collection with all 3 Single Trigger APIs pre-configured and ready to test. This collection includes proper authentication, sample request bodies, and environment variables for seamless testing.

## **📥 Download Options** [#-download-options]

### **Option 1: Direct Download** [#option-1-direct-download]

Right-click and save: &#x2A;*[postman-collection.json](./postman-collection.json)**

### **Option 2: Copy & Save** [#option-2-copy--save]

Copy the JSON collection below and save it as `RevRag_Single_Trigger_APIs.postman_collection.json`:

```json
{
  "info": {
    "name": "RevRag Single Trigger APIs",
    "description": "Collection for RevRag AI Voice Calling Agent APIs - Single Trigger endpoints",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://staging-api.revrag.ai",
      "type": "string"
    },
    {
      "key": "api_key",
      "value": "YOUR_API_KEY",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "1. Get All Agents",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "X-API-Key",
            "value": "{{api_key}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{base_url}}/v1/campaigns/agents",
          "host": ["{{base_url}}"],
          "path": ["v1", "campaigns", "agents"]
        },
        "description": "Retrieve all workspace agents with their detailed information including variables"
      }
    },
    {
      "name": "2. Trigger Single Call",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "X-API-Key",
            "value": "{{api_key}}",
            "type": "text"
          },
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"agent_id\": \"agent_123e4567-e89b-12d3-a456-426614174000\",\n  \"to_phone_number\": \"+1234567890\",\n  \"variable_fields\": {\n    \"first_name\": \"John\",\n    \"company\": \"Acme Inc.\"\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "url": {
          "raw": "{{base_url}}/v1/campaigns/trigger/single",
          "host": ["{{base_url}}"],
          "path": ["v1", "campaigns", "trigger", "single"]
        },
        "description": "Trigger a single AI call for testing purposes"
      }
    },
    {
      "name": "3. Get Call Status",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "X-API-Key",
            "value": "{{api_key}}",
            "type": "text"
          }
        ],
        "url": {
          "raw": "{{base_url}}/v1/campaigns/trigger/status/{{call_id}}",
          "host": ["{{base_url}}"],
          "path": ["v1", "campaigns", "trigger", "status", "{{call_id}}"],
          "variable": [
            {
              "key": "call_id",
              "value": "call_123e4567-e89b-12d3-a456-426614174000",
              "description": "The ID of the call to get status for"
            }
          ]
        },
        "description": "Get the status of a specific call by its call_id"
      }
    }
  ]
}
```

## **📖 How to Import to Postman** [#-how-to-import-to-postman]

### **Step-by-Step Instructions:** [#step-by-step-instructions]

1. **Download or copy** the collection JSON above
2. **Open Postman** application on your computer
3. **Click "Import"** button (located in the top left corner)
4. **Select the JSON file** you downloaded, or paste the JSON content directly
5. **Click "Import"** to add the collection to your workspace
6. **Update API Key**:
   * Go to the collection variables tab
   * Replace `YOUR_API_KEY` with your actual RevRag API key
7. **Select environment**: Make sure the staging environment variables are active
8. **Start testing** all 3 APIs instantly! 🎉

### **Environment Setup:** [#environment-setup]

The collection includes these environment variables:

* `{{base_url}}`: Set to `https://staging-api.revrag.ai` for staging environment
* `{{api_key}}`: Replace with your actual API key
* `{{call_id}}`: Used for testing the Get Call Status endpoint

## **✅ What's Included** [#-whats-included]

* ✅ **All 3 Single Trigger APIs** pre-configured with proper endpoints
* ✅ **Environment variables** for easy base URL and API key management
* ✅ **Sample request bodies** with realistic test data and proper formatting
* ✅ **Proper headers** including `X-API-Key` authentication and content types
* ✅ **Path variables** configured for dynamic call ID usage
* ✅ **Descriptions** for each API endpoint explaining their purpose
* ✅ **Ready for staging environment** pointing to `staging-api.revrag.ai`

## **🎯 API Endpoints Included** [#-api-endpoints-included]

### **1. Get All Agents** [#1-get-all-agents]

* **Method**: GET
* **Endpoint**: `/v1/campaigns/agents`
* **Purpose**: Retrieve all workspace agents with variables
* **Headers**: X-API-Key authentication

### **2. Trigger Single Call** [#2-trigger-single-call]

* **Method**: POST
* **Endpoint**: `/v1/campaigns/trigger/single`
* **Purpose**: Trigger a single AI call for testing
* **Headers**: X-API-Key authentication, Content-Type: application/json
* **Body**: JSON with agent\_id, phone number, and variable fields

### **3. Get Call Status** [#3-get-call-status]

* **Method**: GET
* **Endpoint**: `/v1/campaigns/trigger/status/{call_id}`
* **Purpose**: Get detailed status of a specific call
* **Headers**: X-API-Key authentication
* **Variables**: Dynamic call\_id from previous responses

## **💡 Testing Workflow** [#-testing-workflow]

### **Recommended Testing Order:** [#recommended-testing-order]

1. **Start with "Get All Agents"**
   * Verify your API key works
   * Get available agent IDs for testing
   * Copy an agent ID for the next step

2. **Use "Trigger Single Call"**
   * Update the `agent_id` with a real agent ID from step 1
   * Modify phone number if needed (for testing)
   * Execute the call and save the returned `call_id`

3. **Check "Get Call Status"**
   * Replace the `call_id` variable with the actual ID from step 2
   * Monitor the call status and get detailed information

### **Pro Tips:** [#pro-tips]

* **Save responses**: Copy important values like `call_id` from responses for use in subsequent requests
* **Environment switching**: Create separate environments for staging vs production testing
* **Variables usage**: Leverage Postman variables to automatically pass data between requests
* **Collection runner**: Use Postman's collection runner to test all APIs in sequence
* **Test scripts**: Add test scripts to automatically validate responses and extract values

## **🔧 Troubleshooting** [#-troubleshooting]

### **Common Issues:** [#common-issues]

**❌ 401 Unauthorized**

* Check that your API key is correctly set in the collection variables
* Ensure the API key has proper permissions for the endpoints

**❌ 404 Not Found**

* Verify the base URL is correct (`https://staging-api.revrag.ai`)
* Check that endpoint paths match the API documentation

**❌ 422 Validation Error**

* Ensure request body format matches the expected schema
* Validate phone number format and agent ID values

### **Getting Help:** [#getting-help]

If you encounter issues with the Postman collection:

1. Check the [API Documentation](./call-trigger-apis) for detailed endpoint specifications
2. Verify your API key permissions and validity
3. Contact support at &#x2A;*[contact@revrag.ai](mailto:contact@revrag.ai)** for technical assistance

***

**Ready to start testing?** Download the collection and import it to Postman to begin exploring the RevRag AI Voice Calling APIs! 🚀
