Work
Make a delegated work decision
With the separate opt-in work:decide grant, approve, reject, retry or review your worker request on the EHQ owner's behalf. Inspect it first and pass the current payloadHash; retry requires the observed attempt after reconciling uncertain execution, and acceptance or changes require the current resultHash and concrete evidence. EHQ enforces ownership, unchanged scope, expiry, attempt identity and protected completion. The credential is recorded as delegated authority, not a claim that a human clicked approval. Computer-use decisions remain in EHQ. This does not authorize extra Git, deployment, production-data or messaging operations. Reuse an Idempotency-Key header after interruption.
Method
POST
Path
/v1/work/decide
Required scope
work:decideRequest
curl -X POST "https://api.endurancehq.app/v1/work/decide" \
-H "Authorization: Bearer $EHQ_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"JSON body schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"requestId": {
"type": "string",
"minLength": 1,
"maxLength": 200
},
"payloadHash": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"decision": {
"type": "string",
"enum": [
"approve",
"reject",
"retry",
"accept",
"request_changes"
]
},
"attempt": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"resultHash": {
"type": "string",
"pattern": "^[a-f0-9]{64}$"
},
"evidence": {
"type": "string",
"minLength": 10,
"maxLength": 2000
}
},
"required": [
"requestId",
"payloadHash",
"decision"
],
"additionalProperties": false
}Response
Success status: 200
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"data": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"revision": {
"type": "string"
},
"followUp": {
"anyOf": [
{
"type": "object",
"properties": {
"requestId": {
"type": "string"
},
"attempt": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"actionId": {
"type": "string"
}
},
"required": [
"requestId",
"attempt",
"actionId"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"continuedByRequestId": {
"type": [
"string",
"null"
]
},
"kind": {
"type": "string",
"enum": [
"worker",
"computer_use"
]
},
"requestStatus": {
"type": "string",
"enum": [
"pending",
"approved",
"dispatching",
"dispatched",
"completed",
"rejected",
"failed",
"expired"
]
},
"title": {
"type": "string"
},
"summary": {
"type": [
"string",
"null"
]
},
"project": {
"type": "string"
},
"product": {
"type": "string"
},
"instructions": {
"type": "string"
},
"sourceUrl": {
"type": [
"string",
"null"
]
},
"targetId": {
"type": [
"string",
"null"
]
},
"payloadHash": {
"type": "string"
},
"attempt": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"createdAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"expiresAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"error": {
"type": [
"string",
"null"
]
},
"action": {
"anyOf": [
{
"type": "object",
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri"
},
"mode": {
"type": "string",
"enum": [
"execute",
"prepare"
]
},
"phase": {
"type": "string"
},
"message": {
"type": "string"
},
"changedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
},
"resultHash": {
"type": [
"string",
"null"
]
},
"acceptedAt": {
"type": [
"string",
"null"
]
}
},
"required": [
"id",
"url",
"mode",
"phase",
"message",
"changedAt",
"resultHash",
"acceptedAt"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"execution": {
"type": "object",
"properties": {
"provider": {
"type": [
"string",
"null"
]
},
"harness": {
"type": [
"string",
"null"
]
},
"model": {
"type": [
"string",
"null"
]
},
"reasoningEffort": {
"type": [
"string",
"null"
]
},
"threadId": {
"type": [
"string",
"null"
]
},
"url": {
"type": [
"string",
"null"
]
},
"startedAt": {
"type": [
"string",
"null"
]
},
"completedAt": {
"type": [
"string",
"null"
]
}
},
"required": [
"provider",
"harness",
"model",
"reasoningEffort",
"threadId",
"url",
"startedAt",
"completedAt"
],
"additionalProperties": false
},
"result": {
"type": "object",
"properties": {
"delegatedDecisions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"credentialId": {
"type": "string"
},
"credentialType": {
"type": "string",
"enum": [
"api_key",
"oauth_token"
]
},
"decision": {
"type": "string",
"enum": [
"approve",
"reject",
"retry",
"accept",
"request_changes"
]
},
"payloadHash": {
"type": "string"
},
"inputHash": {
"type": "string"
},
"attempt": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"recordedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
}
},
"required": [
"credentialId",
"credentialType",
"decision",
"payloadHash",
"inputHash",
"attempt",
"recordedAt"
],
"additionalProperties": false
}
},
"reportedOutcome": {
"anyOf": [
{
"type": "string",
"enum": [
"accepted",
"needs_review",
"blocked"
]
},
{
"type": "null"
}
]
},
"criteria": {
"type": "array",
"items": {
"type": "object",
"properties": {
"criterion": {
"type": "string"
},
"passed": {
"type": "boolean"
},
"evidence": {
"type": "string"
}
},
"required": [
"criterion",
"passed",
"evidence"
],
"additionalProperties": false
}
},
"remaining": {
"type": "array",
"items": {
"type": "string"
}
},
"finalMessage": {
"type": [
"string",
"null"
]
}
},
"required": [
"delegatedDecisions",
"reportedOutcome",
"criteria",
"remaining",
"finalMessage"
],
"additionalProperties": false
},
"previousAttempts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"attempt": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"requestStatus": {
"type": "string",
"enum": [
"pending",
"approved",
"dispatching",
"dispatched",
"completed",
"rejected",
"failed",
"expired"
]
},
"error": {
"type": [
"string",
"null"
]
},
"result": {
"type": "object",
"properties": {
"delegatedDecisions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"credentialId": {
"type": "string"
},
"credentialType": {
"type": "string",
"enum": [
"api_key",
"oauth_token"
]
},
"decision": {
"type": "string",
"enum": [
"approve",
"reject",
"retry",
"accept",
"request_changes"
]
},
"payloadHash": {
"type": "string"
},
"inputHash": {
"type": "string"
},
"attempt": {
"type": "integer",
"minimum": -9007199254740991,
"maximum": 9007199254740991
},
"recordedAt": {
"type": "string",
"format": "date-time",
"pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
}
},
"required": [
"credentialId",
"credentialType",
"decision",
"payloadHash",
"inputHash",
"attempt",
"recordedAt"
],
"additionalProperties": false
}
},
"reportedOutcome": {
"anyOf": [
{
"type": "string",
"enum": [
"accepted",
"needs_review",
"blocked"
]
},
{
"type": "null"
}
]
},
"criteria": {
"type": "array",
"items": {
"type": "object",
"properties": {
"criterion": {
"type": "string"
},
"passed": {
"type": "boolean"
},
"evidence": {
"type": "string"
}
},
"required": [
"criterion",
"passed",
"evidence"
],
"additionalProperties": false
}
},
"remaining": {
"type": "array",
"items": {
"type": "string"
}
},
"finalMessage": {
"type": [
"string",
"null"
]
}
},
"required": [
"delegatedDecisions",
"reportedOutcome",
"criteria",
"remaining",
"finalMessage"
],
"additionalProperties": false
}
},
"required": [
"attempt",
"requestStatus",
"error",
"result"
],
"additionalProperties": false
}
},
"review": {
"type": "object",
"properties": {
"url": {
"type": "string",
"format": "uri"
},
"required": {
"type": "boolean"
},
"reason": {
"type": "string"
},
"authority": {
"type": "string",
"enum": [
"ehq_owner",
"delegated_connection"
]
}
},
"required": [
"url",
"required",
"reason",
"authority"
],
"additionalProperties": false
},
"attention": {
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"approval",
"running",
"blocked",
"result",
"closed"
]
},
"message": {
"type": "string"
},
"url": {
"type": "string",
"format": "uri"
},
"canFollowUp": {
"type": "boolean"
}
},
"required": [
"kind",
"message",
"url",
"canFollowUp"
],
"additionalProperties": false
}
},
"required": [
"id",
"revision",
"followUp",
"continuedByRequestId",
"kind",
"requestStatus",
"title",
"summary",
"project",
"product",
"instructions",
"sourceUrl",
"targetId",
"payloadHash",
"attempt",
"createdAt",
"expiresAt",
"error",
"action",
"execution",
"result",
"previousAttempts",
"review",
"attention"
],
"additionalProperties": false
},
"authorization": {
"type": "object",
"properties": {
"kind": {
"type": "string",
"const": "delegated_connection"
},
"credentialId": {
"type": "string"
},
"credentialType": {
"type": "string",
"enum": [
"api_key",
"oauth_token"
]
},
"scope": {
"type": "string",
"const": "work:decide"
}
},
"required": [
"kind",
"credentialId",
"credentialType",
"scope"
],
"additionalProperties": false
}
},
"required": [
"data",
"authorization"
],
"additionalProperties": false
}Other surfaces
CLI: ehq work decide <request_id> --decision <approve|reject|retry|accept|request_changes> --payload-hash <hash> --idempotency-key <key> [--attempt <n>] [--result-hash <hash> --evidence <text>]
MCP tool: ehq_work_decide