Skip to content

Create API key

POST
/v1/auth/api
curl --request POST \
--url https://api.neuramancer.dev/v1/auth/api \
--header 'Authorization: <Authorization>' \
--header 'Content-Type: application/json' \
--data '{ "tenantName": "example", "keyName": "example", "expiryDate": "2026-04-15T12:00:00Z" }'

Generates a new API key for a tenant. The clear-text key is returned only once in the response. Requires authentication (API key belonging to tenant or user JWT with tenant access).

Media typeapplication/json
object
tenantName
required

Tenant name to create the API key for

string
keyName
required

Human-readable name for the API key

string
expiryDate
required

Expiration date for the API key (must be in the future)

string format: date-time
Examplegenerated
{
"tenantName": "example",
"keyName": "example",
"expiryDate": "2026-04-15T12:00:00Z"
}

API key created successfully

Media typeapplication/json

Standardized success response following the APIResponse schema. Returns the full API key object with the clear-text secret (returned only once - store it securely).

object
success
required
boolean
data
required
object
name
required

Human-readable name for the API key

string
uuid
required

Unique identifier for the API key (use this to delete the key)

string format: uuid
createdDate
required

Creation timestamp

string format: date-time
expiryDate
required

Expiration timestamp

string format: date-time
secret
required

The clear-text API key secret (returned only once, store securely). Subsequent reads return ‘***’.

string
Example
{
"success": true
}

Invalid request - missing required fields or invalid expiry date

Media typeapplication/json
object
success
required
boolean
message
required

Error message

string
Example
{
"success": false
}

Unauthorized - invalid or missing authentication

Media typeapplication/json
object
success
required
boolean
message
required

Error message

string
Example
{
"success": false
}

Unauthorized - tenant access denied

Media typeapplication/json
object
success
required
boolean
message
required

Error message

string
Example
{
"success": false
}

Tenant not found

Media typeapplication/json
object
success
required
boolean
message
required

Error message

string
Example
{
"success": false
}

Internal server error

Media typeapplication/json
object
success
required
boolean
message
required

Error message

string
Example
{
"success": false
}