Skip to content

Document methods: update, delete

The Document Verbs update, delete as typed SDK methods, with inputs, result, refusals and an example.

Reference for Document, one group of Document methods.

Document.update

Changes the given properties of a Document. Verb page.

TypeScript
interface DocumentVerbs {
  update(input: DocumentUpdateInput, options?: SB.CallOptions): SB.Call<Document>
}

Emits Document.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Document.
formstringOne of document, deck, or sheet.

Returns

OutputTypeRequiredDescription
documentDocumentrequiredThe Document.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const document = await $.Document.update({ id: 'document_af2wijcmRy', form: 'document' })

Document.delete

Deletes a Document: a soft delete that keeps its history, undone by Thing.restore. Verb page.

TypeScript
interface DocumentVerbs {
  delete(input: DocumentDeleteInput, options?: SB.CallOptions): SB.Call<Document>
}

Emits Document.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Document.

Returns

OutputTypeRequiredDescription
documentDocumentrequiredThe Document.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const document = await $.Document.delete({ id: 'document_af2wijcmRy' })