---
title: "Import Account Correspondence"
method: POST
path: "/accounts/{account_id}/correspondence/import"
tags: ["Documents"]
---

# Import Account Correspondence

`POST /accounts/{account_id}/correspondence/import`

## Request

- Base URL: `https://be.graph8.com/api/v1`
- URL: `https://be.graph8.com/api/v1/accounts/{account_id}/correspondence/import`
- Auth: HTTP bearer

Import a batch of correspondence. PARTIAL SUCCESS IS NORMAL.

The response reports `imported`, `skipped` and `errors` and the status
stays 200 even when rows failed - read the body, not the status. Send
`external_id` on each item to make the import re-runnable: a row whose
`external_id` is already stored is SKIPPED rather than duplicated.

## Path parameters

- `account_id` string, required: The account.

## Headers

- `Authorization` string, nullable
- `X-Target-Org-Id` string, nullable

## Request body

- CorrespondenceImportRequest: Bulk import. Mirrors `correspondence.ImportCorrespondenceRequest`. Partial success is the normal outcome: the response reports `imported`, `skipped` and `errors` and the HTTP status stays 200, so read the body rather than the status.
  - `items` CorrespondenceCreateRequest[], required: The records. Bounded at 500 by this contract - the app has no ceiling, and an unbounded body on a synchronous per-row insert is a request that times out halfway through having written some rows.
    - `channel` string, required: `email`, `linkedin` or `call_notes`.
    - `direction` string, required: `inbound` or `outbound`.
    - `subject` string, nullable
    - `content` string, required: The body. Indexed for retrieval.
    - `correspondence_date` string, date-time, required: When it happened - NOT when it was recorded. Required.
    - `stakeholder_id` string, nullable: The person at the account, when known.
    - `external_id` string, nullable: Your id for this message. The app uses it to skip duplicates on `/correspondence/import`, so send it to make an import re-runnable.

## Response `200`

Successful Response

- ApiResponseDocumentPayload
  - `data` DocumentPayload, required: An open envelope for one document, folder or questionnaire. Open on purpose: a Library document carries extraction metadata, a questionnaire carries per-provider processing detail, and a generated deal document carries `structured_data` and `highlights` whose shape is the generator's rather than this contract's. Pinning those would silently drop whatever the app learned to return that this file had not caught up on.
  - `pagination` PaginationMeta
    - `page` integer, required: Current page number (1-indexed)
    - `limit` integer, required: Items per page
    - `total` integer, required: Total number of items
    - `has_next` boolean, required: Whether there are more pages
    - `next_cursor` string, nullable: Opaque cursor for the next page; null when there are no more items. Pass it back as the `cursor` query param to fetch the following page without computing page numbers.
    - `total_available` integer, nullable: Search endpoints only: how many records really match, when known. Can be larger than `total`, which is capped at the 10,000 results that can be paged. For company search this is a distinct-company estimate. Null when unknown; absent outside search.
    - `total_is_lower_bound` boolean, nullable: Search endpoints only: true when more records match than `total` shows (the result set is larger than the 10,000 results that can be paged). Absent outside search.
    - `notes` string[], nullable: Search endpoints only: plain-language notes about the result, e.g. that more records match than can be paged, or that a reversed `between` range was put in order.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/graph8/apis/graph8-developer-api.md) · [All operations](https://skmtc.dev/graph8/apis/graph8-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/graph8/apis/graph8-developer-api/revisions/2e7cfa0ca921?raw)
