# Authentication API

## Start User Session

<mark style="color:green;">`POST`</mark> `https://api.wolf.xyz/api/v1/sign_in`

This endpoint lets you authenticate user via an API.

#### Headers

| Name           | Type   | Description       |
| -------------- | ------ | ----------------- |
| Authentication | string | Platforms API Key |

#### Request Body

| Name                                     | Type   | Description       |
| ---------------------------------------- | ------ | ----------------- |
| os\_type                                 | string | android or ios    |
| device\_id                               | string | User's device Id  |
| longitude                                | string | User's Longitude  |
| latitude                                 | string | User's Latitude   |
| email<mark style="color:red;">\*</mark>  | string | User Email        |
| password                                 | string | User Password     |
| tenant<mark style="color:red;">\*</mark> | string | Tenant key        |
| one\_time\_password                      | String | One Time Password |

{% tabs %}
{% tab title="200 User authenticated successfully. User type must be 'freelancer' to be able to access jobs.
Store authentication\_token for future requests and query on behalf of the user. " %}

```
        "status": true,
        "user":
        {
            "id": 34371,
            "email": "john.doe@example.com",
            "created_at": "2016-12-23T11:39:40.281Z",
            "updated_at": "2016-12-27T07:12:45.863Z",
            "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": "Ko1ufbEY8jbJWBuXRwaB"
        },
    "jobseeker": {
        "id": 41309,
        "user_id": 54604,
        "name": "Test Candidate",
        "age": 31,
        "country_id": 6,
        "city_id": 4968,
        "gender": "Mujer",
        "bio": "This is public Bio",
        "created_at": "2019-10-13T18:44:48.010Z",
        "updated_at": "2019-12-09T05:17:18.794Z",
        "profile_image_file_name": "Staffing_Bots.png",
        "profile_image_content_type": "image/png",
        "profile_image_file_size": 47332,
        "profile_image_updated_at": "2019-10-13T18:44:57.324Z",
        "banner_image_file_name": null,
        "banner_image_content_type": null,
        "banner_image_file_size": null,
        "banner_image_updated_at": null,
        "contact_email": "somenewstaff@example.com",
        "contact_phone": "+2124700666",
        "profile_link": null,
        "height": null,
        "weight": null,
        "hair_color": null,
        "hair_length": null,
        "skin_color": null,
        "eyes_color": null,
        "internal_rating": 5,
        "video_url": null,
        "rut": null,
        "address": "447 West 36th Street, New York, NY, USA",
        "latitude": 40.755771,
        "longitude": -73.997404,
        "average_rating": 5,
        "reliable": null,
        "verified": true,
        "ambassador": null,
        "fb_id": "3939393939121212",
        "token": "r9sov3hya5pg1wkqevg6wy7xu5bgri0t",
        "slug": "test-candidate",
        "videocv_file_name": null,
        "videocv_content_type": null,
        "videocv_file_size": null,
        "videocv_updated_at": null,
        "profiletype": null,
        "parser_response": null,
        "nationality": null,
        "date_of_birth": "1985-11-11",
        "driving_license": null,
        "parse_status": null,
        "interview_call": null,
        "internal_notes": "This is internal notes",
        "tenant_code": "abra_db",
        "clearance_stamp": "2019-10-13T18:47:26.584Z",
        "active": true,
        "profile_url": https://pic_url,
        "banner_url": https://pic_url
    },
        "device":
        {
            "id": 924,
            "user_id": 34371,
            "device_id": "111412421451478465465sa456sa4894s5a",
            "created_at": "2016-12-27T07:12:45.953Z",
            "updated_at": "2016-12-27T07:12:45.953Z",
            "os_type": "ios"
        },
        "location":
        {
            "id": 142697,
            "freelancer_id": 24138,
            "latitude": 28.7041,
            "longitude": 77.1025,
            "created_at": "2016-12-27T07:14:26.108Z",
            "updated_at": "2016-12-27T07:14:26.108Z"
        }
    }
```

{% endtab %}

{% tab title="404 Invalid user or password." %}

```
{    "message": "Invalid Email or Password"}
```

{% endtab %}
{% endtabs %}

Sample Request Body:&#x20;

```
{"email":"john.doe@example.com", "password": "password", "tenant": "abra_db","latitude":"28.7041","longitude":"77.1025","device_id":"111412421451478465465sa456sa4894s5a","os_type":"ios"}
```

## One time password request

<mark style="color:blue;">`GET`</mark> `https://api.wolf.xyz/api/v1/request_one_time_password`

Get email with one time password for the given user.&#x20;

#### Headers

| Name                                             | Type   | Description      |
| ------------------------------------------------ | ------ | ---------------- |
| Authentication<mark style="color:red;">\*</mark> | String | Platform API Key |

#### Request Body

| Name                                     | Type   | Description        |
| ---------------------------------------- | ------ | ------------------ |
| email<mark style="color:red;">\*</mark>  | String | Email of the user. |
| tenant<mark style="color:red;">\*</mark> | String | Tenant Key         |

{% tabs %}
{% tab title="200: OK We have successfully sent email to candidate with one time password. " %}

```javascript
{
    "status": true, 
    "message": "Email sent with one time password.", 
    "email": "johndoe@example.com"// Response
}
```

{% endtab %}
{% endtabs %}


---

# 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.fromwolf.com/user-api/authentication-api.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.
