---
title: "Solicitação do token"
method: POST
path: "/oauth/token"
---

# Solicitação do token

`POST /oauth/token`

## Request

- Base URL: `https://sandbox.melhorenvio.com.br`
- URL: `https://sandbox.melhorenvio.com.br/oauth/token`
- Auth: none required
- TypeScript: <https://skmtc.dev/melhorenvio/apis/api-melhor-envio-sandbox/docs/oauth/token/post.ts> (a function with typed inputs; its response is checked against the schema)

Autenticação

## Headers

- `Accept` string, required
- `Content-Type` string, required
- `User-Agent` string, required

## Request body

- object
  - `grant_type` string, required: Tipo do modo de solicitação de token
  - `client_id` integer, required: Obtido após a criação do aplicativo no painel do Melhor Envio
  - `client_secret` string, required: O mesmo do aplicativo gerado no painel Melhor Envio
  - `redirect_uri` string, required: Deve ser estática e conforme configurada no app dentro do painel Melhor Envio
  - `code` string, required: Resposta da autenticação
  - `refresh_token` string, required: Obtido da resposta junto à solicitação de token

## Response `200`

200

- object
  - `token_type` string
  - `expires_in` integer
  - `access_token` string
  - `refresh_token` string

## Other responses

- `401`: 401

## Changes

- **2026-11-03** `ffbe3939fc36`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/melhorenvio/apis/api-melhor-envio-sandbox/changes/oauth/token/post.md)

---

[API](https://skmtc.dev/melhorenvio/apis/api-melhor-envio-sandbox.md) - [All operations](https://skmtc.dev/melhorenvio/apis/api-melhor-envio-sandbox/llms.txt) - [OpenAPI document](https://skmtc.dev/melhorenvio/apis/api-melhor-envio-sandbox/revisions/ffbe3939fc36?raw)
