Edit one intent policy of a draft
PATCH/api/public/v1/aip/drafts/{public_id}/intent-policies/{intent_policy_id} beta
sentence re-grounds it (202, its grounding job named); dimension changes it in place; confirmed stores "Is that right?", allowed while a case still gives a wrong verdict (the audit entry counts them); note is kept with its answers; steer replaces an Optimize intent policy's steer and re-grounds it (202), 422 INVALID_BODY on one that owns no Optimize rule. A sentence, steer or dimension change moves the draft's revision. 409 GROUNDING_IN_FLIGHT while it is being grounded; 422 EMPTY_PATCH.
curl --fail-with-body -X PATCH 'https://app.openlatch.ai/api/public/v1/aip/drafts/<draft_public_id>/intent-policies/<intent_policy_id>' \ -H "Authorization: Bearer $OPENLATCH_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"confirmed":true}'import jsonimport osimport urllib.request
body = '{"confirmed":true}'request = urllib.request.Request( 'https://app.openlatch.ai/api/public/v1/aip/drafts/<draft_public_id>/intent-policies/<intent_policy_id>', 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>' \ -H "Authorization: Bearer $OPENLATCH_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"confirmed":true}' | jq .$headers = @{ Authorization = "Bearer $env:OPENLATCH_API_KEY"}$body = '{"confirmed":true}'Invoke-RestMethod -Method PATCH -Uri 'https://app.openlatch.ai/api/public/v1/aip/drafts/<draft_public_id>/intent-policies/<intent_policy_id>' -Headers $headers -ContentType 'application/json; charset=utf-8' -Body $body | ConvertTo-Json -Depth 20Autorización
Sección titulada «Autorización»| Rol en la organización | Este punto de conexión |
|---|---|
owner | Permitido |
admin | Permitido |
editor | Permitido |
viewer | No permitido |
Una clave tiene el rol que su propietario ocupa en la organización. Consulte Autenticación.
Ámbito de la clave de API: aip:write
Parámetros de ruta
Sección titulada «Parámetros de ruta»| Parámetro | Tipo | Descripción |
|---|---|---|
public_id | string | Obligatorio. |
intent_policy_id | string (uuid) | Obligatorio. |
Parámetros de encabezado
Sección titulada «Parámetros de encabezado»| Parámetro | Tipo | Descripción |
|---|---|---|
Idempotency-Key | string or null | Optional. Makes this request safe to retry. Depending on the request, the same key with the same request either joins the job the first one queued (409 JOB_ALREADY_EXISTS, the job id in details) or replays the first answer (Idempotent-Replayed: true; 409 IDEMPOTENCY_IN_PROGRESS while it runs). The same key with another request is 422 IDEMPOTENCY_KEY_REUSED. |
Cuerpo de la solicitud
Sección titulada «Cuerpo de la solicitud»| Campo | Tipo | Descripción |
|---|---|---|
confirmed | boolean or null | |
dimension | string — one of quality, economics, security, safety, compliance or null | |
note | string or null | |
retry | boolean or null | true prepares again an intent policy the drafting job stopped on before it was ready, with every other one it left unprepared, in one job. INVALID_BODY on any other intent policy. |
sentence | string or null | |
steer | string or null |
Respuesta
Sección titulada «Respuesta»- 200 OK — la llamada se completó correctamente.
- 202 Accepted — la llamada se completó correctamente.
- 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,JOB_ALREADY_EXISTS - 422 Unprocessable Content —
EMPTY_PATCH,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
Campos de la respuesta
Sección titulada «Campos de la respuesta»| Campo | Tipo | Descripción |
|---|---|---|
data | object | Obligatorio. |
data.intent_policy | object | Obligatorio. 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 | Obligatorio. |
data.intent_policy.cases | array of object | Obligatorio. |
data.intent_policy.citation | object or null | Obligatorio. 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 | Obligatorio. |
data.intent_policy.fallback | string — one of Ask, Block or null | |
data.intent_policy.fix | object or null | |
data.intent_policy.id | string | Obligatorio. |
data.intent_policy.job_id | string or null | |
data.intent_policy.language | string | Obligatorio. |
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 | Obligatorio. 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 |
Ejemplo de respuesta
Sección titulada «Ejemplo de respuesta»{ "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" }}