# AutessaDB Drive API

Source: https://docs.autessa.com/docs/api/autessadb-drive

> Client API for AutessaDB Drives: browse folders, upload files, search exact text and ranked keywords (or meaning), read pages and lines, manage versions and trash, and share files and folders.

# AutessaDB Drive API

Programmatic access to an [AutessaDB Drive](/docs/guide/autessadb/drive.md): list and find files, grep their text and run ranked search over it (meaning-based when semantic search is on), read exact pages and lines, upload whole folders, and share files and folders with people, teams, your company, or a link.

> Every request is a `POST` with a JSON body to `https://api.autessa.com/clients/autessadb-drive/<operation>`, with the Drive's ID in the `resourceId` query parameter and your API key in the `Authorization` header (no `Bearer` prefix). The body's `tableId` must match `resourceId`.

## Permissions

Two layers apply to every call:

1. **The API key's permission on the Drive**, as for any table: **READ** for browsing, searching, reading, and downloading; **WRITE** for uploads, folders, moves, trash and restore, versions, sharing, and links; **DELETE** for permanent deletion.
2. **Sharing inside the Drive.** Requests run under the key's acting identity and only reach the files and folders that identity can open, with the role it has on each (Owner, Editor, or Viewer). Items it cannot open behave as if they do not exist. See [Sharing](/docs/guide/autessadb/drive.md#sharing).

## Paths

Paths are absolute and start with `/`, for example `/Shared/Legal/Contracts/acme-msa.pdf`. Backslashes are treated as `/`, repeated slashes are collapsed, and `.` and `..` segments are rejected. Names are compared without regard to case, are at most 255 bytes, and paths are at most 64 levels deep. The Drive's root is `/`; a new Drive is empty, and every folder in it is one someone created.

Calls that take an item accept either `path` or `nodeId`; calls that take several items accept `paths` or `nodeIds`. An item's `nodeId` never changes, even when it is moved or renamed.

## The item object

Listings, searches, and most write calls return items in this shape:

- `nodeId` (string) — The item's ID (a decimal string).
- `path` (string) — Current absolute path.
- `name` (string) — The last segment of the path.
- `nodeType` (string) — `FILE` or `FOLDER`.
- `parentId` (string) — ID of the containing folder, or `null` at the top level.
- `sizeBytes` (integer) — File size. Files only.
- `mimeType` (string) — File type. Files only.
- `version` (integer) — Current version number, starting at 1. Files only.
- `contentUpdatedAt` (string) — When the file's content last changed (ISO-8601 UTC). Files only.
- `updatedAt` (string) — When the item last changed, including renames and moves.
- `ownerUserId` (string) — The owner's user ID.
- `ownerName` (string) — The owner's name.
- `extractionStatus` (string) — Files only: `PENDING` or `EXTRACTING` while text is being extracted, `EXTRACTED` when it is searchable, `FAILED`, `UNSUPPORTED` (no extractable text), or `TOO_LARGE` (only the first part is searchable).
- `trashedAt` (string) — When the item was trashed. Present only when listing with `includeTrashed`.
- `customColumns` (object) — Values of any custom columns you added to the Drive, as a map of column name to typed column value (the same shape as [AutessaDB rows](/docs/api/autessadb.md)).

## Paging and truncation

Nothing is dropped silently. Every listing and search response says whether it is complete:

- `truncated` is `false` when you have everything, or a string naming the cap that stopped it: `"limit"` (page full), `"max_entries"` (tree size), `"max_matches_per_file"` (grep per-file cap), or `"timeout"` (grep time budget).
- `nextCursor` continues from where the response stopped. Send it back as `cursor` with the **same** other arguments; a cursor replayed with different arguments is rejected with `INVALID_CURSOR`.

## Uploading files

Uploads take three steps, so file bytes go straight to storage and large files can be sent in parallel parts:

