JavaScript API
Quick Start
import PlaidClient from 'plaid-client';
const client = await PlaidClient.login('http://localhost:8085', 'user@example.com', 'password');
// Create a project
const project = await client.projects.create('My Project');
// Create a document
const doc = await client.documents.create(project.id, 'Document 1');
// Get a project with its documents
const full = await client.projects.get(project.id, true);
// Batch multiple operations atomically
client.beginBatch();
client.tokens.create(tokenLayerId, textId, 0, 5);
client.tokens.create(tokenLayerId, textId, 6, 11);
const results = await client.submitBatch();
Client
constructor(baseUrl, token)Create a new PlaidClient instance
| Parameter | Type | Description |
|---|---|---|
baseUrl |
string |
The base URL for the API |
token |
string |
The authentication token |
login(baseUrl, userId, password) staticAuthenticate and return a new client instance with token
| Parameter | Type | Description |
|---|---|---|
baseUrl |
string |
The base URL for the API |
userId |
string |
User ID for authentication |
password |
string |
Password for authentication |
enterStrictMode(documentId)Enter strict mode for a specific document.
| Parameter | Type | Description |
|---|---|---|
documentId |
string |
The ID of the document to track versions for |
exitStrictMode()Exit strict mode and stop tracking document versions for writes.
setAgentName(agentName)Set the user agent name for audit logging.
| Parameter | Type | Description |
|---|---|---|
agentName |
string |
Name to identify this client in audit logs |
beginBatch()Begin a batch of operations. Subsequent API calls will be queued.
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
batch.submit(body)Execute multiple API operations atomically.
| Parameter | Type | Description |
|---|---|---|
body |
Array |
The request body |
Documents
documents.checkLock(documentId, [asOf])Get information about a document lock
| Parameter | Type | Description |
|---|---|---|
documentId |
string |
The document ID |
asOf optional |
string |
Temporal query timestamp |
documents.acquireLock(documentId)Acquire or refresh a document lock
| Parameter | Type | Description |
|---|---|---|
documentId |
string |
The document ID |
documents.releaseLock(documentId)Release a document lock
| Parameter | Type | Description |
|---|---|---|
documentId |
string |
The document ID |
documents.getMedia(documentId, [asOf])Get media file for a document
| Parameter | Type | Description |
|---|---|---|
documentId |
string |
The document ID |
asOf optional |
string |
Temporal query timestamp |
documents.uploadMedia(documentId, file)Upload a media file for a document. Uses Apache Tika for content validation.
| Parameter | Type | Description |
|---|---|---|
documentId |
string |
The document ID |
file |
File |
The file to upload |
documents.deleteMedia(documentId)Delete media file for a document
| Parameter | Type | Description |
|---|---|---|
documentId |
string |
The document ID |
documents.setMetadata(documentId, body)Replace all metadata for a document.
| Parameter | Type | Description |
|---|---|---|
documentId |
string |
The document ID |
body |
any |
The request body |
documents.deleteMetadata(documentId)Remove all metadata from a document.
| Parameter | Type | Description |
|---|---|---|
documentId |
string |
The document ID |
documents.audit(documentId, [startTime], [endTime], [asOf])Get audit log for a document
| Parameter | Type | Description |
|---|---|---|
documentId |
string |
The document ID |
startTime optional |
string |
Start of time range |
endTime optional |
string |
End of time range |
asOf optional |
string |
Temporal query timestamp |
documents.get(documentId, [includeBody], [asOf])Get a document. Set `includeBody` to true to include all data.
| Parameter | Type | Description |
|---|---|---|
documentId |
string |
The document ID |
includeBody optional |
boolean |
Include document body data |
asOf optional |
string |
Temporal query timestamp |
documents.delete(documentId)Delete a document and all data contained.
| Parameter | Type | Description |
|---|---|---|
documentId |
string |
The document ID |
documents.update(documentId, name)Update a document's name.
| Parameter | Type | Description |
|---|---|---|
documentId |
string |
The document ID |
name |
string |
The name |
documents.create(projectId, name, [metadata])Create a new document in a project.
| Parameter | Type | Description |
|---|---|---|
projectId |
string |
The project ID |
name |
string |
The name |
metadata optional |
any |
Metadata map |
Messages
messages.listen(projectId, onEvent)Listen for project events including service coordination messages
| Parameter | Type | Description |
|---|---|---|
projectId |
string |
The UUID of the project to listen to |
onEvent |
function |
Callback function that receives (eventType, data). If it returns true, listening will stop. |
messages.sendMessage(projectId, data)Send a message to project listeners
| Parameter | Type | Description |
|---|---|---|
projectId |
string |
The UUID of the project to send to |
data |
any |
The message data to send |
messages.discoverServices(projectId, [timeout])Discover available services in a project
| Parameter | Type | Description |
|---|---|---|
projectId |
string |
The UUID of the project to query |
timeout optional |
number |
Timeout in milliseconds (default: 3000) |
messages.serve(projectId, serviceInfo, onServiceRequest, [extras])Register as a service and handle incoming requests
| Parameter | Type | Description |
|---|---|---|
projectId |
string |
The UUID of the project to serve |
serviceInfo |
Object |
Service information {serviceId, serviceName, description} |
onServiceRequest |
function |
Callback to handle service requests |
extras optional |
Object |
Optional additional service metadata |
messages.requestService(projectId, serviceId, data, [timeout])Request a service to perform work
| Parameter | Type | Description |
|---|---|---|
projectId |
string |
The UUID of the project |
serviceId |
string |
The ID of the service to request |
data |
any |
The request data |
timeout optional |
number |
Timeout in milliseconds (default: 10000) |
Projects
projects.addWriter(id, userId)Set a user's access level to read and write for this project.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
userId |
string |
The user ID |
projects.removeWriter(id, userId)Remove a user's writer privileges for this project.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
userId |
string |
The user ID |
projects.addReader(id, userId)Set a user's access level to read-only for this project.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
userId |
string |
The user ID |
projects.removeReader(id, userId)Remove a user's reader privileges for this project.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
userId |
string |
The user ID |
projects.setConfig(id, namespace, configKey, configValue)Set a configuration value for a project in an editor namespace.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
namespace |
string |
The config namespace |
configKey |
string |
The config key |
configValue |
any |
Configuration value to set |
projects.deleteConfig(id, namespace, configKey)Remove a configuration value for a project.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
namespace |
string |
The config namespace |
configKey |
string |
The config key |
projects.addMaintainer(id, userId)Assign a user as a maintainer for this project.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
userId |
string |
The user ID |
projects.removeMaintainer(id, userId)Remove a user's maintainer privileges for this project.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
userId |
string |
The user ID |
projects.audit(projectId, [startTime], [endTime], [asOf])Get audit log for a project
| Parameter | Type | Description |
|---|---|---|
projectId |
string |
The project ID |
startTime optional |
string |
Start of time range |
endTime optional |
string |
End of time range |
asOf optional |
string |
Temporal query timestamp |
projects.linkVocab(id, vocabId)Link a vocabulary to a project.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
vocabId |
string |
The vocab layer ID |
projects.unlinkVocab(id, vocabId)Unlink a vocabulary from a project.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
vocabId |
string |
The vocab layer ID |
projects.get(id, [includeDocuments], [asOf])Get a project by ID.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
includeDocuments optional |
boolean |
Include document IDs and names |
asOf optional |
string |
Temporal query timestamp |
projects.delete(id)Delete a project.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
projects.update(id, name)Update a project's name.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
name |
string |
The name |
projects.list([asOf])List all projects accessible to user
| Parameter | Type | Description |
|---|---|---|
asOf optional |
string |
Temporal query timestamp |
projects.create(name)Create a new project. Note: this also registers the user as a maintainer.
| Parameter | Type | Description |
|---|---|---|
name |
string |
The name |
Relation Layers
relationLayers.shift(relationLayerId, direction)Shift a relation layer's order.
| Parameter | Type | Description |
|---|---|---|
relationLayerId |
string |
The relation layer ID |
direction |
string |
The direction ("up" or "down") |
relationLayers.create(spanLayerId, name)Create a new relation layer.
| Parameter | Type | Description |
|---|---|---|
spanLayerId |
string |
The span layer ID |
name |
string |
The name |
relationLayers.setConfig(relationLayerId, namespace, configKey, configValue)Set a configuration value for a layer in an editor namespace.
| Parameter | Type | Description |
|---|---|---|
relationLayerId |
string |
The relation layer ID |
namespace |
string |
The config namespace |
configKey |
string |
The config key |
configValue |
any |
Configuration value to set |
relationLayers.deleteConfig(relationLayerId, namespace, configKey)Remove a configuration value for a layer.
| Parameter | Type | Description |
|---|---|---|
relationLayerId |
string |
The relation layer ID |
namespace |
string |
The config namespace |
configKey |
string |
The config key |
relationLayers.get(relationLayerId, [asOf])Get a relation layer by ID.
| Parameter | Type | Description |
|---|---|---|
relationLayerId |
string |
The relation layer ID |
asOf optional |
string |
Temporal query timestamp |
relationLayers.delete(relationLayerId)Delete a relation layer.
| Parameter | Type | Description |
|---|---|---|
relationLayerId |
string |
The relation layer ID |
relationLayers.update(relationLayerId, name)Update a relation layer's name.
| Parameter | Type | Description |
|---|---|---|
relationLayerId |
string |
The relation layer ID |
name |
string |
The name |
Relations
relations.setMetadata(relationId, body)Replace all metadata for a relation.
| Parameter | Type | Description |
|---|---|---|
relationId |
string |
The relation ID |
body |
any |
The request body |
relations.deleteMetadata(relationId)Remove all metadata from a relation.
| Parameter | Type | Description |
|---|---|---|
relationId |
string |
The relation ID |
relations.setTarget(relationId, spanId)Update the target span of a relation.
| Parameter | Type | Description |
|---|---|---|
relationId |
string |
The relation ID |
spanId |
string |
The span ID |
relations.get(relationId, [asOf])Get a relation by ID.
| Parameter | Type | Description |
|---|---|---|
relationId |
string |
The relation ID |
asOf optional |
string |
Temporal query timestamp |
relations.delete(relationId)Delete a relation.
| Parameter | Type | Description |
|---|---|---|
relationId |
string |
The relation ID |
relations.update(relationId, value)Update a relation's value.
| Parameter | Type | Description |
|---|---|---|
relationId |
string |
The relation ID |
value |
any |
The value |
relations.setSource(relationId, spanId)Update the source span of a relation.
| Parameter | Type | Description |
|---|---|---|
relationId |
string |
The relation ID |
spanId |
string |
The span ID |
relations.create(layerId, sourceId, targetId, value, [metadata])Create a new relation.
| Parameter | Type | Description |
|---|---|---|
layerId |
string |
The relation layer ID |
sourceId |
string |
The source span ID |
targetId |
string |
The target span ID |
value |
any |
The value |
metadata optional |
any |
Metadata map |
relations.bulkCreate(body)Create multiple relations in a single operation.
| Parameter | Type | Description |
|---|---|---|
body |
Array |
The request body |
relations.bulkDelete(body)Delete multiple relations in a single operation. Provide an array of IDs.
| Parameter | Type | Description |
|---|---|---|
body |
Array |
The request body |
Span Layers
spanLayers.setConfig(spanLayerId, namespace, configKey, configValue)Set a configuration value for a layer in an editor namespace.
| Parameter | Type | Description |
|---|---|---|
spanLayerId |
string |
The span layer ID |
namespace |
string |
The config namespace |
configKey |
string |
The config key |
configValue |
any |
Configuration value to set |
spanLayers.deleteConfig(spanLayerId, namespace, configKey)Remove a configuration value for a layer.
| Parameter | Type | Description |
|---|---|---|
spanLayerId |
string |
The span layer ID |
namespace |
string |
The config namespace |
configKey |
string |
The config key |
spanLayers.get(spanLayerId, [asOf])Get a span layer by ID.
| Parameter | Type | Description |
|---|---|---|
spanLayerId |
string |
The span layer ID |
asOf optional |
string |
Temporal query timestamp |
spanLayers.delete(spanLayerId)Delete a span layer.
| Parameter | Type | Description |
|---|---|---|
spanLayerId |
string |
The span layer ID |
spanLayers.update(spanLayerId, name)Update a span layer's name.
| Parameter | Type | Description |
|---|---|---|
spanLayerId |
string |
The span layer ID |
name |
string |
The name |
spanLayers.create(tokenLayerId, name)Create a new span layer.
| Parameter | Type | Description |
|---|---|---|
tokenLayerId |
string |
The token layer ID |
name |
string |
The name |
spanLayers.shift(spanLayerId, direction)Shift a span layer's order.
| Parameter | Type | Description |
|---|---|---|
spanLayerId |
string |
The span layer ID |
direction |
string |
The direction ("up" or "down") |
Spans
spans.setTokens(spanId, tokens)Replace tokens for a span.
| Parameter | Type | Description |
|---|---|---|
spanId |
string |
The span ID |
tokens |
Array |
The tokens |
spans.create(spanLayerId, tokens, value, [metadata])Create a new span.
| Parameter | Type | Description |
|---|---|---|
spanLayerId |
string |
The span layer ID |
tokens |
Array |
The tokens |
value |
any |
The value |
metadata optional |
any |
Metadata map |
spans.get(spanId, [asOf])Get a span by ID.
| Parameter | Type | Description |
|---|---|---|
spanId |
string |
The span ID |
asOf optional |
string |
Temporal query timestamp |
spans.delete(spanId)Delete a span.
| Parameter | Type | Description |
|---|---|---|
spanId |
string |
The span ID |
spans.update(spanId, value)Update a span's value.
| Parameter | Type | Description |
|---|---|---|
spanId |
string |
The span ID |
value |
any |
The value |
spans.bulkCreate(body)Create multiple spans in a single operation.
| Parameter | Type | Description |
|---|---|---|
body |
Array |
The request body |
spans.bulkDelete(body)Delete multiple spans in a single operation. Provide an array of IDs.
| Parameter | Type | Description |
|---|---|---|
body |
Array |
The request body |
spans.setMetadata(spanId, body)Replace all metadata for a span.
| Parameter | Type | Description |
|---|---|---|
spanId |
string |
The span ID |
body |
any |
The request body |
spans.deleteMetadata(spanId)Remove all metadata from a span.
| Parameter | Type | Description |
|---|---|---|
spanId |
string |
The span ID |
Text Layers
textLayers.setConfig(textLayerId, namespace, configKey, configValue)Set a configuration value for a layer in an editor namespace.
| Parameter | Type | Description |
|---|---|---|
textLayerId |
string |
The text layer ID |
namespace |
string |
The config namespace |
configKey |
string |
The config key |
configValue |
any |
Configuration value to set |
textLayers.deleteConfig(textLayerId, namespace, configKey)Remove a configuration value for a layer.
| Parameter | Type | Description |
|---|---|---|
textLayerId |
string |
The text layer ID |
namespace |
string |
The config namespace |
configKey |
string |
The config key |
textLayers.get(textLayerId, [asOf])Get a text layer by ID.
| Parameter | Type | Description |
|---|---|---|
textLayerId |
string |
The text layer ID |
asOf optional |
string |
Temporal query timestamp |
textLayers.delete(textLayerId)Delete a text layer.
| Parameter | Type | Description |
|---|---|---|
textLayerId |
string |
The text layer ID |
textLayers.update(textLayerId, name)Update a text layer's name.
| Parameter | Type | Description |
|---|---|---|
textLayerId |
string |
The text layer ID |
name |
string |
The name |
textLayers.shift(textLayerId, direction)Shift a text layer's order within the project.
| Parameter | Type | Description |
|---|---|---|
textLayerId |
string |
The text layer ID |
direction |
string |
The direction ("up" or "down") |
textLayers.create(projectId, name)Create a new text layer for a project.
| Parameter | Type | Description |
|---|---|---|
projectId |
string |
The project ID |
name |
string |
The name |
Texts
texts.setMetadata(textId, body)Replace all metadata for a text.
| Parameter | Type | Description |
|---|---|---|
textId |
string |
The text ID |
body |
any |
The request body |
texts.deleteMetadata(textId)Remove all metadata from a text.
| Parameter | Type | Description |
|---|---|---|
textId |
string |
The text ID |
texts.create(textLayerId, documentId, body, [metadata])Create a new text in a document's text layer.
| Parameter | Type | Description |
|---|---|---|
textLayerId |
string |
The text layer ID |
documentId |
string |
The document ID |
body |
string |
The request body |
metadata optional |
any |
Metadata map |
texts.get(textId, [asOf])Get a text.
| Parameter | Type | Description |
|---|---|---|
textId |
string |
The text ID |
asOf optional |
string |
Temporal query timestamp |
texts.delete(textId)Delete a text and all dependent data.
| Parameter | Type | Description |
|---|---|---|
textId |
string |
The text ID |
texts.update(textId, body)Update a text's body.
| Parameter | Type | Description |
|---|---|---|
textId |
string |
The text ID |
body |
any |
The request body |
Token Layers
tokenLayers.shift(tokenLayerId, direction)Shift a token layer's order.
| Parameter | Type | Description |
|---|---|---|
tokenLayerId |
string |
The token layer ID |
direction |
string |
The direction ("up" or "down") |
tokenLayers.create(textLayerId, name)Create a new token layer.
| Parameter | Type | Description |
|---|---|---|
textLayerId |
string |
The text layer ID |
name |
string |
The name |
tokenLayers.setConfig(tokenLayerId, namespace, configKey, configValue)Set a configuration value for a layer in an editor namespace.
| Parameter | Type | Description |
|---|---|---|
tokenLayerId |
string |
The token layer ID |
namespace |
string |
The config namespace |
configKey |
string |
The config key |
configValue |
any |
Configuration value to set |
tokenLayers.deleteConfig(tokenLayerId, namespace, configKey)Remove a configuration value for a layer.
| Parameter | Type | Description |
|---|---|---|
tokenLayerId |
string |
The token layer ID |
namespace |
string |
The config namespace |
configKey |
string |
The config key |
tokenLayers.get(tokenLayerId, [asOf])Get a token layer by ID.
| Parameter | Type | Description |
|---|---|---|
tokenLayerId |
string |
The token layer ID |
asOf optional |
string |
Temporal query timestamp |
tokenLayers.delete(tokenLayerId)Delete a token layer.
| Parameter | Type | Description |
|---|---|---|
tokenLayerId |
string |
The token layer ID |
tokenLayers.update(tokenLayerId, name)Update a token layer's name.
| Parameter | Type | Description |
|---|---|---|
tokenLayerId |
string |
The token layer ID |
name |
string |
The name |
Tokens
tokens.create(tokenLayerId, text, begin, end, [precedence], [metadata])Create a new token in a token layer.
| Parameter | Type | Description |
|---|---|---|
tokenLayerId |
string |
The token layer ID |
text |
string |
The text ID |
begin |
number |
Start offset (inclusive) |
end |
number |
End offset (exclusive) |
precedence optional |
number |
Ordering precedence |
metadata optional |
any |
Metadata map |
tokens.get(tokenId, [asOf])Get a token.
| Parameter | Type | Description |
|---|---|---|
tokenId |
string |
The token ID |
asOf optional |
string |
Temporal query timestamp |
tokens.delete(tokenId)Delete a token and remove it from any spans.
| Parameter | Type | Description |
|---|---|---|
tokenId |
string |
The token ID |
tokens.update(tokenId, [begin], [end], [precedence])Update a token.
| Parameter | Type | Description |
|---|---|---|
tokenId |
string |
The token ID |
begin optional |
number |
New start offset |
end optional |
number |
New end offset |
precedence optional |
number |
Ordering precedence |
tokens.bulkCreate(body)Create multiple tokens in a single operation.
| Parameter | Type | Description |
|---|---|---|
body |
Array |
The request body |
tokens.bulkDelete(body)Delete multiple tokens in a single operation. Provide an array of IDs.
| Parameter | Type | Description |
|---|---|---|
body |
Array |
The request body |
tokens.setMetadata(tokenId, body)Replace all metadata for a token.
| Parameter | Type | Description |
|---|---|---|
tokenId |
string |
The token ID |
body |
any |
The request body |
tokens.deleteMetadata(tokenId)Remove all metadata from a token.
| Parameter | Type | Description |
|---|---|---|
tokenId |
string |
The token ID |
Users
users.list([asOf])List all users
| Parameter | Type | Description |
|---|---|---|
asOf optional |
string |
Temporal query timestamp |
users.create(username, password, isAdmin)Create a new user
| Parameter | Type | Description |
|---|---|---|
username |
string |
The username |
password |
string |
The password |
isAdmin |
boolean |
Whether the user is an admin |
users.audit(userId, [startTime], [endTime], [asOf])Get audit log for a user's actions
| Parameter | Type | Description |
|---|---|---|
userId |
string |
The user ID |
startTime optional |
string |
Start of time range |
endTime optional |
string |
End of time range |
asOf optional |
string |
Temporal query timestamp |
users.get(id, [asOf])Get a user by ID
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
asOf optional |
string |
Temporal query timestamp |
users.delete(id)Delete a user
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
users.update(id, [password], [username], [isAdmin])Modify a user.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
password optional |
string |
New password |
username optional |
string |
New username |
isAdmin optional |
boolean |
New admin status |
Vocab Items
vocabItems.setMetadata(id, body)Replace all metadata for a vocab item.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
body |
any |
The request body |
vocabItems.deleteMetadata(id)Remove all metadata from a vocab item.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
vocabItems.create(vocabLayerId, form, [metadata])Create a new vocab item
| Parameter | Type | Description |
|---|---|---|
vocabLayerId |
string |
The vocab layer ID |
form |
string |
The vocab item form |
metadata optional |
any |
Metadata map |
vocabItems.get(id, [asOf])Get a vocab item by ID
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
asOf optional |
string |
Temporal query timestamp |
vocabItems.delete(id)Delete a vocab item
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
vocabItems.update(id, form)Update a vocab item's form
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
form |
string |
The vocab item form |
Vocab Layers
vocabLayers.get(id, [includeItems], [asOf])Get a vocab layer by ID
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
includeItems optional |
boolean |
Include vocab items |
asOf optional |
string |
Temporal query timestamp |
vocabLayers.delete(id)Delete a vocab layer.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
vocabLayers.update(id, name)Update a vocab layer's name.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
name |
string |
The name |
vocabLayers.setConfig(id, namespace, configKey, configValue)Set a configuration value for a layer in an editor namespace.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
namespace |
string |
The config namespace |
configKey |
string |
The config key |
configValue |
any |
Configuration value to set |
vocabLayers.deleteConfig(id, namespace, configKey)Remove a configuration value for a layer.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
namespace |
string |
The config namespace |
configKey |
string |
The config key |
vocabLayers.list([asOf])List all vocab layers accessible to user
| Parameter | Type | Description |
|---|---|---|
asOf optional |
string |
Temporal query timestamp |
vocabLayers.create(name)Create a new vocab layer. Note: this also registers the user as a maintainer.
| Parameter | Type | Description |
|---|---|---|
name |
string |
The name |
vocabLayers.addMaintainer(id, userId)Assign a user as a maintainer for this vocab layer.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
userId |
string |
The user ID |
vocabLayers.removeMaintainer(id, userId)Remove a user's maintainer privileges for this vocab layer.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
userId |
string |
The user ID |
Vocab Links
vocabLinks.create(vocabItem, tokens, [metadata])Create a new vocab link between tokens and a vocab item.
| Parameter | Type | Description |
|---|---|---|
vocabItem |
string |
The vocab item to link |
tokens |
Array |
The tokens to link |
metadata optional |
any |
Metadata for the link |
vocabLinks.setMetadata(id, body)Replace all metadata for a vocab link. The entire metadata map is replaced - existing metadata keys not included in the request will be removed.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
body |
any |
The request body |
vocabLinks.deleteMetadata(id)Remove all metadata from a vocab link.
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
vocabLinks.get(id, [asOf])Get a vocab link by ID
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |
asOf optional |
string |
Temporal query timestamp |
vocabLinks.delete(id)Delete a vocab link
| Parameter | Type | Description |
|---|---|---|
id |
string |
The resource ID |