Skip to content

Take the next name

POST
/api/names/next
curl --request POST \
--url https://app.nurseshark.org/api/names/next \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "suffix": true, "max_length": 1, "long_names": "skip" }'

Hands out the next name from the list chosen on the account page: the one alphabetically after the last name handed out, skipping names the account’s projects already use. Each call moves the account along the list. Fails with 422 if the account hasn’t chosen a list, or every name in it is taken.

Same as the next_name MCP tool.

Media typeapplication/json
object
suffix

Append a random four-digit suffix such as -0427. Defaults to the user’s account setting.

boolean
max_length

Longest name to hand out, in characters, before any suffix. Defaults to the user’s account setting, if any.

integer
>= 3 <= 64
long_names

What to do with names over max_length: skip them, or truncate them to fit. Defaults to the user’s account setting.

string
Allowed values: skip truncate

OK

Media typeapplication/json
object
name
required

Lowercase with hyphens between words, with any suffix or truncation applied.

string
slug
required
string
theme
required

The key of the theme it came from.

string

Example generated

{
"name": "example",
"slug": "example",
"theme": "example"
}

The token is missing, invalid or expired.

Media typeapplication/json
object
error
required

What went wrong and what to change.

string
errors

For validation failures, the messages for each field.

object
key
additional properties
Array<string>

Example generated

{
"error": "example",
"errors": {
"additionalProperty": [
"example"
]
}
}

The request was understood but can’t be done, for example a value over its limit or a name already in use. error says what to change.

Media typeapplication/json
object
error
required

What went wrong and what to change.

string
errors

For validation failures, the messages for each field.

object
key
additional properties
Array<string>

Example generated

{
"error": "example",
"errors": {
"additionalProperty": [
"example"
]
}
}

Over the rate limit. Try again in a minute.

Media typeapplication/json
object
error
required

What went wrong and what to change.

string
errors

For validation failures, the messages for each field.

object
key
additional properties
Array<string>

Example generated

{
"error": "example",
"errors": {
"additionalProperty": [
"example"
]
}
}