Aller au contenu

Emite e renova tokens OAuth do MCP

POST/oauth/token

Auth
Jeton requis
Clé d’API:
Clé d’API non acceptée
Les descriptions des endpoints viennent directement de la spécification de l’API et sont en portugais pour l’instant. L’interface autour est traduite.

`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.

Corps de la requête application/x-www-form-urlencoded

NomTypeDescription
grant_typeobligatoireauthorization_code | refresh_token
client_idobligatoirestring
client_secretfacultatifstring
codefacultatifstring
redirect_urifacultatifstring
code_verifierfacultatifstring
refresh_tokenfacultatifstring
resourcefacultatifstring

Réponses

StatutDescription
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`.

Exemple curl

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"}'