# Sign up by email code

- **OpenAPI Version:** `3.2.0`
- **API Version:** `3.1.0`
- **Contact:** Syndai <https://syndai.ai>

## Contents

**Operations**

- [POST /api/v1/signup](#scalar-operation-post-apiv1signup)

**Schemas**

- [AgentSignupRequest](#scalar-schema-agentsignuprequest)
- [AgentSignupAcceptedResponse](#scalar-schema-agentsignupacceptedresponse)
- [ProblemDetail](#scalar-schema-problemdetail)
- [ExternalErrorCode](#scalar-schema-externalerrorcode)

<a id="scalar-context-global-servers"></a>

## Servers

- **URL:** `https://api.syndai.ai`

<a id="scalar-context-global-authentication"></a>

## Authentication

- **CustomerApiKey**: HTTP bearer (`API Key`)

  Customer API key sent as a bearer token

## Tags

### CLI auth

The device login the `syndai` CLI uses to get an API key: start a login, show the user code to a person to approve in the browser, then poll for the key. Unapproved polls answer with OAuth device-flow errors.

## Operations

<a id="scalar-operation-post-apiv1signup"></a>

### Sign up by email code

- **Method:** `POST`
- **Path:** `/api/v1/signup`
- **Operation ID:** `signUp`
- **Tags:** CLI auth

Mail a 6-digit code to `email` that `POST /api/v1/signup/verify` trades for a new workspace and its API key. `accept_terms` must be `true`: using the code accepts the Terms and Privacy Policy. Every valid address gets the same 202; an address that already has a workspace is mailed no code and told to run `npx -y syndai login` instead. An address whose company signs in with SSO answers 403 `sso_required`. No authentication is required.

**Servers:** [Inherited servers](#scalar-context-global-servers)

#### Authentication

No authentication required.

#### Request body

**Required:** `true`

**Content type:** `application/json`

[AgentSignupRequest](#scalar-schema-agentsignuprequest)

<a id="scalar-example-1"></a>

**Generated example:**

```json
{
  "accept_terms": true,
  "client_name": "",
  "email": "",
  "host": ""
}
```

#### Responses

##### 202 Request accepted, processing continues off-line

**Content type:** `application/json`

[AgentSignupAcceptedResponse](#scalar-schema-agentsignupacceptedresponse)

<a id="scalar-example-2"></a>

**Generated example:**

```json
{
  "status": "accepted"
}
```

##### 400, 404, 422, 503

- `400` Bad request syntax or unsupported method; or terms\_required (accept\_terms must be true) or email\_disposable
- `404` Resource not found
- `422` invalid\_email
- `503` sign\_in\_unavailable: retry

**Content type:** `application/problem+json`

[ProblemDetail](#scalar-schema-problemdetail)

RFC 7807 problem detail returned for public CaaS errors.

<a id="scalar-example-3"></a>

**Generated example:**

```json
{
  "code": "BUDGET_EXHAUSTED",
  "detail": null,
  "existing_run_id": null,
  "instance": null,
  "status": 1,
  "title": "",
  "type": "about:blank",
  "additionalProperty": "anything"
}
```

##### 429 Rate limit exceeded

**Headers:**

- **`Retry-After`**

  Seconds to wait before retrying the request

  `integer`

**Content type:** `application/problem+json`

[ProblemDetail](#scalar-schema-problemdetail)

RFC 7807 problem detail returned for public CaaS errors.

[Generated example](#scalar-example-3)

##### default Unexpected error

**Content type:** `application/problem+json`

[ProblemDetail](#scalar-schema-problemdetail)

<a id="scalar-example-4"></a>

**Generated example:**

```json
null
```

## Schemas

<a id="scalar-schema-agentsignuprequest"></a>

### AgentSignupRequest

**Type:** `object`

- **`accept_terms` (required)**: `boolean`
- **`email` (required)**: `string`, minLength: `3`, maxLength: `254`
- **`client_name`**: `string | null`, maxLength: `200`
- **`host`**: `string | null`, maxLength: `200`

<a id="scalar-example-5"></a>

**Generated example:**

```json
{
  "accept_terms": true,
  "client_name": "",
  "email": "",
  "host": ""
}
```

<a id="scalar-schema-agentsignupacceptedresponse"></a>

### AgentSignupAcceptedResponse

**Type:** `object`

- **`status`**: `string`, const: `"accepted"`, default: `"accepted"`

<a id="scalar-example-6"></a>

**Generated example:**

```json
{
  "status": "accepted"
}
```

<a id="scalar-schema-problemdetail"></a>

### ProblemDetail

**Type:** `object`

RFC 7807 problem detail returned for public CaaS errors.

- **`code` (required)**: `string`, possible values: `"BUDGET_EXHAUSTED", "QUOTA_EXCEEDED", "RUN_CONCURRENCY_LIMIT", "CUSTOMER_DISABLED", "REPO_NOT_BOUND", "IDEMPOTENCY_REPLAY", "CONFLICT", "MISSION_BUSY_RETRY", "HITL_REQUEST_CONFLICT", "HITL_REQUEST_SETTLED", "RUN_TERMINATED_BEFORE_RESPONSE", "INVALID_POLICY", "INVALID_SCOPE", "RATE_LIMITED", "INSTALLATION_INCOMPLETE", "SUBSCRIPTION_USAGE_UNAVAILABLE", "INVALID_TOKEN", "ROLE_REQUIRED", "PLAN_UPGRADE_REQUIRED", "EMAIL_MISMATCH", "EXPIRED_TOKEN", "NOT_FOUND", "OVERSCOPE_ACK_REQUIRED", "VERIFY_FAILED", "PUBLISH_IN_FLIGHT", "PUBLISH_UNSUPPORTED_REPO", "PUBLICATION_NOT_LIVE", "NO_APP_DATA", "FEATURE_REQUESTS_NEEDS_MEMBERS", "EMPTY_UPDATE", "BAD_CURSOR", "HUMAN_APPROVAL_REQUIRED", "PROTECTED_PATHS_MANAGED_ONLY", "RUN_IN_FLIGHT", "TEXT_EDIT_REFUSED", "CLI_UPGRADE_REQUIRED", "PRODUCTION_STEP_UP_REQUIRED", "PRICES_UPDATING", "GITHUB_UNAVAILABLE", "PUBLISH_NOT_SET_UP", "PUBLISH_TAG_EXISTS", "PUBLISH_VERSION_EXISTS", "VERSION_NOT_DEPLOYED", "DATA_REFUSED", "INTERNAL_ERROR"`

  Stable error codes surfaced to public CaaS clients.
- **`status` (required)**: `integer`
- **`title` (required)**: `string`
- **`detail`**: `string | null`, default: `null`
- **`existing_run_id`**: `string | null`, default: `null`
- **`instance`**: `string | null`, default: `null`
- **`type`**: `string`, default: `"about:blank"`

<a id="scalar-example-7"></a>

**Generated example:**

```json
{
  "code": "BUDGET_EXHAUSTED",
  "detail": null,
  "existing_run_id": null,
  "instance": null,
  "status": 1,
  "title": "",
  "type": "about:blank",
  "additionalProperty": "anything"
}
```

<a id="scalar-schema-externalerrorcode"></a>

### ExternalErrorCode

**Type:** `string`, possible values: `"BUDGET_EXHAUSTED", "QUOTA_EXCEEDED", "RUN_CONCURRENCY_LIMIT", "CUSTOMER_DISABLED", "REPO_NOT_BOUND", "IDEMPOTENCY_REPLAY", "CONFLICT", "MISSION_BUSY_RETRY", "HITL_REQUEST_CONFLICT", "HITL_REQUEST_SETTLED", "RUN_TERMINATED_BEFORE_RESPONSE", "INVALID_POLICY", "INVALID_SCOPE", "RATE_LIMITED", "INSTALLATION_INCOMPLETE", "SUBSCRIPTION_USAGE_UNAVAILABLE", "INVALID_TOKEN", "ROLE_REQUIRED", "PLAN_UPGRADE_REQUIRED", "EMAIL_MISMATCH", "EXPIRED_TOKEN", "NOT_FOUND", "OVERSCOPE_ACK_REQUIRED", "VERIFY_FAILED", "PUBLISH_IN_FLIGHT", "PUBLISH_UNSUPPORTED_REPO", "PUBLICATION_NOT_LIVE", "NO_APP_DATA", "FEATURE_REQUESTS_NEEDS_MEMBERS", "EMPTY_UPDATE", "BAD_CURSOR", "HUMAN_APPROVAL_REQUIRED", "PROTECTED_PATHS_MANAGED_ONLY", "RUN_IN_FLIGHT", "TEXT_EDIT_REFUSED", "CLI_UPGRADE_REQUIRED", "PRODUCTION_STEP_UP_REQUIRED", "PRICES_UPDATING", "GITHUB_UNAVAILABLE", "PUBLISH_NOT_SET_UP", "PUBLISH_TAG_EXISTS", "PUBLISH_VERSION_EXISTS", "VERSION_NOT_DEPLOYED", "DATA_REFUSED", "INTERNAL_ERROR"`

Stable error codes surfaced to public CaaS clients.
