JavaScript API Documentation

misc

constructor

Create a new PlaidClient instance

Parameters

login

static

Authenticate and return a new client instance with token

Parameters

enterStrictMode

Enter strict mode for a specific document.

Parameters

exitStrictMode

Exit strict mode and stop tracking document versions for writes.

beginBatch

Begin a batch of operations. All subsequent API calls will be queued instead of executed.

submitBatch

Submit all queued batch operations as a single batch request.

abortBatch

Abort the current batch without executing any operations.

isBatchMode

Check if currently in batch mode.

batch

submit

Execute multiple API operations one after the other. If any operation fails (status >= 300), all changes are rolled back. Atomicity is guaranteed. On success, returns an array of each response associated with each submitted request in the batch. On failure, returns a single response map with the first failing response in the batch.

Parameters

documentVersions

create

Create a new vocab link (link between tokens and vocab item).

Parameters

setMetadata

Replace all metadata for a vocab link. The entire metadata map is replaced - existing metadata keys not included in the request will be removed.

Parameters

deleteMetadata

Remove all metadata from a vocab link.

Parameters

get

Get a vocab link by ID

Parameters

delete

Delete a vocab link

Parameters

documents

checkLock

Get information about a document lock

Parameters

acquireLock

Acquire or refresh a document lock

Parameters

releaseLock

Release a document lock

Parameters

getMedia

Get media file for a document

Parameters

uploadMedia

Upload a media file for a document. Uses Apache Tika for content validation.

Parameters

deleteMedia

Delete media file for a document

Parameters

setMetadata

Replace all metadata for a document. The entire metadata map is replaced - existing metadata keys not included in the request will be removed.

Parameters

deleteMetadata

Remove all metadata from a document.

Parameters

audit

Get audit log for a document

Parameters

get

Get a document. Set includeBody to true in order to include all data contained in the document.

Parameters

delete

Delete a document and all data contained.

Parameters

update

Update a document. Supported keys:

Parameters

create

Create a new document in a project. Requires projectId and name.

Parameters

messages

listen

Listen for project events including service coordination messages

Parameters

sendMessage

Send a message to project listeners

Parameters

discoverServices

Discover available services in a project

Parameters

serve

Register as a service and handle incoming requests

Parameters

requestService

Request a service to perform work

Parameters

projects

addWriter

Set a user's access level to read and write for this project.

Parameters

removeWriter

Remove a user's writer privileges for this project.

Parameters

addReader

Set a user's access level to read-only for this project.

Parameters

removeReader

Remove a user's reader privileges for this project.

Parameters

setConfig

Set a configuration value for a layer in a editor namespace. Intended for storing metadata about how the layer is intended to be used, e.g. for morpheme tokenization or sentence boundary marking.

Parameters

deleteConfig

Remove a configuration value for a layer.

Parameters

addMaintainer

Assign a user as a maintainer for this project.

Parameters

removeMaintainer

Remove a user's maintainer privileges for this project.

Parameters

audit

Get audit log for a project

Parameters

linkVocab

Link a vocabulary to a project.

Parameters

unlinkVocab

Unlink a vocabulary to a project.

Parameters

get

Get a project by ID. If includeDocuments is true, also include document IDs and names.

Parameters

delete

Delete a project.

Parameters

update

Update a project's name.

Parameters

list

List all projects accessible to user

Parameters

create

Create a new project. Note: this also registers the user as a maintainer.

Parameters

relationLayers

shift

Shift a relation layer's order.

Parameters

create

Create a new relation layer.

Parameters

setConfig

Set a configuration value for a layer in a editor namespace. Intended for storing metadata about how the layer is intended to be used, e.g. for morpheme tokenization or sentence boundary marking.

Parameters

deleteConfig

Remove a configuration value for a layer.

Parameters

get

Get a relation layer by ID.

Parameters

delete

Delete a relation layer.

Parameters

update

Update a relation layer's name.

Parameters

relations

setMetadata

Replace all metadata for a relation. The entire metadata map is replaced - existing metadata keys not included in the request will be removed.

Parameters

deleteMetadata

Remove all metadata from a relation.

Parameters

setTarget

Update the target span of a relation.

Parameters

get

Get a relation by ID.

Parameters

delete

Delete a relation.

Parameters

update

Update a relation's value.

Parameters

setSource

Update the source span of a relation.

Parameters

create

Create a new relation. A relation is a directed edge between two spans with a value, useful for expressing phenomena such as syntactic or semantic relations. A relation must at all times have both a valid source and target span. These spans must also belong to a single span layer which is linked to the relation's relation layer.

Parameters

bulkCreate

Create multiple relations in a single operation. Provide an array of objects whose keysare:

Parameters

bulkDelete

Delete multiple relations in a single operation. Provide an array of IDs.

Parameters

spanLayers

setConfig

Set a configuration value for a layer in a editor namespace. Intended for storing metadata about how the layer is intended to be used, e.g. for morpheme tokenization or sentence boundary marking.