1. [Start uploads](#start-uploads) with the paths and sizes. Storage is reserved and each file gets an upload link.
2. `PUT` each file's bytes to its `url` with the returned `headers`, or for multipart uploads, `PUT` each part to its [part link](#get-part-links) and then [complete](#complete-a-multipart-upload) it.
3. [Commit](#commit-uploads) the finished uploads. Files appear in the Drive and processing starts.

The [CLI](/docs/cli/autessadb.md#how-to-work-with-a-drive) wraps all three steps in `autessa autessadb drive push` and `upload`.

---

## List a folder

**POST** `/ls`

Lists the direct children of a folder: folders first, then files, each group sorted by the chosen order. Only items the caller can open are returned. Omit both `path` and `nodeId` to list the top level of the Drive (or of the folder an agent tool is scoped to).

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `path` (string) — Absolute path of the item, e.g. `/Contracts/acme-msa.pdf`. Send `path` or `nodeId`.
- `nodeId` (string) — The item's ID. Takes precedence over `path` when both are sent.
- `sort` (string) — `name` (default), `modified`, or `size`. Folders always come first.
- `includeTrashed` (boolean) — Include items in the trash. Default `false`.
- `limit` (integer) — Maximum entries to return. Default 200, maximum 1000.
- `cursor` (string) — The `nextCursor` from the previous page. Send the same other arguments as the first call.

### Response

- `driveRole` (string) — Your Drive membership: `OWNER` (the Drive's owner or a Drive admin), `EDITOR` or `VIEWER` (a member: the Drive itself is shared with you), or `NONE` (only items inside it are shared with you). Membership does not show any item by itself: members see what they own and what is shared with them. `OWNER` and `EDITOR` can add items at the top level.
- `folder` (object) — The folder being listed, or `null` for the top level.
- `items` — "> The folder's children. See [The item object](#the-item-object).
- `nextCursor` (string) — Cursor for the next page, or `null` when there is nothing more.
- `truncated` (boolean | string) — `false` when the response is complete; otherwise the reason it stopped early. See [Paging and truncation](#paging-and-truncation).

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/ls?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "path": "/Shared/Legal/Contracts",
    "limit": 2
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/ls?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      path: '/Shared/Legal/Contracts',
      limit: 2
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/ls?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'path': '/Shared/Legal/Contracts',
        'limit': 2
    }
)

data = response.json()
```

```json title="Response"
{
  "folder": {
    "nodeId": "4170",
    "path": "/Shared/Legal/Contracts",
    "name": "Contracts",
    "nodeType": "FOLDER",
    "parentId": "4101",
    "updatedAt": "2026-09-21T09:12:40Z",
    "owner": {
      "userId": "u8Kd2LmQ4x",
      "name": "Dana Ortiz"
    }
  },
  "items": [
    {
      "nodeId": "4190",
      "path": "/Shared/Legal/Contracts/Archive",
      "name": "Archive",
      "nodeType": "FOLDER",
      "parentId": "4170",
      "updatedAt": "2026-09-21T09:12:40Z",
      "owner": {
        "userId": "u8Kd2LmQ4x",
        "name": "Dana Ortiz"
      }
    },
    {
      "nodeId": "4182",
      "path": "/Shared/Legal/Contracts/acme-msa.pdf",
      "name": "acme-msa.pdf",
      "nodeType": "FILE",
      "parentId": "4170",
      "sizeBytes": 482113,
      "mimeType": "application/pdf",
      "version": 2,
      "contentUpdatedAt": "2026-09-28T17:04:11Z",
      "updatedAt": "2026-09-28T17:04:11Z",
      "owner": {
        "userId": "u8Kd2LmQ4x",
        "name": "Dana Ortiz"
      },
      "extractionStatus": "EXTRACTED"
    }
  ],
  "nextCursor": "eyJrIjpbImFjbWUtbXNhLnBkZiIsNDE4Ml19",
  "truncated": "limit"
}
```

---

## Get a folder tree

**POST** `/tree`

Returns a folder and its descendants down to a depth, as a flat list in path order. Useful for getting an overview of a folder in one call.

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `path` (string) — Folder to start from. Defaults to the top level.
- `maxDepth` (integer) — Levels below `path` to include. Default 3, maximum 20.
- `maxEntries` (integer) — Maximum entries to return. Default 500, maximum 5000.

### Response

- `root` (string) — The starting path.
- `entries` — "> One entry per item: `nodeId`, `path`, `nodeType`, `depth` (relative to `root`), and for files `sizeBytes`.
- `truncated` (boolean | string) — `"max_entries"` if more items exist than were returned.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/tree?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "path": "/Shared/Legal",
    "maxDepth": 2
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/tree?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      path: '/Shared/Legal',
      maxDepth: 2
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/tree?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'path': '/Shared/Legal',
        'maxDepth': 2
    }
)

data = response.json()
```

```json title="Response"
{
  "root": "/Shared/Legal",
  "entries": [
    {
      "nodeId": "4170",
      "path": "/Shared/Legal/Contracts",
      "nodeType": "FOLDER",
      "depth": 1
    },
    {
      "nodeId": "4182",
      "path": "/Shared/Legal/Contracts/acme-msa.pdf",
      "nodeType": "FILE",
      "depth": 2,
      "sizeBytes": 482113
    },
    {
      "nodeId": "4175",
      "path": "/Shared/Legal/Policies",
      "nodeType": "FOLDER",
      "depth": 1
    }
  ],
  "truncated": false
}
```

---

## Find items

**POST** `/find`

Finds files and folders by name, pattern, type, date, or size anywhere under a folder. Glob patterns support `*`, `**` (any number of folders), `?`, character classes like `[0-9]`, and alternatives like `{pdf,docx}`. A pattern with no `/` (such as `*.pdf`) matches the name at any depth.

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `path` (string) — Folder to search under. Defaults to everything the caller can see.
- `glob` (string) — Glob pattern matched against paths, e.g. `**/2026/*.pdf` or `invoice-*`.
- `nameRegex` (string) — Regular expression matched against names.
- `type` (string) — `FILE` or `FOLDER`.
- `mime` (string) — Exact MIME type, or a prefix ending in `/`, e.g. `image/`.
- `modifiedAfter` (string) — ISO-8601 UTC timestamp. Only items modified at or after it.
- `modifiedBefore` (string) — ISO-8601 UTC timestamp. Only items modified before it.
- `sizeGt` (integer) — Minimum file size in bytes.
- `sizeLt` (integer) — Maximum file size in bytes.
- `limit` (integer) — Maximum entries to return. Default 200, maximum 1000.
- `cursor` (string) — The `nextCursor` from the previous page. Send the same other arguments as the first call.

### Response

- `items` — "> Matching items in path order. See [The item object](#the-item-object).
- `nextCursor` (string) — Cursor for the next page, or `null` when there is nothing more.
- `truncated` (boolean | string) — `false` when the response is complete; otherwise the reason it stopped early. See [Paging and truncation](#paging-and-truncation).

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/find?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "path": "/Shared/Legal",
    "glob": "*.pdf",
    "modifiedAfter": "2026-09-01T00:00:00Z"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/find?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      path: '/Shared/Legal',
      glob: '*.pdf',
      modifiedAfter: '2026-09-01T00:00:00Z'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/find?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'path': '/Shared/Legal',
        'glob': '*.pdf',
        'modifiedAfter': '2026-09-01T00:00:00Z'
    }
)

data = response.json()
```

```json title="Response"
{
  "items": [
    {
      "nodeId": "4182",
      "path": "/Shared/Legal/Contracts/acme-msa.pdf",
      "name": "acme-msa.pdf",
      "nodeType": "FILE",
      "parentId": "4170",
      "sizeBytes": 482113,
      "mimeType": "application/pdf",
      "version": 2,
      "contentUpdatedAt": "2026-09-28T17:04:11Z",
      "updatedAt": "2026-09-28T17:04:11Z",
      "owner": {
        "userId": "u8Kd2LmQ4x",
        "name": "Dana Ortiz"
      },
      "extractionStatus": "EXTRACTED"
    }
  ],
  "nextCursor": null,
  "truncated": false
}
```

---

## Get item details

**POST** `/stat`

Returns one item with its processing status, page and line counts, recent versions, and the caller's role on it. Callers who can manage sharing on the item also get its shares.

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `path` (string) — Absolute path of the item, e.g. `/Contracts/acme-msa.pdf`. Send `path` or `nodeId`.
- `nodeId` (string) — The item's ID. Takes precedence over `path` when both are sent.

### Response

The item's own fields (`nodeId`, `path`, `name`, `nodeType`, `sizeBytes`, `version`, …) at the top level, as in [The item object](#the-item-object), plus:

- `effectiveRole` (string) — The caller's effective role: `OWNER`, `EDITOR`, or `VIEWER`.
- `extraction` (object) — For files: `status`, `indexStatus`, `textKind` (`NATIVE` for text files with real line numbers, `PAGED` for documents extracted page by page), `pageCount`, `lineCount`, `ocrNeededPages` (scanned pages OCR was unsure of), `ocrStatus` (`DONE` when scanned pages were read by OCR, otherwise `NONE`), and `ocr`: `engine`, `pagesOcr` (pages read by OCR), `pagesLowConfidence` and `lowConfidencePages` (pages read with low confidence; their text is kept as read and is searchable), and `pagesUnreadable` and `unreadablePages` (pages with no searchable text).
- `versionsCount` (integer) — How many previous versions the file has. List them with [List versions](#list-versions).

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/stat?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "path": "/Shared/Legal/Contracts/acme-msa.pdf"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/stat?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      path: '/Shared/Legal/Contracts/acme-msa.pdf'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/stat?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'path': '/Shared/Legal/Contracts/acme-msa.pdf'
    }
)

data = response.json()
```

```json title="Response"
{
  "nodeId": "4182",
  "path": "/Shared/Legal/Contracts/acme-msa.pdf",
  "name": "acme-msa.pdf",
  "parentId": "4170",
  "nodeType": "FILE",
  "depth": 4,
  "sizeBytes": 482113,
  "mimeType": "application/pdf",
  "version": 2,
  "contentUpdatedAt": "2026-09-28T17:04:11Z",
  "ownerUserId": "u8Kd2LmQ4x",
  "ownerName": "Dana Ortiz",
  "updatedAt": "2026-09-28T17:04:11Z",
  "extractionStatus": "EXTRACTED",
  "extraction": {
    "status": "EXTRACTED",
    "indexStatus": "NONE",
    "textKind": "PAGED",
    "pageCount": 14,
    "lineCount": 612,
    "ocrNeededPages": [9],
    "ocrStatus": "DONE",
    "ocr": {
      "engine": "tesseract",
      "pagesOcr": 3,
      "pagesLowConfidence": 1,
      "pagesUnreadable": 0,
      "lowConfidencePages": [9],
      "unreadablePages": []
    }
  },
  "versionsCount": 1,
  "effectiveRole": "EDITOR"
}
```

---

## Search exact text

**POST** `/grep`

Finds lines that contain a string or match a regular expression, across every searchable file under a folder. Matching is per line. Each match carries its page and line, so you can [read](#read-a-file) around it or cite it. Files that are not searchable yet are counted in `stats.filesUnsearchable` rather than silently skipped.

Regular expressions support character classes, `\d`, `\w`, `\s`, alternation, anchors, and quantifiers. A regular expression must contain at least 3 literal characters unless the search is scoped to 2,000 files or fewer.

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `pattern` (string, required) — Text or regular expression to find. Up to 1,000 characters.
- `regex` (boolean) — Treat `pattern` as a regular expression. Default `false` (literal text).
- `caseInsensitive` (boolean) — Ignore case. Default `false`.
- `path` (string) — Folder or file to search. Defaults to everything the caller can see.
- `glob` (string) — Only search files whose path matches this glob, e.g. `*.pdf`.
- `outputMode` (string) — `matches` (default) returns each matching line; `files` returns only the files with a match; `count` returns the match count per file.
- `context` (integer) — Lines of context before and after each match, 0 to 10. Default 0.
- `maxMatchesPerFile` (integer) — Maximum matches returned per file. Default 20.
- `timeoutMs` (integer) — Time budget in milliseconds. Default 5000, maximum 15000.
- `limit` (integer) — Maximum entries to return. Default 100, maximum 1000.
- `cursor` (string) — The `nextCursor` from the previous page. Send the same other arguments as the first call.

### Response

- `matches` — "> In `matches` mode: `nodeId`, `path`, `version`, `page` and `pageLine` (for paged documents), `line`, `text`, `submatches` (character `start`/`end` of each hit in `text`), and `before`/`after` context lines.
- `files` — "> In `files` mode: `files`, each with `nodeId`, `path` and `matchCount`; in `count` mode: `count` with `files` and `matches`.
- `stats` (object) — `filesUnsearchable`: counts of files in scope that could not be searched, by reason (`pending`, `failed`, `unsupported`, `tooLarge`), with `samplePaths`.
- `nextCursor` (string) — Cursor for the next page, or `null` when there is nothing more.
- `truncated` (boolean | string) — `false` when the response is complete; otherwise the reason it stopped early. See [Paging and truncation](#paging-and-truncation).

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/grep?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "pattern": "termination for convenience",
    "caseInsensitive": true,
    "path": "/Shared/Legal",
    "context": 1
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/grep?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      pattern: 'termination for convenience',
      caseInsensitive: true,
      path: '/Shared/Legal',
      context: 1
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/grep?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'pattern': 'termination for convenience',
        'caseInsensitive': True,
        'path': '/Shared/Legal',
        'context': 1
    }
)

data = response.json()
```

```json title="Response"
{
  "matches": [
    {
      "nodeId": "4182",
      "path": "/Shared/Legal/Contracts/acme-msa.pdf",
      "version": 2,
      "page": 4,
      "pageLine": 12,
      "line": 171,
      "text": "12.2 Termination for Convenience. Either party may terminate this Agreement",
      "submatches": [
        {
          "start": 5,
          "end": 32
        }
      ],
      "before": [
        "12.1 Term. This Agreement begins on the Effective Date."
      ],
      "after": [
        "upon sixty (60) days written notice to the other party."
      ]
    }
  ],
  "stats": {
    "filesUnsearchable": {
      "pending": 1,
      "failed": 0,
      "unsupported": 0,
      "tooLarge": 0,
      "samplePaths": [
        "/Shared/Legal/Contracts/globex-sow.docx"
      ]
    }
  },
  "nextCursor": null,
  "truncated": false
}
```

---

## Read a file

**POST** `/read`

Returns a file's extracted text for a page range or a line range. Use it to read around a match before quoting. A single call returns at most 20 pages or 2,000 lines, and at most `maxChars` characters; when the range is cut short, `nextRange` tells you where to continue.

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `path` (string) — Absolute path of the item, e.g. `/Contracts/acme-msa.pdf`. Send `path` or `nodeId`.
- `nodeId` (string) — The item's ID. Takes precedence over `path` when both are sent.
- `pages` (string) — Page range for paged documents, e.g. `"4"` or `"3-5"`.
- `lines` (string) — Line range, e.g. `"100-250"`. Send `pages` or `lines`; with neither, reading starts at the beginning.
- `maxChars` (integer) — Maximum characters to return. Default 20,000, maximum 100,000.

### Response

- `path` (string) — The file's current path.
- `version` (integer) — The version that was read.
- `kind` (string) — `NATIVE` or `PAGED`.
- `lines` — "> The lines read: `line`, `text`, and for paged documents `page` and `pageLine`. Empty lines are included with empty `text`.
- `nextRange` (string) — The range to request next, or `null` at the end of the file.
- `truncated` (boolean | string) — `"limit"` when the range was cut short by `maxChars` or the per-call caps.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/read?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "path": "/Shared/Legal/Contracts/acme-msa.pdf",
    "pages": "4"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/read?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      path: '/Shared/Legal/Contracts/acme-msa.pdf',
      pages: '4'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/read?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'path': '/Shared/Legal/Contracts/acme-msa.pdf',
        'pages': '4'
    }
)

data = response.json()
```

```json title="Response"
{
  "path": "/Shared/Legal/Contracts/acme-msa.pdf",
  "version": 2,
  "kind": "PAGED",
  "lines": [
    {
      "line": 160,
      "page": 4,
      "pageLine": 1,
      "text": "12. TERM AND TERMINATION"
    },
    {
      "line": 171,
      "page": 4,
      "pageLine": 12,
      "text": "12.2 Termination for Convenience. Either party may terminate this Agreement"
    }
  ],
  "nextRange": "5",
  "truncated": false
}
```

---

## Search file contents

**POST** `/search`

Ranked keyword search over file contents; meaning-based when the Drive's **Semantic search** setting is on. Each result is a passage with its page and line range and a snippet.

- **Semantic search off (the default):** files that contain more of the query's words rank first, then files with more matches, earlier pages, and matching names. Common words are ignored. Snippets mark the matched words as `**word**`, results have `source: "keyword"`, and `stats.mode` is `keyword`. Every `mode` behaves this way.
- **Semantic search on:** `hybrid` (the default) combines meaning-based and keyword ranking, which works well for both questions and specific terms. Semantic search usage counts toward your company's search limits.

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `query` (string, required) — What to look for, in plain language or keywords.
- `mode` (string) — `hybrid` (default), `semantic` (meaning only), `lexical` (keywords only), or `keyword`. Applies when semantic search is on; otherwise every mode is a ranked keyword search.
- `path` (string) — Folder or file to search. Defaults to everything the caller can see.
- `glob` (string) — Only search files whose path matches this glob.
- `topK` (integer) — Number of results. Default 10, maximum 50.

### Response

- `results` — "> Best passages first: `nodeId`, `path`, `score`, `page` (for paged documents), `lineStart`, `lineEnd`, `snippet`, and `source` (`keyword`, or with semantic search on `hybrid`, `dense`, or `bm25`).
- `stats` (object) — How the search ran, including `mode` (`keyword` when semantic search is off).

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/search?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "query": "can either side end the contract early?",
    "path": "/Shared/Legal/Contracts",
    "topK": 3
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/search?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      query: 'can either side end the contract early?',
      path: '/Shared/Legal/Contracts',
      topK: 3
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/search?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'query': 'can either side end the contract early?',
        'path': '/Shared/Legal/Contracts',
        'topK': 3
    }
)

