---
title: "Gerar Token de autenticação"
method: POST
path: "/v1/authentication"
tags: ["Authorization"]
---

# Gerar Token de autenticação

`POST /v1/authentication`

## Request

- Base URL: `https://datatrustapihml.clearsale.com.br`
- URL: `https://datatrustapihml.clearsale.com.br/v1/authentication`
- Auth: none declared

Todas as requisições submetidas à nossa API devem contemplar um token de autenticação gerado através de um usuário e senha que devem ser fornecidos pela ClearSale. Neste processo, além do token retornamos seu tempo de expiração em segundos. Portanto, é necessário que contemple no seu desenvolvimento o gerenciamento da vida útil do token com base nesse tempo de expiração.

Para o recebimento desse dado é necessário que reserve um espaço de 2048 caracteres.

## Request body

- User
  - `username` string, required: Nome do usuário da API
  - `password` string, required: Senha do usuário da API

## Response `200`

Ok

- LoginSuccessfulResponseExample
  - `token` string, nullable
  - `expiresInSeconds` integer

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `500`: Internal Server Error

## Changes

- **2026-11-03** `48d050829038`: 7 warning, 7 info
  - removed the optional property `creationDateUtc` from the response with the `200` status
  - removed the optional property `criterion` from the response with the `200` status
  - removed the optional property `document` from the response with the `200` status
  - removed the optional property `id` from the response with the `200` status
  - …10 more

[Operation history](https://skmtc.dev/serasaexperian/apis/autentica-o/changes/v1/authentication/post.md)

---

[API](https://skmtc.dev/serasaexperian/apis/autentica-o.md) - [All operations](https://skmtc.dev/serasaexperian/apis/autentica-o/llms.txt) - [OpenAPI document](https://skmtc.dev/serasaexperian/apis/autentica-o/revisions/48d050829038?raw)
