Skip to Content
dropshelf
REST API

Import documents into a collection

Owner, editor or admin. Merges JSON Lines, one document per line as exportCollection writes them, in one transaction: equal data is unchanged, a line whose rev no longer matches is a conflict unless force, a document deleted since is created again. New documents keep their author for the owner and admins and are the importer's for an editor. Nothing is written on any error, conflict or full quota; a file naming more documents than the drop can hold answers 507 before its lines are checked; otherwise a file with invalid lines answers 422 and one with conflicts 409 even when it is also over a limit, which quota then names. dryRun writes nothing and answers the same status. Every import that is not a dry run is an audit event.

POST
/api/v1/drops/{slug}/db/{collection}/import

Owner, editor or admin. Merges JSON Lines, one document per line as exportCollection writes them, in one transaction: equal data is unchanged, a line whose rev no longer matches is a conflict unless force, a document deleted since is created again. New documents keep their author for the owner and admins and are the importer's for an editor. Nothing is written on any error, conflict or full quota; a file naming more documents than the drop can hold answers 507 before its lines are checked; otherwise a file with invalid lines answers 422 and one with conflicts 409 even when it is also over a limit, which quota then names. dryRun writes nothing and answers the same status. Every import that is not a dry run is an audit event.

Authorization

headerAuthorizationBearer <token>

A personal access token, odp_ followed by 43 characters. Create one in the dashboard.

Path Parameters

slug*string

The drop.

collection*string

The collection.

Query Parameters

force?boolean

Optional. true overwrites documents that changed since they were read.

dryRun?boolean

Optional. true answers the report and writes nothing.

Request Body

JSON Lines, one document per line, as exportCollection writes them. Blank lines are skipped.

body*stringapplication/x-ndjson

Response Body

Applied, or a dry run that found nothing wrong.

application/json
  1. response
after*
applied*boolean

Whether this import committed.

authoredByYou*integer

New documents whose line named another author and which the importer, an editor, now authors.

conflicts*array<>

At most 100; conflictsTotal counts all.

conflictsTotal*integer
created*integer
dryRun*boolean
errors*array<>

At most 100, in line order; errorsTotal counts all.

errorsTotal*integer
limits*
quota?string

Which drop limit the file is over: docs, bytes or collections. Set on a 507, and on a 422 or 409 whose file is also over a limit.

recreated*integer

Documents a line carried a rev for that no longer existed.

replaced*integer
unchanged*integer
Example Request
curl -X POST 'https://drop.example.com/api/v1/drops/string/db/string/import' \  -H 'Content-Type: application/x-ndjson' \  -d 'string'
Example Response
{  "after": {    "bytes": 0,    "collections": 0,    "docs": 0  },  "applied": true,  "authoredByYou": 0,  "conflicts": [    {      "id": "string",      "read": 0,      "stored": 0    }  ],  "conflictsTotal": 0,  "created": 0,  "dryRun": true,  "errors": [    {      "line": 0,      "reason": "string"    }  ],  "errorsTotal": 0,  "limits": {    "bytes": 0,    "collections": 0,    "docs": 0  },  "quota": "string",  "recreated": 0,  "replaced": 0,  "unchanged": 0}

Generated from dropshelf core at 6a548b2, 26 Nov 2026.