Documents
Create and manage instance documents backed by Cargo.
Documents object
Attributes
object
StringString representing the object's type
id
Stringstatus
Enumtitle
Stringcontent
Stringfile_id
Stringparent_document_id
StringNullablecurrent_version_id
StringNullablecreated_by
ObjectNullablecreated_at
Dateupdated_at
Date{"object": "document","status": "active","created_by": {"type": "organization_actor","organization_actor": {"object": "organization.actor","id": "omem_5fGhJkLmNpQrStUv","type": "member","organization_id": "org_7hNkPqRsTuVwXyZa","name": "Alex Chen","email": "[email protected]","image_url": "https://avatar-cdn.metorial.com/aimg_1234567890","teams": [{"id": "tm_3eFgHjKlMnPqRsTu","name": "Engineering","slug": "engineering","assignment_id": "tmas_8jKlMnPqRsTuVwXy"},{"id": "tm_3eFgHjKlMnPqRsTu","name": "Engineering","slug": "engineering","assignment_id": "tmas_8jKlMnPqRsTuVwXy"}]},"consumer": {"object": "consumer"}}}
List documents
Returns a paginated list of documents owned by the instance.
Query Parameters
limit
NumberOptionalafter
StringOptionalbefore
StringOptionalcursor
StringOptionalorder
EnumOptionalid
UnionOptionalFilter by document ID
file_id
UnionOptionalFilter by file ID
store_id
UnionOptionalFilter by store ID
parent_document_id
UnionOptionalFilter by parent document ID
created_at
ObjectOptionalFilter Filter by creation time by date range
updated_at
ObjectOptionalFilter Filter by update time by date range
curl -X GET "https://api.metorial.com/documents" \-H "Authorization: Bearer metorial_sk_..."
Create document
Creates a new document for the instance.
Request Body
title
Stringcontent
Stringcurl -X POST "https://api.metorial.com/documents" \-H "Content-Type: application/json" \-H "Authorization: Bearer metorial_sk_..." \-d '{"title": "example_title","content": "example_content"}'
Get document by ID
Retrieves a document by its ID.
URL Parameters
document_id
StringThe unique identifier for the document
curl -X GET "https://api.metorial.com/documents/doc_Rm4Mnheq2bfEPhBhP7SY" \-H "Authorization: Bearer metorial_sk_..."
Get document permissions
Returns the effective Cargo permissions for the current actor on a specific document.
URL Parameters
document_id
StringThe unique identifier for the document
curl -X GET "https://api.metorial.com/documents/doc_Rm4Mnheq2bfEPhBhP7SY/permissions" \-H "Authorization: Bearer metorial_sk_..."
Update document by ID
Updates a specific document.
URL Parameters
document_id
StringThe unique identifier for the document
Request Body
title
StringOptionalcontent
StringOptionalcurl -X PATCH "https://api.metorial.com/documents/doc_Rm4Mnheq2bfEPhBhP7SY" \-H "Content-Type: application/json" \-H "Authorization: Bearer metorial_sk_..." \-d '{"title": "example_title","content": "example_content"}'
Delete document by ID
Deletes a specific document.
URL Parameters
document_id
StringThe unique identifier for the document
curl -X DELETE "https://api.metorial.com/documents/doc_Rm4Mnheq2bfEPhBhP7SY" \-H "Authorization: Bearer metorial_sk_..."
Clone document by ID
Clones a specific document.
URL Parameters
document_id
StringThe unique identifier for the document
Request Body
target_document_id
StringOptionaltitle
StringOptionalcurl -X POST "https://api.metorial.com/documents/doc_Rm4Mnheq2bfEPhBhP7SY/clone" \-H "Content-Type: application/json" \-H "Authorization: Bearer metorial_sk_..." \-d '{"target_document_id": "example_target_document_id","title": "example_title"}'