Skip to content
POST /auth/signup

Creates a team with 3 environments (development, staging, production) and its first admin, and emails a link to verify the address. The account cannot sign in until the link is opened (GET /auth/verify-email). An account that is not verified within 24 hours is removed.

Protected by Turnstile (cf_token), a per-IP limit (20 a minute) and one request per email address a minute (429). A request for an address whose account is still waiting for verification sends the link again and answers 201.

region picks where the account's data is kept: one of the ids GET /auth/signup/regions lists. Without it, the default region. A request for an address that already has an account, or a signup still waiting for verification, is answered where that account is, whatever region says.

name and team_name are optional. A missing one is filled from the email: the name from the part before @ (jane.doe becomes Jane Doe), the team's name from the domain (acme.com becomes Acme). A value that is sent is used as is. Free and disposable email domains (such as gmail.com) are refused: 400 with truto_error_code work_email_required.

Request Body

cf_tokenstring

The Turnstile token from the signup page.

emailstring

A work email. Free and disposable domains are refused.

namestring

The person's full name. Optional; defaults to the email's local part, title-cased.

regionstring

The data region, an id from GET /auth/signup/regions. Defaults to that list's default.

team_namestring

The company name, the team's name. Optional, and not blank when sent: it is stored trimmed. Defaults to the email domain's first label, title-cased. A request that sends the link again for a pending signup keeps the team's first name.

Response Body

expires_ininteger

Seconds the verification link works (86400).

successboolean

Errors

StatusDescription
400A missing or invalid field (a blank team_name among them), an invalid email, a free or disposable email domain (truto_error_code work_email_required), a cf_token Turnstile refused, or a region that is not offered (message: Unknown region).
404Self-serve signup is not offered here (no region is set up).
409The email already has a Truto account (message: You already have a Truto account. Please sign in.), or a signup for it is still waiting for verification in another region than region (code signup_pending_in_region, with that region's id in region; no link is sent, and a request for that region sends it again).
413The request body is over 64 KB.
429Another signup for this email in the last 60 seconds, or too many from this IP.
503The account could not be set up. Retry; the same request finishes it.
curl -X POST 'https://api.truto.one/auth/signup' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "cf_token": "your_cf_token",
  "email": "your_email",
  "name": "your_name",
  "team_name": "your_team_name",
  "region": "your_region"
}'
const body = {
  "cf_token": "your_cf_token",
  "email": "your_email",
  "name": "your_name",
  "team_name": "your_team_name",
  "region": "your_region"
};

const response = await fetch('https://api.truto.one/auth/signup', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
import requests

url = "https://api.truto.one/auth/signup"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}
payload = {
    "cf_token": "your_cf_token",
    "email": "your_email",
    "name": "your_name",
    "team_name": "your_team_name",
    "region": "your_region"
}

response = requests.post(url, headers=headers, params=params, json=payload)
print(response.json())