cURL
curl -X POST https://api.neuraldraft.io/v1/projects/me/api-keys \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"name":"CI builds","scopes":["content:read","blog:read"]}'const key = await nd.projects.apiKeys.create({
name: "CI builds",
scopes: ["content:read", "blog:read"],
});
console.log(key.secret); // store immediately
r = requests.post(
"https://api.neuraldraft.io/v1/projects/me/api-keys",
headers={"Authorization": f"Bearer {key}"},
json={"name": "CI builds", "scopes": ["content:read", "blog:read"]},
)
secret = r.json()["secret"]
<?php
$created = json_decode((string) $client->post('projects/me/api-keys', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['name' => 'CI builds', 'scopes' => ['content:read','blog:read']],
])->getBody(), true);
{
"id": "key_2Ngc7HpQrZk1",
"name": "CI builds",
"prefix": "ndsk_live_",
"masked": "ndsk_live_…aB91",
"secret": "ndsk_live_a5oqV2uY3sR8mD7fK9hP4tWcXeZi6jLg7yQpaB91",
"scopes": [
"content:read",
"blog:read"
],
"last_used_at": null,
"created_at": "2026-04-19T10:02:00Z"
}{
"type": "https://api.neuraldraft.io/errors/bad_request",
"title": "Bad request",
"status": 400,
"detail": "Request body could not be parsed.",
"code": "bad_request",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "API key missing or invalid.",
"code": "unauthorized",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields failed validation.",
"code": "validation_failed",
"instance": "req_2Nh4PqRsTuVw",
"errors": {
"customer_email": [
"The customer email field must be a valid email address."
],
"starts_at": [
"The starts at field must be a date after now."
]
}
}Projects
Create an API key
Creates a new API key for the current project. The full secret is
returned once in the secret field — store it immediately. After
the response, only the masked preview is retrievable.
Scopes follow pillar:permission syntax. Use * for full access.
POST
/
projects
/
me
/
api-keys
cURL
curl -X POST https://api.neuraldraft.io/v1/projects/me/api-keys \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"name":"CI builds","scopes":["content:read","blog:read"]}'const key = await nd.projects.apiKeys.create({
name: "CI builds",
scopes: ["content:read", "blog:read"],
});
console.log(key.secret); // store immediately
r = requests.post(
"https://api.neuraldraft.io/v1/projects/me/api-keys",
headers={"Authorization": f"Bearer {key}"},
json={"name": "CI builds", "scopes": ["content:read", "blog:read"]},
)
secret = r.json()["secret"]
<?php
$created = json_decode((string) $client->post('projects/me/api-keys', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['name' => 'CI builds', 'scopes' => ['content:read','blog:read']],
])->getBody(), true);
{
"id": "key_2Ngc7HpQrZk1",
"name": "CI builds",
"prefix": "ndsk_live_",
"masked": "ndsk_live_…aB91",
"secret": "ndsk_live_a5oqV2uY3sR8mD7fK9hP4tWcXeZi6jLg7yQpaB91",
"scopes": [
"content:read",
"blog:read"
],
"last_used_at": null,
"created_at": "2026-04-19T10:02:00Z"
}{
"type": "https://api.neuraldraft.io/errors/bad_request",
"title": "Bad request",
"status": 400,
"detail": "Request body could not be parsed.",
"code": "bad_request",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "API key missing or invalid.",
"code": "unauthorized",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields failed validation.",
"code": "validation_failed",
"instance": "req_2Nh4PqRsTuVw",
"errors": {
"customer_email": [
"The customer email field must be a valid email address."
],
"starts_at": [
"The starts at field must be a date after now."
]
}
}Authorizations
Project API key. Pass as Authorization: Bearer ndsk_live_.... Manage
keys via /projects/me/api-keys. Test-mode keys use
the ndsk_test_ prefix.
Body
application/json
Response
The created key. The secret field is included only in this
response — store it now.
Example:
"key_2NfQB5GdkY9P"
Example:
"Production server"
Example:
"ndsk_live_"
Example:
"ndsk_live_…7yQp"
Example:
["content:read", "content:write"]
Full secret value. Returned only once at creation.
Example:
"ndsk_live_a5oqV2uY3sR8mD7fK9hP4tWcXeZi6jLg7yQpaB91"