Create a new user
If no users have been created yet, no API key is required. Otherwise, an API key must be included in the request header. Keep in mind that first user created will be the admin user.
Request Body
The date and time at which the user's account will expire. If null, the account will never expire. Must be in ISO 8601 format (e.g. 2023-11-03T00:00:00.000Z).
Not applicable if the user is an admin (first user). Admin accounts never expire.
If set to true, the response will include an API token with a 24-hour validity period, applicable for both Personal and Organization API access.
- 200
- 401
- 429
- 500
User successfully created
Schema
{
"id": "abcd1234",
"email": "johndoe@ztnet.network",
"name": "John Doe",
"expiresAt": "2023-10-28T00:00:00Z",
"apiToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9ihuihfds78tewgyre67dtfeswr7gyu3q8gfrv78ewrtgf8wrb98SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}
Unauthorized access, indicating that the request has not been applied because it lacks valid authentication credentials for the target resource.
Schema
A message detailing the reason for the unauthorized status.
{
"error": "Unauthorized: API key is missing or invalid."
}
API key is missing
{
"error": "Unauthorized: API key is missing."
}
API key is invalid
{
"error": "Unauthorized: API key is invalid."
}
Rate limit exceeded, indicating that the request was not accepted because the application has exceeded the rate limit for the API.
Schema
A message detailing the reason for exceeding the rate limit.
{
"error": "Rate limit exceeded. Try again in X minutes."
}
Example response for rate limit exceeded
{
"error": "Rate limit exceeded. Try again in 1 minute."
}
Internal Server Error, indicating that the server encountered an unexpected condition that prevented it from fulfilling the request.
Schema
A message detailing the unexpected condition encountered by the server.
{
"error": "Internal server error. Please try again later."
}
Example response for an internal server error
{
"error": "Internal server error. Please try again later."
}