constructor
Create a new PlaidClient instance
login
Authenticate and return a new client instance with token
enterStrictMode
Enter strict mode for a specific document.
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.
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.
create
Create a new vocab link (link between tokens and vocab item).
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.
deleteMetadata
Remove all metadata from a vocab link.
get
Get a vocab link by ID
delete
Delete a vocab link
checkLock
Get information about a document lock
acquireLock
Acquire or refresh a document lock
releaseLock
Release a document lock
getMedia
Get media file for a document
uploadMedia
Upload a media file for a document. Uses Apache Tika for content validation.
deleteMedia
Delete media file for a document
setMetadata
Replace all metadata for a document. The entire metadata map is replaced - existing metadata keys not included in the request will be removed.
deleteMetadata
Remove all metadata from a document.
audit
Get audit log for a document
get
Get a document. Set includeBody to true in order to include all data contained in the document.
delete
Delete a document and all data contained.
update
Update a document. Supported keys:
create
Create a new document in a project. Requires projectId and name.
listen
Listen for project events including service coordination messages
sendMessage
Send a message to project listeners
discoverServices
Discover available services in a project
serve
Register as a service and handle incoming requests
requestService
Request a service to perform work
addWriter
Set a user's access level to read and write for this project.
removeWriter
Remove a user's writer privileges for this project.
addReader
Set a user's access level to read-only for this project.
removeReader
Remove a user's reader privileges for this project.
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.
deleteConfig
Remove a configuration value for a layer.
addMaintainer
Assign a user as a maintainer for this project.
removeMaintainer
Remove a user's maintainer privileges for this project.
audit
Get audit log for a project
linkVocab
Link a vocabulary to a project.
unlinkVocab
Unlink a vocabulary to a project.
get
Get a project by ID. If includeDocuments is true, also include document IDs and names.
delete
Delete a project.
update
Update a project's name.
list
List all projects accessible to user
create
Create a new project. Note: this also registers the user as a maintainer.
shift
Shift a relation layer's order.
create
Create a new relation layer.
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.
deleteConfig
Remove a configuration value for a layer.
get
Get a relation layer by ID.
delete
Delete a relation layer.
update
Update a relation layer's name.
setMetadata
Replace all metadata for a relation. The entire metadata map is replaced - existing metadata keys not included in the request will be removed.
deleteMetadata
Remove all metadata from a relation.
setTarget
Update the target span of a relation.
get
Get a relation by ID.
delete
Delete a relation.
update
Update a relation's value.
setSource
Update the source span of a relation.
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.
bulkCreate
Create multiple relations in a single operation. Provide an array of objects whose keysare:
bulkDelete
Delete multiple relations in a single operation. Provide an array of IDs.
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.
deleteConfig
Remove a configuration value for a layer.
get
Get a span layer by ID.
delete
Delete a span layer.
update
Update a span layer's name.
create
Create a new span layer.
shift
Shift a span layer's order.
setTokens
Replace tokens for a span.
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.
get
Get a span by ID.
delete
Delete a span.
update
Update a span's value.
bulkCreate
Create multiple spans in a single operation. Provide an array of objects whose keysare:
bulkDelete
Delete multiple spans in a single operation. Provide an array of IDs.
setMetadata
Replace all metadata for a span. The entire metadata map is replaced - existing metadata keys not included in the request will be removed.
deleteMetadata
Remove all metadata from a span.
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.
deleteConfig
Remove a configuration value for a layer.
get
Get a text layer by ID.
delete
Delete a text layer.
update
Update a text layer's name.
shift
Shift a text layer's order within the project.
create
Create a new text layer for a project.
setMetadata
Replace all metadata for a text. The entire metadata map is replaced - existing metadata keys not included in the request will be removed.
deleteMetadata
Remove all metadata from a text.
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.
get
Get a text.
delete
Delete a text and all dependent data.
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.
shift
Shift a token layer's order.
create
Create a new token layer.
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.
deleteConfig
Remove a configuration value for a layer.
get
Get a token layer by ID.
delete
Delete a token layer.
update
Update a token layer's name.
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.
get
Get a token.
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.
update
Update a token. Supported keys:
bulkCreate
Create multiple tokens in a single operation. Provide an array of objects whose keysare:
bulkDelete
Delete multiple tokens in a single operation. Provide an array of IDs.
setMetadata
Replace all metadata for a token. The entire metadata map is replaced - existing metadata keys not included in the request will be removed.
deleteMetadata
Remove all metadata from a token.
list
List all users
create
Create a new user
audit
Get audit log for a user's actions
get
Get a user by ID
delete
Delete a user
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.
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.
deleteMetadata
Remove all metadata from a vocab item.
create
Create a new vocab item
get
Get a vocab item by ID
delete
Delete a vocab item
update
Update a vocab item's form
get
Get a vocab layer by ID
delete
Delete a vocab layer.
update
Update a vocab layer's name.
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.
deleteConfig
Remove a configuration value for a layer.
list
List all vocab layers accessible to user
create
Create a new vocab layer. Note: this also registers the user as a maintainer.
addMaintainer
Assign a user as a maintainer for this vocab layer.
removeMaintainer
Remove a user's maintainer privileges for this vocab layer.