# List import statuses

List import statuses is a read in the HeadHoncho API. The status words the staged files use, how many rows carry each, and which of our statuses each should land on. Nothing is written.

Page: https://headhoncho.app/docs/api/list_import_statuses | Part of the HeadHoncho API docs: https://headhoncho.app/docs/api | Machine-readable: https://headhoncho.app/docs/api/openapi.json | Everything in one file: https://headhoncho.app/docs/api/llms-full.txt

## The request

Reference for **List import statuses**, HeadHoncho API v1. It is a read, sent to the base address `https://api.headhoncho.app`.

`GET /api/v1/imports/statuses`

The key needs the **Jobs** area at **read**. An answered call costs 1 credit; a refusal costs nothing. See [credits](https://headhoncho.app/docs/api/errors#credits).

Send your key as `Authorization: Bearer hh_live_...`. See [API keys](https://headhoncho.app/docs/api/keys).

## Parameters

| Name | Kind | Required | Description | Example |
| --- | --- | --- | --- | --- |
| `plan` | text, in the query | Yes | The staged files as a JSON list. Each item: staging_id (from Stage an import file), half (jobs, money or payments), mapping (field to column numbers) and date_order. | `[{"staging_id": "k3Zp...", "half": "jobs", "mapping": {"ref": [0], "client_name": [1]}}]` |
| `system` | text, in the query | No | The system the file came from, a key from Import sources. The answers are remembered for it. | `workiz` |

## Try it with your key

Paste your key and change the values. The box builds the call as a cURL line and a fetch line, ready to copy. It never sends anything itself.

Paste your key on the web page and it fills a cURL line and a fetch line with your key and the example values. The page never sends the key anywhere. The same lines with a placeholder key are under Examples below.

## What comes back

statuses, one per word: key, word, count, jobs, money, target (a status id, new or canceled), target_label, confidence and reason. options: the choices for each target. remembered_all and counts. Send your answers back as status_map on the next calls.

It never changes a record. It only reads the companies the key reaches.

## Every field in the answer

Types are read from the example answer. Money is a plain number in the company's currency. A time carries its offset from UTC (`Z` is UTC). Ids are opaque text. A field with no line of its own here has its name spelled out; the common fields mean the same on every page.

| Field | Type | Meaning |
| --- | --- | --- |
| `statuses` | list of objects | The statuses. |
| `statuses[].key` | text | A short code for this item. Match on it in code. |
| `statuses[].word` | text | The word. |
| `statuses[].count` | whole number | How many match in all, across every page. |
| `statuses[].jobs` | whole number | The jobs. |
| `statuses[].money` | whole number | The money. |
| `statuses[].target` | text | The target. |
| `statuses[].target_label` | text | The target label. |
| `statuses[].confidence` | text | The confidence. |
| `statuses[].reason` | text | The reason given. |
| `options` | list of objects | The options. |
| `options[].id` | id (text) | The id of this record. Ids are opaque text: keep them exactly as given. |
| `options[].label` | text | The name the app shows for it. |
| `remembered_all` | true or false | The remembered all. |
| `counts` | object | The counts. |
| `counts.words` | whole number | The text, as a person would say it. |
| `counts.matched` | whole number | The matched. |
| `counts.new` | whole number | The new. |

## How to answer

Build status_map as an object of the file's word to a target: a status id, "new" to add it, or "canceled". Send it on Preview, Rehearse and Commit.

## Errors that apply

| Code | Status | What it means |
| --- | --- | --- |
| [`missing_key`](https://headhoncho.app/docs/api/errors#missing_key) | 401 | Send your key as Authorization: Bearer hh_live_... |
| [`unknown_key`](https://headhoncho.app/docs/api/errors#unknown_key) | 401 | That key is not one we issued, or it was revoked. |
| [`no_access`](https://headhoncho.app/docs/api/errors#no_access) | 403 | This credential does not reach that. Ask the person who made it for access. |
| [`invalid`](https://headhoncho.app/docs/api/errors#invalid) | 422 | Some fields were refused. See fields. |
| [`no_credits`](https://headhoncho.app/docs/api/errors#no_credits) | 402 | Out of credits. Top up on Settings › Credits, or turn on auto top-up. |

## Related

- [List import systems](https://headhoncho.app/docs/api/list_import_systems): The systems a book can be imported from, and for each the steps to get its file out, what the file cannot carry, and which one this workspace used last.
- [Get import fields](https://headhoncho.app/docs/api/get_import_fields): Every field an import reads, for the jobs file and the money file: its label, its tier and what leaving it blank costs.
- [Get import template](https://headhoncho.app/docs/api/get_import_template): A CSV to fill in, with every column the import reads and three example rows, for the jobs file, the money file or a payments list.
- [Stage import](https://headhoncho.app/docs/api/stage_import): Send one export file (CSV or Excel) and get back what each column looks like and the mapping we propose. Nothing is imported yet.
- [List import job types](https://headhoncho.app/docs/api/list_import_job_types): The job-type words the staged files use, how many rows carry each, and which of our job types each should land on. Nothing is written.
- [Preview import](https://headhoncho.app/docs/api/preview_import): Read the staged files against this workspace and say what an import would do, row by row: what lands, what is already here, what is refused and why.
- [Rehearse import](https://headhoncho.app/docs/api/rehearse_import): Run the whole import for real inside one step that is then thrown away, and say what it would have landed and refused. Nothing is kept.
- [Commit import](https://headhoncho.app/docs/api/commit_import): Import every clean row of the staged files: the jobs, then the money on them. Rows already here are skipped, so sending it twice adds nothing.
- The same records in the app: [the Jobs panel](https://headhoncho.app/docs/jobs).
- How the API fits together: [the model](https://headhoncho.app/docs/api/model), [API keys](https://headhoncho.app/docs/api/keys), [errors](https://headhoncho.app/docs/api/errors) and [the MCP server](https://headhoncho.app/docs/api/mcp).

## Examples

### Answer

```json
{
  "statuses": [
    {
      "key": "done",
      "word": "Done",
      "count": 64,
      "jobs": 64,
      "money": 0,
      "target": "st_06",
      "target_label": "Closed",
      "confidence": "word",
      "reason": ""
    }
  ],
  "options": [
    {
      "id": "st_06",
      "label": "Closed"
    }
  ],
  "remembered_all": false,
  "counts": {
    "words": 1,
    "matched": 1,
    "new": 0
  }
}
```

### cURL

```bash
curl "https://api.headhoncho.app/api/v1/imports/statuses?plan=%5B%7B%22staging_id%22%3A+%22k3Zp...%22%2C+%22half%22%3A+%22jobs%22%2C+%22mapping%22%3A+%7B%22ref%22%3A+%5B0%5D%2C+%22client_name%22%3A+%5B1%5D%7D%7D%5D&system=workiz" \
  -H "Authorization: Bearer hh_live_..."
```

### Python

```python
import requests

response = requests.get(
    "https://api.headhoncho.app/api/v1/imports/statuses",
    headers={"Authorization": "Bearer hh_live_..."},
    params={
        "plan": "[{\"staging_id\": \"k3Zp...\", \"half\": \"jobs\", \"mapping\": {\"ref\": [0], \"client_name\": [1]}}]",
        "system": "workiz",
    },
)
response.raise_for_status()
print(response.json())
```

### JavaScript

```javascript
const response = await fetch("https://api.headhoncho.app/api/v1/imports/statuses?plan=%5B%7B%22staging_id%22%3A+%22k3Zp...%22%2C+%22half%22%3A+%22jobs%22%2C+%22mapping%22%3A+%7B%22ref%22%3A+%5B0%5D%2C+%22client_name%22%3A+%5B1%5D%7D%7D%5D&system=workiz", {
  headers: { Authorization: "Bearer hh_live_..." },
});
const data = await response.json();
console.log(data);
```

### Your AI

```text
Tool: list_import_statuses
Arguments: plan (text, required), system (text, optional)
Access: read on Jobs
Hints: readOnly=true, destructive=false, idempotent=true, openWorld=false
Try asking: "Using HeadHoncho, list import statuses with plan [{"staging_id": "k3Zp...", "half": "jobs", "mapping": {"ref": [0], "client_name": [1]}}] and system workiz."
```
