> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ando.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Write history import records

> 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.



## OpenAPI

````yaml /openapi.json post /imports/{importId}/records
openapi: 3.0.3
info:
  description: >-
    Generated from Ando's accepted public API v1 contract metadata. Current
    routes preserve legacy /api/v1 response envelopes while converging on the
    public https://api.ando.so/v1 shape.
  title: Ando Public API
  version: v1
servers:
  - description: Canonical public API host.
    url: https://api.ando.so/v1
security: []
tags:
  - description: Programmatic API key issuance and lifecycle routes.
    name: API Keys
  - description: Workspace agent lifecycle routes.
    name: Agents
  - description: Call detail and transcript routes.
    name: Calls
  - description: Membership-scoped conversation routes.
    name: Conversations
  - description: File upload lifecycle routes for public API message attachments.
    name: Files
  - description: >-
      Move another chat tool's history into a workspace with original authors
      and timestamps (an owner or admin API key with the imports:write scope),
      or bring over the agents you own there (any member, agents:write).
    name: Imports
  - description: >-
      Workspace member detail routes. Existing v1 paths keep member
      compatibility spellings.
    name: Members
  - description: Message and conversation message routes.
    name: Messages
  - description: Public realtime connection and protocol routes.
    name: Realtime
  - description: Search routes.
    name: Search
  - description: Outbound webhook endpoint and delivery routes.
    name: Webhooks
paths:
  /imports/{importId}/records:
    post:
      tags:
        - Imports
      summary: Write history import records
      description: >-
        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.
      operationId: writeHistoryImportRecords
      parameters:
        - description: Import identifier.
          in: path
          name: importId
          required: true
          schema:
            description: Import identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HistoryImportRecordsBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HistoryImportRecordsResponse'
          description: What was written and what was skipped.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
      security:
        - AndoApiKey: []
        - BearerApiKey: []
