Skip to main content

Strategy Group Endpoints

Create and manage strategy groups for bulk operations on collections of strategies.

Create strategy group

POST /api/strategy-groups

Request body

{
  "name": "E-commerce Monitors",
  "description": "Product price tracking across 50 stores"
}
FieldTypeRequiredDescription
namestringYesName for the group
descriptionstringNoDescription of the group

Response

{
  "id": "aa0e8400-e29b-41d4-a716-446655440000",
  "name": "E-commerce Monitors",
  "description": "Product price tracking across 50 stores",
  "strategy_count": 0,
  "created_at": "2025-01-15T10:30:00Z",
  "updated_at": "2025-01-15T10:30:00Z"
}

Example

curl -X POST https://api.meter.sh/api/strategy-groups \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "E-commerce Monitors",
    "description": "Product price tracking across 50 stores"
  }'

List strategy groups

GET /api/strategy-groups?limit=50&offset=0

Query parameters

ParameterTypeRequiredDescription
limitintegerNoMax results (default: 50)
offsetintegerNoResults to skip (default: 0)

Response

[
  {
    "id": "aa0e8400-e29b-41d4-a716-446655440000",
    "name": "E-commerce Monitors",
    "description": "Product price tracking across 50 stores",
    "strategy_count": 12,
    "created_at": "2025-01-15T10:30:00Z",
    "updated_at": "2025-01-15T10:30:00Z"
  }
]

Example

curl https://api.meter.sh/api/strategy-groups?limit=10 \
  -H "Authorization: Bearer sk_live_..."

Get strategy group

Get details for a specific group including member strategies.
GET /api/strategy-groups/{group_id}

Response

{
  "id": "aa0e8400-e29b-41d4-a716-446655440000",
  "name": "E-commerce Monitors",
  "description": "Product price tracking across 50 stores",
  "strategies": [
    {
      "strategy_id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Amazon Products",
      "description": "Extract product listings",
      "url": "https://amazon.com/products",
      "created_at": "2025-01-15T10:30:00Z",
      "updated_at": "2025-01-15T10:30:00Z"
    }
  ],
  "created_at": "2025-01-15T10:30:00Z",
  "updated_at": "2025-01-15T10:30:00Z"
}

Example

curl https://api.meter.sh/api/strategy-groups/{group_id} \
  -H "Authorization: Bearer sk_live_..."

Update strategy group

Update a group’s name or description.
PATCH /api/strategy-groups/{group_id}

Request body

{
  "name": "Updated Name",
  "description": "Updated description"
}
All fields are optional. Include only fields to update.

Example

curl -X PATCH https://api.meter.sh/api/strategy-groups/{group_id} \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"name": "New Group Name"}'

Delete strategy group

Delete a group. Strategies in the group become ungrouped — they are not deleted.
DELETE /api/strategy-groups/{group_id}

Response

{
  "message": "Strategy group deleted successfully"
}

Example

curl -X DELETE https://api.meter.sh/api/strategy-groups/{group_id} \
  -H "Authorization: Bearer sk_live_..."

Add strategies to group

Add existing strategies to a group.
POST /api/strategy-groups/{group_id}/strategies

Request body

{
  "strategy_ids": [
    "550e8400-e29b-41d4-a716-446655440000",
    "660e8400-e29b-41d4-a716-446655440000"
  ]
}

Response

{
  "message": "Strategies added to group"
}

Example

curl -X POST https://api.meter.sh/api/strategy-groups/{group_id}/strategies \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "strategy_ids": [
      "550e8400-e29b-41d4-a716-446655440000",
      "660e8400-e29b-41d4-a716-446655440000"
    ]
  }'

Remove strategy from group

Remove a strategy from a group (sets the strategy’s group to null — the strategy is not deleted).
DELETE /api/strategy-groups/{group_id}/strategies/{strategy_id}

Response

{
  "message": "Strategy removed from group"
}

Example

