> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.tryenvoy.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.tryenvoy.ai/_mcp/server.

# Log a terminal CSV import summary

POST https://tryenvoy.ai/api/v1/uploads/csv/import-summary
Content-Type: application/json

Records bounded browser-observed counts and timing; it does not persist import lifecycle state.

**Authentication:** Bearer token required.

Reference: https://docs.tryenvoy.ai/api-reference/endpoints/api/log-csv-import-summary-api-v-1-uploads-csv-import-summary-post

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Servers

- `https://tryenvoy.ai/api/v1` (Production, default)
- `https://staging.tryenvoy.ai/api/v1` (Staging)

## Request

### Headers

- `X-Organization-ID` (string, optional, nullable)
- `Idempotency-Key` (string, optional) — A unique key (up to 255 printable ASCII characters, e.g. a UUID) that makes a retry of this request safe. Envoy stores the response for 24 hours; a retry with the same key and the same request returns it again with `Idempotent-Replayed: true` instead of running twice. The same key with a different request returns 422 `idempotency_key_reused`; while the first request is still running, 409 `idempotency_key_in_progress`. 5xx and 429 responses are not stored.

### Body (application/json)

This endpoint expects a CsvImportSummaryRequest.

- `import_id` (string, required)
- `entity_type` (enum, required) — Which entity a CSV upload is for — echoed in the response and the correlated logs.
  - Allowed values: `loads`, `carriers`, `carrier-lane-preferences`
- `outcome` (enum, required)
  - Allowed values: `success`, `partial_success`, `failed`
- `rows_parsed` (integer, required)
- `rows_client_invalid` (integer, required)
- `rows_submitted` (integer, required)
- `rows_created` (integer, required)
- `rows_updated` (integer, required)
- `rows_failed` (integer, required)
- `rows_not_attempted` (integer, required)
- `backend_duration_ms` (double, required)
- `end_to_end_duration_ms` (double, required)
- `archival_outcome` (enum, required)
  - Allowed values: `success`, `failed`, `not_attempted`
- `rows_skipped` (integer, optional, default: 0) — Rows accepted but deliberately not written (e.g. TMS-protection skips)
- `rows_indeterminate` (integer, optional, default: 0) — Rows in a failed chunk whose commit state the browser cannot know
- `archival_duration_ms` (double, optional, nullable)
- `failure_category` (enum, optional, nullable)
  - Allowed values: `request_validation`, `row_ingestion`, `transport`, `internal`

## Response

### 200

Successful Response

- `import_id` (string, required)
- `logged` (boolean, optional, default: true)

## Errors

### 401 Unauthorized Error

Not authenticated - missing or invalid token/API key

- `any`

### 403 Forbidden Error

Insufficient permissions for this operation

- `any`

### 409 Conflict Error

`idempotency_key_in_progress`: a request with this Idempotency-Key is still running; retry later

- `any`

### 422 Unprocessable Entity Error

Validation Error; or `idempotency_key_reused`: this Idempotency-Key was already used for a different request

- `detail` (list of ValidationError, optional)

### 429 Too Many Requests Error

Rate limit exceeded - see Retry-After header

- `any`

## Types

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `input` (any, optional)
- `ctx` (ValidationErrorCtx, optional)

### ValidationErrorLocItems

- string
- integer

### ValidationErrorCtx

## Examples

**Request**

```json
{
  "import_id": "string",
  "entity_type": "loads",
  "outcome": "success",
  "rows_parsed": 1,
  "rows_client_invalid": 1,
  "rows_submitted": 1,
  "rows_created": 1,
  "rows_updated": 1,
  "rows_failed": 1,
  "rows_not_attempted": 1,
  "backend_duration_ms": 1.1,
  "end_to_end_duration_ms": 1.1,
  "archival_outcome": "success"
}
```

**Response**

```json
{
  "import_id": "string",
  "logged": true
}
```

**SDK Code**

