# Look up records of a migration

Says where each record named by its id in the other tool stands: applied with the dimmi id it became, deferred, failed, unsupported, or missing when the migration never received it. Use it to check a sample after a run. Returns one entry per source id, in the order asked.

```http
POST https://trydimmi.com/api/v1/migrations/{migration}/lookups
```

## Authorization

Send an API token as `Authorization: Bearer <token>`.
The token needs: `settings:write`.

## Path parameters

- `migration` (string, required): The migration (mig_...) the records belong to. Such as mig_01jc8q3x7m2n4p5r6s7t8v9w0y.

## Body

- `kind` (string, required): The kind of the records, as the import format names it: contact, conversation, article and so on. Such as contact. One of: `teammate`, `team`, `tag`, `attribute_definition`, `company`, `contact`, `contact_note`, `ticket_type`, `help_center`, `collection`, `article`, `snippet`, `saved_reply`, `schedule`, `workflow`, `conversation`, `ticket`.
- `source_ids` (string[] | null, required): Up to 100 ids the records had in the other tool. Such as ["6512ab","6512ac"].

## Response 200 (OK)

- `data` (object[] | null, required): The items of this page, as a list; empty when nothing matches.
  - `id` (string | null, required): The id of this record. Send it wherever an endpoint asks for this record; never use its name or title in its place.
  - `source_id` (string, required): The record's id in the other tool, as asked.
  - `status` (string, required): applied, deferred, failed or unsupported as the ledger has it, or missing when the migration never received it. One of: `applied`, `deferred`, `failed`, `unsupported`, `missing`.
- `links` (object): Addresses of related pages by name, such as next; left out when there are none.
- `meta` (object, required)
  - `next_cursor` (string | null, required): Send it as cursor to read the next page; null on the last page.
  - `per_page` (integer, required): How many items a page holds at most, such as 25.
  - `prev_cursor` (string | null, required): Send it as cursor to read the page before; null on the first page.
  - `total` (integer): How many items match in all; left out when the list does not count them.

## Response default (Error)

- `code` (string, required): Stable code for programs to tell errors apart, such as validation_failed or internal_error.
- `errors` (object): Each rejected field mapped to its messages. Only present when the input was invalid.
- `message` (string, required): What went wrong, in words safe to show a person.

## Example request

```bash
curl --request POST \
  --url 'https://trydimmi.com/api/v1/migrations/{migration}/lookups' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "kind": "teammate",
  "source_ids": [
    "<string>"
  ]
}'
```

## Example response

```json
{
  "data": [
    {
      "id": "<string>",
      "source_id": "<string>",
      "status": "applied"
    }
  ],
  "links": {
    "<key>": "<string>"
  },
  "meta": {
    "next_cursor": "<string>",
    "per_page": 123,
    "prev_cursor": "<string>",
    "total": 123
  }
}
```

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
