> For the complete documentation index, see [llms.txt](https://docs.kick.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kick.co/api/api-reference/accounting-migration.md).

# Accounting Migration

Start an entity's accounting migration, check its status, and generate transaction rules from the migrated history.

An accounting migration marks an entity whose history you're importing from another accounting system. An entity keeps at most one, so the resource is singular and addressed by the entity uuid alone. You push the history itself through [Journal Entries](/api/api-reference/journal-entries.md). For the full process, see [Migration](/api/migration.md).

Creating the migration pauses automatic categorization of the entity's transactions. Generating transaction rules builds categorization rules from the migrated journal entries in the background and then resumes categorization. `enrichmentRulesSeededAt` is `null` until that finishes.

## Start an accounting migration

> Starts an API-driven accounting migration for the entity. Create it before pushing historical journal entries: while the migration is open, Kick pauses automatic transaction enrichment so the rules generated from the migrated history apply before live transactions are categorized. An entity keeps at most one migration, and an entity that already has opening balances cannot start one; both are rejected with \`409\`. The entity must have a bookkeeping start date, otherwise the call is rejected with \`400\`.

```json
{"openapi":"3.0.2","info":{"title":"Kick Platform API","version":"v1"},"servers":[{"description":"Production","url":"https://use.kick.co/api"}],"security":[{"organizationAccessToken":[]}],"components":{"securitySchemes":{"organizationAccessToken":{"description":"Organization access token issued by Kick, sent as `Authorization: Bearer kick_org_...`.","scheme":"bearer","type":"http"}}},"paths":{"/platform/v1/entities/{entityId}/accounting-migration":{"post":{"description":"Starts an API-driven accounting migration for the entity. Create it before pushing historical journal entries: while the migration is open, Kick pauses automatic transaction enrichment so the rules generated from the migrated history apply before live transactions are categorized. An entity keeps at most one migration, and an entity that already has opening balances cannot start one; both are rejected with `409`. The entity must have a bookkeeping start date, otherwise the call is rejected with `400`.","operationId":"accountingMigrations.create","parameters":[{"in":"path","name":"entityId","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"A unique key that makes the request idempotent. Retrying with the same key within 24 hours replays the original response (marked with `Idempotent-Replayed: true`) instead of executing again.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"201":{"content":{"application/json":{"schema":{"properties":{"accountingMigration":{"properties":{"createdAt":{"format":"date-time","type":"string"},"enrichmentRulesSeededAt":{"description":"Set once transaction-rule generation from the migrated history has completed. `null` while generation has not run or is still in progress.","format":"date-time","nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"}},"required":["id","enrichmentRulesSeededAt","createdAt"],"type":"object"}},"required":["accountingMigration"],"type":"object"}}},"description":"201"},"400":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"400"},"401":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"401"},"403":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"403"},"404":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"404"},"409":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"409"},"429":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"429"}},"summary":"Start an accounting migration","tags":["accountingMigrations"]}}}}
```

## Get the accounting migration

> Returns the entity's accounting migration. Poll \`enrichmentRulesSeededAt\` after triggering transaction-rule generation: it is \`null\` until generation has finished. Returns \`404\` when the entity has no migration.

```json
{"openapi":"3.0.2","info":{"title":"Kick Platform API","version":"v1"},"servers":[{"description":"Production","url":"https://use.kick.co/api"}],"security":[{"organizationAccessToken":[]}],"components":{"securitySchemes":{"organizationAccessToken":{"description":"Organization access token issued by Kick, sent as `Authorization: Bearer kick_org_...`.","scheme":"bearer","type":"http"}}},"paths":{"/platform/v1/entities/{entityId}/accounting-migration":{"get":{"description":"Returns the entity's accounting migration. Poll `enrichmentRulesSeededAt` after triggering transaction-rule generation: it is `null` until generation has finished. Returns `404` when the entity has no migration.","operationId":"accountingMigrations.get","parameters":[{"in":"path","name":"entityId","required":true,"schema":{"format":"uuid","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"accountingMigration":{"properties":{"createdAt":{"format":"date-time","type":"string"},"enrichmentRulesSeededAt":{"description":"Set once transaction-rule generation from the migrated history has completed. `null` while generation has not run or is still in progress.","format":"date-time","nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"}},"required":["id","enrichmentRulesSeededAt","createdAt"],"type":"object"}},"required":["accountingMigration"],"type":"object"}}},"description":"200"},"400":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"400"},"401":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"401"},"404":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"404"},"429":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"429"}},"summary":"Get the accounting migration","tags":["accountingMigrations"]}}}}
```

## Generate transaction rules from migrated history

> Queues generation of transaction categorization rules from the historical journal entries pushed for this migration. Only journal entries on the entity's cash ledger, posted to income or expense accounts, and dated in the year before the entity's bookkeeping start date are considered. Generation runs asynchronously: the call returns \`202\` with the migration, and \`enrichmentRulesSeededAt\` is set once it completes — automatic transaction enrichment resumes at that point. Returns \`409\` when rules were already generated for this migration, and \`422\` when the workspace is not eligible for rule generation.

```json
{"openapi":"3.0.2","info":{"title":"Kick Platform API","version":"v1"},"servers":[{"description":"Production","url":"https://use.kick.co/api"}],"security":[{"organizationAccessToken":[]}],"components":{"securitySchemes":{"organizationAccessToken":{"description":"Organization access token issued by Kick, sent as `Authorization: Bearer kick_org_...`.","scheme":"bearer","type":"http"}}},"paths":{"/platform/v1/entities/{entityId}/accounting-migration/generate-transaction-rules":{"post":{"description":"Queues generation of transaction categorization rules from the historical journal entries pushed for this migration. Only journal entries on the entity's cash ledger, posted to income or expense accounts, and dated in the year before the entity's bookkeeping start date are considered. Generation runs asynchronously: the call returns `202` with the migration, and `enrichmentRulesSeededAt` is set once it completes — automatic transaction enrichment resumes at that point. Returns `409` when rules were already generated for this migration, and `422` when the workspace is not eligible for rule generation.","operationId":"accountingMigrations.generateTransactionRules","parameters":[{"in":"path","name":"entityId","required":true,"schema":{"format":"uuid","type":"string"}},{"description":"A unique key that makes the request idempotent. Retrying with the same key within 24 hours replays the original response (marked with `Idempotent-Replayed: true`) instead of executing again.","in":"header","name":"Idempotency-Key","required":false,"schema":{"maxLength":255,"minLength":1,"type":"string"}}],"responses":{"202":{"content":{"application/json":{"schema":{"properties":{"accountingMigration":{"properties":{"createdAt":{"format":"date-time","type":"string"},"enrichmentRulesSeededAt":{"description":"Set once transaction-rule generation from the migrated history has completed. `null` while generation has not run or is still in progress.","format":"date-time","nullable":true,"type":"string"},"id":{"format":"uuid","type":"string"}},"required":["id","enrichmentRulesSeededAt","createdAt"],"type":"object"}},"required":["accountingMigration"],"type":"object"}}},"description":"202"},"400":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"400"},"401":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"401"},"403":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"403"},"404":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"404"},"409":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"409"},"422":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"422"},"429":{"content":{"application/json":{"schema":{"properties":{"message":{"type":"string"},"traceId":{"nullable":true,"type":"string"}},"required":["message"],"type":"object"}}},"description":"429"}},"summary":"Generate transaction rules from migrated history","tags":["accountingMigrations"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kick.co/api/api-reference/accounting-migration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
