Take the next name
const url = 'https://app.nurseshark.org/api/names/next';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"suffix":true,"max_length":1,"long_names":"skip"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”object
Append a random four-digit suffix such as -0427. Defaults to the user’s account setting.
Longest name to hand out, in characters, before any suffix. Defaults to the user’s account setting, if any.
What to do with names over max_length: skip them, or truncate them to fit. Defaults to the user’s account setting.
Responses
Section titled “Responses”OK
object
Lowercase with hyphens between words, with any suffix or truncation applied.
The key of the theme it came from.
Example generated
{ "name": "example", "slug": "example", "theme": "example"}The token is missing, invalid or expired.
object
What went wrong and what to change.
For validation failures, the messages for each field.
object
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.
object
What went wrong and what to change.
For validation failures, the messages for each field.
object
Example generated
{ "error": "example", "errors": { "additionalProperty": [ "example" ] }}Over the rate limit. Try again in a minute.
object
What went wrong and what to change.
For validation failures, the messages for each field.
object
Example generated
{ "error": "example", "errors": { "additionalProperty": [ "example" ] }}