# Login API

```
POST: /api/partner/login
```

Create a new session for the user

{% hint style="info" %}
Security requirements: Encrypt data and include a digital signature
{% endhint %}

#### Request Body <a href="#request-body" id="request-body"></a>

<details>

<summary>Model</summary>

* key (string, required),

  Key decrypts (encrypted) data. How to establish refer to the section: Encryption of transmitted data and authentication of digital signature
* data (string, required),

  Data with electronic signature (encrypted). How to decrypt refer to the section: Encryption of transmitted data and authentication of digital signature

  *Signature data schema:*

  ```
  <access_code>|<user_id>|<layout>|<product>
  ```

  *Original data schema:*

  ```
  <access_code>|<user_id>|<layout>|<product>|<signature>
  ```

  * access\_code (String, required)

    Access code provided by Gotadi to Partners.
  * user\_id (String, required)

    User identifier on the Partner’s system.
  * layout (String, optional)

    The value is dual or single corresponding to 2 types of layout Gotadi provides to partners.
  * product (String, required)
    * The value is flight or hotel. Corresponding to 2 products Gotadi provided to partners.
    * When the layout is single: Used to select the display service on the webview.
    * When the layout is dual: Used to focus the service displayed on the webview.

</details>

#### Response <a href="#response" id="response"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

* key (String, required)

  Key decrypts (encrypted) data. How to establish refer to the section: Encryption of transmitted data and authentication of digital signature
* data (String, required)

  Data with electronic signature (encrypted). How to decrypt refer to the section: Encryption of transmitted data and authentication of digital signature

  *Signature data schema:*

  ```
  <access_code>|<error_code>|<redirect_url>
  ```

  *Original data schema:*

  ```
  <access_code>|<error_code>|<redirect_url>|<signature>
  ```

  * access\_code (String, required)

    Access code provided by Gotadi to Partners.
  * error\_code (String, required)

    [Error code](https://developer.gotadi.com/dev-guide-en/agency-partner/integration-documentation/#error-code)
  * redirect\_url (String, optional)

    Link to Gotadi Webview with jwtToken included.

    ```
    https://<gotadi_webview_url>?access_token=<jwtToken>
    ```

</details>


---

# 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://developer.gotadi.com/english/b2b2c-partner/api-method/login-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.
