Aller au contenu

Answer one interview card

POST/api/public/v1/aip/drafts/{public_id}/intent-policies/{intent_policy_id}/answers beta

accept the recommended answer, or change it with values (a dictionary card), question (an agent question card) or fallback Ask or Block (the fallback card). An answer that changes nothing the rules read (an accept, or the value already in force) is only recorded: no job, the revision and confirmed stay. Otherwise the draft's revision moves and the stored cases re-run at once, code-only; cases for added values are then written in the background (busy: topping_up, blocking nothing), or every case again when more than half went stale. 422 UNKNOWN_CARD, 422 INVALID_PATTERN, 503 ENGINE_UNAVAILABLE.

Fenêtre de terminal
curl --fail-with-body -X POST 'https://app.openlatch.ai/api/public/v1/aip/drafts/<draft_public_id>/intent-policies/<intent_policy_id>/answers' \
-H "Authorization: Bearer $OPENLATCH_API_KEY" \
-H 'Content-Type: application/json' \
-d '{"card_key":"<card_key>","choice":"accept"}'
Rôle dans l’organisationCe point de terminaison
ownerAutorisé
adminAutorisé
editorAutorisé
viewerNon 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ètreTypeDescription
public_idstringObligatoire.
intent_policy_idstring (uuid)Obligatoire.
ParamètreTypeDescription
Idempotency-Keystring or nullOptional. 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.
ChampTypeDescription
card_keystringObligatoire.
choicestring — one of accept, changeObligatoire.
fallbackstring — one of Ask, Block or null
questionstring or null
valuesarray of string or null
ChampTypeDescription
dataobjectObligatoire. One intent policy of a draft.
data.busystring or nullWhat 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.capabilitystring or null
data.cardsarray of objectObligatoire.
data.cards[].answerobject or null
data.cards[].keystringObligatoire.
data.cards[].kindstring — one of dictionary_values, agent_question, fallbackObligatoire.
data.cards[].questionstringObligatoire.
data.cards[].recommendedobjectObligatoire.
data.casesarray of objectObligatoire.
data.citationobject or nullObligatoire. The framework preset rule this intent policy came from, edited when its sentence differs; null for anything not drawn from a framework preset.
data.citation.editedbooleanObligatoire.
data.citation.entriesarray of objectObligatoire.
data.citation.itemsarray of objectObligatoire.
data.citation.license_urlstringObligatoire.
data.citation.preset_keystringObligatoire.
data.citation.preset_titlestringObligatoire.
data.citation.rule_idstringObligatoire.
data.citation.source_commitstringObligatoire.
data.citation.source_datestringObligatoire.
data.citation.source_sentencestringObligatoire.
data.citation.versioninteger — 1Obligatoire.
data.confirmedboolean or null
data.deferredobject or nullThe deferred part's gap class and fallback; null when it has none.
data.deferred.classobject or null
data.deferred.fallbackstring — one of Ask, BlockObligatoire.
data.dimensionstring — one of quality, economics, security, safety, complianceObligatoire.
data.fallbackstring — one of Ask, Block or null
data.fixobject or null
data.fix.attempts_leftintegerObligatoire. How many more fixes may be asked for (aip_draft_fix); the check loop never spends one.
data.fix.availablebooleanObligatoire.
data.fix.diffobjectObligatoire.
data.fix.fix_idstringObligatoire.
data.fix.reasonobject or nullWhy the proposal is not simply the fix: breaks_passing_case (a passing case fails under it), not_enforceable (it grounds to a refusal), unchanged (the same sentence), still_failing (a case still fails with it, or the attempts ran out), refused_rewrite (an enforceable rewrite of a refused sentence); null for a proposal with none of these.
data.fix.requestedbooleanA fix asked for with POST …/fix: applied with fix/apply, which keeps the cases it re-ran. false for the check loop's own suggestion, taken by sending diff.after as the sentence.
data.idstringObligatoire.
data.job_idstring or null
data.languagestringObligatoire.
data.passageobject or null
data.passage.endintegerObligatoire.
data.passage.startintegerObligatoire.
data.refusalobject or null
data.refusal.classstring — one of nothing_observable, not_agent_controlObligatoire.
data.refusal.reasonstringObligatoire.
data.request_ruleobject or null
data.request_rule.leverstring — one of effort_clamp, context_edit, prefix_guardObligatoire.
data.request_rule.paramsobjectObligatoire.
data.sentencestringObligatoire. 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.steerstring or null
data.validateobject or null
data.validate.exampleobject or null
data.validate.fires_on_every_actionbooleanObligatoire.
data.validate.never_firesbooleanObligatoire.
{
"data": {
"busy": "string",
"capability": "string",
"cards": [
{
"answer": {
"choice": "accept",
"fallback": "Ask",
"question": "string",
"values": []
},
"key": "string",
"kind": "dictionary_values",
"question": "string",
"recommended": {}
}
],
"cases": [
{}
],
"citation": {
"edited": false,
"entries": [
{
"id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"title": "string",
"url": "https://app.openlatch.ai/",
"via": {}
}
],
"items": [
{
"key": "string",
"label": "string",
"url": "https://app.openlatch.ai/"
}
],
"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": {
"after": "string",
"before": "string"
},
"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
}
}
}