πŸ““

Endpoints β€” Groups API

Getting Started
Installation
Setup
Inspect Traffic
HTTP Rules (Modify Traffic)
Session Book
Mock Server
API Client
File Server
Workspace
Public API
Guides
TroubleShooting
Subscription & Billing
Getting Started
Installation
Setup
Inspect Traffic
API Client
HTTP Rules (Modify Traffic)
Mock Server
File Server
Workspace
Public API
Guides
Session Book
Subscription & Billing
TroubleShooting
Β 

Authentication

To authenticate with the API, use the custom header x-api-key with your provided API key.
Example:
curl -H "x-api-key: YOUR_API_KEY" https://api2.requestly.io/v1/rules
🎁
Requestly API is currently in BETA. Fill this form to get your API key today.

Endpoints

The current APIs give all the basic crud capabilities for rules and groups. In case you want to quickly try these out on this playground https://requestly.readme.io/

Retrieve Groups

Get All Groups

Endpoint: GET /groups
CURL Example:
curl -H "x-api-key: YOUR_API_KEY" https://api2.requestly.io/v1/groups
Sample Response:
{ "success": true, "data": [ { "createdBy": "Gw9geGxr4aWejyB1erPKMnyFNNZW", "creationDate": 1707893324459, "currentOwner": "Gw9geGxr4aWejyB1erPKMnyFNNZW", "description": "", "groupId": "", "id": "Cancel_jcgzx", "isSample": false, "lastModifiedBy": "Gw9geGxr4aWejyB1erPKMnyFNNZW", "modificationDate": 1707893326371, "name": "cancel-1707893324464", "objectType": "rule", "pairs": [ { "id": "vr1e2", "source": { "key": "Url", "operator": "Contains", "value": "sdfa" } } ], "ruleType": "Cancel", "status": "Active" }, // other groups ] }

Get a Specific Group

Endpoint: GET /groups/:id
CURL Example:
curl -H "x-api-key: YOUR_API_KEY" https://api2.requestly.io/v1/groups/Group_1a2b3c
Sample Response:
{ "success": true, "data": { "id": "Group_4bfu8", "creationDate": 1707893421467, "modificationDate": 1707894488025, "createdBy": "Gw9geGxr4aWejyB1erPKMnyFNNZW", "lastModifiedBy": "Gw9geGxr4aWejyB1erPKMnyFNNZW", "name": "now this is active", "objectType": "group", "status": "Active", "isFavourite": false } }

Create a Group

Endpoint: POST /groups
CURL Example:
curl -X POST -H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" -d '{ "name": "New Awesome Group", "status": "Active" }' https://api2.requestly.io/v1/groups
Sample Response:
{ "success": true, "data": { "id": "Group_08j61", "creationDate": 1707894094078, "modificationDate": 1707894094078, "createdBy": "Gw9geGxr4aWejyB1erPKMnyFNNZW", "lastModifiedBy": "Gw9geGxr4aWejyB1erPKMnyFNNZW", "name": "New Awesome Group", "objectType": "group", "status": "Active", "isFavourite": false, "currentOwnerId": "Gw9geGxr4aWejyB1erPKMnyFNNZW" }}

Update a Group

Endpoint: PUT /groups/:id
CURL Example:
curl -X PUT -H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" -d '{ "name": "Updated Group Name", "status": "Inactive" }' https://api2.requestly.io/v1/groups/Group_1a2b3c
Sample Response:
{ "success": true, "data": { "id": "Group_1a2b3c", "creationDate": 1707893421467, "modificationDate": 1707894488025, "createdBy": "Gw9geGxr4aWejyB1erPKMnyFNNZW", "lastModifiedBy": "Gw9geGxr4aWejyB1erPKMnyFNNZW", "name": "Updated Group Name", "objectType": "group", "status": "Inactive", "isFavourite": false } }

Delete a Group

Endpoint: DELETE /groups/:id
CURL Example:
curl -X DELETE -H "x-api-key: YOUR_API_KEY" https://api2.requestly.io/v1/groups/Group_1a2b3c
Sample Response:
{ "success": true, "message": "Group successfully deleted." }

Possible Errors

  • Group not found: The specified group does not exist.
  • Unauthorized action: You do not have access to the specified group.
  • Invalid Group Id: The provided group ID is invalid.
  • Invalid Group Payload: The entire group payload is invalid.
  • Group Name Required: A group name is required.
Each error returns a response in the format:
{ "success": false, "message": "Error message here." }