Document
The document resource.
Basehttps://rest.carbon.ms/document
GET
/documentList documents
Retrieve a paginated list of documents. Filter, order, and select columns with PostgREST query parameters.
Query parameters
selectstringComma-separated columns to return. Defaults to all.
orderstringColumn to sort by, e.g. `createdAt.desc`.
limitintegerMaximum rows to return.
offsetintegerRows to skip, for pagination.
GEThttps://rest.carbon.ms/document
curl --request GET \
--url 'https://rest.carbon.ms/document?select=*&limit=10' \
--header 'Authorization: Bearer <api-key>'Response
[
{
"id": "abc123def456",
"path": "string",
"name": "Example",
"size": 0,
"type": "string",
"active": true,
"companyId": "xyz789",
"createdBy": "string"
}
]GET
/documentRetrieve a document
Fetch a single document by filtering on `id`.
Query parameters
idstringMatch on the document's `id`, e.g. `eq.{id}`.
GEThttps://rest.carbon.ms/document
curl --request GET \
--url 'https://rest.carbon.ms/document?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'Response
{
"id": "abc123def456",
"path": "string",
"name": "Example",
"size": 0,
"type": "string",
"active": true,
"companyId": "xyz789",
"createdBy": "string"
}POST
/documentCreate a document
Create a new document.
Body parameters
pathstringrequirednamestringrequireddescriptionstringsizenumberrequiredextensionstringtypedocumentTyperequiredreadGroupsarraywriteGroupsarrayactivebooleanrequiredcompanyIdstringrequiredsourceDocumentdocumentSourceTypesourceDocumentIdstringPOSThttps://rest.carbon.ms/document
curl --request POST \
--url https://rest.carbon.ms/document \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"path":"string","name":"Example","description":"string","size":0,"type":"string","active":true,"companyId":"xyz789"}'Response
{
"id": "abc123def456",
"path": "string",
"name": "Example",
"size": 0,
"type": "string",
"active": true,
"companyId": "xyz789",
"createdBy": "string"
}PATCH
/documentUpdate a document
Update an existing document, matched on `id`.
Body parameters
pathstringrequirednamestringrequireddescriptionstringsizenumberrequiredextensionstringtypedocumentTyperequiredreadGroupsarraywriteGroupsarrayactivebooleanrequiredcompanyIdstringrequiredsourceDocumentdocumentSourceTypesourceDocumentIdstringPATCHhttps://rest.carbon.ms/document
curl --request PATCH \
--url 'https://rest.carbon.ms/document?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"path":"string"}'Response
{
"id": "abc123def456",
"path": "string",
"name": "Example",
"size": 0,
"type": "string",
"active": true,
"companyId": "xyz789",
"createdBy": "string"
}DELETE
/documentDelete a document
Delete a document, matched on `id`. Returns 204 No Content.
Query parameters
idstringThe `id` of the document to delete, e.g. `eq.{id}`.
DELETEhttps://rest.carbon.ms/document
curl --request DELETE \
--url 'https://rest.carbon.ms/document?id=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'204 No Content