Skip to content

Emite e renova tokens OAuth do MCP

POST/oauth/token

Auth
Requires a token
Endpoint descriptions come straight from the API specification and are in Portuguese for now. The interface around them is translated.

`grant_type=authorization_code` troca o código pelo par de tokens, conferindo o PKCE (`code_verifier`) e a `redirect_uri`. `grant_type=refresh_token` renova e **gira** o refresh token: reapresentar um já usado revoga a conexão inteira. Access token de 1 hora, refresh de 30 dias, ambos opacos e presos à conexão (membro + comunidade). Aceita `application/x-www-form-urlencoded` ou JSON. Limite de 60 por minuto por IP. Público.

Request body application/x-www-form-urlencoded

NameTypeDescription
grant_typerequiredauthorization_code | refresh_token
client_idrequiredstring
client_secretoptionalstring
codeoptionalstring
redirect_urioptionalstring
code_verifieroptionalstring
refresh_tokenoptionalstring
resourceoptionalstring

Responses

StatusDescription
200`{ access_token, token_type: Bearer, expires_in, refresh_token, scope }`.
400`{ error, error_description }` — `invalid_grant`, `invalid_request`, `unsupported_grant_type`.
401`invalid_client`.

curl example

curl -X POST "https://api.memberfy.net/oauth/token" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"grant_type":"authorization_code","client_id":"string"}'