Set the verdict a case should get
PATCH/api/public/v1/aip/drafts/{public_id}/intent-policies/{intent_policy_id}/cases/{index} beta
expect allow, ask, block or optimize for the case at index of the intent policy's cases; optimize only on an intent policy that owns an Optimize rule (422 INVALID_BODY otherwise). The expectation is kept through every regeneration of the cases (the case then reads owner: true); an ask expectation passes when the engine asks, or cannot decide and the fallback is Ask (any expectation equal to the fallback passes then). The draft's revision moves and that case runs again at once, code-only, so it works with AI authoring off; job_id is set only when it still fails and AI authoring drafts a suggestion (no case is written again). An index names a case for one call only: re-read the intent policy before the next. 404 for a case the intent policy does not hold.
curl --fail-with-body -X PATCH 'https://app.openlatch.ai/api/public/v1/aip/drafts/<draft_public_id>/intent-policies/<intent_policy_id>/cases/0' \ -H "Authorization: Bearer $OPENLATCH_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"expect":"block"}'import jsonimport osimport urllib.request
body = '{"expect":"block"}'request = urllib.request.Request( 'https://app.openlatch.ai/api/public/v1/aip/drafts/<draft_public_id>/intent-policies/<intent_policy_id>/cases/0', method='PATCH', data=body.encode(), headers={ 'Authorization': 'Bearer ' + os.environ['OPENLATCH_API_KEY'], 'Content-Type': 'application/json', },)with urllib.request.urlopen(request) as response: text = response.read().decode() print(json.dumps(json.loads(text), indent=2) if text else response.status)#!/usr/bin/env bashset -euo pipefail
curl -sS --fail-with-body -X PATCH 'https://app.openlatch.ai/api/public/v1/aip/drafts/<draft_public_id>/intent-policies/<intent_policy_id>/cases/0' \ -H "Authorization: Bearer $OPENLATCH_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"expect":"block"}' | jq .$headers = @{ Authorization = "Bearer $env:OPENLATCH_API_KEY"}$body = '{"expect":"block"}'Invoke-RestMethod -Method PATCH -Uri 'https://app.openlatch.ai/api/public/v1/aip/drafts/<draft_public_id>/intent-policies/<intent_policy_id>/cases/0' -Headers $headers -ContentType 'application/json; charset=utf-8' -Body $body | ConvertTo-Json -Depth 20Autorisation
Section intitulée « Autorisation »| Rôle dans l’organisation | Ce point de terminaison |
|---|---|
owner | Autorisé |
admin | Autorisé |
editor | Autorisé |
viewer | Non autorisé |
Une clé porte le rôle que son propriétaire détient dans l’organisation. Voir Authentification.
Portée de clé d’API : aip:write
Paramètres de chemin
Section intitulée « Paramètres de chemin »| Paramètre | Type | Description |
|---|---|---|
public_id | string | Obligatoire. |
intent_policy_id | string (uuid) | Obligatoire. |
index | integer | Obligatoire. |
Paramètres d’en-tête
Section intitulée « Paramètres d’en-tête »| Paramètre | Type | Description |
|---|---|---|
Idempotency-Key | string or null | Optional. Makes the request safe to retry: the same key and the same request, within 24 hours, returns the stored response with Idempotent-Replayed: true and runs once. |
Corps de la requête
Section intitulée « Corps de la requête »| Champ | Type | Description |
|---|---|---|
expect | string — one of allow, ask, block, optimize | Obligatoire. |
- 202 Accepted — l’appel a réussi.
- 400 Bad Request —
BAD_REQUEST - 401 Unauthorized —
UNAUTHORIZED - 402 Payment Required —
license_expired - 403 Forbidden —
FEATURE_DISABLED,FORBIDDEN,INSUFFICIENT_SCOPE - 404 Not Found —
NOT_FOUND - 409 Conflict —
GROUNDING_IN_FLIGHT,IDEMPOTENCY_IN_PROGRESS - 422 Unprocessable Content —
IDEMPOTENCY_KEY_REUSED,INVALID_BODY,INVALID_ID,VALIDATION_ERROR - 429 Too Many Requests —
TOO_MANY_REQUESTS - 500 Internal Server Error —
INTERNAL_SERVER_ERROR,tenant_isolation_violation - 503 Service Unavailable —
FEATURE_STATE_UNAVAILABLE,SERVICE_UNAVAILABLE
Champs de la réponse
Section intitulée « Champs de la réponse »| Champ | Type | Description |
|---|---|---|
data | object | Obligatoire. |
data.intent_policy | object | Obligatoire. One intent policy of a draft. |
data.intent_policy.busy | string or null | What runs on the intent policy: grounding, cases (its stored cases checked again), fix, or topping_up (cases written for the values an answer added, appended when ready; it blocks nothing). |
data.intent_policy.capability | string or null | |
data.intent_policy.cards | array of object | Obligatoire. |
data.intent_policy.cases | array of object | Obligatoire. |
data.intent_policy.citation | object or null | Obligatoire. The framework preset rule this intent policy came from, edited when its sentence differs; null for anything not drawn from a framework preset. |
data.intent_policy.confirmed | boolean or null | |
data.intent_policy.deferred | object or null | The deferred part's gap class and fallback; null when it has none. |
data.intent_policy.dimension | string — one of quality, economics, security, safety, compliance | Obligatoire. |
data.intent_policy.fallback | string — one of Ask, Block or null | |
data.intent_policy.fix | object or null | |
data.intent_policy.id | string | Obligatoire. |
data.intent_policy.job_id | string or null | |
data.intent_policy.language | string | Obligatoire. |
data.intent_policy.passage | object or null | |
data.intent_policy.refusal | object or null | |
data.intent_policy.request_rule | object or null | |
data.intent_policy.sentence | string | Obligatoire. The intent policy. Empty while the drafting job still prepares it (busy is grounding and it holds no grounding yet): a sentence is served only once it is final. |
data.intent_policy.steer | string or null | |
data.intent_policy.validate | object or null | |
data.job_id | string or null |
Exemple de réponse
Section intitulée « Exemple de réponse »{ "data": { "intent_policy": { "busy": "string", "capability": "string", "cards": [ { "answer": {}, "key": "string", "kind": "dictionary_values", "question": "string", "recommended": {} } ], "cases": [ {} ], "citation": { "edited": false, "entries": [ {} ], "items": [ {} ], "license_url": "https://app.openlatch.ai/", "preset_key": "string", "preset_title": "string", "rule_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "source_commit": "string", "source_date": "string", "source_sentence": "string", "version": 1 }, "confirmed": false, "deferred": { "class": "string", "fallback": "Ask" }, "dimension": "quality", "fallback": "Ask", "fix": { "attempts_left": 3, "available": false, "diff": {}, "fix_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "reason": "Never push to main without a review.", "requested": false }, "id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "job_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "language": "string", "passage": { "end": 3, "start": 3 }, "refusal": { "class": "nothing_observable", "reason": "Never push to main without a review." }, "request_rule": { "lever": "effort_clamp", "params": {} }, "sentence": "string", "steer": "string", "validate": { "example": "string", "fires_on_every_action": false, "never_fires": false } }, "job_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10" }}