Skip to main content
POST
https://app.artanis.ai
/
api
/
v1
/
traces
/
{trace_id}
/
attribute
Trigger Attribution
curl --request POST \
  --url https://app.artanis.ai/api/v1/traces/{trace_id}/attribute \
  --header 'Authorization: Bearer <token>'
{
  "trace_id": "<string>",
  "error_type": "<string>",
  "error_type_id": "<string>",
  "error_type_name": "<string>",
  "error_type_category": "<string>",
  "reasoning": "<string>"
}

Overview

The attribution endpoint analyzes a trace and its feedback to determine the root cause of any disagreement between AI and human judgment. This helps identify systemic issues in your AI system.
Attribution uses AI to classify errors into categories like documentation issues, labeling errors, or retrieval failures. Run this after feedback has been submitted.

Path Parameters

trace_id
string
required
The trace ID to analyze.Example: trace_abc123xyz789

Response

trace_id
string
The trace that was analyzed.
error_type
string
The error type identifier. See Error Types for all possible values.
error_type_id
string
UUID of the error type in the database.
error_type_name
string
Human-readable name (e.g., "Ambiguous instructions").
error_type_category
string
Category: "User Error", "Human Error", or "AI Error". See Error Types for details.
reasoning
string
AI-generated explanation of why this error type was chosen.

Example

const response = await fetch(
  `https://app.artanis.ai/api/v1/traces/${traceId}/attribute`,
  {
    method: "POST",
    headers: {
      Authorization: "Bearer ak_...",
    },
  }
);

const attribution = await response.json();
console.log(`Error type: ${attribution.error_type_name}`);
console.log(`Category: ${attribution.error_type_category}`);
console.log(`Reasoning: ${attribution.reasoning}`);
Response:
{
  "trace_id": "trace_abc123xyz789",
  "error_type": "ambiguous_instructions",
  "error_type_id": "550e8400-e29b-41d4-a716-446655440000",
  "error_type_name": "Ambiguous instructions",
  "error_type_category": "User Error",
  "reasoning": "The AI and human disagreed because the guidelines for greeting customers are ambiguous about when to use the customer's first name vs. formal address."
}

Error Responses

Status CodeErrorSolution
400Invalid trace_id formatEnsure trace_id starts with trace_
401Invalid API keyVerify your API key is correct
404Trace not foundCheck the trace_id exists
422No feedback to analyzeSubmit feedback before triggering attribution

Next Steps