Accept a learning proposal
POST/api/public/v1/learning-proposals/{public_id}/accept beta
Applies the proposal through its kind's own operation, with the input_digest the caller read. 409 PROPOSAL_STALE when its inputs moved since it opened (it is then superseded); 409 PROPOSAL_CLOSED when it is no longer open or has expired. A connected agent is refused 403 FORBIDDEN: a proposal is accepted by a person or an API key. The applied operation's own refusals (for example NOT_ATTACHED, INHERITED_HERE, INVALID_PATTERN, NOT_RATIFIED) leave the proposal open.
curl --fail-with-body -X POST 'https://app.openlatch.ai/api/public/v1/learning-proposals/<proposal_public_id>/accept' \ -H "Authorization: Bearer $OPENLATCH_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"input_digest":"<input_digest>"}'import jsonimport osimport urllib.request
body = '{"input_digest":"<input_digest>"}'request = urllib.request.Request( 'https://app.openlatch.ai/api/public/v1/learning-proposals/<proposal_public_id>/accept', method='POST', 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 POST 'https://app.openlatch.ai/api/public/v1/learning-proposals/<proposal_public_id>/accept' \ -H "Authorization: Bearer $OPENLATCH_API_KEY" \ -H 'Content-Type: application/json' \ -d '{"input_digest":"<input_digest>"}' | jq .$headers = @{ Authorization = "Bearer $env:OPENLATCH_API_KEY"}$body = '{"input_digest":"<input_digest>"}'Invoke-RestMethod -Method POST -Uri 'https://app.openlatch.ai/api/public/v1/learning-proposals/<proposal_public_id>/accept' -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 : proposals:write
Paramètres de chemin
Section intitulée « Paramètres de chemin »| Paramètre | Type | Description |
|---|---|---|
public_id | string | Obligatoire. |
Paramètres de requête
Section intitulée « Paramètres de requête »| Paramètre | Type | Description |
|---|---|---|
zone_id | string (uuid) or null | The deciding zone: a proposal above it answers 404. |
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 |
|---|---|---|
input_digest | string | Obligatoire. |
- 200 OK — 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 —
CONFLICT,IDEMPOTENCY_IN_PROGRESS,INHERITED_HERE,LOOSENS_LAYER,NOT_ACTIVATABLE,NOT_ATTACHED,NOT_RATIFIED,PROPOSAL_CLOSED,PROPOSAL_STALE,SAME_LAYER_CONFLICT - 422 Unprocessable Content —
IDEMPOTENCY_KEY_REUSED,INVALID_ID,INVALID_PATTERN,VALIDATION_ERROR - 429 Too Many Requests —
TOO_MANY_REQUESTS - 500 Internal Server Error —
INTERNAL_SERVER_ERROR,tenant_isolation_violation - 503 Service Unavailable —
ENGINE_UNAVAILABLE,FEATURE_STATE_UNAVAILABLE,PROOF_UNAVAILABLE,SERVICE_UNAVAILABLE
Champs de la réponse
Section intitulée « Champs de la réponse »| Champ | Type | Description |
|---|---|---|
data | object | Obligatoire. One proposal: what would change, why, in which direction, and what was decided. |
data.case | object or null | |
data.case.action_line | object or null | |
data.case.kind | string | Obligatoire. |
data.case.outcome_today | object or null | |
data.changed | object or null | |
data.changed.sample | array of object | |
data.changed.to_allow | integer | |
data.changed.to_ask | integer | |
data.changed.to_block | integer | |
data.decided_at | string (date-time) or null | |
data.decided_by | object or null | |
data.decided_by.kind | string — one of user, api_key | Obligatoire. |
data.decided_by.name | string | Obligatoire. |
data.direction | string — one of tightens, neutral, widens | Obligatoire. |
data.evidence | object or null | |
data.evidence.action | object or null | A regression case's reviewed action in plain words, scrubbed; null when a secret still matched. |
data.expires_at | string (date-time) | Obligatoire. |
data.input_digest | string | Obligatoire. |
data.intent_policy | object or null | |
data.intent_policy.id | string | Obligatoire. |
data.intent_policy.sentence | string | Obligatoire. |
data.kind | string — one of monitor_to_enforce, dictionary_value, decisive_declaration, regression_case | Obligatoire. |
data.opened_at | string (date-time) | Obligatoire. |
data.policy | object or null | |
data.policy.name | string | Obligatoire. |
data.policy.public_id | string | Obligatoire. |
data.policy.version | integer | Obligatoire. |
data.public_id | string | Obligatoire. |
data.result | object or null | |
data.state | string — one of open, accepted, dismissed, superseded, expired | Obligatoire. |
data.table_name | string or null | |
data.value | string or null | |
data.zone | object or null | |
data.zone.id | string | Obligatoire. |
data.zone.name | string | Obligatoire. |
Exemple de réponse
Section intitulée « Exemple de réponse »{ "data": { "case": { "action_line": "string", "kind": "string", "outcome_today": "string" }, "changed": { "sample": [ { "action": "string", "action_line": "string", "category": "string", "decision_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "occurred_at": "2026-01-15T14:32:05Z", "verdict_after": "string", "verdict_before": "string" } ], "to_allow": 0, "to_ask": 0, "to_block": 0 }, "decided_at": "2026-01-15T14:32:05Z", "decided_by": { "kind": "user", "name": "release-bot" }, "direction": "tightens", "evidence": { "action": "string" }, "expires_at": "2026-01-15T14:32:05Z", "input_digest": "string", "intent_policy": { "id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "sentence": "string" }, "kind": "monitor_to_enforce", "opened_at": "2026-01-15T14:32:05Z", "policy": { "name": "release-bot", "public_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "version": 3 }, "public_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "result": {}, "state": "open", "table_name": "release-bot", "value": "string", "zone": { "id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10", "name": "release-bot" } }}