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"}'import requests
url = "https://app.simpledocs.com/api/v1/repository_documents"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"url": "<string>",
"metadata": "{\"department\":\"Legal\",\"category\":\"Vendor\"}"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('url', '<string>');
form.append('metadata', '{"department":"Legal","category":"Vendor"}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://app.simpledocs.com/api/v1/repository_documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": "Document created successfully",
"data": {
"id": "0dbhXg",
"name": "Employment Agreement.pdf",
"created_at": "2023-11-07T05:31:56Z"
}
}
Repository Documents
Create a repository document
Upload a document to the repository. You must provide either a file (multipart upload) or a url to fetch the document from. An optional metadata JSON object can be attached.
Requires the write scope.
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"}'import requests
url = "https://app.simpledocs.com/api/v1/repository_documents"
files = { "file": ("example-file", open("example-file", "rb")) }
payload = {
"url": "<string>",
"metadata": "{\"department\":\"Legal\",\"category\":\"Vendor\"}"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text)const form = new FormData();
form.append('file', '<string>');
form.append('url', '<string>');
form.append('metadata', '{"department":"Legal","category":"Vendor"}');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://app.simpledocs.com/api/v1/repository_documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"message": "Document created successfully",
"data": {
"id": "0dbhXg",
"name": "Employment Agreement.pdf",
"created_at": "2023-11-07T05:31:56Z"
}
}
Authorizations
Obtain a Bearer token via the Create access token endpoint using the OAuth2 client credentials flow.
Body
multipart/form-data
The document file to upload. Required if url is not provided.
A public HTTPS URL to fetch the document from. Required if file is not provided. Internal and private network addresses are blocked.
A JSON string with arbitrary metadata to attach to the document.
Example:
"{\"department\":\"Legal\",\"category\":\"Vendor\"}"