---
title: "Write history import records"
method: POST
path: "/imports/{importId}/records"
tags: ["Imports"]
---

# Write history import records

`POST /imports/{importId}/records`

## Request

- Base URL: `https://api.ando.so/v1`
- URL: `https://api.ando.so/v1/imports/{importId}/records`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer

Writes a batch of members, conversations, messages, and reactions with their original authors and timestamps. Keyed by the source tool's ids, so re-sending a batch is safe. Imported messages create no notifications or unread state.

## Path parameters

- `importId` string, required: Import identifier.

## Request body

- HistoryImportRecordsBody: Any subset of records, keyed by the source tool's ids so every request is idempotent. Per request: at most 100 members, 10 conversations, 100 messages, and 200 reactions. Records that reference something not yet imported are reported in skipped.
  - `conversations` HistoryImportConversationRecord[]: Conversations.
    - `archived` boolean, required: Whether the conversation was archived at the source.
    - `created_at` string, date-time, required: When the conversation was created at the source.
    - `description` string, nullable, required: Channel description.
    - `external_id` string, required: The conversation's id in the source tool.
    - `kind` 'channel' | 'direct_message', required: Conversation kind.
    - `member_external_ids` string[], required: External ids of members imported earlier. At most 250 across one request; send a larger roster as repeated records.
    - `name` string, nullable, required: Channel name. Required for channels; ignored for direct messages.
    - `visibility` 'public' | 'private', required: Channel visibility. Direct messages are always private.
  - `members` HistoryImportMemberRecord[]: People.
    - `ando_member_id` string, nullable, required: Existing Ando workspace member this person already is.
    - `avatar_url` string, nullable, required: https avatar URL.
    - `deactivated` boolean, required: Whether the source tool had deactivated them.
    - `display_name` string, required: Display name in the source tool.
    - `email` string, nullable, required: Email address, when the source tool has one.
    - `external_id` string, required: The person's id in the source tool.
    - `kind` 'person' | 'bot', required: Person or bot.
  - `messages` HistoryImportMessageRecord[]: Messages.
    - `author_external_id` string, required: External id of the author.
    - `conversation_external_id` string, required: External id of the conversation.
    - `created_at` string, date-time, required: When the message was sent at the source.
    - `edited_at` string, date-time, nullable, required: When the message was last edited at the source.
    - `external_id` string, required: The message's id in the source tool.
    - `markdown` string, required: Message body as Markdown, at most 40,000 characters.
    - `thread_root_external_id` string, nullable, required: External id of the thread's root message. Ando threads are one level deep.
    - `files` HistoryImportMessageFile[]: Attachments, at most 10. Upload each with POST /v1/files first. Omit to keep the message's current attachments; send an empty array to remove them. A message may have files and empty markdown.
      - `external_id` string, required: The file's id in the source tool, used to find it again with files/lookup.
      - `file_id` string, required: The Ando file id returned by POST /v1/files.
  - `reactions` HistoryImportReactionRecord[]: Reactions.
    - `author_external_id` string, required: External id of the person who reacted.
    - `conversation_external_id` string, required: External id of the conversation.
    - `emoji` string, required: Unicode emoji, or a workspace custom emoji name.
    - `message_external_id` string, required: External id of the message.

## Response `200`

What was written and what was skipped.

- HistoryImportRecordsResponse: History import records response.
  - `data` HistoryImportRecordsResult, required: Outcome of one records request.
    - `conversations` HistoryImportWrittenCount, required: Records written (or already present) in this request.
      - `written` integer, required: Record count.
    - `members` HistoryImportWrittenCount, required: Records written (or already present) in this request.
      - `written` integer, required: Record count.
    - `messages` HistoryImportWrittenCount, required: Records written (or already present) in this request.
      - `written` integer, required: Record count.
    - `reactions` HistoryImportWrittenCount, required: Records written (or already present) in this request.
      - `written` integer, required: Record count.
    - `skipped` HistoryImportSkippedRecord[], required: Records that were not written.
      - `external_id` string, required: External id of the record or reference.
      - `reason` string, required: Why, e.g. unknown_member, unknown_conversation, unknown_author, unknown_message, unsupported_emoji, message_too_long, empty_message, ando_member_not_found, agent_not_added (an agent keeps authorship of its messages but is never added to a conversation by an import).

## Other responses

- `400`: Bad request.
- `401`: Missing or invalid API key.
- `403`: Forbidden.
- `404`: Not found.
- `409`: Conflict.
- `429`: Rate limit or quota exceeded.
- `500`: Internal server error.

## Changes

- **2026-10-18** `aaceae49c08d`: 12 info
  - added the optional property `request_id` to the response with the `400` status
  - added the optional property `request_id` to the response with the `401` status
  - added the optional property `request_id` to the response with the `403` status
  - added the optional property `request_id` to the response with the `404` status
  - …8 more
- **2026-10-03** `c5d9fe685b8f`: 1 info
  - added the new optional request property `messages/items/files`
- **2026-09-29** `dbc7bd1e9aec`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/ando/apis/ando-public-api/changes/imports/:importId/records/post.md)

---

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