data = response.json()
```

```json title="Response"
{
  "results": [
    {
      "nodeId": "4182",
      "path": "/Shared/Legal/Contracts/acme-msa.pdf",
      "score": 0.83,
      "page": 4,
      "lineStart": 168,
      "lineEnd": 179,
      "snippet": "12.2 Termination for Convenience. Either party may terminate this Agreement upon sixty (60) days written notice...",
      "source": "hybrid"
    }
  ],
  "stats": {
    "mode": "hybrid"
  }
}
```

---

## Get a download link

**POST** `/download-url`

Returns a short-lived link to download a file's content, or one of its previous versions.

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `path` (string) — Absolute path of the item, e.g. `/Contracts/acme-msa.pdf`. Send `path` or `nodeId`.
- `nodeId` (string) — The item's ID. Takes precedence over `path` when both are sent.
- `version` (integer) — A previous version to download. Defaults to the current version.

### Response

- `url` (string) — The download link.
- `expiresAt` (string) — When the link stops working (ISO-8601 UTC).

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/download-url?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "nodeId": "4182"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/download-url?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      nodeId: '4182'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/download-url?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'nodeId': '4182'
    }
)

data = response.json()
```

```json title="Response"
{
  "url": "https://files.autessa.com/d/9f3c1a7e...",
  "expiresAt": "2026-10-02T15:10:00Z"
}
```

---

## Fetch a file

**POST** `/fetch`

Returns a 10-minute download link for a file, or one of its previous versions, together with the file's name, type, size and version. Same as [`/download-url`](#get-a-download-link), which stays available, plus the file's details.

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `path` (string) — Absolute path of the file, e.g. `/Reports/q1.pdf`. Send `path` or `nodeId`.
- `nodeId` (string) — The file's ID.
- `version` (integer) — A previous version. Defaults to the current version.

### Response

- `url` (string) — The download link, valid for 10 minutes.
- `expiresAt` (string) — When the link stops working (ISO-8601 UTC).
- `nodeId` (string) — The file's ID.
- `path` (string) — The file's path.
- `name` (string) — The file's name.
- `mime` (string) — MIME type of the version served.
- `sizeBytes` (integer) — Size of the version served.
- `version` (integer) — The version served.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/fetch?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tableId": "V1StGXR8Z5", "path": "/Reports/q1.pdf"}'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/fetch?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({'tableId': 'V1StGXR8Z5', 'path': '/Reports/q1.pdf'})
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/fetch?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={'tableId': 'V1StGXR8Z5', 'path': '/Reports/q1.pdf'}
)

data = response.json()
```

```json title="Response"
{
  "url": "https://files.autessa.com/d/9f3c1a7e...",
  "expiresAt": "2026-10-03T15:10:00Z",
  "nodeId": "4182",
  "path": "/Reports/q1.pdf",
  "name": "q1.pdf",
  "mime": "application/pdf",
  "sizeBytes": 248112,
  "version": 2
}
```

---

## Get processing status

**POST** `/status`

Summarizes how many files in the Drive are searchable, still processing, or not searchable. Use it after a large upload to wait until everything is searchable.

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.

### Response

- `extraction` (object) — File counts by text status (`PENDING`, `EXTRACTING`, `EXTRACTED`, `FAILED`, `UNSUPPORTED`, `TOO_LARGE`).
- `index` (object) — File counts by semantic-search index status (used only while the Drive's semantic search is on).
- `files` (integer) — Files in the Drive.
- `folders` (integer) — Folders in the Drive.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/status?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/status?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/status?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5'
    }
)

data = response.json()
```

```json title="Response"
{
  "extraction": {
    "PENDING": 0,
    "EXTRACTING": 2,
    "EXTRACTED": 318,
    "FAILED": 1,
    "UNSUPPORTED": 4,
    "TOO_LARGE": 0
  },
  "index": {
    "NONE": 325
  },
  "files": 325,
  "folders": 41
}
```

---

## Get storage usage

**POST** `/usage`

Returns your company's Drive storage and processing usage against its limits.

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.

### Response

- `bytesUsed` (integer) — Bytes stored, including previous versions and trash.
- `bytesLimit` (integer) — Storage allowance in bytes.
- `filesCount` (integer) — Files in the Drive.
- `maxFileBytes` (integer) — Largest file you can upload, in bytes.
- `extractedPagesThisMonth` (integer) — Pages extracted this calendar month.
- `extractedPagesLimit` (integer) — Monthly page allowance, or `null` if unlimited.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/usage?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/usage?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/usage?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5'
    }
)

data = response.json()
```

```json title="Response"
{
  "bytesUsed": 18253611008,
  "bytesLimit": 53687091200,
  "filesCount": 12408,
  "maxFileBytes": 5368709120,
  "extractedPagesThisMonth": 4120,
  "extractedPagesLimit": 50000
}
```

---

## Get changes

**POST** `/changes`

Lists what changed in the Drive since a cursor, so a sync client can keep a local copy current without listing everything again. Changes are returned in order, and each one carries the item's current state, so applying them in order converges on what the Drive holds now.

Start with `cursor: null`. The response has `resyncRequired: true`, no changes, and the current `cursor`: list the Drive with [`ls`](#list-a-folder) or [`find`](#find-items), keep the cursor, and from then on call `changes` with it. An unknown or expired cursor also answers `resyncRequired: true` with a fresh cursor. Changes are kept for 30 days.

You only see changes to items the key's acting identity can open now. When sharing changes hide an item or folder from it, you get `ACCESS_LOST` for it; when they reveal one, `ACCESS_GAINED`.

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `cursor` (string) — The opaque `cursor` from the previous response, or `null` to start.
- `limit` (integer) — Changes to scan per call. Default 500, maximum 1,000.

### Response

- `changes` — "> The changes, oldest first. Fields below.
- `cursor` (string) — Send this back to continue after the last change scanned.
- `hasMore` (boolean) — `true` when more changes are waiting; call again right away. A page can hold fewer than `limit` changes (even none) and still have more.
- `resyncRequired` (boolean) — `true` when the cursor was `null`, unknown, or expired. List the whole Drive again, then follow the returned `cursor`.

Each change has:

- `seq` (integer) — The change's position in the Drive's history. Increases with every change.
- `op` (string) — What happened. `CREATE`, `UPDATE` (new content or version), `MOVE` (moved or renamed; rewrite every path under `oldPath`), `TRASH`, `RESTORE`, `PURGE` (deleted permanently), `ACCESS_GAINED` (list this item and everything under it), or `ACCESS_LOST` (remove this item and everything under it). `TRASH` and `PURGE` also apply to everything under a folder.
- `nodeId` (string) — The item's ID.
- `parentId` (string) — The containing folder's ID, or `null` at the top level.
- `path` (string) — The item's path now (for `ACCESS_LOST` and `PURGE`, its last known path).
- `oldPath` (string) — For `MOVE`, the path it had before. Otherwise `null`.
- `name` (string) — The last segment of `path`.
- `nodeType` (string) — `FILE` or `FOLDER`.
- `sizeBytes` (integer) — File size. Files only; `null` for `ACCESS_LOST` and `PURGE`.
- `sha256` (string) — The file content's SHA-256 (hex), so a client can skip downloading content it already has. Files only.
- `version` (integer) — The file's current version. Files only.
- `contentUpdatedAt` (string) — When the file's content last changed (ISO-8601 UTC). Files only.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/changes?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "cursor": "dc1.MTI0OjE4MzQx",
    "limit": 500
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/changes?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      cursor: 'dc1.MTI0OjE4MzQx',
      limit: 500
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/changes?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'cursor': 'dc1.MTI0OjE4MzQx',
        'limit': 500
    }
)

data = response.json()
```

