Python API
Quick Start
from plaid_client import PlaidClient
client = PlaidClient.login("http://localhost:8085", "user@example.com", "password")
# Create a project
project = client.projects.create("My Project")
# Create a document
doc = client.documents.create(project["id"], "Document 1")
# List a project's documents
docs = client.projects.list_documents(project["id"])
# Batch multiple operations atomically
client.begin_batch()
client.tokens.create(token_layer_id, text_id, 0, 5)
client.tokens.create(token_layer_id, text_id, 6, 11)
results = client.submit_batch()
Client
__init__(base_url, token, timeout)Create a new PlaidClient instance.
| Parameter | Type | Description |
|---|---|---|
base_url |
Any |
The base URL for the API |
token |
Any |
The authentication token |
timeout |
Any |
Per-request timeout in seconds (default 30; ``None`` disables |
query(body)Run a query over every project you can read.
| Parameter | Type | Description |
|---|---|---|
body |
Any |
The query AST ({find, where, scope?, limit?, order_by?, |
enter_strict_mode(document_id)Enter strict mode for a specific document.
| Parameter | Type | Description |
|---|---|---|
document_id |
Any |
The ID of the document to track versions for |
exit_strict_mode()Exit strict mode and stop tracking document versions for writes.
set_audit_message()Set a custom audit-log message applied to every subsequent write,
clear_audit_message()Clear the ambient custom audit-log message (revert to auto-generated).
audit_message() @contextmanagerRun the block with a custom audit-log message in effect, restoring
begin_batch()Begin a batch of operations. Subsequent API calls will be queued.
submit_batch()Submit all queued batch operations as a single batch request.
abort_batch()Abort the current batch without executing any operations.
is_batch_mode()Check if currently in batch mode.
batched() @contextmanagerCollect the calls in this block into ONE atomic batch request.
close()Close the underlying HTTP session.
Api Tokens
api_tokens.list(user_id)List a user's named API tokens.
| Parameter | Type | Description |
|---|---|---|
user_id |
Any |
The user ID who owns the tokens |
api_tokens.iter_pages(user_id, page_size)Iterate over pages of a user's API tokens, yielding each page's entries.
| Parameter | Type | Description |
|---|---|---|
user_id |
Any |
The user ID who owns the tokens |
page_size |
Any |
Page size (1..1000) |
api_tokens.create(user_id, name)Mint a named API token for a user.
| Parameter | Type | Description |
|---|---|---|
user_id |
Any |
The user ID who will own the token |
name |
Any |
A human label, e.g. "Stanza Parser" |
api_tokens.revoke(user_id, token_id)Revoke a named API token (soft-revoke; idempotent).
| Parameter | Type | Description |
|---|---|---|
user_id |
Any |
The user ID who owns the token |
token_id |
Any |
The token ID to revoke |
Batch
batch.submit(body)Execute multiple API operations atomically.
| Parameter | Type | Description |
|---|---|---|
body |
Any |
The request body |
Documents
documents.check_lock(document_id, as_of)Get information about a document lock.
| Parameter | Type | Description |
|---|---|---|
document_id |
Any |
The document ID |
as_of |
Any |
Temporal query timestamp |
documents.acquire_lock(document_id)Acquire or refresh a document lock.
| Parameter | Type | Description |
|---|---|---|
document_id |
Any |
The document ID |
documents.release_lock(document_id)Release a document lock.
| Parameter | Type | Description |
|---|---|---|
document_id |
Any |
The document ID |
documents.locked() @contextmanagerHold this document's server-enforced lock for a ``with`` block,
documents.get_media(document_id, as_of)Get media file for a document.
| Parameter | Type | Description |
|---|---|---|
document_id |
Any |
The document ID |
as_of |
Any |
Temporal query timestamp |
documents.upload_media(document_id, file)Upload a media file for a document. Uses Apache Tika for content validation.
| Parameter | Type | Description |
|---|---|---|
document_id |
Any |
The document ID |
file |
Any |
The file to upload |
documents.delete_media(document_id)Delete media file for a document.
| Parameter | Type | Description |
|---|---|---|
document_id |
Any |
The document ID |
documents.delete(document_id)Delete a document and all data contained.
| Parameter | Type | Description |
|---|---|---|
document_id |
Any |
The document ID |
documents.update(document_id, name)Update a document's name.
| Parameter | Type | Description |
|---|---|---|
document_id |
Any |
The document ID |
name |
Any |
The name |
documents.create(project_id, name, metadata)Create a new document in a project.
| Parameter | Type | Description |
|---|---|---|
project_id |
Any |
The project ID |
name |
Any |
The name |
metadata |
Any |
Metadata map. Omit to leave unset; pass ``None`` to send |
documents.set_metadata(document_id, body)Replace all metadata for a document.
| Parameter | Type | Description |
|---|---|---|
document_id |
Any |
The document ID |
body |
Any |
The request body |
documents.delete_metadata(document_id)Remove all metadata from a document.
| Parameter | Type | Description |
|---|---|---|
document_id |
Any |
The document ID |
documents.patch_metadata(document_id, body)Patch (shallow-merge) metadata for a document.
| Parameter | Type | Description |
|---|---|---|
document_id |
Any |
The document ID |
body |
Any |
The metadata patch |
Messages
messages.listen(project_id, on_event, path)Open a Server-Sent Events stream for a project.
| Parameter | Type | Description |
|---|---|---|
project_id |
Any |
The UUID of the project to listen to |
on_event |
Any |
Callback function that receives (event_type, data). If it |
path |
Any |
Stream path under the base URL. Defaults to the project |
messages.send_message(project_id, data)Send a message to project listeners.
| Parameter | Type | Description |
|---|---|---|
project_id |
Any |
The UUID of the project to send to |
data |
Any |
The message data to send |
messages.discover_services(project_id)Discover the services seen on a project.
| Parameter | Type | Description |
|---|---|---|
project_id |
Any |
The UUID of the project to query |
messages.discard_service(project_id, service_id)Forget a previously-seen (offline) service.
| Parameter | Type | Description |
|---|---|---|
project_id |
Any |
The UUID of the project |
service_id |
Any |
The ID of the service to forget |
Projects
projects.create(name)Create a new project.
| Parameter | Type | Description |
|---|---|---|
name |
Any |
The name |
projects.list(as_of)List all projects accessible to the current user.
| Parameter | Type | Description |
|---|---|---|
as_of |
Any |
Temporal query timestamp |
projects.iter_pages(page_size, as_of)Iterate over pages of projects, yielding each page's entries list.
| Parameter | Type | Description |
|---|---|---|
page_size |
Any |
Page size (1..1000) |
as_of |
Any |
Temporal query timestamp |
projects.list_documents(id)List all documents (IDs and names) in a project.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The project ID |
projects.iter_documents(id, page_size)Iterate over pages of a project's documents, yielding each page's entries.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The project ID |
page_size |
Any |
Page size (1..1000) |
projects.get(id, as_of)Get a project by ID.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
as_of |
Any |
Temporal query timestamp |
projects.delete(id, audit_message, timeout)Delete a project and everything in it. This is irrecoverable.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
audit_message |
Any |
Custom audit-log message. |
timeout |
Any |
Per-request timeout in seconds; ``None`` (default) disables it. |
projects.update(id, name)Update a project's name.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
name |
Any |
The name |
projects.add_writer(id, user_id)Set a user's access level to read and write for this project.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
user_id |
Any |
The user ID |
projects.remove_writer(id, user_id)Remove a user's writer privileges for this project.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
user_id |
Any |
The user ID |
projects.add_reader(id, user_id)Set a user's access level to read-only for this project.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
user_id |
Any |
The user ID |
projects.remove_reader(id, user_id)Remove a user's reader privileges for this project.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
user_id |
Any |
The user ID |
projects.add_maintainer(id, user_id)Assign a user as a maintainer for this project.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
user_id |
Any |
The user ID |
projects.remove_maintainer(id, user_id)Remove a user's maintainer privileges for this project.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
user_id |
Any |
The user ID |
projects.set_config(id, namespace, config_key, config_value)Set a configuration value for a project in an editor namespace.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
namespace |
Any |
The config namespace |
config_key |
Any |
The config key |
config_value |
Any |
Configuration value to set |
projects.delete_config(id, namespace, config_key)Remove a configuration value for a project.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
namespace |
Any |
The config namespace |
config_key |
Any |
The config key |
projects.link_vocab(id, vocab_id)Link a vocabulary to a project.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
vocab_id |
Any |
The vocab layer ID |
projects.unlink_vocab(id, vocab_id)Unlink a vocabulary from a project.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
vocab_id |
Any |
The vocab layer ID |
Relation Layers
relation_layers.get(relation_layer_id, as_of)Get a relation layer by ID.
| Parameter | Type | Description |
|---|---|---|
relation_layer_id |
Any |
The relation layer ID |
as_of |
Any |
Temporal query timestamp |
relation_layers.delete(relation_layer_id)Delete a relation layer.
| Parameter | Type | Description |
|---|---|---|
relation_layer_id |
Any |
The relation layer ID |
relation_layers.update(relation_layer_id, name)Update a relation layer's name.
| Parameter | Type | Description |
|---|---|---|
relation_layer_id |
Any |
The relation layer ID |
name |
Any |
The name |
relation_layers.set_config(relation_layer_id, namespace, config_key, config_value)Set a configuration value for a relation layer in an editor namespace.
| Parameter | Type | Description |
|---|---|---|
relation_layer_id |
Any |
The relation layer ID |
namespace |
Any |
The config namespace |
config_key |
Any |
The config key |
config_value |
Any |
Configuration value to set |
relation_layers.delete_config(relation_layer_id, namespace, config_key)Remove a configuration value for a relation layer.
| Parameter | Type | Description |
|---|---|---|
relation_layer_id |
Any |
The relation layer ID |
namespace |
Any |
The config namespace |
config_key |
Any |
The config key |
relation_layers.shift(relation_layer_id, direction)Shift a relation layer's display order.
| Parameter | Type | Description |
|---|---|---|
relation_layer_id |
Any |
The relation layer ID |
direction |
Any |
The direction ("up" or "down") |
relation_layers.create(span_layer_id, name)Create a new relation layer.
| Parameter | Type | Description |
|---|---|---|
span_layer_id |
Any |
The span layer ID |
name |
Any |
The name |
Relations
relations.set_metadata(relation_id, body)Replace all metadata for a relation.
| Parameter | Type | Description |
|---|---|---|
relation_id |
Any |
The relation ID |
body |
Any |
The request body |
relations.delete_metadata(relation_id)Remove all metadata from a relation.
| Parameter | Type | Description |
|---|---|---|
relation_id |
Any |
The relation ID |
relations.patch_metadata(relation_id, body)Patch (shallow-merge) metadata for a relation.
| Parameter | Type | Description |
|---|---|---|
relation_id |
Any |
The relation ID |
body |
Any |
The metadata patch |
relations.set_target(relation_id, span_id)Update the target span of a relation.
| Parameter | Type | Description |
|---|---|---|
relation_id |
Any |
The relation ID |
span_id |
Any |
The span ID |
relations.set_source(relation_id, span_id)Update the source span of a relation.
| Parameter | Type | Description |
|---|---|---|
relation_id |
Any |
The relation ID |
span_id |
Any |
The span ID |
relations.get(relation_id, as_of)Get a relation by ID.
| Parameter | Type | Description |
|---|---|---|
relation_id |
Any |
The relation ID |
as_of |
Any |
Temporal query timestamp |
relations.delete(relation_id)Delete a relation.
| Parameter | Type | Description |
|---|---|---|
relation_id |
Any |
The relation ID |
relations.update(relation_id, value)Update a relation's value.
| Parameter | Type | Description |
|---|---|---|
relation_id |
Any |
The relation ID |
value |
Any |
The value |
relations.bulk_create(body)Create multiple relations in a single operation.
| Parameter | Type | Description |
|---|---|---|
body |
Any |
The request body |
relations.bulk_delete(body)Delete multiple relations in a single operation. Provide a list of IDs.
| Parameter | Type | Description |
|---|---|---|
body |
Any |
The request body |
Span Layers
span_layers.get(span_layer_id, as_of)Get a span layer by ID.
| Parameter | Type | Description |
|---|---|---|
span_layer_id |
Any |
The span layer ID |
as_of |
Any |
Temporal query timestamp |
span_layers.delete(span_layer_id)Delete a span layer.
| Parameter | Type | Description |
|---|---|---|
span_layer_id |
Any |
The span layer ID |
span_layers.update(span_layer_id, name)Update a span layer's name.
| Parameter | Type | Description |
|---|---|---|
span_layer_id |
Any |
The span layer ID |
name |
Any |
The name |
span_layers.set_config(span_layer_id, namespace, config_key, config_value)Set a configuration value for a span layer in an editor namespace.
| Parameter | Type | Description |
|---|---|---|
span_layer_id |
Any |
The span layer ID |
namespace |
Any |
The config namespace |
config_key |
Any |
The config key |
config_value |
Any |
Configuration value to set |
span_layers.delete_config(span_layer_id, namespace, config_key)Remove a configuration value for a span layer.
| Parameter | Type | Description |
|---|---|---|
span_layer_id |
Any |
The span layer ID |
namespace |
Any |
The config namespace |
config_key |
Any |
The config key |
span_layers.shift(span_layer_id, direction)Shift a span layer's display order.
| Parameter | Type | Description |
|---|---|---|
span_layer_id |
Any |
The span layer ID |
direction |
Any |
The direction ("up" or "down") |
span_layers.create(token_layer_id, name)Create a new span layer.
| Parameter | Type | Description |
|---|---|---|
token_layer_id |
Any |
The token layer ID |
name |
Any |
The name |
Spans
spans.set_metadata(span_id, body)Replace all metadata for a span.
| Parameter | Type | Description |
|---|---|---|
span_id |
Any |
The span ID |
body |
Any |
The request body |
spans.delete_metadata(span_id)Remove all metadata from a span.
| Parameter | Type | Description |
|---|---|---|
span_id |
Any |
The span ID |
spans.patch_metadata(span_id, body)Patch (shallow-merge) metadata for a span.
| Parameter | Type | Description |
|---|---|---|
span_id |
Any |
The span ID |
body |
Any |
The metadata patch |
spans.set_tokens(span_id, tokens)Replace the tokens associated with a span.
| Parameter | Type | Description |
|---|---|---|
span_id |
Any |
The span ID |
tokens |
Any |
The tokens |
spans.get(span_id, as_of)Get a span by ID.
| Parameter | Type | Description |
|---|---|---|
span_id |
Any |
The span ID |
as_of |
Any |
Temporal query timestamp |
spans.delete(span_id)Delete a span.
| Parameter | Type | Description |
|---|---|---|
span_id |
Any |
The span ID |
spans.update(span_id, value)Update a span's value.
| Parameter | Type | Description |
|---|---|---|
span_id |
Any |
The span ID |
value |
Any |
The value |
spans.create(span_layer_id, tokens, value, metadata)Create a new span.
| Parameter | Type | Description |
|---|---|---|
span_layer_id |
Any |
The span layer ID |
tokens |
Any |
The tokens |
value |
Any |
The value |
metadata |
Any |
Metadata map. Omit to leave unset; pass ``None`` to send |
spans.bulk_create(body)Create multiple spans in a single operation.
| Parameter | Type | Description |
|---|---|---|
body |
Any |
The request body |
spans.bulk_delete(body)Delete multiple spans in a single operation. Provide a list of IDs.
| Parameter | Type | Description |
|---|---|---|
body |
Any |
The request body |
Text Layers
text_layers.get(text_layer_id, as_of)Get a text layer by ID.
| Parameter | Type | Description |
|---|---|---|
text_layer_id |
Any |
The text layer ID |
as_of |
Any |
Temporal query timestamp |
text_layers.delete(text_layer_id)Delete a text layer.
| Parameter | Type | Description |
|---|---|---|
text_layer_id |
Any |
The text layer ID |
text_layers.update(text_layer_id, name)Update a text layer's name.
| Parameter | Type | Description |
|---|---|---|
text_layer_id |
Any |
The text layer ID |
name |
Any |
The name |
text_layers.set_config(text_layer_id, namespace, config_key, config_value)Set a configuration value for a text layer in an editor namespace.
| Parameter | Type | Description |
|---|---|---|
text_layer_id |
Any |
The text layer ID |
namespace |
Any |
The config namespace |
config_key |
Any |
The config key |
config_value |
Any |
Configuration value to set |
text_layers.delete_config(text_layer_id, namespace, config_key)Remove a configuration value for a text layer.
| Parameter | Type | Description |
|---|---|---|
text_layer_id |
Any |
The text layer ID |
namespace |
Any |
The config namespace |
config_key |
Any |
The config key |
text_layers.shift(text_layer_id, direction)Shift a text layer's order within the project.
| Parameter | Type | Description |
|---|---|---|
text_layer_id |
Any |
The text layer ID |
direction |
Any |
The direction ("up" or "down") |
text_layers.create(project_id, name)Create a new text layer for a project.
| Parameter | Type | Description |
|---|---|---|
project_id |
Any |
The project ID |
name |
Any |
The name |
Texts
texts.get(text_id, as_of)Get a text.
| Parameter | Type | Description |
|---|---|---|
text_id |
Any |
The text ID |
as_of |
Any |
Temporal query timestamp |
texts.delete(text_id)Delete a text and all dependent data.
| Parameter | Type | Description |
|---|---|---|
text_id |
Any |
The text ID |
texts.update(text_id, body)Update a text's ``body``.
| Parameter | Type | Description |
|---|---|---|
text_id |
Any |
The text ID |
body |
Any |
The request body |
texts.set_metadata(text_id, body)Replace all metadata for a text.
| Parameter | Type | Description |
|---|---|---|
text_id |
Any |
The text ID |
body |
Any |
The request body |
texts.delete_metadata(text_id)Remove all metadata from a text.
| Parameter | Type | Description |
|---|---|---|
text_id |
Any |
The text ID |
texts.patch_metadata(text_id, body)Patch (shallow-merge) metadata for a text.
| Parameter | Type | Description |
|---|---|---|
text_id |
Any |
The text ID |
body |
Any |
The metadata patch |
Token Layers
token_layers.get(token_layer_id, as_of)Get a token layer by ID.
| Parameter | Type | Description |
|---|---|---|
token_layer_id |
Any |
The token layer ID |
as_of |
Any |
Temporal query timestamp |
token_layers.delete(token_layer_id)Delete a token layer.
| Parameter | Type | Description |
|---|---|---|
token_layer_id |
Any |
The token layer ID |
token_layers.update(token_layer_id, name)Update a token layer's name.
| Parameter | Type | Description |
|---|---|---|
token_layer_id |
Any |
The token layer ID |
name |
Any |
The name |
token_layers.set_config(token_layer_id, namespace, config_key, config_value)Set a configuration value for a token layer in an editor namespace.
| Parameter | Type | Description |
|---|---|---|
token_layer_id |
Any |
The token layer ID |
namespace |
Any |
The config namespace |
config_key |
Any |
The config key |
config_value |
Any |
Configuration value to set |
token_layers.delete_config(token_layer_id, namespace, config_key)Remove a configuration value for a token layer.
| Parameter | Type | Description |
|---|---|---|
token_layer_id |
Any |
The token layer ID |
namespace |
Any |
The config namespace |
config_key |
Any |
The config key |
token_layers.shift(token_layer_id, direction)Shift a token layer's display order.
| Parameter | Type | Description |
|---|---|---|
token_layer_id |
Any |
The token layer ID |
direction |
Any |
The direction ("up" or "down") |
Tokens
tokens.set_metadata(token_id, body)Replace all metadata for a token.
| Parameter | Type | Description |
|---|---|---|
token_id |
Any |
The token ID |
body |
Any |
The request body |
tokens.delete_metadata(token_id)Remove all metadata from a token.
| Parameter | Type | Description |
|---|---|---|
token_id |
Any |
The token ID |
tokens.patch_metadata(token_id, body)Patch (shallow-merge) metadata for a token.
| Parameter | Type | Description |
|---|---|---|
token_id |
Any |
The token ID |
body |
Any |
The metadata patch |
tokens.get(token_id, as_of)Get a token.
| Parameter | Type | Description |
|---|---|---|
token_id |
Any |
The token ID |
as_of |
Any |
Temporal query timestamp |
tokens.delete(token_id)Delete a token and remove it from any spans.
| Parameter | Type | Description |
|---|---|---|
token_id |
Any |
The token ID |
tokens.bulk_create(body)Create multiple tokens in a single operation.
| Parameter | Type | Description |
|---|---|---|
body |
Any |
The request body |
tokens.bulk_delete(body)Delete multiple tokens in a single operation. Provide a list of IDs.
| Parameter | Type | Description |
|---|---|---|
body |
Any |
The request body |
tokens.split(token_id, position)Split a token at a Unicode code-point offset.
| Parameter | Type | Description |
|---|---|---|
token_id |
Any |
The token ID |
position |
Any |
Code-point offset to split at (strictly between begin and end) |
tokens.merge(token_id, other_token_id)Merge two tokens.
| Parameter | Type | Description |
|---|---|---|
token_id |
Any |
The anchor token ID |
other_token_id |
Any |
The other token to merge in |
tokens.shift(token_id, begin, end)Shift a token's boundary.
| Parameter | Type | Description |
|---|---|---|
token_id |
Any |
The token ID |
begin |
Any |
New start offset, inclusive (Unicode code points). Omit to leave unchanged. |
end |
Any |
New end offset, exclusive (Unicode code points). Omit to leave unchanged. |
Users
users.list(q, as_of)List (or search) users. Admin-or-maintainer only.
| Parameter | Type | Description |
|---|---|---|
q |
Any |
Filter to usernames containing this text (case-insensitive) |
as_of |
Any |
Temporal query timestamp |
users.create(username, password, is_admin)Create a new user.
| Parameter | Type | Description |
|---|---|---|
username |
Any |
The username |
password |
Any |
The password |
is_admin |
Any |
Whether the user is an admin |
users.get(id, as_of)Get a user by ID.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
as_of |
Any |
Temporal query timestamp |
users.delete(id)Deactivate a user.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
users.activate(id)Reactivate a deactivated user, restoring their ability to log in.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
Vocab Items
vocab_items.create(vocab_layer_id, form, metadata)Create a new vocab item.
| Parameter | Type | Description |
|---|---|---|
vocab_layer_id |
Any |
The vocab layer ID |
form |
Any |
The vocab item form |
metadata |
Any |
Metadata map. Omit to leave unset; pass ``None`` to send |
vocab_items.bulk_create(body)Create multiple vocab items in a single operation.
| Parameter | Type | Description |
|---|---|---|
body |
Any |
The vocab items to create |
vocab_items.bulk_delete(body)Delete multiple vocab items in a single operation. Provide a list of IDs.
| Parameter | Type | Description |
|---|---|---|
body |
Any |
The vocab item IDs to delete |
vocab_items.get(id, as_of)Get a vocab item by ID.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
as_of |
Any |
Temporal query timestamp |
vocab_items.delete(id)Delete a vocab item.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
vocab_items.update(id, form)Update a vocab item's form.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
form |
Any |
The vocab item form |
vocab_items.set_metadata(id, body)Replace all metadata for a vocab item.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
body |
Any |
The request body |
vocab_items.delete_metadata(id)Remove all metadata from a vocab item.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
vocab_items.patch_metadata(id, body)Patch (shallow-merge) metadata for a vocab item.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
body |
Any |
The metadata patch |
Vocab Layers
vocab_layers.get(id, include_items, as_of)Get a vocab layer by ID.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
include_items |
Any |
Include vocab items |
as_of |
Any |
Temporal query timestamp |
vocab_layers.delete(id)Delete a vocab layer.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
vocab_layers.update(id, name)Update a vocab layer's name.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
name |
Any |
The name |
vocab_layers.set_config(id, namespace, config_key, config_value)Set a configuration value for a vocab layer in an editor namespace.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
namespace |
Any |
The config namespace |
config_key |
Any |
The config key |
config_value |
Any |
Configuration value to set |
vocab_layers.delete_config(id, namespace, config_key)Remove a configuration value for a vocab layer.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
namespace |
Any |
The config namespace |
config_key |
Any |
The config key |
vocab_layers.list(as_of)List all vocab layers accessible to the current user.
| Parameter | Type | Description |
|---|---|---|
as_of |
Any |
Temporal query timestamp |
vocab_layers.iter_pages(page_size, as_of)Iterate over pages of vocab layers, yielding each page's entries list.
| Parameter | Type | Description |
|---|---|---|
page_size |
Any |
Page size (1..1000) |
as_of |
Any |
Temporal query timestamp |
vocab_layers.create(name)Create a new vocab layer.
| Parameter | Type | Description |
|---|---|---|
name |
Any |
The name |
vocab_layers.add_maintainer(id, user_id)Assign a user as a maintainer for this vocab layer.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
user_id |
Any |
The user ID |
vocab_layers.remove_maintainer(id, user_id)Remove a user's maintainer privileges for this vocab layer.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
user_id |
Any |
The user ID |
Vocab Links
vocab_links.create(vocab_item, tokens, metadata)Create a new vocab link between tokens and a vocab item.
| Parameter | Type | Description |
|---|---|---|
vocab_item |
Any |
The vocab item to link |
tokens |
Any |
The tokens to link |
metadata |
Any |
Metadata for the link. Omit to leave unset; pass ``None`` |
vocab_links.bulk_create(body)Create multiple vocab links in a single operation.
| Parameter | Type | Description |
|---|---|---|
body |
Any |
The vocab links to create |
vocab_links.bulk_delete(body)Delete multiple vocab links in a single operation. Provide a list of IDs.
| Parameter | Type | Description |
|---|---|---|
body |
Any |
The request body |
vocab_links.set_metadata(id, body)Replace all metadata for a vocab link.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
body |
Any |
The request body |
vocab_links.delete_metadata(id)Remove all metadata from a vocab link.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
vocab_links.patch_metadata(id, body)Patch (shallow-merge) metadata for a vocab link.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
body |
Any |
The metadata patch |
vocab_links.get(id, as_of)Get a vocab link by ID.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |
as_of |
Any |
Temporal query timestamp |
vocab_links.delete(id)Delete a vocab link.
| Parameter | Type | Description |
|---|---|---|
id |
Any |
The resource ID |