---
title: "Fetch Agent"
method: GET
path: "/v1/fetch_agent/"
tags: ["Public"]
---

# Fetch Agent

`GET /v1/fetch_agent/`

## Request

- Base URL: `https://api.koncile.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.koncile.ai/v1/fetch_agent/`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/koncile/apis/koncile-api/docs/v1/fetch_agent/get.ts> (a function with typed inputs; its response is checked against the schema)

A single agent, in full.

Note for `fraud` agents: Koncile-internal configuration (the base-test
rules and the prompts behind them) is not exposed, so a fraud agent's
settings here are a partial view and cannot be used to recreate it. Fraud
agents are configured in the app.

## Query parameters

- `agent_id` integer, required

## Response `200`

Successful Response

- AgentApiOut: An agent as the public API exposes it.
  - `id` integer, required
  - `type` 'compliance' | 'datatable_match' | 'fraud' | 'signature' | 'document_rename' | 'splitting' | 'cross_split', required
  - `name` string, nullable
  - `status` 'active' | 'inactive', required
  - `is_locked` boolean, nullable
  - `is_show_hint` boolean, nullable
  - `template_ids` integer[]: Templates this agent is linked to. Exactly one for `datatable_match` and `compliance`; at least two for `cross_split`.
  - `settings` object, nullable: Type-specific configuration. For `fraud` agents this is filtered: Koncile-internal rules and prompts are not exposed.
  - `linked_field_ids` integer[]: Fields the agent reads
  - `field_mapping` AgentApiFieldMapping[]: Field roles; populated for `compliance` agents
    - `field_id` integer, required: Id of the field this mapping applies to
    - `agent_field` 'label' | 'code' | 'unit_price' | 'total_price' | 'quantity' | 'invoice_date' | 'invoice_amount' | 'invoice_number', required
  - `datatable_ref` AgentApiDatatableRef: Pointer to a datatable-match agent's reference data. ``document_id`` is null until a CSV has been uploaded *and* processed — the row is written by the worker, not by the upload request, so a freshly uploaded agent reads as null for a few seconds. Deliberately does not repeat ``columns`` / ``has_header``: both already live in ``settings``, and a second copy is a thing to keep in sync for no gain.
    - `document_id` integer, nullable: Document holding the uploaded reference CSV; null if none loaded yet
  - `source_agent_id` integer, nullable: Read-only provenance if this agent was duplicated
  - `source_agent_name` string, nullable
  - `activation_error` string, nullable: Set only on `create_agent` when `status: active` was requested but the agent is not yet ready to activate. The agent exists and is inactive; fix the reason and call `activate_agent`.

## Other responses

- `422`: Validation Error

## Changes

- **2026-09-25** `1446f41e0cd4`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/koncile/apis/koncile-api/changes/v1/fetch_agent/get.md)

---

[API](https://skmtc.dev/koncile/apis/koncile-api.md) - [All operations](https://skmtc.dev/koncile/apis/koncile-api/llms.txt) - [OpenAPI document](https://skmtc.dev/koncile/apis/koncile-api/revisions/37187db89a87?raw)
