# post\_\_user\_register

`POST /user/register`

*Register User*

Register a new user with internal email/password authentication.

This endpoint creates a new user account and organization. The system automatically:

* Validates email format and uniqueness
* Checks password complexity requirements
* Creates an organization based on company domain
* Assigns a free trial subscription
* Sends email verification

**Password Requirements:**

* Minimum 8 characters
* Must contain uppercase letter
* Must contain lowercase letter
* Must contain number

**Email Verification:**

* Verification email sent immediately after registration
* Verification tokens expire after 24 hours
* Write operations blocked until email verification

**Account Types:**

* **Personal**: Use `isBusiness: false` for personal accounts
* **Business**: Use `isBusiness: true` for business accounts with company details

#### TypeScript Client Library

```typescript
public userRegister = async (data: RegisterBody): Promise<RegisterResponse> => {
  return this.makeRequest<RegisterResponse>('user/register', 'POST', data);
};
```

#### Code Samples

{% tabs %}
{% tab title="Shell" %}

```shell
# You can also use wget
curl -X POST https://backend.flashback.tech/user/register \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'
```

{% endtab %}

{% tab title="HTTP" %}

```http
POST https://backend.flashback.tech/user/register HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: application/json
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const inputBody = '{
  "email": "john.doe@company.com",
  "password": "SecurePass123",
  "firstName": "John",
  "lastName": "Doe",
  "companyName": "Acme Corporation",
  "companyWebsite": "https://acme.com",
  "isBusiness": true
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'Bearer {access-token}'
};

fetch('https://backend.flashback.tech/user/register',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'rest-client'
require 'json'

headers = {
  'Content-Type' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'Bearer {access-token}'
}

result = RestClient.post 'https://backend.flashback.tech/user/register',
  params: {
  }, headers: headers

p JSON.parse(result)
```

{% endtab %}

{% tab title="Python" %}

```python
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://backend.flashback.tech/user/register', headers = headers)

print(r.json())
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer {access-token}',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','https://backend.flashback.tech/user/register', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...
```

{% endtab %}

{% tab title="Java" %}

```java
URL obj = new URL("https://backend.flashback.tech/user/register");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
       "bytes"
       "net/http"
)

func main() {

    headers := map[string][]string{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"Bearer {access-token}"},
    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://backend.flashback.tech/user/register", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}
```

{% endtab %}
{% endtabs %}

> Body parameter

```json
{
  "email": "john.doe@company.com",
  "password": "SecurePass123",
  "firstName": "John",
  "lastName": "Doe",
  "companyName": "Acme Corporation",
  "companyWebsite": "https://acme.com",
  "isBusiness": true
}
```

**Parameters**

| Name             | In   | Type          | Required | Description                                          |
| ---------------- | ---- | ------------- | -------- | ---------------------------------------------------- |
| body             | body | object        | true     | none                                                 |
| » email          | body | string(email) | true     | User's email address (must be unique)                |
| » password       | body | string        | true     | Password meeting complexity requirements             |
| » firstName      | body | string        | true     | User's first name                                    |
| » lastName       | body | string        | true     | User's last name                                     |
| » companyName    | body | string        | true     | Company or organization name                         |
| » companyWebsite | body | string        | false    | Company website URL (optional for personal accounts) |
| » isBusiness     | body | boolean       | true     | Whether this is a business account                   |

> Example responses

> 201 Response

```json
{
  "success": true,
  "accessToken": "string",
  "refreshToken": "string",
  "tokenId": "string",
  "user": {
    "id": "string",
    "email": "string",
    "name": "string",
    "orgId": "string",
    "image_url": "string"
  }
}
```

**Responses**

| Status | Meaning                                                          | Description                  | Schema |
| ------ | ---------------------------------------------------------------- | ---------------------------- | ------ |
| 201    | [Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)     | User registered successfully | Inline |
| 400    | [Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1) | Registration failed          | Inline |

**Response Schema**

Status Code **201**

| Name           | Type    | Required | Restrictions | Description                             |
| -------------- | ------- | -------- | ------------ | --------------------------------------- |
| » success      | boolean | false    | none         | none                                    |
| » accessToken  | string  | false    | none         | JWT access token for API authentication |
| » refreshToken | string  | false    | none         | JWT refresh token for token renewal     |
| » tokenId      | string  | false    | none         | Internal token identifier               |
| » user         | object  | false    | none         | none                                    |
| »» id          | string  | false    | none         | User's unique identifier                |
| »» email       | string  | false    | none         | User's email address                    |
| »» name        | string  | false    | none         | User's display name                     |
| »» orgId       | string  | false    | none         | Organization identifier                 |
| »» image\_url  | string  | false    | none         | User's profile image URL                |

Status Code **400**

| Name          | Type    | Required | Restrictions | Description                  |
| ------------- | ------- | -------- | ------------ | ---------------------------- |
| » success     | boolean | false    | none         | none                         |
| » error\_code | string  | false    | none         | Specific error code          |
| » message     | string  | false    | none         | Human-readable error message |

**Enumerated Values**

| Property    | Value                   |
| ----------- | ----------------------- |
| error\_code | EMAIL\_EXISTS\_ACTIVE   |
| error\_code | EMAIL\_EXISTS\_INACTIVE |
| error\_code | WEAK\_PASSWORD          |
| error\_code | INVALID\_INPUT          |
| error\_code | ORG\_BANNED             |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flashback.tech/support-reference/platform-api-reference/user-account/post__user_register.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
