Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.invokehq.run/llms.txt

Use this file to discover all available pages before exploring further.

Call this endpoint before executing a write that depends on previously resolved state. Invoke compares your assumed state against current live state and returns a decision — proceed, block, or replan.

Endpoint

POST https://agentgate-ai.onrender.com/state/verify

Authentication

-H "X-API-Key: your_api_key"

Request body

{
  "intent": "crm_update_customer",
  "required_fields": ["customer_id", "account_status"],
  "assumed_state": { "customer_id": "cust_123", "account_status": "qualified" },
  "current_state": { "customer_id": "cust_123", "account_status": "qualified" },
  "conditions": { "customer_id": "cust_123" },
  "on_mismatch": "replan"
}

Fields

FieldTypeRequiredDescription
intentstringYesHuman-readable label for the action
required_fieldsstring[]YesFields that must match between assumed and current state
assumed_stateobjectYesState the agent resolved at plan time
current_stateobjectYesLive state fetched immediately before the call
conditionsobjectYesField values that must hold for the write to proceed
on_mismatchstringYes"replan" or "block"

Response

{
  "status": "verified",
  "decision": "proceed",
  "mismatches": []
}

When state has drifted

{
  "status": "mismatch_detected",
  "decision": "replan",
  "mismatches": [
    {
      "field": "customer_id",
      "assumed": "cust_123",
      "current": "cust_999"
    }
  ]
}

Decision values

DecisionMeaning
proceedState matches, write is safe to execute
replanState drifted, agent should re-resolve before proceeding
blockState drifted and on_mismatch is "block"

Full example

curl -X POST https://agentgate-ai.onrender.com/state/verify \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "intent": "crm_update_customer",
    "required_fields": ["customer_id", "account_status"],
    "assumed_state": { "customer_id": "cust_123", "account_status": "qualified" },
    "current_state": { "customer_id": "cust_999", "account_status": "qualified" },
    "conditions": { "customer_id": "cust_123" },
    "on_mismatch": "replan"
  }'

Next steps