Import History
Fetch and index the selection; returns only after native indexing succeeds.
This is a long-running request. For interactive use, the Slack import dialog acknowledges immediately and reports its background result.
Path Parameters
- team_id (str): Slack workspace (team) id of the connected installation to read history from. Only the owner of an active connection for it may import. An import already running in this process for this workspace and the same dataset is rejected with 400.
Request Parameters
- channel_ids (List[str]): Slack channel ids (C… or G…) to import; names and DMs are rejected and duplicates dropped. Channel imports also require days or an oldest date, and at least one channel or thread must be selected. At most 50 items.
- dataset_id (UUID): UUID of the dataset (from GET /api/v1/datasets).
- days (Optional[int]): Size of the window ending now, used instead of explicit dates; passing it together with oldest or latest is rejected. Must be between 1 and 3650.
- latest (Optional[datetime]): End of the date window; must be timezone-aware, later than oldest and no later than now, and cannot be combined with days. Omitted, the window ends at the time of the request.
- max_messages (int): Cap on the messages fetched for this selection. Exceeding the cap fails the import with 400 rather than storing a truncated snapshot. Must be between 1 and 500000. Defaults to 50000.
- max_requests (int): Cap on the Slack API requests this import may issue, retries included. Exceeding the cap fails the import with 400 rather than storing a truncated snapshot. Must be between 1 and 10000. Defaults to 1000.
- oldest (Optional[datetime]): Start of the date window; must be timezone-aware and precede latest, and cannot be combined with days. Channel selections require it when days is not given.
- thread_links (List[str]): Slack message permalinks (https://<workspace>.slack.com/archives/…) selecting whole conversations regardless of the date window; duplicates are dropped and links that cannot be parsed are rejected. At most 50 items.
- thread_mode (Literal[‘started’, ‘active’]): ‘started’ selects threads whose root message falls in the window; ‘active’ scans the channel’s whole history up to latest and selects threads with any message in the window. Every page scanned counts toward max_messages and max_requests, so ‘active’ on a large channel can exceed them. Neither acts as a retention policy. One of: ‘started’, ‘active’. Defaults to ‘started’.
- threads (List[SlackThread]): Threads named directly by channel id and root timestamp, as an alternative to thread_links; each selected thread is imported with all available replies. At most 50 items.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Date bounds select conversations; selected threads include all available replies.
started selects roots in the window. active also scans older roots
and selects threads with a message in the window. Neither is a retention
policy. Explicit thread links select entire conversations independently
of the date window. All bounds are timezone-aware.
5050501 <= x <= 3650started, active 1 <= x <= 100001 <= x <= 500000