Create an API key
const url = 'https://api.engram.page/api-keys';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"default_access":"none","name":"CI pipeline","vault_access":{"0b7c6a4e-3f1d-4c8e-9a2b-5d6e7f809a1b":"read"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.engram.page/api-keys \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "default_access": "none", "name": "CI pipeline", "vault_access": { "0b7c6a4e-3f1d-4c8e-9a2b-5d6e7f809a1b": "read" } }'The raw key is returned once in this response and never again.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Key name
object
Level for every vault not listed in vault_access, including vaults you create later. Defaults to none when vault_access is given. write also lets the key create vaults. The key must reach at least one vault now or later.
Level per vault id: none, read (search and read) or write (also create, edit, rename and delete notes, and rename or delete the vault). Every id must be one of your vaults. Omit both this and default_access for a key on every vault with full write access.
object
Example
{ "default_access": "none", "name": "CI pipeline", "vault_access": { "0b7c6a4e-3f1d-4c8e-9a2b-5d6e7f809a1b": "read" }}Responses
Section titled “Responses”Created (raw key)
object
The granted level for every vault not in vault_access, including later ones.
Raw secret — store it now; never shown again.
What the key was granted, read back from storage: a level per listed vault id. Compare it with what you asked for; revoke the key if it is wider.
object
Example
{ "default_access": "none", "vault_access": { "additionalProperty": "none" }}Validation error