Skip to Content
Vatis TechAPI docs
Vocabularies

Update a vocabulary

Adds entries to a saved vocabulary, removes some, replaces them all, or renames it.

Serverhttps://api.eu.vatis.tech

PATCH/v1/vocabularies/{id}

Admin key only

A Member key gets 403 admin_only. Roles: Authentication and API keys.

Path parameters

id (required)
The vocabulary.
Valuesa vocabulary id, voc_...

Headers

Authorization (required)
An Admin key (Roles). A Member key gets 403 admin_only.
ValuesBearer <api key>

Body fields

application/json

namestring
A new name.
Values1 to 64 letters, digits, dots, dashes or underscores
add_entriesstring[]
Entries to add, at the end. One that is there already takes the new spelling and keeps its place.
Valuesa JSON list of strings
remove_entriesstring[]
Entries to remove, whatever their case. One that is not there is no error.
Valuesa JSON list of strings
entriesstring[]
All the entries, in place of the ones there. Not with add_entries or remove_entries.
Valuesa JSON list of strings

Response fields

id
voc_ and 12 hex digits: a session's vocabulary_id.
name
The vocabulary's name.
entry_count
How many entries it holds.
created_at
When it was made: ISO 8601, UTC.
updated_at
Its last change: ISO 8601, UTC.
entries
The entries, in the order they were added.

Responses

The vocabulary as it is now.

400 invalid_parameter

A field that is unknown or not valid, an entry that is not one (param add_entries[<index>], its place in the list sent), entries together with one of the other two, more than 10,000 entries after the change, or a query parameter. The param names it. Nothing of a refused request is applied.

400 invalid_request

A body that is not a JSON object.

No key, or a wrong, revoked or expired one.

403 admin_only

A Member key.

No vocabulary of your workspace has that id.

409 name_taken

Another vocabulary of your workspace has that name. Pick another name, or change that one.

413 request_too_large

A JSON body over 8 MB.

503 unavailable

The service is busy for a moment. Send the request again after the seconds of the Retry-After header.

Notes

  • Removed first, then added: with both remove_entries and add_entries, what is removed goes first.
  • New sessions and files only: a session reads its vocabulary when it starts, a file when its job is accepted. Open sessions keep the entries they started with. The first session after a change of a long list may get its first text a moment later.
  • A request that changes nothing (the same name, entries to remove that are not there, an empty object) answers the vocabulary as it is, and updated_at stays.