POST
/
api
/
document
/
create
curl --request POST \
  --url https://cite.petal.org/api/document/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form organization_id=123 \
  --form 'doctype=<string>'
{
  "annotation_ids": [
    123
  ],
  "created_at": "<string>",
  "csl": {},
  "doctype": "<string>",
  "file_resource_size": 123,
  "file_size": 123,
  "filename": "<string>",
  "id": 123,
  "is_trash": true,
  "meta": {},
  "modified_at": "<string>",
  "modified_by": 123,
  "organization_id": 123,
  "pages": 123,
  "resource_size": 123,
  "status": {},
  "tag_ids": [
    123
  ],
  "ui": {},
  "use_ocr": true,
  "user": {
    "id": 123,
    "name": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

multipart/form-data
organization_id
integer

Unique ID of Organization

doctype
string

Type of file, such as pdf, txt, etc.

file
file

Binary representation of the file

Response

200
application/json
OK
annotation_ids
integer[]
required

Unique IDs of Annotations made on this Document

created_at
string
required

Creation time, by UTC

csl
object
required

Citation information

doctype
string
required

Extension of the Document (txt, pdf, etc.)

file_resource_size
integer
required

Size of extracted information

file_size
integer
required

Size of original file

id
integer
required

Unique ID of the Document

is_trash
boolean
required

Is the Document in Workspace trash

meta
object
required

Metadata, for internal use

modified_at
string
required

Modification time, by UTC

modified_by
integer
required

User ID of last modifier. May be -1 (system)

organization_id
integer
required

ID of Workspace this Document belongs to

pages
integer
required

Number of pages in Document

resource_size
integer
required

Miscellaneous space used by Document

status
object
required

Document processing status. 0 = not started, 1 = in progress, 2 = completed, and 3 = error

tag_ids
integer[]
required

IDs of Tags added to this Document

ui
object
required

For use by Petal frontend, for UI settings

use_ocr
boolean
required

Whether or not to use OCR on this Document. Leave as False except for images

user
object
required
filename
string

Name of original file