curl -X DELETE https://api.meter.sh/api/strategy-groups/{group_id}/strategies/{strategy_id} \
  -H "Authorization: Bearer sk_live_..."

Apply group schedule

Create or update a schedule for every strategy in the group.
POST /api/strategy-groups/{group_id}/schedule

Request body

{
  "interval_seconds": 3600,
  "webhook_url": "https://your-app.com/webhooks/meter",
  "webhook_type": "standard"
}
FieldTypeRequiredDescription
interval_secondsintegerConditionalRun every N seconds (min: 60)
cron_expressionstringConditionalCron expression
webhook_urlstringNoWebhook URL for notifications
webhook_secretstringNoWebhook secret (auto-generated if not provided)
webhook_typestringNostandard, slack, slack_workflow, or discord. Auto-detected from URL if not specified
webhook_metadataobjectNoCustom JSON metadata for webhook payloads
Provide either interval_seconds or cron_expression, not both.

Response

{
  "message": "Group schedule applied",
  "created": 8,
  "updated": 4
}

Example

curl -X POST https://api.meter.sh/api/strategy-groups/{group_id}/schedule \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "interval_seconds": 3600,
    "webhook_url": "https://your-app.com/webhooks/meter"
  }'

Delete group schedules

Delete all schedules for strategies in the group.
DELETE /api/strategy-groups/{group_id}/schedule

Response

{
  "message": "Group schedules deleted"
}

Example

curl -X DELETE https://api.meter.sh/api/strategy-groups/{group_id}/schedule \
  -H "Authorization: Bearer sk_live_..."

Toggle group schedules

Enable or disable all schedules for strategies in the group.
PATCH /api/strategy-groups/{group_id}/schedule/toggle

Request body

{
  "enabled": false
}

Response

{
  "message": "Group schedules updated"
}

Example

curl -X PATCH https://api.meter.sh/api/strategy-groups/{group_id}/schedule/toggle \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{"enabled": false}'

Apply group schema

Apply an output schema to all strategies in the group. This triggers asynchronous regeneration of each strategy.
PATCH /api/strategy-groups/{group_id}/schema

Request body

{
  "output_schema": {
    "title": "string",
    "price": "number",
    "in_stock": "boolean"
  }
}
FieldTypeRequiredDescription
output_schemaobjectYesJSON schema defining the desired output structure
See Output Schemas for supported types and nesting.

Response

{
  "message": "Schema applied and regeneration started",
  "strategy_count": 12
}

Example

curl -X PATCH https://api.meter.sh/api/strategy-groups/{group_id}/schema \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "output_schema": {
      "title": "string",
      "price": "number",
      "in_stock": "boolean"
    }
  }'

Get schema progress

Poll the progress of a group schema regeneration task.
GET /api/strategy-groups/{group_id}/schema/progress

Response

Returns progress details from the background regeneration task.

Example

curl https://api.meter.sh/api/strategy-groups/{group_id}/schema/progress \
  -H "Authorization: Bearer sk_live_..."

Test group webhook

Send a test webhook using a group’s schedule webhook configuration.
POST /api/strategy-groups/{group_id}/webhook/test

Response

{
  "success": true,
  "status_code": 200,
  "message": "Webhook delivered successfully"
}

Example

curl -X POST https://api.meter.sh/api/strategy-groups/{group_id}/webhook/test \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json"
The test uses the webhook URL from any existing schedule in the group. At least one member strategy must have a schedule with a webhook_url configured.

Error responses

StatusDescription
400Invalid request (missing required fields, invalid cron expression)
401Invalid or missing API key
404Strategy group not found
422Validation error (e.g., both interval and cron provided)
500Internal server error
See REST API Errors for detailed error handling.

Next steps

Strategy Groups Concept

Understand strategy group architecture

Output Schemas

Define output structure for groups

Python SDK

Strategy group methods in the SDK

Webhooks

Handle webhook notifications

Need help?

Email me at mckinnon@meter.sh