TeamGriddeveloper
TeamGrid Developer

documents SDK client

6 typed @teamgrid/api-client methods for Documents, plus 1 convenience helper.

Client propertyclient.documents
Mapped operations6
API groupsDocuments

Operation methods

Parameter declarations below are taken from the pinned TypeScript source. Request fields and responses are summarized from the matching OpenAPI operation; follow the API link for every field, constraint, example, and error description.

GET/documents
Full API operation →

documents.list

Lists document metadata only. Content, edit locks, subscriptions, and storage internals are not selected.

client.documents.list(options: DocumentListOptions = {})
Return form
Promise
Operation ID
listDocuments
Required scopes
documents:read
SDK parameters
options: DocumentListOptions
Query request fields
cursor?: stringlimit?: integerarchived?: boolean
Success
200 Array<Document> envelope
Declared API errors
400401403429502503
POST/documents
Full API operation →

documents.create

Creates a bounded plain document through the product document model with credential-bound idempotency.

client.documents.create(data: DocumentCreate, options: MutationOptions = {})
Return form
Promise
Operation ID
createDocument
Required scopes
documents:write
SDK parameters
data: DocumentCreateoptions: MutationOptions
Header request fields
Idempotency-Key: string
Request body
DocumentCreateapplication/json
Success
201 Document envelope
Declared API errors
400401403409429502503
GET/documents/{id}
Full API operation →

documents.get

Use this operation to get a document. It returns the resource only when it belongs to the authenticated workspace and is visible to the credential. Required scopes, product permissions, sharing rules, workspace locks, and regional cell ownership are enforced for every request.

client.documents.get(id: string, options?: RequestOptions)
Return form
Promise
Operation ID
getDocument
Required scopes
documents:read
SDK parameters
id: stringoptions: RequestOptions
Path request fields
id: string
Success
200 Document envelope
Declared API errors
400401403404413429502503
PATCH/documents/{id}
Full API operation →

documents.update

Requires the latest strong resource ETag. The cell-local App re-authenticates and atomically applies the tenant-bound revision before returning a fresh ETag.

client.documents.update(id: string, data: DocumentUpdate, options: DocumentMutationOptions)
Return form
Promise
Operation ID
updateDocument
Required scopes
documents:write
SDK parameters
id: stringdata: DocumentUpdateoptions: DocumentMutationOptions
Path request fields
id: string
Header request fields
If-Match: string
Request body
DocumentUpdateapplication/json
Success
200 Document envelope
DELETE/documents/{id}
Full API operation →

documents.archive

Requires the latest strong resource ETag. The cell-local App re-authenticates and atomically applies the tenant-bound revision before returning a fresh ETag.

client.documents.archive(id: string, options: DocumentMutationOptions)
Return form
Promise
Operation ID
archiveDocument
Required scopes
documents:write
SDK parameters
id: stringoptions: DocumentMutationOptions
Path request fields
id: string
Header request fields
If-Match: string
Success
200 Document envelope
POST/documents/{id}/restore
Full API operation →

documents.restore

Requires the latest strong resource ETag. The cell-local App re-authenticates and atomically applies the tenant-bound revision before returning a fresh ETag.

client.documents.restore(id: string, options: DocumentMutationOptions)
Return form
Promise
Operation ID
restoreDocument
Required scopes
documents:write
SDK parameters
id: stringoptions: DocumentMutationOptions
Path request fields
id: string
Header request fields
If-Match: string
Success
200 Document envelope

Convenience helpers

These typed helpers compose mapped operations. They do not grant scopes or bypass API limits.

documents.pages

Iterate cursor pages with a bounded PaginationOptions policy.

client.documents.pages(options: DocumentListOptions = {}, pagination?: PaginationOptions)
Returns AsyncGenerator

Errors and transport metadata

HTTP failures reject with TeamGridApiError, including the status, stable error documents, request ID, optional retry delay, and transport metadata. Local validation, routing, timeout, response-size, and pagination failures reject withTeamGridClientError and a stable client error code. Successful envelopes expose non-enumerable transport metadata.

See pagination and errors andclient configuration for handling guidance.

Stable documentation · Developer Platform · Reviewed 2026-08-10Edit this page ↗
Documentation feedbackWas this page useful?
Esc

Search TeamGrid Developer

Find guides, concepts and every API operation.