Skip to content

API Keys

API keys provide programmatic access to the Notebind API. Keys are hashed before storage and the plain key is only returned once at creation time.

{
"id": "key-uuid",
"name": "Production Agent",
"key_prefix": "nb_sk_a1b2c3",
"last_used_at": "2026-03-13T12:00:00.000Z",
"created_at": "2026-03-13T11:00:00.000Z"
}
FieldTypeDescription
idUUIDKey identifier
namestringHuman-readable name (max 100 characters)
key_prefixstringFirst 14 characters of the key for identification
last_used_atISO 8601 or nullLast time the key was used to authenticate
created_atISO 8601When the key was created

GET /api/keys

Returns all API keys for the authenticated user, sorted by created_at descending.

Terminal window
curl https://notebind.com/api/keys \
-H "Authorization: Bearer nb_sk_YOUR_KEY"
{
"data": [
{
"id": "key-uuid",
"name": "Production Agent",
"key_prefix": "nb_sk_a1b2c3",
"last_used_at": "2026-03-13T12:00:00.000Z",
"created_at": "2026-03-13T11:00:00.000Z"
}
],
"error": null
}

The response never includes the full key or key hash.


POST /api/keys
FieldTypeRequiredDescription
namestringYesHuman-readable name for the key (max 100 characters)
Terminal window
curl -X POST https://notebind.com/api/keys \
-H "Authorization: Bearer nb_sk_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "CI/CD Pipeline"}'
{
"data": {
"apiKey": {
"id": "key-uuid",
"name": "CI/CD Pipeline",
"key_prefix": "nb_sk_a1b2c3",
"last_used_at": null,
"created_at": "2026-03-13T12:00:00.000Z"
},
"key": "nb_sk_a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6"
},
"error": null
}

Keys follow the pattern: nb_sk_ + 32 hex characters (16 random bytes).

nb_sk_a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6

DELETE /api/keys/:id

Permanently revokes an API key. Any requests using this key will immediately fail with 401 Unauthorized.

ParameterTypeDescription
idUUIDAPI key ID
Terminal window
curl -X DELETE https://notebind.com/api/keys/KEY_ID \
-H "Authorization: Bearer nb_sk_YOUR_KEY"
{
"data": { "deleted": true },
"error": null
}

  • Keys are hashed with SHA-256 before storage
  • Only the first 14 characters (prefix) are stored in plaintext for display
  • last_used_at is updated on every successful authentication
  • Keys are scoped to the user who created them — cross-user access is not possible
  • There is no key rotation mechanism; delete the old key and create a new one

StatusCodeDescription
400VALIDATION_ERRORMissing or empty name, or name exceeds 100 characters
401UNAUTHORIZEDMissing or invalid credentials
404NOT_FOUNDAPI key not found