Skip to main content
Create a repository document
curl --request POST \
  --url https://app.simpledocs.com/api/v1/repository_documents \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form file='@example-file' \
  --form 'url=<string>' \
  --form 'metadata={"department":"Legal","category":"Vendor"}'
{
  "success": true,
  "message": "Document created successfully",
  "data": {
    "id": "0dbhXg",
    "name": "Employment Agreement.pdf",
    "created_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Obtain a Bearer token via the Create access token endpoint using the OAuth2 client credentials flow.

Body

multipart/form-data
file
file

The document file to upload. Required if url is not provided.

url
string<uri>

A public HTTP/HTTPS URL to fetch the document from. Required if file is not provided. Internal/private addresses are blocked.

metadata
string

A JSON string with arbitrary metadata to attach to the document.

Example:

"{\"department\":\"Legal\",\"category\":\"Vendor\"}"

Response

Document created successfully.

success
boolean
Example:

true

message
string
Example:

"Document created successfully"

data
object