```json title="Response"
{
  "changes": [
    {
      "seq": 18342,
      "op": "UPDATE",
      "nodeId": "4210",
      "parentId": "4202",
      "path": "/Shared/Legal/Contracts/2026/Q4/initech-msa.docx",
      "oldPath": null,
      "name": "initech-msa.docx",
      "nodeType": "FILE",
      "sizeBytes": 48211,
      "sha256": "9b74c9897bac770ffc029102a200c5de2f1c6b1a4a8e4f8a5c0d3e2b1a0f9e8d",
      "version": 4,
      "contentUpdatedAt": "2026-10-27T15:02:44Z"
    },
    {
      "seq": 18343,
      "op": "MOVE",
      "nodeId": "4188",
      "parentId": "4101",
      "path": "/Shared/Legal/Archive/2025",
      "oldPath": "/Shared/Legal/Contracts/2025",
      "name": "2025",
      "nodeType": "FOLDER",
      "sizeBytes": null,
      "sha256": null,
      "version": null,
      "contentUpdatedAt": null
    }
  ],
  "cursor": "dc1.MTI0OjE4MzQz",
  "hasMore": false,
  "resyncRequired": false
}
```

---

## Write a file

**POST** `/write`

Writes text to a file: creates it, replaces its content, or appends to its end. Missing folders are created. A replaced file keeps its previous content in its [version history](#list-versions), and the new text is searchable with [grep](#search-exact-text) as soon as the call returns. Text files only (by extension or MIME type), up to 5 MB; upload anything else with [uploads](#start-uploads).

**Permission:** WRITE, and Editor on the file (or on its folder for a new file)

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `path` (string, required) — Absolute path of the file, e.g. `/Shared/notes/memory.md`.
- `content` (string) — The text, UTF-8. Absent or empty writes an empty file.
- `mode` (string) — `overwrite` (default) replaces the file, creating it when missing. `create` fails with `NAME_CONFLICT` when the file exists. `append` adds `content` to the end, starting a new line when the file does not end with one, and creates the file when missing.
- `mime` (string) — MIME type. Default: the existing file's, else inferred from the extension (`.md` text/markdown, `.json` application/json, `.csv` text/csv), else text/plain.
- `expectedVersion` (integer) — Only write when the file is still at this version (`0`: it must not exist yet). Otherwise the call fails with `VERSION_CONFLICT`, and `error.details.currentVersion` holds the current version.

### Response

- `node` (object) — The file after the write (see [The item object](#the-item-object)).
- `version` (integer) — The file's version after the write (`1` for a new file).
- `bytes` (integer) — Size of the file after the write.
- `created` (boolean) — `true` when the write created the file.
- `mode` (string) — The mode applied.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/write?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tableId": "V1StGXR8Z5", "path": "/Shared/notes/memory.md", "content": "- Acme prefers Net 45", "mode": "append"}'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/write?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({'tableId': 'V1StGXR8Z5', 'path': '/Shared/notes/memory.md', 'content': '- Acme prefers Net 45', 'mode': 'append'})
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/write?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={'tableId': 'V1StGXR8Z5', 'path': '/Shared/notes/memory.md', 'content': '- Acme prefers Net 45', 'mode': 'append'}
)

data = response.json()
```

```json title="Response"
{
  "node": { "nodeId": "5120", "path": "/Shared/notes/memory.md", "version": 4, "mimeType": "text/markdown" },
  "version": 4,
  "bytes": 112,
  "created": false,
  "mode": "append"
}
```

---

## Edit a file

**POST** `/edit`

Replaces an exact piece of text in a text file, like an editor's find-and-replace. `oldText` must occur exactly once unless `replaceAll` is `true`. The change is saved as a new version. Files with Windows line endings also match an `oldText` written with plain line breaks. Text files up to 5 MB.

**Permission:** WRITE, and Editor on the file

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `path` (string) — Absolute path of the file. Send `path` or `nodeId`.
- `nodeId` (string) — The file's ID.
- `oldText` (string, required) — The exact text to replace, including spaces and line breaks.
- `newText` (string, required) — The replacement. An empty string deletes `oldText`.
- `replaceAll` (boolean) — Replace every occurrence instead of requiring exactly one. Default `false`.
- `expectedVersion` (integer) — Only edit when the file is still at this version; otherwise `VERSION_CONFLICT`.

### Response

- `node` (object) — The file after the edit.
- `version` (integer) — The file's new version.
- `replacements` (integer) — How many places were changed.
- `bytes` (integer) — Size of the file after the edit.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/edit?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tableId": "V1StGXR8Z5", "path": "/Shared/notes/plan.md", "oldText": "Status: draft", "newText": "Status: approved"}'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/edit?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({'tableId': 'V1StGXR8Z5', 'path': '/Shared/notes/plan.md', 'oldText': 'Status: draft', 'newText': 'Status: approved'})
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/edit?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={'tableId': 'V1StGXR8Z5', 'path': '/Shared/notes/plan.md', 'oldText': 'Status: draft', 'newText': 'Status: approved'}
)

data = response.json()
```

```json title="Response"
{
  "node": { "nodeId": "5121", "path": "/Shared/notes/plan.md", "version": 3 },
  "version": 3,
  "replacements": 1,
  "bytes": 2048
}
```

---

## Create folders

**POST** `/mkdir`

Creates one or more folders, along with any missing parent folders. Existing folders are left as they are, so the call is safe to repeat.

**Permission:** WRITE, and Editor on the parent folder

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `paths` — " required> Folders to create (up to 1,000), e.g. `["/Shared/Reports/2026"]`.
- `parents` (boolean) — Create missing parent folders too. Default `true`.

### Response

- `folders` — "> Every requested folder, existing or new. See [The item object](#the-item-object).
- `created` — "> The folders this call created.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/mkdir?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "paths": [
      "/Shared/Legal/Contracts/2026/Q4",
      "/Shared/Legal/Contracts/2026/Q3"
    ]
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/mkdir?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      paths: ['/Shared/Legal/Contracts/2026/Q4', '/Shared/Legal/Contracts/2026/Q3']
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/mkdir?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'paths': ['/Shared/Legal/Contracts/2026/Q4', '/Shared/Legal/Contracts/2026/Q3']
    }
)

data = response.json()
```

```json title="Response"
{
  "created": [
    {
      "nodeId": "4201",
      "paths": ["/Shared/Legal/Contracts/2026"],
      "name": "2026",
      "nodeType": "FOLDER",
      "parentId": "4101",
      "updatedAt": "2026-09-21T09:12:40Z",
      "owner": {
        "userId": "u8Kd2LmQ4x",
        "name": "Dana Ortiz"
      }
    },
    {
      "nodeId": "4202",
      "paths": ["/Shared/Legal/Contracts/2026/Q4"],
      "name": "Q4",
      "nodeType": "FOLDER",
      "parentId": "4201",
      "updatedAt": "2026-09-21T09:12:40Z",
      "owner": {
        "userId": "u8Kd2LmQ4x",
        "name": "Dana Ortiz"
      }
    },
    {
      "nodeId": "4203",
      "paths": ["/Shared/Legal/Contracts/2026/Q3"],
      "name": "Q3",
      "nodeType": "FOLDER",
      "parentId": "4201",
      "updatedAt": "2026-09-21T09:12:40Z",
      "owner": {
        "userId": "u8Kd2LmQ4x",
        "name": "Dana Ortiz"
      }
    }
  ]
}
```

---

## Move or rename

**POST** `/move`

Moves an item into another folder, renames it, or both. Moving a folder moves everything inside it.

Because access follows folders, a move can change who sees the item. If it would, and `confirm` is not `true`, nothing moves and the response lists who would gain and lose access; repeat the call with `confirm: true` to go ahead. A folder that contains items the caller cannot see cannot be moved by that caller.

**Permission:** WRITE, Editor on the item, and Editor on the destination folder

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `paths` — "> Paths of the items to move, e.g. `["/Inbox/acme-msa.pdf"]`. Send `paths`, `nodeIds`, or both. With one item named by path and a `destinationPath` that does not exist yet (inside an existing folder), the item is moved there under that name, like `mv a b`.
- `nodeIds` — "> IDs of the items to move.
- `destinationPath` (string, required) — The folder to move into.
- `newName` (string) — New name, when moving a single item.
- `confirm` (boolean) — Proceed even if the move changes who has access. Default `false`.

### Response

- `moved` — "> The moved items at their new paths, when the move happened.
- `requiresConfirmation` (boolean) — `true` when nothing moved because access would change.
- `accessChanges` (object) — `gaining` and `losing`: the people, teams, and company-wide shares that would gain or lose access, each with their `role` and the folder it comes from.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/move?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "paths": ["/Drafts/globex-sow.docx"],
    "destinationPath": "/Shared/Legal/Contracts"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/move?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      paths: ['/Drafts/globex-sow.docx'],
      destinationPath: '/Shared/Legal/Contracts'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/move?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'paths': ['/Drafts/globex-sow.docx'],
        'destinationPath': '/Shared/Legal/Contracts'
    }
)

data = response.json()
```

```json title="Response (confirmation needed)"
{
  "requiresConfirmation": true,
  "accessChanges": {
    "gaining": [
      {
        "principal": {
          "type": "TEAM",
          "teamId": "3b1f6a2e-7c41-4d55-9a0e-58c2b7f1d903",
          "name": "Legal"
        },
        "role": "EDITOR"
      }
    ],
    "losing": []
  }
}
```

---

## Move to trash

**POST** `/trash`

Moves items to the trash. A trashed folder takes everything inside it along. Trashed items keep their shares, are hidden from listings and search, and can be restored until the trash retention period ends.

**Permission:** WRITE, and Editor on each item

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `paths` — "> Paths of the items to trash. Send `paths`, `nodeIds`, or both.
- `nodeIds` — "> IDs of the items to trash.
- `permanent` (boolean) — Delete the items for good right after trashing them; they cannot be restored. Needs the key's DELETE permission. Default `false`.

### Response

- `trashed` (integer) — How many items were trashed.
- `items` — "> The trashed items.
- `purged` (integer) — With `permanent`: rows deleted for good, including everything inside folders.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/trash?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "nodeIds": [
      "4182",
      "4190"
    ]
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/trash?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      nodeIds: ['4182', '4190']
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/trash?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'nodeIds': ['4182', '4190']
    }
)