```python
import requests

url = "https://tryenvoy.ai/api/v1/uploads/csv/import-summary"

payload = {
    "import_id": "string",
    "entity_type": "loads",
    "outcome": "success",
    "rows_parsed": 1,
    "rows_client_invalid": 1,
    "rows_submitted": 1,
    "rows_created": 1,
    "rows_updated": 1,
    "rows_failed": 1,
    "rows_not_attempted": 1,
    "backend_duration_ms": 1.1,
    "end_to_end_duration_ms": 1.1,
    "archival_outcome": "success"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://tryenvoy.ai/api/v1/uploads/csv/import-summary';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"import_id":"string","entity_type":"loads","outcome":"success","rows_parsed":1,"rows_client_invalid":1,"rows_submitted":1,"rows_created":1,"rows_updated":1,"rows_failed":1,"rows_not_attempted":1,"backend_duration_ms":1.1,"end_to_end_duration_ms":1.1,"archival_outcome":"success"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://tryenvoy.ai/api/v1/uploads/csv/import-summary"

	payload := strings.NewReader("{\n  \"import_id\": \"string\",\n  \"entity_type\": \"loads\",\n  \"outcome\": \"success\",\n  \"rows_parsed\": 1,\n  \"rows_client_invalid\": 1,\n  \"rows_submitted\": 1,\n  \"rows_created\": 1,\n  \"rows_updated\": 1,\n  \"rows_failed\": 1,\n  \"rows_not_attempted\": 1,\n  \"backend_duration_ms\": 1.1,\n  \"end_to_end_duration_ms\": 1.1,\n  \"archival_outcome\": \"success\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://tryenvoy.ai/api/v1/uploads/csv/import-summary")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"import_id\": \"string\",\n  \"entity_type\": \"loads\",\n  \"outcome\": \"success\",\n  \"rows_parsed\": 1,\n  \"rows_client_invalid\": 1,\n  \"rows_submitted\": 1,\n  \"rows_created\": 1,\n  \"rows_updated\": 1,\n  \"rows_failed\": 1,\n  \"rows_not_attempted\": 1,\n  \"backend_duration_ms\": 1.1,\n  \"end_to_end_duration_ms\": 1.1,\n  \"archival_outcome\": \"success\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://tryenvoy.ai/api/v1/uploads/csv/import-summary")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"import_id\": \"string\",\n  \"entity_type\": \"loads\",\n  \"outcome\": \"success\",\n  \"rows_parsed\": 1,\n  \"rows_client_invalid\": 1,\n  \"rows_submitted\": 1,\n  \"rows_created\": 1,\n  \"rows_updated\": 1,\n  \"rows_failed\": 1,\n  \"rows_not_attempted\": 1,\n  \"backend_duration_ms\": 1.1,\n  \"end_to_end_duration_ms\": 1.1,\n  \"archival_outcome\": \"success\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://tryenvoy.ai/api/v1/uploads/csv/import-summary', [
  'body' => '{
  "import_id": "string",
  "entity_type": "loads",
  "outcome": "success",
  "rows_parsed": 1,
  "rows_client_invalid": 1,
  "rows_submitted": 1,
  "rows_created": 1,
  "rows_updated": 1,
  "rows_failed": 1,
  "rows_not_attempted": 1,
  "backend_duration_ms": 1.1,
  "end_to_end_duration_ms": 1.1,
  "archival_outcome": "success"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://tryenvoy.ai/api/v1/uploads/csv/import-summary");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"import_id\": \"string\",\n  \"entity_type\": \"loads\",\n  \"outcome\": \"success\",\n  \"rows_parsed\": 1,\n  \"rows_client_invalid\": 1,\n  \"rows_submitted\": 1,\n  \"rows_created\": 1,\n  \"rows_updated\": 1,\n  \"rows_failed\": 1,\n  \"rows_not_attempted\": 1,\n  \"backend_duration_ms\": 1.1,\n  \"end_to_end_duration_ms\": 1.1,\n  \"archival_outcome\": \"success\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "import_id": "string",
  "entity_type": "loads",
  "outcome": "success",
  "rows_parsed": 1,
  "rows_client_invalid": 1,
  "rows_submitted": 1,
  "rows_created": 1,
  "rows_updated": 1,
  "rows_failed": 1,
  "rows_not_attempted": 1,
  "backend_duration_ms": 1.1,
  "end_to_end_duration_ms": 1.1,
  "archival_outcome": "success"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://tryenvoy.ai/api/v1/uploads/csv/import-summary")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```