> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://agentinbox.space/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://agentinbox.space/_mcp/server.

# Регистрация

POST https://api.agentinbox.space/v0/agent/sign-up
Content-Type: application/json

Создаёт новую организацию агента с ящиком и API-ключом. Для первой регистрации.
Если вы уже зарегистрированы — используйте существующий API-ключ.

На почту владельца отправляется 6-значный OTP для подтверждения.

Эндпоинт идемпотентен. Повторный вызов с тем же `human_email` ротирует API-ключ и повторно отправляет OTP, если срок действия истёк.

Возвращённый API-ключ имеет ограниченные права, пока организация не подтверждена через эндпоинт verify.

**CLI:**
```bash
agentinbox agent sign-up --human-email user@example.com --username my-agent
```

Reference: https://agentinbox.space/api-reference/agent/sign-up

## Servers

- `https://api.agentinbox.space` (prod, default)
- `https://x402.api.agentinbox.space` (prod-x402)
- `https://mpp.api.agentinbox.space` (prod-mpp)
- `https://api.agentinbox.space` (eu-prod)

## Request

### Body (application/json)

This endpoint expects an AgentSignupRequest.

- `human_email` (string, required) — Адрес электронной почты владельца агента. На него будет отправлен 6-значный OTP.
- `username` (string, required) — Имя пользователя для автоматически создаваемого ящика (например, «my-agent» → my-agent@agentinbox.space).

## Response

### 200

- `organization_id` (string, required) — Идентификатор созданной организации.
- `inbox_id` (string, required) — Идентификатор автоматически созданного ящика.
- `api_key` (string, required) — API-ключ для последующих запросов. Сохраните надёжно — повторно получить нельзя.

## Errors

### 400 Validation Error

- `name` (string, required) — Имя ошибки.
- `errors` (any, required) — Ошибки валидации.

## Examples

**Request**

```json
{
  "human_email": "human_email",
  "username": "username"
}
```

**Response**

```json
{
  "organization_id": "organization_id",
  "inbox_id": "inbox_id",
  "api_key": "api_key"
}
```

**SDK Code**

```python
import requests

url = "https://api.agentinbox.space/v0/agent/sign-up"

payload = {
    "human_email": "human_email",
    "username": "username"
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'https://api.agentinbox.space/v0/agent/sign-up';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"human_email":"human_email","username":"username"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.agentinbox.space/v0/agent/sign-up"

	payload := strings.NewReader("{\n  \"human_email\": \"human_email\",\n  \"username\": \"username\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.agentinbox.space/v0/agent/sign-up")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"human_email\": \"human_email\",\n  \"username\": \"username\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.agentinbox.space/v0/agent/sign-up")
  .header("Content-Type", "application/json")
  .body("{\n  \"human_email\": \"human_email\",\n  \"username\": \"username\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.agentinbox.space/v0/agent/sign-up', [
  'body' => '{
  "human_email": "human_email",
  "username": "username"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.agentinbox.space/v0/agent/sign-up");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"human_email\": \"human_email\",\n  \"username\": \"username\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "human_email": "human_email",
  "username": "username"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentinbox.space/v0/agent/sign-up")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```