---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://truto.one/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Sign up for Truto

> Source: https://truto.one/docs/api-reference/admin/authentication/signup/

`POST /auth/signup`

Resource: **Authentication**

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_token`** _(string)_
  The Turnstile token from the signup page.
- **`email`** _(string)_
  A work email. Free and disposable domains are refused.
- **`name`** _(string)_
  The person's full name. Optional; defaults to the email's local part, title-cased.
- **`team_name`** _(string)_
  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.
- **`region`** _(string)_
  The data region, an `id` from `GET /auth/signup/regions`. Defaults to that list's `default`.

## Response body

- **`success`** _(boolean)_
- **`expires_in`** _(integer)_
  Seconds the verification link works (86400).

## Errors

| Status | Description |
| :----- | :---------- |
| `400` | A 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`). |
| `404` | Self-serve signup is not offered here (no region is set up). |
| `409` | The 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). |
| `413` | The request body is over 64 KB. |
| `429` | Another signup for this email in the last 60 seconds, or too many from this IP. |
| `503` | The account could not be set up. Retry; the same request finishes it. |

## Code examples

### curl

```bash
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"
}'
```

### JavaScript

```javascript
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);
```

### Python

```python
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())
```