data = response.json()
```

```json title="Response"
{
  "trashed": 2,
  "items": [
    { "nodeId": "4182", "path": "/Shared/Legal/Contracts/acme-msa.pdf", "nodeType": "FILE" },
    { "nodeId": "4190", "path": "/Shared/Legal/Contracts/Archive", "nodeType": "FOLDER" }
  ]
}
```

---

## Restore from trash

**POST** `/restore`

Restores trashed items to their original paths. If something now occupies a path, the restored item gets a numbered name. Missing parent folders are recreated.

**Permission:** WRITE, and Editor on each item

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `nodeIds` — " required> Trashed items to restore.

### Response

- `restored` — "> One entry per item: `nodeId` and `path` (the final path, which differs from the original if it was renamed).

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/restore?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "nodeIds": [
      "4190"
    ]
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/restore?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      nodeIds: ['4190']
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/restore?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'nodeIds': ['4190']
    }
)

data = response.json()
```

```json title="Response"
{
  "restored": [
    {
      "nodeId": "4190",
      "path": "/Shared/Legal/Contracts/Archive"
    }
  ]
}
```

---

## Delete permanently

**POST** `/purge`

Permanently deletes trashed items, their versions, and their shares and links. This cannot be undone. To empty the trash, call `/empty-trash` (no other arguments).

**Permission:** DELETE, and Owner on each item (or Drive manager)

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `nodeIds` — "> Trashed items to delete.

### Response

- `purged` (integer) — Items permanently deleted, including folder contents.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/purge?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "nodeIds": [
      "4182"
    ]
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/purge?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      nodeIds: ['4182']
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/purge?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'nodeIds': ['4182']
    }
)

data = response.json()
```

```json title="Response"
{
  "purgedCount": 1,
  "bytesFreed": 962033
}
```

---

## Start uploads

**POST** `/uploads/create`

Registers up to 1,000 files to upload and returns where to send each one. Paths, permissions, file size, and storage are checked up front, and storage is reserved, so a file that cannot be stored is refused before you send it. Files up to 100 MB use one `PUT` to `url`; larger files use multipart upload with [part links](#get-part-links). Then [commit](#commit-uploads) the finished uploads.

**Permission:** WRITE, and Editor on each destination folder

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `basePath` (string) — Folder that relative `files[].path` values are resolved against. Missing folders are created on commit.
- `conflict` (string) — What to do when a file already exists at a path: `FAIL` (default), `RENAME` (keep both, adding a number), or `NEW_VERSION` (replace, keeping the old content as a version).
- `files` — " required> Files to upload: `path` (absolute, or relative to `basePath`), `size` in bytes, and optionally `mimeType` and `sha256` (hex). When `sha256` is sent, the upload is rejected if the content does not match. To save new content into an existing file, add `overwriteNodeId` (the file's ID; `path` is then optional) and optionally `expectedVersion`. On commit the bytes become a new version of that file, wherever it is by then: its ID, comments, shares, links, and history are kept, and its version goes up by one. This needs Editor on the file. When `expectedVersion` is set and the file has moved on, the entry is refused with `VERSION_CONFLICT`, both here (before any bytes are sent) and again at commit.

### Response

- `uploads` — "> One entry per accepted file: `uploadId`, `path`, `method` (`SINGLE` or `MULTIPART`), and `expiresAt`. `SINGLE` entries carry `url` and `headers` to send with the `PUT`; `MULTIPART` entries carry `partSize` and `partCount`.
- `errors` — "> Files that were refused: `path`, `errorCode`, and `message`.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/uploads/create?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "basePath": "/Shared/Legal/Contracts/2026/Q4",
    "conflict": "RENAME",
    "files": [
      {
        "path": "initech-msa.pdf",
        "size": 913442,
        "mimeType": "application/pdf"
      }
    ]
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/uploads/create?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      basePath: '/Shared/Legal/Contracts/2026/Q4',
      conflict: 'RENAME',
      files: [
        {
          path: 'initech-msa.pdf',
          size: 913442,
          mimeType: 'application/pdf'
        }
      ]
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/uploads/create?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'basePath': '/Shared/Legal/Contracts/2026/Q4',
        'conflict': 'RENAME',
        'files': [
            {
                'path': 'initech-msa.pdf',
                'size': 913442,
                'mimeType': 'application/pdf'
            }
        ]
    }
)

data = response.json()
```

```json title="Response"
{
  "uploads": [
    {
      "uploadId": "5d0a7c2e-1b9f-4e3a-8f61-0c2d9b7a4e15",
      "path": "/Shared/Legal/Contracts/2026/Q4/initech-msa.pdf",
      "method": "SINGLE",
      "url": "https://uploads.autessa.com/u/5d0a7c2e...",
      "headers": {
        "Content-Type": "application/pdf"
      },
      "expiresAt": "2026-10-02T16:00:00Z"
    }
  ],
  "errors": []
}
```

---

## Get part links

**POST** `/uploads/part-urls`

For a multipart upload, returns links to `PUT` each part to. Every part except the last must be exactly `partSize` bytes. Keep the `ETag` response header from each part for [completion](#complete-a-multipart-upload).

**Permission:** WRITE

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `uploadId` (string, required) — The multipart upload.
- `partNumbers` — " required> Part numbers to get links for, starting at 1.

### Response

- `partUrls` (object) — Map of part number to upload link.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/uploads/part-urls?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "uploadId": "8e4b2f10-6a3d-4c7e-b5a9-2f1e0d8c7b64",
    "partNumbers": [
      1,
      2,
      3
    ]
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/uploads/part-urls?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      uploadId: '8e4b2f10-6a3d-4c7e-b5a9-2f1e0d8c7b64',
      partNumbers: [1, 2, 3]
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/uploads/part-urls?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'uploadId': '8e4b2f10-6a3d-4c7e-b5a9-2f1e0d8c7b64',
        'partNumbers': [1, 2, 3]
    }
)

data = response.json()
```

```json title="Response"
{
  "partUrls": {
    "1": "https://uploads.autessa.com/u/8e4b2f10.../1",
    "2": "https://uploads.autessa.com/u/8e4b2f10.../2",
    "3": "https://uploads.autessa.com/u/8e4b2f10.../3"
  }
}
```

---

## Complete a multipart upload

**POST** `/uploads/complete-multipart`

Assembles the uploaded parts of a multipart upload. Then commit it like any other upload.

**Permission:** WRITE

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `uploadId` (string, required) — The multipart upload.
- `parts` — " required> Every part: `partNumber` and the `etag` returned when it was uploaded.

### Response

- `uploadId` (string) — The upload, now ready to commit.
- `status` (string) — `UPLOADED`.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/uploads/complete-multipart?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "uploadId": "8e4b2f10-6a3d-4c7e-b5a9-2f1e0d8c7b64",
    "parts": [
      {
        "partNumber": 1,
        "etag": "\"a54357aff0632cce46d942af68356b38\""
      },
      {
        "partNumber": 2,
        "etag": "\"0c78aef83f66abc1fa1e8477f296d394\""
      },
      {
        "partNumber": 3,
        "etag": "\"acbd18db4cc2f85cedef654fccc4a4d8\""
      }
    ]
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/uploads/complete-multipart?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      uploadId: '8e4b2f10-6a3d-4c7e-b5a9-2f1e0d8c7b64',
      parts: [
        {
          partNumber: 1,
          etag: '"a54357aff0632cce46d942af68356b38"'
        },
        {
          partNumber: 2,
          etag: '"0c78aef83f66abc1fa1e8477f296d394"'
        },
        {
          partNumber: 3,
          etag: '"acbd18db4cc2f85cedef654fccc4a4d8"'
        }
      ]
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/uploads/complete-multipart?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'uploadId': '8e4b2f10-6a3d-4c7e-b5a9-2f1e0d8c7b64',
        'parts': [
            {
                'partNumber': 1,
                'etag': '"a54357aff0632cce46d942af68356b38"'
            },
            {
                'partNumber': 2,
                'etag': '"0c78aef83f66abc1fa1e8477f296d394"'
            },
            {
                'partNumber': 3,
                'etag': '"acbd18db4cc2f85cedef654fccc4a4d8"'
            }
        ]
    }
)

data = response.json()
```

```json title="Response"
{
  "uploadId": "8e4b2f10-6a3d-4c7e-b5a9-2f1e0d8c7b64",
  "status": "UPLOADED"
}
```

---

## Commit uploads

**POST** `/uploads/commit`

Turns finished uploads into Drive files, creating missing folders and applying the conflict rule chosen at start. Up to 100 uploads per call; each succeeds or fails on its own. Committed files appear immediately and become searchable once processing finishes. Insert or update triggers on the Drive fire for each file.

**Permission:** WRITE

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `uploadIds` — " required> Uploads to commit, up to 100.

### Response

- `results` — "> One entry per upload: `uploadId`, `status` (`COMMITTED` or `FAILED`), `node` when committed (an [item](#the-item-object) with its new `version`, `sizeBytes`, and `contentUpdatedAt`), and `errorCode`/`message` when not. An overwrite whose file moved past `expectedVersion` fails with `VERSION_CONFLICT`.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/uploads/commit?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "uploadIds": [
      "5d0a7c2e-1b9f-4e3a-8f61-0c2d9b7a4e15"
    ]
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/uploads/commit?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      uploadIds: ['5d0a7c2e-1b9f-4e3a-8f61-0c2d9b7a4e15']
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/uploads/commit?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'uploadIds': ['5d0a7c2e-1b9f-4e3a-8f61-0c2d9b7a4e15']
    }
)

