> For the complete documentation index, see [llms.txt](https://docs.editran.onesait.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.editran.onesait.com/documentacion-editran/connect-3.2-en/api/login.md).

# Login

In order to be able to use the rest of the APIs in the Interoperability module, it is necessary to authenticate beforehand through the operation of **login**. This operation provides us with a **JWT token**, which must be included in subsequent API calls so that they are authorized correctly.

## Important considerations

* The **tokens have an expiration**. If a token expires, the API will return an authentication error. In that case, you simply need to make the login request again to obtain a new one.
* The **token inherits the permissions of the authenticated user**. If the user has restrictions (for example, cannot operate channels or access certain resources), those restrictions will also apply in API calls.
* The **token must be included** in the header `Authorization` of all protected requests using the prefix `Bearer`.

***

## Login request

**Method:** `POST`\
**URL:** `https://<your_server/integration/v1/auth/login`\
**Headers:** Content-Type: application/json

**Request body:**

```json
{
  "email": "usuario_editran@empresa.com",
  "password": "<your_editran_password>"
}
```

### curl example

```bash
curl -k 'https://<your_server>/integration/v1/auth/login' --header 'Content-Type: application/json' --data-raw '{"email":"usuario_editran@empresa.com","password":"<your_editran_password>"}'
```

### Expected response

```json
{
  "refresh_token": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJncnJhbWlyZXpAbWluc2FpdC5jb20iLCJyZWZyZXNoIjp0cnVlLCJleHAiOjE3NDgzNjc4OTh9.lpBRiR95ydlWSRvfV1WGp7MKovOmrFi5zLcozDtOW27XHOJWGJgdpJMR2DYny5XlwP0IZzALS2RiZCuRMvqi0Q",
  "expiration_token": "27-05-2025 19:14:58",
  "user": {
    "lastName": "Nadie",
    "secondLastName": "",
    "role": "Global Administrator",
    "auths": {
      "operate": true,
      "administration": true,
      "editChannels": true,
      "editranFF": true,
      "contactChannels": true
    },
    "name": "Juan",
    "language": "ES",
    "email": "juanNadie@minsait.com"
  },
  "token": "Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJncnJhbWlyZXpAbWluc2FpdC5jb20iLCJBdXRob3JpemF0aW9ucyI6eyJhdXRocyI6eyJvcGVyYXRlIjp0cnVlLCJhZG1pbmlzdHJhdGlvbiI6dHJ1ZSwiZWRpdENoYW5uZWxzIjp0cnVlLCJlZGl0cmFuRkYiOnRydWUsImNvbnRhY3RDaGFubmVscyI6dHJ1ZX19LCJyZWZyZXNoIjpmYWxzZSwiZXhwIjoxNzQ4MzY2MDk4fQ.LLLPDjszyICXsoG5u6musFzRdA-Paw-Y7OLLwKVXWKlSfhP45RUiviK7iqkwNPj2kt52PsDGvM5VXy9F2S6dxA"
}
```

where what interests us is the **token** that we will use in the rest of the API calls.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.editran.onesait.com/documentacion-editran/connect-3.2-en/api/login.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
