---
title: "Trigger a manual rule run with a sync-or-async branch."
method: POST
path: "/model-hub/annotation-queues/{queue_id}/automation-rules/{id}/evaluate/"
tags: ["model-hub"]
---

# Trigger a manual rule run with a sync-or-async branch.

`POST /model-hub/annotation-queues/{queue_id}/automation-rules/{id}/evaluate/`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/model-hub/annotation-queues/{queue_id}/automation-rules/{id}/evaluate/`
- Auth: one of:
  - API key in header `X-Api-Key`
  - API key in header `X-Secret-Key`

Small runs (filter resolves to ≤ ``RULE_RUN_SYNC_THRESHOLD``) finish
in the HTTP request and return 200 with the result — fast feedback
for the common case. Large runs (mostly first-ever runs on backlogs
or rules with wide filters) hand the work to a Temporal activity and
return 202 immediately. The activity emails creator + queue managers
on completion.

The peek is a cheap dry-run (``[:cap+1]`` LIMIT, no COUNT(*)) — sub-
100ms even on 10M+ row trace tables — so this branch costs little
even when it ends up taking the sync path.

## Request body

- EmptyRequest

## Response `200`

OK

- AutomationRuleEvaluateResponse
  - `status` boolean
  - `result` AutomationRuleEvaluateResult, required
    - `matched` integer, required
    - `added` integer, required
    - `duplicates` integer, required
    - `truncated` boolean
    - `error` string

## Other responses

- `202`: Accepted
- `400`: Bad Request
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `500`: Internal Server Error
- `default`: Default error response

---

[API](https://skmtc.dev/futureagi/apis/future-agi-management-api.md) · [All operations](https://skmtc.dev/futureagi/apis/future-agi-management-api/llms.txt) · [OpenAPI document](https://skmtc.dev/futureagi/apis/future-agi-management-api/revisions/c8684118e142?raw)
