Skip to content

Create an API key

POST
/api-keys
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.

Key name

Media typeapplication/json
CreateApiKeyRequest
object
default_access

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.

string
Allowed values: none read write
name
required
string
vault_access

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
key
additional properties
string
Allowed values: none read write

Example

{
"default_access": "none",
"name": "CI pipeline",
"vault_access": {
"0b7c6a4e-3f1d-4c8e-9a2b-5d6e7f809a1b": "read"
}
}

Created (raw key)

Media typeapplication/json
ApiKeyCreated
object
default_access
required

The granted level for every vault not in vault_access, including later ones.

string
Allowed values: none read write
id
required
string format: uuid
key
required

Raw secret — store it now; never shown again.

string
name
required
string
vault_access
required

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
key
additional properties
string
Allowed values: none read write

Example

{
"default_access": "none",
"vault_access": {
"additionalProperty": "none"
}
}

Validation error

Media typeapplication/json
Error
object
errors
One of:
string

Example generated

{
"errors": {}
}