data = response.json()
```

```json title="Response"
{
  "results": [
    {
      "uploadId": "5d0a7c2e-1b9f-4e3a-8f61-0c2d9b7a4e15",
      "status": "COMMITTED",
      "node": {
        "nodeId": "4210",
        "path": "/Shared/Legal/Contracts/2026/Q4/initech-msa.pdf",
        "name": "initech-msa.pdf",
        "nodeType": "FILE",
        "parentId": "4202",
        "sizeBytes": 913442,
        "mimeType": "application/pdf",
        "version": 1,
        "contentUpdatedAt": "2026-09-28T17:04:11Z",
        "updatedAt": "2026-09-28T17:04:11Z",
        "owner": {
          "userId": "u8Kd2LmQ4x",
          "name": "Dana Ortiz"
        },
        "extractionStatus": "PENDING"
      }
    }
  ]
}
```

---

## Cancel uploads

**POST** `/uploads/abort`

Cancels uploads that have not been committed and releases their reserved storage. Uploads that are never committed expire on their own.

**Permission:** WRITE

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `uploadIds` — " required> Uploads to cancel.

### Response

- `aborted` — "> The uploads that were cancelled.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/uploads/abort?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "uploadIds": [
      "8e4b2f10-6a3d-4c7e-b5a9-2f1e0d8c7b64"
    ]
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/uploads/abort?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      uploadIds: ['8e4b2f10-6a3d-4c7e-b5a9-2f1e0d8c7b64']
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/uploads/abort?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'uploadIds': ['8e4b2f10-6a3d-4c7e-b5a9-2f1e0d8c7b64']
    }
)

data = response.json()
```

```json title="Response"
{
  "aborted": [
    "8e4b2f10-6a3d-4c7e-b5a9-2f1e0d8c7b64"
  ]
}
```

---

## List versions

**POST** `/versions/list`

Lists a file's versions, newest first. The current content is the highest version.

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `path` (string) — Absolute path of the item, e.g. `/Contracts/acme-msa.pdf`. Send `path` or `nodeId`.
- `nodeId` (string) — The item's ID. Takes precedence over `path` when both are sent.

### Response

- `versions` — "> `version`, `sizeBytes`, `sha256`, `createdAt`, `createdBy`, and `current` (`true` for the current content).

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/versions/list?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "nodeId": "4182"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/versions/list?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      nodeId: '4182'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/versions/list?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'nodeId': '4182'
    }
)

data = response.json()
```

```json title="Response"
{
  "versions": [
    {
      "version": 2,
      "sizeBytes": 482113,
      "sha256": "9b74c9897bac770ffc029102a200c5de...",
      "createdAt": "2026-09-28T17:04:11Z",
      "createdBy": {
        "userId": "u8Kd2LmQ4x",
        "name": "Dana Ortiz"
      },
      "current": true
    },
    {
      "version": 1,
      "sizeBytes": 479920,
      "sha256": "3f786850e387550fdab836ed7e6dc881...",
      "createdAt": "2026-09-02T11:30:05Z",
      "createdBy": {
        "userId": "u8Kd2LmQ4x",
        "name": "Dana Ortiz"
      },
      "current": false
    }
  ]
}
```

---

## Restore a version

**POST** `/versions/restore`

Makes a previous version current again. The restore itself creates a new version, so nothing is lost.

**Permission:** WRITE, and Editor on the file

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `nodeId` (string, required) — The file's ID.
- `version` (integer, required) — The version to restore.

### Response

- `node` (object) — The file with its new `version`.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/versions/restore?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "nodeId": "4182",
    "version": 1
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/versions/restore?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      nodeId: '4182',
      version: 1
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/versions/restore?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'nodeId': '4182',
        'version': 1
    }
)

data = response.json()
```

```json title="Response"
{
  "node": {
    "nodeId": "4182",
    "name": "acme-msa.pdf",
    "nodeType": "FILE",
    "parentId": "4170",
    "sizeBytes": 479920,
    "mimeType": "application/pdf",
    "version": 3,
    "contentUpdatedAt": "2026-09-28T17:04:11Z",
    "updatedAt": "2026-09-28T17:04:11Z",
    "owner": {
      "userId": "u8Kd2LmQ4x",
      "name": "Dana Ortiz"
    },
    "extractionStatus": "EXTRACTED"
  }
}
```

---

## Replace a file with another

**POST** `/fs/replace`

Makes one file's content a new version of another, then deletes the first file permanently (it does not go to trash). This is the "safe save" that Word, Excel, and many other editors do on a computer: write a temporary file, then swap it in for the original. The target keeps its ID, comments, shares, links, and version history, and its previous content stays available as a version.

**Permission:** WRITE and DELETE, and Editor on both files

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `sourceNodeId` (string, required) — The file whose content to keep. It is deleted permanently.
- `targetNodeId` (string, required) — The file that gets the content as a new version. Must be a different file.
- `expectedTargetVersion` (integer) — Fail with `VERSION_CONFLICT` unless the target is still at this version.

### Response

- `node` (object) — The target [item](#the-item-object) as it is now, with its new `version`.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/fs/replace?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "sourceNodeId": "4233",
    "targetNodeId": "4210",
    "expectedTargetVersion": 3
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/fs/replace?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      sourceNodeId: '4233',
      targetNodeId: '4210',
      expectedTargetVersion: 3
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/fs/replace?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'sourceNodeId': '4233',
        'targetNodeId': '4210',
        'expectedTargetVersion': 3
    }
)

data = response.json()
```

```json title="Response"
{
  "node": {
    "nodeId": "4210",
    "path": "/Shared/Legal/Contracts/2026/Q4/initech-msa.docx",
    "name": "initech-msa.docx",
    "nodeType": "FILE",
    "parentId": "4202",
    "sizeBytes": 48211,
    "mimeType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
    "version": 4,
    "contentUpdatedAt": "2026-10-27T15:02:44Z",
    "updatedAt": "2026-10-27T15:02:44Z",
    "owner": {
      "userId": "u8Kd2LmQ4x",
      "name": "Dana Ortiz"
    },
    "extractionStatus": "PENDING"
  }
}
```

---

## Who has access

**POST** `/shares/list`

Lists everyone who can reach an item: its owner, Drive managers, direct shares, shares inherited from parent folders (deepest folder first, with the folder they come from), and active links. Drive members are listed separately in `members`, because membership doesn't give access to an item. Send `path: "/"` to list the Drive's members.

**Permission:** READ, and the ability to see the item

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `path` (string) — Absolute path of the item, e.g. `/Contracts/acme-msa.pdf`. Send `path` or `nodeId`.
- `nodeId` (string) — The item's ID. Takes precedence over `path` when both are sent.

### Response

- `owner` (object) — The item's owner: `userId` and `name`.
- `managers` — "> Drive managers, who can see and manage everything.
- `shares` — "> One entry per person, team, or company-wide share that gives access to this item: `principal` (`type` of `USER`, `TEAM`, or `COMPANY`, with `userId` or `teamId` and `name`), `role`, `direct` (`true` if shared on this item), `inheritedFrom` (`nodeId` and `path` of the folder it comes from; `null` when direct), `expiresAt`, and `alsoVia` (other folders that grant the same principal a weaker or equal role). With `path: "/"`, the Drive's members.
- `links` — "> Active links on this item or a parent folder. Same shape as [List links](#list-links).
- `members` — "> The Drive's members, in the same shape as `shares`, with each member's Drive role. Members see the Drive in their list but only the items shared with them. Returned to members and Drive managers; absent for callers who only have items shared with them.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/shares/list?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "nodeId": "4182"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/shares/list?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      nodeId: '4182'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/shares/list?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'nodeId': '4182'
    }
)

data = response.json()
```

```json title="Response"
{
  "owner": {
    "userId": "u8Kd2LmQ4x",
    "name": "Dana Ortiz"
  },
  "managers": [
    {
      "userId": "k3Jd8sLq2W",
      "name": "Priya Natarajan"
    }
  ],
  "shares": [
    {
      "principal": {
        "type": "USER",
        "userId": "pQ7wR2tY9z",
        "name": "Sam Lee"
      },
      "role": "EDITOR",
      "direct": true,
      "inheritedFrom": null,
      "expiresAt": null,
      "alsoVia": []
    },
    {
      "principal": {
        "type": "TEAM",
        "teamId": "3b1f6a2e-7c41-4d55-9a0e-58c2b7f1d903",
        "name": "Legal"
      },
      "role": "VIEWER",
      "direct": false,
      "inheritedFrom": {
        "nodeId": "4101",
        "path": "/Shared/Legal"
      },
      "expiresAt": null,
      "alsoVia": []
    },
    {
      "principal": {
        "type": "COMPANY",
        "name": "Anyone at Acme Corp"
      },
      "role": "VIEWER",
      "direct": false,
      "inheritedFrom": {
        "nodeId": "4175",
        "path": "/Shared/Legal/Policies"
      },
      "expiresAt": null,
      "alsoVia": []
    }
  ],
  "links": [],
  "members": [
    {
      "principal": {
        "type": "TEAM",
        "teamId": "3b1f6a2e-7c41-4d55-9a0e-58c2b7f1d903",
        "name": "Legal"
      },
      "role": "VIEWER",
      "direct": true,
      "inheritedFrom": null,
      "expiresAt": null,
      "alsoVia": []
    }
  ]
}
```

---

## Share an item

**POST** `/shares/upsert`

Shares a folder or a file with people, teams, or everyone at your company, adds members to the Drive, or changes the role of an existing share. Sharing a folder shares everything inside it, including items added later. Sharing the Drive itself (`path: "/"`, or `scope: "drive"`) adds **members**: the Drive appears in their list of Drives and an `EDITOR` member can add items at the top level, but members see no folder or file until it is shared with them. To share a folder or file with every current member, send `"principals": "members"`; each member gets their own share on the item. You can grant up to your own role.

