> For the complete documentation index, see [llms.txt](https://docs.fromwolf.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fromwolf.com/user-api/registration-api.md).

# Registration API

Lets user signup on the platform

## Create User

<mark style="color:green;">`POST`</mark> `https://www.ondemandstaffing.app/api/v1/sign_up`

This endpoint allows you to post new users.&#x20;

#### Query Parameters

| Name       | Type   | Description                                                                                     |
| ---------- | ------ | ----------------------------------------------------------------------------------------------- |
| email      | string | Email of the user. User must not have an account on the platform.                               |
| password   | string | Must be a unique password and 8 characters or higher.                                           |
| user\_type | string | Must be either 'freelancer' or 'company'. Everything in lowercase. No other forms are accepted. |
| tenant     | string | Tenant key for the App.                                                                         |

#### Headers

| Name           | Type   | Description                      |
| -------------- | ------ | -------------------------------- |
| Authentication | string | API Key for the tenant required. |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{
  "status": 200,
  "message": "Success",
  "user": {
    "id": 34368,
    "email": "newtestuser@example.com",
    "created_at": "2019-12-07T05:58:08.683Z",
    "updated_at": "2019-12-07T10:18:38.341Z",
    "user_type": "freelancer",
    "provider": null,
    "uid": null,
    "invitation_token": null,
    "invitation_created_at": null,
    "invitation_sent_at": null,
    "invitation_accepted_at": null,
    "invitation_limit": null,
    "invited_by_id": null,
    "invited_by_type": null,
    "invitations_count": 0,
    "referred_by_id": null,
    "locale": "en",
    "country_id": 6,
    "authentication_token": "72wxmXSewkov_An3fWXz"
  }
}
```

{% endtab %}

{% tab title="401 You will get detailed error message, If the user already exists or the password is insufficient or we did not get all the required parameters.  " %}

```
{    "message": "Password too short."}
```

{% endtab %}
{% endtabs %}

An email is automatically sent to the user's email with a token. User must verify this token before proceeding.&#x20;

## Verify Token

<mark style="color:green;">`POST`</mark> `https://www.ondemandstaffing.app/api/v1/email_verification`

This method verifies the email address of the user. Account will experience a leash unless their email is confirmed.  \ <br>

#### Request Body

| Name                | Type   | Description                |
| ------------------- | ------ | -------------------------- |
| verification\_token | string | Token sent to user's email |
| tenant              | string | Tenant key for the app     |
| id                  | string | ID of the current user     |
| email               | number | email of the current user  |

{% tabs %}
{% tab title="200 Evaluation success." %}

```
{'verification_status' => 'Verified'} #for Valid Token
{'verification_status' => 'Incorrect', 'message' => "Token did not match"} . #Invalid Token
```

{% endtab %}
{% endtabs %}

Send optional parameter: '**resend\_email'** as true  to resend email with verification code to user. User should be locked for 24 hours after 10 attempts have been made. Minimum 60 seconds delay required between each request for resending email. Below is an example request.

```
{'resend_email':true, 'tenant':'tenant_key','id': 2392,'email':'johndoe@example.com}
```