Parameters

deleteConfig

Remove a configuration value for a layer.

Parameters

get

Get a span layer by ID.

Parameters

delete

Delete a span layer.

Parameters

update

Update a span layer's name.

Parameters

create

Create a new span layer.

Parameters

shift

Shift a span layer's order.

Parameters

spans

setTokens

Replace tokens for a span.

Parameters

create

Create a new span. A span holds a primary atomic value and optional metadata, and must at all times be associated with one or more tokens.

Parameters

get

Get a span by ID.

Parameters

delete

Delete a span.

Parameters

update

Update a span's value.

Parameters

bulkCreate

Create multiple spans in a single operation. Provide an array of objects whose keysare:

Parameters

bulkDelete

Delete multiple spans in a single operation. Provide an array of IDs.

Parameters

setMetadata

Replace all metadata for a span. The entire metadata map is replaced - existing metadata keys not included in the request will be removed.

Parameters

deleteMetadata

Remove all metadata from a span.

Parameters

textLayers

setConfig

Set a configuration value for a layer in a editor namespace. Intended for storing metadata about how the layer is intended to be used, e.g. for morpheme tokenization or sentence boundary marking.

Parameters

deleteConfig

Remove a configuration value for a layer.

Parameters

get

Get a text layer by ID.

Parameters

delete

Delete a text layer.

Parameters

update

Update a text layer's name.

Parameters

shift

Shift a text layer's order within the project.

Parameters

create

Create a new text layer for a project.

Parameters

texts

setMetadata

Replace all metadata for a text. The entire metadata map is replaced - existing metadata keys not included in the request will be removed.

Parameters

deleteMetadata

Remove all metadata from a text.

Parameters

create

Create a new text in a document's text layer. A text is simply a container for one long string in body for a given layer.

Parameters

get

Get a text.

Parameters

delete

Delete a text and all dependent data.

Parameters

update

Update a text's body. A diff is computed between the new and old bodies, and a best effort is made to minimize Levenshtein distance between the two. Token indices are updated so that tokens remain intact. Tokens which fall within a range of deleted text are either shrunk appropriately if there is partial overlap or else deleted if there is whole overlap.

Parameters

tokenLayers

shift

Shift a token layer's order.

Parameters

create

Create a new token layer.

Parameters

setConfig

Set a configuration value for a layer in a editor namespace. Intended for storing metadata about how the layer is intended to be used, e.g. for morpheme tokenization or sentence boundary marking.

Parameters

deleteConfig

Remove a configuration value for a layer.

Parameters

get

Get a token layer by ID.

Parameters

delete

Delete a token layer.

Parameters

update

Update a token layer's name.

Parameters

tokens

create

Create a new token in a token layer. Tokens define text substrings usingbegin and end offsets in the text. Tokens may be zero-width, and they may overlap with each other. For tokens which share the same begin, precedence may be used to indicate a preferred linear ordering, with tokens with lower precedence occurring earlier.

Parameters

get

Get a token.

Parameters

delete

Delete a token and remove it from any spans. If this causes the span to have no remaining associated tokens, the span will also be deleted.

Parameters

update

Update a token. Supported keys:

Parameters

bulkCreate

Create multiple tokens in a single operation. Provide an array of objects whose keysare:

Parameters

bulkDelete

Delete multiple tokens in a single operation. Provide an array of IDs.

Parameters

setMetadata

Replace all metadata for a token. The entire metadata map is replaced - existing metadata keys not included in the request will be removed.

Parameters

deleteMetadata

Remove all metadata from a token.

Parameters

users

list

List all users

Parameters

create

Create a new user

Parameters

audit

Get audit log for a user's actions

Parameters

get

Get a user by ID

Parameters

delete

Delete a user

Parameters

update

Modify a user. Admins may change the username, password, and admin status of any user. All other users may only modify their own username or password.

Parameters

vocabItems

setMetadata

Replace all metadata for a vocab item. The entire metadata map is replaced - existing metadata keys not included in the request will be removed.

Parameters

deleteMetadata

Remove all metadata from a vocab item.

Parameters

create

Create a new vocab item

Parameters

get

Get a vocab item by ID

Parameters

delete

Delete a vocab item

Parameters

update

Update a vocab item's form

Parameters

vocabLayers

get

Get a vocab layer by ID

Parameters

delete

Delete a vocab layer.

Parameters

update

Update a vocab layer's name.

Parameters

setConfig

Set a configuration value for a layer in a editor namespace. Intended for storing metadata about how the layer is intended to be used, e.g. for morpheme tokenization or sentence boundary marking.

Parameters

deleteConfig

Remove a configuration value for a layer.

Parameters

list

List all vocab layers accessible to user

Parameters

create

Create a new vocab layer. Note: this also registers the user as a maintainer.

Parameters

addMaintainer

Assign a user as a maintainer for this vocab layer.

Parameters

removeMaintainer

Remove a user's maintainer privileges for this vocab layer.

Parameters