**Permission:** WRITE, and Owner on the item, Drive manager, or Editor when Editors can share is on

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `path` (string) — Absolute path of the item, e.g. `/Contracts/acme-msa.pdf`. Send `path` or `nodeId`.
- `nodeId` (string) — The item's ID. Takes precedence over `path` when both are sent.
- `scope` (string) — `drive` to add members to the Drive. Same as sending `path: "/"`.
- `principals` — | string" required> Who to share with. Each entry is `{"type": "USER", "userId": ...}`, `{"type": "TEAM", "teamId": ...}`, or `{"type": "COMPANY"}`. Users and teams must belong to your company. Send the string `"members"` (or an entry `{"type": "MEMBERS"}`) to share a folder or file with every current member of the Drive; not allowed with `path: "/"`.
- `role` (string, required) — `VIEWER` or `EDITOR`.
- `expiresAt` (string) — ISO-8601 UTC time when the share ends.

### Response

- `shares` — "> The resulting shares, same shape as [Who has access](#who-has-access).

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/shares/upsert?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "path": "/Shared/Legal/Contracts",
    "principals": [
      {
        "type": "TEAM",
        "teamId": "3b1f6a2e-7c41-4d55-9a0e-58c2b7f1d903"
      },
      {
        "type": "USER",
        "userId": "pQ7wR2tY9z"
      }
    ],
    "role": "EDITOR"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/shares/upsert?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      path: '/Shared/Legal/Contracts',
      principals: [
        {
          type: 'TEAM',
          teamId: '3b1f6a2e-7c41-4d55-9a0e-58c2b7f1d903'
        },
        {
          type: 'USER',
          userId: 'pQ7wR2tY9z'
        }
      ],
      role: 'EDITOR'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/shares/upsert?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'path': '/Shared/Legal/Contracts',
        'principals': [
            {
                'type': 'TEAM',
                'teamId': '3b1f6a2e-7c41-4d55-9a0e-58c2b7f1d903'
            },
            {
                'type': 'USER',
                'userId': 'pQ7wR2tY9z'
            }
        ],
        'role': 'EDITOR'
    }
)

data = response.json()
```

```json title="Response"
{
  "shares": [
    {
      "principal": {
        "type": "TEAM",
        "teamId": "3b1f6a2e-7c41-4d55-9a0e-58c2b7f1d903",
        "name": "Legal"
      },
      "role": "EDITOR",
      "direct": true,
      "inheritedFrom": null,
      "expiresAt": null,
      "alsoVia": []
    },
    {
      "principal": {
        "type": "USER",
        "userId": "pQ7wR2tY9z",
        "name": "Sam Lee"
      },
      "role": "EDITOR",
      "direct": true,
      "inheritedFrom": null,
      "expiresAt": null,
      "alsoVia": []
    }
  ]
}
```

---

## Stop sharing

**POST** `/shares/remove`

Removes one direct share, by its `grantId` (from [Who has access](#who-has-access)). Access ends immediately. To remove inherited access, remove the share on the folder it comes from.

**Permission:** WRITE, and the same rights as sharing

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `grantId` (string, required) — The share to remove: a `grantId` from [Who has access](#who-has-access).

### Response

- `ok` (boolean) — `true` when the share was removed.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/shares/remove?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "grantId": "6f1c2b9e-4d7a-4f0e-9b2a-1c3d5e7f9a0b"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/shares/remove?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      grantId: '6f1c2b9e-4d7a-4f0e-9b2a-1c3d5e7f9a0b'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/shares/remove?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'grantId': '6f1c2b9e-4d7a-4f0e-9b2a-1c3d5e7f9a0b'
    }
)

data = response.json()
```

```json title="Response"
{
  "ok": true
}
```

---

## Shared with me

**POST** `/shared-with-me`

Lists items other people have shared with the caller, directly, through one of their teams, or with everyone at the company. Only the shared item itself is listed, not its contents; browse into a shared folder with [List a folder](#list-a-folder). When the caller is a member of the Drive, the Drive is listed as one entry whose `node` is the Drive itself (`path` `/`, named after the Drive) and whose `role` is the caller's Drive role. Membership shows only the Drive, not its contents.

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `limit` (integer) — Maximum entries to return. Default 200, maximum 1000.
- `cursor` (string) — The `nextCursor` from the previous page. Send the same other arguments as the first call.

### Response

- `items` — "> One entry per shared item: `node` (see [The item object](#the-item-object)), `role` (your role), `grantedBy` and `createdAt`.
- `nextCursor` (string) — Cursor for the next page; absent on the last page.
- `hasMore` (boolean) — `true` when another page exists.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/shared-with-me?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/shared-with-me?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/shared-with-me?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5'
    }
)

data = response.json()
```

```json title="Response"
{
  "items": [
    {
      "node": {
        "nodeId": "4101",
        "path": "/Shared/Legal",
        "name": "Legal",
        "nodeType": "FOLDER",
        "parentId": "4001",
        "updatedAt": "2026-09-21T09:12:40Z",
        "owner": {
          "userId": "u8Kd2LmQ4x",
          "name": "Dana Ortiz"
        }
      },
      "role": "VIEWER",
      "sharedBy": {
        "userId": "k3Jd8sLq2W",
        "name": "Priya Natarajan"
      },
      "sharedAt": "2026-08-14T10:02:00Z",
      "via": {
        "type": "TEAM",
        "name": "Legal"
      }
    }
  ],
  "nextCursor": null,
  "truncated": false
}
```

---

## Check access

**POST** `/access`

Returns the caller's effective role on an item and their Drive membership. To see every share on an item, use [Who has access](#who-has-access).

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `path` (string) — Absolute path of the item, e.g. `/Contracts/acme-msa.pdf`. Send `path` or `nodeId`.
- `nodeId` (string) — The item's ID. Takes precedence over `path` when both are sent.

### Response

- `effectiveRole` (string) — `OWNER`, `EDITOR`, `VIEWER`, or `NONE`.
- `driveRole` (string) — The caller's Drive membership: `OWNER` (owner or Drive admin), `EDITOR` or `VIEWER` (a member), or `NONE`. Membership alone gives no access to files and folders.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/access?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "nodeId": "4182"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/access?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      nodeId: '4182'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/access?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'nodeId': '4182'
    }
)

data = response.json()
```

```json title="Response"
{
  "effectiveRole": "EDITOR",
  "driveRole": "VIEWER"
}
```

---

## Transfer ownership

**POST** `/transfer-owner`

Makes another person in your company the owner of an item. The previous owner keeps Editor access.

**Permission:** WRITE, and Owner on the item or Drive manager

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `nodeId` (string, required) — The item's ID.
- `newOwnerUserId` (string, required) — The new owner: a member of your company.

### Response

- `node` (object) — The item with its new owner.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/transfer-owner?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "nodeId": "4182",
    "newOwnerUserId": "pQ7wR2tY9z"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/transfer-owner?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      nodeId: '4182',
      newOwnerUserId: 'pQ7wR2tY9z'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/transfer-owner?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'nodeId': '4182',
        'newOwnerUserId': 'pQ7wR2tY9z'
    }
)

data = response.json()
```

```json title="Response"
{
  "node": {
    "nodeId": "4182",
    "name": "acme-msa.pdf",
    "nodeType": "FILE",
    "parentId": "4170",
    "sizeBytes": 482113,
    "mimeType": "application/pdf",
    "version": 2,
    "contentUpdatedAt": "2026-09-28T17:04:11Z",
    "updatedAt": "2026-09-28T17:04:11Z",
    "owner": {
      "newOwnerUserId": "pQ7wR2tY9z",
      "name": "Sam Lee"
    },
    "extractionStatus": "EXTRACTED"
  }
}
```

---

## Create a link

**POST** `/links/create`

Creates a link to a file, a folder, or the whole Drive (`path: "/"`). A folder or Drive link opens a read-only view of everything inside it. Links keep working when the item is moved or renamed and stop working when it is trashed.

The link `url` is returned only by this call. Autessa does not store it in readable form, so save it if you need it again; otherwise revoke the link and create a new one.

**Permission:** WRITE, and the same rights as sharing

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `path` (string) — Absolute path of the item, e.g. `/Contracts/acme-msa.pdf`. Send `path` or `nodeId`.
- `nodeId` (string) — The item's ID. Takes precedence over `path` when both are sent.
- `scope` (string) — `drive` to link the whole Drive. Same as sending `path: "/"`.
- `audience` (string) — `COMPANY` (default): only signed-in people at your company. `ANYONE`: anyone with the link, no sign-in.
- `role` (string) — `VIEWER` (default).
- `allowDownload` (boolean) — Let link visitors download files. Default `false` (preview only).
- `allowSearch` (boolean) — Let link visitors search inside the shared folder. Default `true`.
- `expiresAt` (string) — ISO-8601 UTC time when the link stops working.

### Response

- `url` (string) — The link. Shown only once.
- `link` (object) — The link's settings, same shape as [List links](#list-links).

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/links/create?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "path": "/Shared/Legal/Contracts",
    "audience": "ANYONE",
    "allowDownload": false,
    "expiresAt": "2026-12-31T23:59:59Z"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/links/create?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      path: '/Shared/Legal/Contracts',
      audience: 'ANYONE',
      allowDownload: false,
      expiresAt: '2026-12-31T23:59:59Z'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/links/create?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'path': '/Shared/Legal/Contracts',
        'audience': 'ANYONE',
        'allowDownload': False,
        'expiresAt': '2026-12-31T23:59:59Z'
    }
)

data = response.json()
```

```json title="Response"
{
  "url": "https://app.autessa.com/public/drive/Xk9vQ2...",
  "link": {
    "linkId": "c6e2d9a4-0f3b-4a71-9e58-7d1b2c4f6a80",
    "target": {
      "nodeId": "4170",
      "path": "/Shared/Legal/Contracts"
    },
    "role": "VIEWER",
    "audience": "ANYONE",
    "allowDownload": false,
    "allowSearch": true,
    "expiresAt": "2026-12-31T23:59:59Z",
    "createdBy": {
      "userId": "u8Kd2LmQ4x",
      "name": "Dana Ortiz"
    },
    "createdAt": "2026-10-02T14:58:00Z",
    "accessCount": 0,
    "lastAccessedAt": null
  }
}
```

---

## List links

**POST** `/links/list`

Lists active links, for one item or for everything the caller can manage. Link URLs are not included.

**Permission:** READ

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `path` (string) — Only links on this item.
- `nodeId` (string) — Only links on this item.

