Skip to content

Capture Correction

POST
/api/v1/ai/corrections
curl --request POST \
--url https://api.ultimateteam.ai/api/v1/ai/corrections \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "agent_role": "example", "correction_context": {}, "decision_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "original_output": "example", "tenant_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "user_correction": "example" }'

Capture a user correction of an agent output.

Persists an agent_corrections row under the AUTHENTICATED tenant. Pattern extraction happens asynchronously (the row starts with the default correction_type and no pattern), so no LLM client is needed on this path.

Media typeapplication/json
CorrectionCreate

Request body for capturing a user correction.

object
agent_role
required
Agent Role
string
>= 1 characters <= 100 characters
correction_context
Correction Context
object
key
additional properties
any
decision_id
Any of:
string format: uuid
original_output
required
Original Output
string
>= 1 characters
tenant_id
required
Tenant Id
string format: uuid
user_correction
required
User Correction
string
>= 1 characters
Examplegenerated
{
"agent_role": "example",
"correction_context": {},
"decision_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"original_output": "example",
"tenant_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"user_correction": "example"
}

Successful Response

Media typeapplication/json
CorrectionResponse

Response body for a single correction record.

object
agent_role
required
Agent Role
string
applied_count
required
Applied Count
integer
correction_context
required
Correction Context
object
key
additional properties
any
correction_type
required
Correction Type
string
created_at
required
Created At
string format: date-time
decision_id
Any of:
string format: uuid
id
required
Id
string format: uuid
original_output
required
Original Output
string
pattern_description
Any of:
string
recurrence_count
required
Recurrence Count
integer
status
required
Status
string
tenant_id
required
Tenant Id
string format: uuid
updated_at
required
Updated At
string format: date-time
user_correction
required
User Correction
string
weight
required
Weight
number
Examplegenerated
{
"agent_role": "example",
"applied_count": 1,
"correction_context": {},
"correction_type": "example",
"created_at": "2026-04-15T12:00:00Z",
"decision_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"original_output": "example",
"pattern_description": "example",
"recurrence_count": 1,
"status": "example",
"tenant_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"updated_at": "2026-04-15T12:00:00Z",
"user_correction": "example",
"weight": 1
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}