Assistant

Preview Assistant Attachment Import

Put an attached CSV or Excel file (its first sheet) through the lead import pipeline's upload step: the same preview as `POST /imports/leads` (detected encoding and delimiter, suggested column mapping, sample rows) plus `attachment_id`. Nothing is imported until `POST /imports/{import_id}/commit` (Oro asks for a confirmation with the mapping first). 422 for other kinds (RO-323).

API key access

Not available to API keys or connected apps: only a signed-in person can call this route.
POST/api/v1/assistant/attachments/{attachment_id}/import-preview
AuthorizationBearer <token>

Access token from /api/v1/auth/login, or an API key (ro_pat_..., RO-176) from /api/v1/workspaces/current/api-keys: the key implies its workspace and needs the route's scope. MCP connectors (/api/v1/mcp only) may use an OAuth access token (ro_oat_..., RO-284).

In: header

Path Parameters

attachment_idstring
Formatuuid

Header Parameters

X-Workspace-Id?string | null

Id of the workspace to act on (must be a member).

Response Body

curl -X POST "http://localhost:8000/api/v1/assistant/attachments/497f6eca-6276-4993-bfeb-53cbbbba6f08/import-preview" \  -H "X-Workspace-Id: string"
{
  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  "filename": "string",
  "status": "previewed",
  "encoding": "string",
  "delimiter": "string",
  "headers": [
    "string"
  ],
  "total_rows": 0,
  "created_count": 0,
  "updated_count": 0,
  "skipped_count": 0,
  "error_count": 0,
  "suppressed_count": 0,
  "mapping": [
    {
      "property1": null,
      "property2": null
    }
  ],
  "options": {
    "property1": null,
    "property2": null
  },
  "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
  "created_at": "2019-08-24T14:15:22Z",
  "started_at": "2019-08-24T14:15:22Z",
  "completed_at": "2019-08-24T14:15:22Z",
  "suggested_mapping": [
    {
      "column": 0,
      "header": "string",
      "field": {},
      "custom_key": "string"
    }
  ],
  "sample_rows": [
    {
      "row": 0,
      "cells": [
        "string"
      ]
    }
  ],
  "default_country": "string"
}
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}