### Response

- `links` — "> Each link: `linkId`, `target` (`nodeId` and `path`), `role`, `audience`, `allowDownload`, `allowSearch`, `expiresAt`, `createdBy`, `createdAt`, `accessCount`, and `lastAccessedAt`.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/links/list?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "path": "/Shared/Legal/Contracts"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/links/list?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      path: '/Shared/Legal/Contracts'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/links/list?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'path': '/Shared/Legal/Contracts'
    }
)

data = response.json()
```

```json title="Response"
{
  "links": [
    {
      "linkId": "c6e2d9a4-0f3b-4a71-9e58-7d1b2c4f6a80",
      "target": {
        "nodeId": "4170",
        "path": "/Shared/Legal/Contracts"
      },
      "role": "VIEWER",
      "audience": "ANYONE",
      "allowDownload": false,
      "allowSearch": true,
      "expiresAt": "2026-12-31T23:59:59Z",
      "createdBy": {
        "userId": "u8Kd2LmQ4x",
        "name": "Dana Ortiz"
      },
      "createdAt": "2026-10-02T14:58:00Z",
      "accessCount": 14,
      "lastAccessedAt": "2026-10-02T13:20:44Z"
    }
  ]
}
```

---

## Revoke a link

**POST** `/links/revoke`

Revokes a link. It stops working immediately, including for anyone who already has it open.

**Permission:** WRITE, and the same rights as sharing

### Request parameters

- `tableId` (string, required) — The Drive's ID. Must match the `resourceId` query parameter.
- `linkId` (string, required) — The link to revoke.

### Response

- `revoked` (boolean) — `true` when the link was revoked.

**cURL:**

```bash
curl -X POST 'https://api.autessa.com/clients/autessadb-drive/links/revoke?resourceId=V1StGXR8Z5' \
  -H "Authorization: $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "tableId": "V1StGXR8Z5",
    "linkId": "c6e2d9a4-0f3b-4a71-9e58-7d1b2c4f6a80"
  }'
```

**JavaScript:**

```javascript
const response = await fetch(
  'https://api.autessa.com/clients/autessadb-drive/links/revoke?resourceId=V1StGXR8Z5',
  {
    method: 'POST',
    headers: {
      'Authorization': process.env.API_KEY,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      tableId: 'V1StGXR8Z5',
      linkId: 'c6e2d9a4-0f3b-4a71-9e58-7d1b2c4f6a80'
    })
  }
);

const data = await response.json();
```

**Python:**

```python
import os
import requests

response = requests.post(
    'https://api.autessa.com/clients/autessadb-drive/links/revoke?resourceId=V1StGXR8Z5',
    headers={'Authorization': os.environ['API_KEY']},
    json={
        'tableId': 'V1StGXR8Z5',
        'linkId': 'c6e2d9a4-0f3b-4a71-9e58-7d1b2c4f6a80'
    }
)

data = response.json()
```

```json title="Response"
{
  "revoked": true
}
```

---

## Comments

Comments live under `/comments/*` and need the **Commenter** role or higher on the item (owners and Drive managers always qualify). All calls take `tableId` and identify the item by `nodeId` or `path`.

- `POST /comments/list` with `includeResolved` and `cursor`: threads with their replies, each with the author's display name, time, body, `anchor`, and `resolved`.
- `POST /comments/add` with `body`, optional `anchor`, and optional `parentId` to reply.
- `POST /comments/edit` with `commentId` and `body` (authors only).
- `POST /comments/resolve` with `commentId` and `resolved` (Editors, owners, and managers).
- `POST /comments/delete` with `commentId` (authors; Drive managers for any comment).

An `anchor` is one of `{ "kind": "page", "page": 3, "quote": "..." }`, `{ "kind": "text", "from": 120, "to": 164, "quote": "..." }` (offsets into the file's extracted text), `{ "kind": "cell", "sheet": "Q1", "range": "B2:D9" }`, `{ "kind": "slide", "slide": 2 }`, or omitted for the whole file. Anchors carry the version they were made on; a text anchor whose quote no longer matches a newer version is returned with `stale: true`. `stat` includes `commentCount` and `openCommentCount`.

Live co-editing uses a WebSocket at `/ws/autessadb/drive/collab` with the same session parameters as other sockets; only Editors and above may send changes.

## Drive on your computer

The Autessa app and the network drive use the same Drive calls as everything else: [`changes`](#get-changes) to follow what changed, [`uploads`](#start-uploads) with `overwriteNodeId` to save a new version, and [`fs/replace`](#replace-a-file-with-another) for an editor's safe save. See [Use Drive on your computer](/docs/guide/autessadb/drive-on-your-computer.md).

The calls below belong to a signed-in person rather than to an API key: the Autessa app and the web app make them for you, and an API key cannot call them. They are listed here so you know what they return.

### Top-level folders

**POST** `/autessadb/drive/desktop/roots`

The top-level folders a person sees on their computer, in order, and the company's settings for Drive on computers. Takes an empty body `{}`.

- `roots` — "> One entry per top-level folder: `rootKey` (stable and URL-safe), `displayName` (unique, and valid as a folder name on Windows and macOS), `tableId` (the Drive's ID), `path` (`/` for a whole Drive, empty for Shared with me), `writable` (whether the person can add items at its top), and `kind` (`SHARED_WITH_ME` or `DRIVE`).
- `policy` (object) — The company's settings: `mountEnabled` (connecting Drive as a network drive is allowed) and `desktopSyncEnabled` (Drive in the Autessa app is allowed). Both are `true` unless an admin turned them off.

When a company admin turns off **Allow Drive in the Autessa desktop app**, this call and `changes` answer `403 FORBIDDEN` to the Autessa app.

### App passwords

App passwords are what a network drive signs in with: the person's email as the user name and the app password as the password. Each belongs to the person and to the company they were in when they created it, and works only for connecting Drive.

**POST** `/user/app-passwords/create`

Creates an app password. Send an optional `label` (up to 100 characters; defaults to "Network drive"). Returns `id`, `label`, `username` (the person's email), `password`, and `createdAt`. The password is returned only this once. A person can have up to 20 at a time, and none can be created while the company has turned off connecting Drive as a network drive.

**POST** `/user/app-passwords/list`

Lists the person's app passwords in the current company, newest first, as `items`: `id`, `label`, `createdAt`, `lastUsedAt`, and `lastUsedIp`. Passwords themselves are never returned.

**POST** `/user/app-passwords/revoke`

Removes an app password by `id` and returns `revoked: true`. Any computer using it is disconnected right away.

## Errors

Failed calls return an error code, a plain-language message and a hint with the next step. Some errors add `details`:

```json title="Error response"
{
  "errorCode": "VERSION_CONFLICT",
  "errors": ["/Shared/notes/plan.md is now at version 5"],
  "hint": "Read the file again, then retry with expectedVersion=5.",
  "error": {
    "code": "VERSION_CONFLICT",
    "message": "/Shared/notes/plan.md is now at version 5",
    "hint": "Read the file again, then retry with expectedVersion=5.",
    "details": { "path": "/Shared/notes/plan.md", "currentVersion": 5 }
  }
}
```

| Status | Error code | When |
| --- | --- | --- |
| `400` | `INVALID_PATH` | The path is malformed, contains `.` or `..`, or exceeds the length or depth limits. |
| `400` | `INVALID_PATTERN` | A glob or regular expression is invalid, too broad (fewer than 3 literal characters over a large scope), or longer than 1,000 characters. |
| `400` | `INVALID_CURSOR` | The cursor is malformed, expired, or was sent with different arguments than the call that produced it. |
| `400` | `INVALID_MOVE` | A folder was moved into itself or one of its own subfolders. |
| `400` | `NAME_INVALID` | A name created from a computer (the Autessa app or a network drive) contains one of `\ : * ? " < > \|` or ends with a dot or a space. |
| `401` | — | Missing or invalid API key. |
| `403` | `FORBIDDEN` | The key lacks the table permission for the operation, the body's `tableId` does not match `resourceId`, the caller's role on the item is too low, or a folder contains items the caller cannot see. |
| `404` | `NOT_FOUND` | The item does not exist or the caller cannot open it. |
| `409` | `NAME_CONFLICT` | The name is already taken in the folder and the conflict rule is `FAIL`, or a `write` with `mode: create` found the file. |
| `409` | `VERSION_CONFLICT` | A `write`, `edit`, or overwrite upload named an `expectedVersion` (or `fs/replace` an `expectedTargetVersion`) the file is no longer at. `error.details.currentVersion` holds the current version. |
| `409` | `EDIT_NO_MATCH` | An `edit`'s `oldText` does not occur in the file. |
| `409` | `EDIT_AMBIGUOUS` | An `edit`'s `oldText` occurs more than once and `replaceAll` is not set. `error.details.matches` holds the count. |
| `413` | `FILE_TOO_LARGE` | A `write` or `edit` would make the file larger than 5 MB. Upload large files instead. |
| `413` | `QUOTA_EXCEEDED` | The upload would exceed your storage allowance, the per-file size limit, or the file-count limit. |
| `413` | `TOO_MANY_ITEMS` | A move or trash would touch more than 100,000 items at once. |
| `415` | `UNSUPPORTED_TYPE` | The file type is not allowed in a Drive. |
| `429` | `RATE_LIMITED` | Too many search, grep, or read calls; retry after a short wait. Semantic search also counts toward your company's search limits. |

## Related

- [AutessaDB Drive guide](/docs/guide/autessadb/drive.md)
- [Use Drive on your computer](/docs/guide/autessadb/drive-on-your-computer.md)
- [AutessaDB API](/docs/api/autessadb.md) — row operations for regular tables
- [AutessaDB - Columnar API](/docs/api/autessadb-analytics.md)
- [Drive tool type](/docs/tools/autessadb.md#drive)
- [Drive commands in the CLI](/docs/cli/autessadb.md#how-to-work-with-a-drive)
- [`autessa.autessadb` SDK](/docs/autessascript/sdk/autessadb.md)