components:
  schemas:
    HistoryImportRecordsBody:
      additionalProperties: false
      description: >-
        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.
      properties:
        conversations:
          description: Conversations.
          items:
            $ref: '#/components/schemas/HistoryImportConversationRecord'
          type: array
        members:
          description: People.
          items:
            $ref: '#/components/schemas/HistoryImportMemberRecord'
          type: array
        messages:
          description: Messages.
          items:
            $ref: '#/components/schemas/HistoryImportMessageRecord'
          type: array
        reactions:
          description: Reactions.
          items:
            $ref: '#/components/schemas/HistoryImportReactionRecord'
          type: array
      type: object
    HistoryImportRecordsResponse:
      additionalProperties: false
      description: History import records response.
      properties:
        data:
          $ref: '#/components/schemas/HistoryImportRecordsResult'
      required:
        - data
      type: object
    HistoryImportConversationRecord:
      additionalProperties: false
      description: >-
        A channel or direct message. Rosters accumulate: send the same record
        again with more member ids to add people. Re-sending a record also
        updates the conversation's name, description, visibility, and archived
        state. A direct message always becomes its own imported conversation. An
        imported channel never takes a live channel's name; it gets a source
        suffix instead.
      properties:
        archived:
          description: Whether the conversation was archived at the source.
          type: boolean
        created_at:
          description: When the conversation was created at the source.
          type: string
          example: '2026-05-14T08:00:00.000Z'
          format: date-time
        description:
          description: Channel description.
          type: string
          nullable: true
        external_id:
          description: The conversation's id in the source tool.
          type: string
        kind:
          description: Conversation kind.
          enum:
            - channel
            - direct_message
          type: string
        member_external_ids:
          description: >-
            External ids of members imported earlier. At most 250 across one
            request; send a larger roster as repeated records.
          items:
            description: Member external id.
            type: string
          type: array
        name:
          description: Channel name. Required for channels; ignored for direct messages.
          type: string
          nullable: true
        visibility:
          description: Channel visibility. Direct messages are always private.
          enum:
            - public
            - private
          type: string
      required:
        - archived
        - created_at
        - description
        - external_id
        - kind
        - member_external_ids
        - name
        - visibility
      type: object
    HistoryImportMemberRecord:
      additionalProperties: false
      description: >-
        A person from the source tool. Their history is attributed to
        ando_member_id when given, else to an Ando member with the same email,
        else to an imported placeholder that keeps their name and avatar.
      properties:
        ando_member_id:
          description: Existing Ando workspace member this person already is.
          type: string
          nullable: true
        avatar_url:
          description: https avatar URL.
          type: string
          nullable: true
        deactivated:
          description: Whether the source tool had deactivated them.
          type: boolean
        display_name:
          description: Display name in the source tool.
          type: string
        email:
          description: Email address, when the source tool has one.
          type: string
          nullable: true
        external_id:
          description: The person's id in the source tool.
          type: string
        kind:
          description: Person or bot.
          enum:
            - person
            - bot
          type: string
      required:
        - ando_member_id
        - avatar_url
        - deactivated
        - display_name
        - email
        - external_id
        - kind
      type: object
    HistoryImportMessageRecord:
      additionalProperties: false
      description: >-
        A message with its original author and time. Send thread roots before
        their replies. Imported messages notify no one.
      properties:
        author_external_id:
          description: External id of the author.
          type: string
        conversation_external_id:
          description: External id of the conversation.
          type: string
        created_at:
          description: When the message was sent at the source.
          type: string
          example: '2026-05-14T08:00:00.000Z'
          format: date-time
        edited_at:
          description: When the message was last edited at the source.
          type: string
          example: '2026-05-14T08:00:00.000Z'
          format: date-time
          nullable: true
        external_id:
          description: The message's id in the source tool.
          type: string
        markdown:
          description: Message body as Markdown, at most 40,000 characters.
          type: string
        thread_root_external_id:
          description: >-
            External id of the thread's root message. Ando threads are one level
            deep.
          type: string
          nullable: true
        files:
          description: >-
            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.
          items:
            $ref: '#/components/schemas/HistoryImportMessageFile'
          type: array
      required:
        - author_external_id
        - conversation_external_id
        - created_at
        - edited_at
        - external_id
        - markdown
        - thread_root_external_id
      type: object
    HistoryImportReactionRecord:
      additionalProperties: false
      description: A reaction on an imported message.
      properties:
        author_external_id:
          description: External id of the person who reacted.
          type: string
        conversation_external_id:
          description: External id of the conversation.
          type: string
        emoji:
          description: Unicode emoji, or a workspace custom emoji name.
          type: string
        message_external_id:
          description: External id of the message.
          type: string
      required:
        - author_external_id
        - conversation_external_id
        - emoji
        - message_external_id
      type: object
    HistoryImportRecordsResult:
      additionalProperties: false
      description: Outcome of one records request.
      properties:
        conversations:
          $ref: '#/components/schemas/HistoryImportWrittenCount'
        members:
          $ref: '#/components/schemas/HistoryImportWrittenCount'
        messages:
          $ref: '#/components/schemas/HistoryImportWrittenCount'
        reactions:
          $ref: '#/components/schemas/HistoryImportWrittenCount'
        skipped:
          description: Records that were not written.
          items:
            $ref: '#/components/schemas/HistoryImportSkippedRecord'
          type: array
      required:
        - conversations
        - members
        - messages
        - reactions
        - skipped
      type: object
    LegacyErrorResponse:
      additionalProperties: false
      description: Current compatibility error envelope used by legacy /api/v1 routes.
      properties:
        error:
          description: Error message.
          type: string
        error_code:
          description: Optional machine-readable error code.
          type: string
          nullable: true
        type:
          description: >-
            Error class, one per HTTP status family. rate_limit_error,
            api_error, overloaded_error and timeout_error are worth retrying;
            the others need a different request. Retry a write only with the
            same Idempotency-Key: an api_error can mean it committed.
          enum:
            - invalid_request_error
            - authentication_error
            - permission_error
            - not_found_error
            - conflict_error
            - request_too_large
            - rate_limit_error
            - api_error
            - overloaded_error
            - timeout_error
          type: string
        request_id:
          description: >-
            The request id, also sent as the x-request-id header. Quote it when
            reporting a problem.
          type: string
        missing_scopes:
          description: Missing scopes.
          items:
            description: Scope.
            type: string
          type: array
      required:
        - error
      type: object
    PublicApiErrorResponse:
      additionalProperties: false
      description: Target public API error envelope.
      properties:
        error:
          additionalProperties: false
          description: Error details.
          properties:
            code:
              description: Machine-readable error code.
              type: string
            message:
              description: Human-readable error message.
              type: string
            request_id:
              description: Request identifier.
              type: string
              nullable: true
          required:
            - code
            - message
          type: object
      required:
        - error
      type: object
    HistoryImportMessageFile:
      additionalProperties: false
      description: >-
        A file uploaded with POST /v1/files by the import's operator, attached
        to an imported message.
      properties:
        external_id:
          description: >-
            The file's id in the source tool, used to find it again with
            files/lookup.
          type: string
        file_id:
          description: The Ando file id returned by POST /v1/files.
          type: string
      required:
        - external_id
        - file_id
      type: object
    HistoryImportWrittenCount:
      additionalProperties: false
      description: Records written (or already present) in this request.
      properties:
        written:
          description: Record count.
          type: integer
          minimum: 0
      required:
        - written
      type: object
    HistoryImportSkippedRecord:
      additionalProperties: false
      description: A record that was not written.
      properties:
        external_id:
          description: External id of the record or reference.
          type: string
        reason:
          description: >-
            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).
          type: string
      required:
        - external_id
        - reason
      type: object
  responses:
    BadRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LegacyErrorResponse'
      description: Bad request.
    Unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LegacyErrorResponse'
      description: Missing or invalid API key.
    Forbidden:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LegacyErrorResponse'
      description: Forbidden.
    NotFound:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LegacyErrorResponse'
      description: Not found.
    Conflict:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LegacyErrorResponse'
      description: Conflict.
    RateLimited:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiErrorResponse'
      description: Rate limit or quota exceeded.
    InternalError:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LegacyErrorResponse'
      description: Internal server error.
  securitySchemes:
    AndoApiKey:
      description: Workspace API key. Current accepted keys use the ando_sk_ prefix.
      in: header
      name: x-api-key
      type: apiKey
    BearerApiKey:
      bearerFormat: ando_sk
      description: Compatibility transport for workspace API keys.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.