VESvault API Error Numbers
The VESvault REST API at https://api.ves.host/v1/
reports every failure as one or more
numbered error entries. This page explains the response format and lists every error number the
API returns.
Most applications call the API through
libVES.js,
libVES.c or the
ves command line utility,
which pass the number through to you.
Response Format
A failed request returns a JSON object with an errors
array:
{
"errors": [
{
"code": "NotFound",
"number": 4021,
"message": "Object does not exist"
}
]
}
code
String
The error class, such as NotFound
. Always present.
number
Integer
The error number from the list below. A few failures that have no specific number send code
without number
.
message
String
A description for people. The wording may change, so match on number
or code
, never on the message.
path
Array
Where the problem is. For a POST, the keys and array indexes that lead from the posted body to the offending object or field.
For a size limit, the field path of the list or object in the requested fields
.
Present only where it applies.
Some errors add more members, described with the error. Expect members not listed here and ignore the ones you do not use.
A POST can return several entries at once, one for each invalid field.
The HTTP status of the response comes from the first entry.
A few errors are sent next to a
result
(
1061,
9011).
In that case the result is real but incomplete, and the error says what is missing.
Reading a Number
Every error number has four digits. The first digit is the error class, which also sets the HTTP status:
3xxx
Unauthorized
HTTP 401
5xxx
AccessDenied
HTTP 403
7xxx
InvalidData
HTTP 403
The second digit usually names the kind of object involved:
0 – the request or session, 1 – user, 2 – Vault Key, 3 – Vault Item or file,
5 – Vault Entry, 7 – domain, 9 – external reference.
For example, 5291 is an AccessDenied error (5) on a Vault Key (2).
Handling Errors
- 1xxx Internal – a failure on the server, expected to be temporary. Retry the request with an increasing interval. If it keeps failing, report the error with its number.
- 2xxx BadRequest, 7xxx InvalidData – the request needs to be fixed. Do not retry it unchanged.
- 3xxx Unauthorized – authenticate again. 3014 means the session has expired.
- 4xxx NotFound – the object named in the path or in the posted body does not exist. Check the ID.
- 5xxx AccessDenied, 6xxx ReadOnly – the session is not allowed to do this. A different session or a different operation is needed. Retrying will not change the answer.
- 8xxx OverQuota – come back later. Retry with an increasing delay.
- 9xxx TooLarge – ask for less: fewer fields, or a range on the list named by
path
. Retrying the same request will get the same answer.
A field the session is not allowed to read is left out of the result. It is not reported as an error.
An absent field can mean either no value
or not permitted
.
libVES.js, libVES.c, ves
libVES.js rejects the promise with a libVES.Error
built from the first entry.
The entry's members are copied onto the error, so err.code
, err.number
, err.message
and err.path
are available. Set an onerror
handler to receive all entries.
VES.get('vaultItems/12345').catch(function(err) {
if (err.number == 4021) {
// no Vault Item with this ID
}
});
libVES.c maps the HTTP status to a
LIBVES_E_* code:
401 and 403 become
LIBVES_E_DENIED
, 404
LIBVES_E_NOTFOUND
, 503
LIBVES_E_QUOTA
,
and any other status
LIBVES_E_SERVER
.
The error number is in the message from
libVES_getErrorInfo(),
which starts with
API#
and the number, for example
API#4021: HTTP 404
.
The
ves utility prints that message and exits with the libVES error code, as listed in its
Exit Codes.
Error Numbers
Each error is listed with the message the server sends, followed by what it means.
A …
in a message stands for text that varies.
1xxx – Internal Errors (Internal, HTTP 500)
Internal errors are expected to be temporary and every one of them can be retried.
Retry with an increasing interval, and report the error with its number if it keeps failing.
1011
Cannot save the field
A posted field could not be stored.
1012
Update failed
The update could not be applied.
1041
Try again
Transient failure while checking login credentials.
1042
Try again
Transient failure while loading the session.
1043
Try again
Transient failure while reading data.
1044
Try again
Transient failure while reading data.
1061
A value could not be encoded and was left out
Sent alongside a result
: one value could not be represented in JSON and is missing from the result. path
names the field. The rest of the result is valid.
1201
Not supported
Converting a pending Vault Key into the current key is not supported this way.
1202
Invalid anonymous key
An anonymous Vault Key has neither a user nor an external reference.
1211
Update Denied
The security time delay check could not be completed, so the update was refused.
1212
Update failed
Vault Key entries could not be updated.
1213
Update failed
The Vault Key type could not be updated.
1231
Error retrieving data
An external reference of a Vault Key could not be read.
1232
Error loading VaultKey
The Vault Key could not be loaded.
1241
Deleting a non-existing key
A delete was attempted on a Vault Key that does not exist.
1311
Update failed
Vault Item entries could not be updated.
1312
Update Failed
The Vault Item could not be deleted.
1321
Error retrieving the object
The Vault Item could not be loaded.
1322
Update failed
The file object could not be updated.
1323
Error retrieving the object
The Vault Item could not be loaded.
1326
Error retrieving data
An external reference of a file could not be read.
1541
Validation failed
The Vault Entries of a Vault Item could not be validated.
1711
Update failed
The domain could not be updated.
2xxx – Bad Request (BadRequest, HTTP 400)
2011
Missing request body
A POST request was sent with no body.
2012
Error parsing post data
The request body is not valid JSON.
2021
Error processing post data
The posted object could not be processed. Usually follows a more specific entry that names the problem.
2051
Bad request path
The request path could not be parsed.
2061
Logout failed
The session could not be closed.
2071
fields= nests deeper than this server allows
The fields
parameter nests sub-objects deeper than the server accepts. The entry carries depth
(requested) and maxDepth
(allowed). Flatten the request into several calls.
2072
fields= needs more joined tables than one statement can name
The fields
parameter asks for too many related objects at once. Split the request.
3xxx – Unauthorized (Unauthorized, HTTP 401)
3001
Invalid authorization header
The Authorization
header is neither Bearer
nor Basic
.
3002
Invalid basic authorization
The Basic credentials are not a base64 login:password
pair.
3012
Empty auth token
The Bearer token is empty.
3013
Bad auth token
The Bearer token is malformed.
3014
Session expired
The session token has expired. Authenticate again to get a new one.
3015
Invalid auth token
The session token is not recognized – it was never issued, or the session has been closed.
3023
Bad verify token
A verification token (a Bearer token starting with ~
) is malformed.
3024
Bad verify token expiration timestamp
The expiration part of a verification token is not a number.
3131
Invalid login
Login with Basic credentials failed.
3132
Authentication failed
Login with Basic credentials failed.
3134
Authentication expired
The account password has expired and must be reset before it can be used to log in.
3141
Session authorization is needed to retrieve user information
me
was requested without a session.
4xxx – Not Found (NotFound, HTTP 404)
4001
Unspecified object ID
The request needs an object ID and none was given.
4002
Object ID must be numeric
The ID in the request path is not a number.
4003
Invalid object name
The first path segment is not a known object collection.
4021
Object does not exist
No object with this ID exists.
4031
Request path too long
The path has more segments than collection/id
.
4101
Not found
A posted user reference does not match an existing user.
4111
Field values don't match
A user posted with $op: "match"
exists, but its stored fields differ from the posted ones.
4201
Not found
A posted Vault Key reference does not match an existing Vault Key.
4211
Field values don't match
A Vault Key posted with $op: "match"
exists, but its stored fields differ from the posted ones.
4301
Not found
A posted Vault Item reference does not match an existing Vault Item.
4302
Not found
A posted file reference does not match an existing file.
4311
Field values don't match
A Vault Item posted with $op: "match"
exists, but its stored fields differ from the posted ones.
4312
Field values don't match
A file posted with $op: "match"
exists, but its stored fields differ from the posted ones.
4701
Not found
A posted domain reference does not match an existing domain.
4711
Field values don't match
A domain posted with $op: "match"
exists, but its stored fields differ from the posted ones.
4901
Not found
A posted external reference does not match an existing one.
4911
Field values don't match
An external reference posted with $op: "match"
exists, but its stored fields differ from the posted ones.
5xxx – Access Denied (AccessDenied, HTTP 403)
5001
Administratively disabled: …
Requests from this network address are disabled. Do not retry. See Over Quota for the extra members.
5013
Update denied
The posted field cannot be changed in this operation.
5101
Administratively disabled: …
This user account is disabled for the operation. Do not retry.
5111
Already exists
A user posted with $op: "create"
already exists.
5112
Cannot delete
Users cannot be deleted through the API.
5121
No permission to update
A session can only update its own user.
5141
No user is associated with the session
me
was requested with a session that has no user, such as an anonymous vault session.
5211
Already exists
A Vault Key posted with $op: "create"
already exists.
5212
Cannot delete
Vault Keys of this type cannot be deleted.
5216
Cannot delete non-empty vaultKey
A secondary Vault Key can only be deleted after nothing is shared with it.
5221
externalId containing '@' for vaultKey must match user's lowercase email
An external ID that looks like an email address must be the account's own email, in lowercase.
5222
Anonymous externalId must start with '!'
An anonymous Vault Key needs an external ID beginning with !
.
5231
Restricted vaultKey
This external reference is restricted and cannot be used for the Vault Key.
5232
Primary authentication is required to create a vaultKey with an arbitrary externalId
Log in with the account (primary session) to use this external ID.
5233
Need primary authentication to alter current or shadow VaultKey
The current and shadow Vault Keys can only be changed by the account's own primary session.
5234
Elevated authentication is required to rekey a secondary vaultKey
Rekeying a secondary Vault Key needs an elevated session.
5235
Elevated authentication required for rekeying
Rekeying needs an elevated session.
5239
Only a primary user session can create a pending VaultKey for themselves
A pending Vault Key can only be created by the account's own primary session.
5241
Illegal type change
The Vault Key cannot change to the requested type.
5242
Illegal type change
The Vault Key cannot change to the requested type.
5251
Create a secondary VaultKey instead
A temporary Vault Key cannot be created for your own account.
5252
Unauthorized creator
The creator
of a new Vault Key must be the session's own user.
5253
Cannot create a VaultKey of this type
Vault Keys of this type cannot be created through the API.
5254
Not authorized for this VaultKey
The session has no access to this Vault Key.
5255
Only current or secondary VaultKey can get lost
Only a current or secondary Vault Key can be marked lost.
5256
Temp section keys are not permitted
A temporary Vault Key cannot be created for a section vault.
5261
Password authentication is required to create a vaultKey without rekeying
Log in with the account password, or rekey from an existing key.
5262
Only a primary user session can create a secondary VaultKey for themselves
A secondary Vault Key can only be created by the account's own primary session.
5263
Primary or secondary vault session is needed to create a section vault
Section vaults are created from a primary or secondary vault session.
5264
Anonymous session is needed to create an anonymous VaultKey
An anonymous Vault Key cannot be created from a user session.
5265
Anonymous parent key authorization needed to create an anonymous section VaultKey
An anonymous section Vault Key needs the parent anonymous key's session.
5291
Update Denied: Security Time Delay
A Vault Key involved was changed recently and is still within its security time delay. The change can be made once the delay has passed.
5311
Already exists
A Vault Item posted with $op: "create"
already exists.
5312
Not permitted
The operation is not permitted on this file.
5317
Not allowed to replace this vaultItem
The session cannot replace this Vault Item.
5318
Not allowed to replace this vaultItem
The session cannot replace this Vault Item.
5319
Not allowed for an inaccessible vaultItem
The session has no access to this Vault Item.
5322
Creator key authorization needed for sharing with non-owner
Only the Vault Item's creator can share it with this Vault Key.
5331
Creator key authorization needed for sharing with new users
Only the Vault Item's creator can share it with a new user.
5332
Creator key authorization needed for unsharing
Only the Vault Item's creator can remove this share.
5351
Cannot create a new vauItem for an existing vaultKey
A new Vault Item that holds a Vault Key must come with a new Vault Key.
5391
Unauthorized Creator
The creator
of a file must be the session's own user.
5392
A restricted vaultItem can only be created by the owner of an existing vaultKey with the externalId preceding the '!'
Restricted Vault Item IDs are reserved for the owner of the matching Vault Key.
5519
Unsupported action
This operation is not supported on a Vault Entry.
5531
Sharing with this vaultKey is not allowed or is redundant
The Vault Item cannot be shared with this Vault Key, or is already shared with it.
5532
Attempt to remove owner's access
The owner's own entry cannot be removed from a Vault Item.
5701
Administratively disabled: …
This domain is disabled for the operation. Do not retry.
5712
Not permitted
The operation is not permitted on this domain.
5721
Use x-* or x.* to create an experimental domain
Only experimental domains, named x-…
or x.…
, can be created through the API.
5731
Domain creation denied for an anonymous session
Domains cannot be created from an anonymous session.
5901
Administratively disabled: …
This app is disabled for the operation. Do not retry.
5912
Not permitted
The operation is not permitted on this external reference.
6xxx – Read Only (ReadOnly, HTTP 403)
6011
Read only field
The posted field cannot be written.
6012
Conflicting assignment
The same field is assigned more than once in the posted object.
6031
Update denied - readonly session
The session is read-only.
6341
Delete denied for a readonly session
A read-only session cannot delete Vault Items.
6731
Domain creation denied for a readonly session
A read-only session cannot create domains.
7xxx – Invalid Data (InvalidData, HTTP 403)
7001
Unknown field
The posted object has a field this object type does not have.
7002
Required field
A field required to create this object is missing.
7011
Integer expected
The field must be an integer.
7012
Positive integer expected
The field must be a positive integer.
7021
String expected
The field must be a string.
7022
Too long
The string is longer than the field allows.
7026
HTTPS URL String expected
The field must be an https://
URL.
7031
Object expected
The field must be a JSON object.
7032
Object expected
The posted value must be a JSON object.
7041
Array expected
The field must be a JSON array.
7051
Invalid ref path, must start with '#'
A $ref
value must be a path starting with #
.
7052
Path not found or is not a valid object
A $ref
path does not point to another object of the same type in the posted body.
7061
Invalid special key
A key starting with $
is not one of $op
or $ref
.
7111
Email address expected, … chars max
The field must be an email address within the length limit.
7211
Missing rekeyed entries
A rekey must include an entry for every Vault Item shared with the old key. ref
is the ID of a Vault Item that is missing.
7212
vaultEntries on a vaultKey should be used for rekeying only. Use vaultItem to share it with a new vaultKey.
To share a Vault Item, post it to vaultItems.
7215
Invalid vault key type
The Vault Key type
is not recognized.
7216
Invalid vault key algorithm
The Vault Key algo
is not recognized.
7222
A new matching key is expected to be posted
This operation must include the new Vault Key.
7232
1 VaultItem type=password required
A new secondary Vault Key needs exactly one password Vault Item.
7233
1 VaultItem type=password required
A new temporary Vault Key needs exactly one password Vault Item.
7234
At least 1 VaultItem type=secret required
A new shadow Vault Key needs at least one secret Vault Item.
7241
Creator required for a temp key
A temporary Vault Key needs a creator
.
7252
A secondary key requires an external reference
A secondary Vault Key needs an external reference.
7261
PEM expected
The publicKey
is not PEM encoded.
7262
(varies)
The publicKey
could not be parsed. The message describes why.
7311
Invalid vault item type
The Vault Item type
is not recognized.
7312
Either file or vaultKey is required
A new Vault Item needs exactly one of file
or vaultKey
.
7511
Too short
The Vault Entry encData
is too short to be valid ciphertext.
7521
A new vaultItem must have an entry for the creator's session vaultKey
Include a Vault Entry for the Vault Key of the session that creates the item.
7522
A new shared secret vaultItem must have an entry for the recipient's vaultKey
Include a Vault Entry for the recipient.
7523
A section password vaultItem must have an entry for the app vaultKey
Include a Vault Entry for the app Vault Key.
7531
Cannot delete nonexisting entry
The Vault Entry to remove does not exist.
7541
Mismatched current/shadow vaultKey pair
The current and shadow Vault Keys in the post do not belong together.
7542
Mismatched current/shadow vaultKey pair
The current and shadow Vault Keys in the post do not belong together.
7711
Expected: case insensitive string starting with a letter, domain name format, max … chars
The domain tag is not a valid domain name.
7921
External ID string expected, …
The external ID must be a non-empty string within the length limit.
7922
An array max 1 element expected
At most one external reference can be given here.
8xxx – Over Quota (OverQuota, HTTP 503)
Each request is charged against several budgets: the caller's network address, and where they apply the user, the domain and the app.
When one runs out, the API answers 503 until it refills. The last three digits name the budget.
The entry also carries sel
, naming the meter that ran out, and ref
. Include both if you contact support.
The same budgets can be switched off by VESvault. That is reported as AccessDenied with the matching number
(5001, 5101, 5701, 5901) and the message Administratively disabled: …
, and is not resolved by waiting.
8001
Quota exceeded: …
The request budget for this network address is used up.
8101
Quota exceeded: …
The user's request budget is used up.
8701
Quota exceeded: …
The domain's request budget is used up.
8901
Quota exceeded: …
The app's request budget is used up.
9xxx – Too Large (TooLarge, HTTP 507)
The API caps how many rows one request reads and how large one response can be.
To page through a list, put a range after the list field in fields
: [start+count]
, as in
vaultItems(id,type)[0+100]
.
start
is an object ID, not a position: the list returns up to count
objects whose ID is
start
or higher, in ID order, and 0
starts from the beginning.
The response carries a ranges
entry for the list with nextId
; ask for [nextId+100]
to get the next page, and stop when more
is false
.
Use -
in place of +
to go the other way, from start
down to lower IDs
([0-100]
is the 100 highest IDs).
9011
The list is longer than the row cap -- ask for a range
Sent alongside a result
that holds the first page of a list. path
names the list. Request the rest with a range.
9012
The response reached the memory cap -- ask for fewer fields or a range
The response is too large. path
names the list or object that could not be completed. Ask for fewer fields or a range.