API Reference
Get a token
/oauth/tokenhttps://oauth.bb.mimicr.dev · provider: https://oauth.hm.bb.com.brIssues an access token through the client_credentials flow. Send client_id:client_secret in Base64 in the Authorization: Basic header and, in the application/x-www-form-urlencoded body, grant_type=client_credentials and scope with the scopes the application will use, separated by one space (commas are rejected).
The token is opaque (not a JWT) and lasts 600 seconds. Reuse it until it expires: in homologação BB accepts at most 10 token requests every 10 minutes. The returned scope does not follow the request order.
The token does not replace the application key: every API call also carries ?gw-dev-app-key=<app-key>.
In Mimicr, the 10-tokens-per-10-minutes limit only applies with the tokenRateLimit homologation toggle on; the 11th request answers 429 too_many_requests.
Authorization
Public route, no token.
Body
application/x-www-form-urlencodedAlways client_credentials.
client_credentialsScopes separated by one space, case-sensitive. Required. Use only scopes granted to the application.
50 values
cob.readcob.writecobv.readcobv.writelotecobv.readlotecobv.writepayloadlocation.readpayloadlocation.writepix.readpix.writepix-bb.readwebhook.readwebhook.writerec.readrec.writesolicrec.readsolicrec.writecobr.readcobr.writepayloadlocationrec.readpayloadlocationrec.writewebhookrec.readwebhookrec.writewebhookcobr.readwebhookcobr.writewebhooksolicrec.readwebhooksolicrec.writecobrancas.boletos-infocobrancas.boletos-requisicaocobrancas.convenio-requisicaopagamentos-lote.boletos-infopagamentos-lote.boletos-requisicaopagamentos-lote.cancelar-requisicaopagamentos-lote.devolvidos-infopagamentos-lote.guias-codigo-barras-infopagamentos-lote.guias-codigo-barras-requisicaopagamentos-lote.lancamentos-infopagamentos-lote.lotes-infopagamentos-lote.lotes-requisicaopagamentos-lote.mtlspagamentos-lote.pagamentos-codigo-barras-infopagamentos-lote.pagamentos-guias-sem-codigo-barras-infopagamentos-lote.pagamentos-guias-sem-codigo-barras-requisicaopagamentos-lote.pagamentos-infopagamentos-lote.pix-infopagamentos-lote.transferencias-infopagamentos-lote.transferencias-pix-infopagamentos-lote.transferencias-pix-requisicaopagamentos-lote.transferencias-requisicaoextrato-info"cob.write cob.read pix.read"Responses
200Token issued.
Opaque token. Send it as Authorization: Bearer <token>; do not try to decode it.
BearerLifetime in seconds (600).
600Granted scopes, space-separated, in BB's own order.
"pix.read cob.write cob.read"400Invalid request: no Authorization: Basic (invalid_request), grant_type other than client_credentials (unsupported_grant_type) or a missing, unknown or comma-separated scope (invalid_scope).
OAuth error code.
invalid_requestinvalid_clientunsupported_grant_typeinvalid_scopetoo_many_requestsError description, in Portuguese.
"Identificador ou credencial inválidos"401Invalid client_id or client_secret (invalid_client).
OAuth error code.
invalid_requestinvalid_clientunsupported_grant_typeinvalid_scopetoo_many_requestsError description, in Portuguese.
"Identificador ou credencial inválidos"405A method other than POST: Method Not Allowed as text/html.
429More than 10 token requests in 10 minutes (homologação). In Mimicr, only with the tokenRateLimit toggle on.
OAuth error code.
invalid_requestinvalid_clientunsupported_grant_typeinvalid_scopetoo_many_requestsError description, in Portuguese.
"Identificador ou credencial inválidos"