POST /oauth/clients
Registra um client
- Acesso: Pública
- Serviço:
https://auth-api.axuz.net
Autenticação aceita
sessionCookie— Sessão plena Axuz (cookie de sessão da casa). Sessão restrita é 403 enrollment_required.
Sessão plena + Origin confiável. client_secret (só confidential) aparece UMA vez, nesta resposta; no banco fica o SHA-256. Limite de 20 clients ativos por dono. Escopos sensíveis (todo files:*, tasks:*, forms:*, me:*, mais webhooks:manage e mail:send) exigem client verified (aprovação de operador) — no self-service são rejeitados. Nome que imita "Axuz" (variantes com espaços, homoglifos, leet) é rejeitado para client não verificado. redirect_uris: https, ou http só em loopback (localhost, 127.0.0.1, [::1]), ou esquema customizado (public/native); nunca fragmento, wildcard, javascript:/data:.
A descrição desta operação vem do comentário do handler no código (em português).
Parâmetros
Sem parâmetros.
Corpo da requisição
application/json · Obrigatório
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
name | string | sim | |
client_type | string | sim | enum: |
redirect_uris | array<string> | sim | |
scopes | array<string> | sim | |
team_id | string<uuid> | não | Opcional; exige owner/admin do time. |
{
"name": "string",
"client_type": "public",
"redirect_uris": [
"string"
],
"scopes": [
"string"
],
"team_id": "00000000-0000-0000-0000-000000000000"
}Respostas
201
Criado.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
client_id | string | sim | |
name | string | sim | |
client_type | string | sim | enum: |
redirect_uris | array<string> | sim | |
scopes | array<string> | sim | |
team_id | string<uuid> | null | não | |
verified | boolean | sim | |
created_at | string<date-time> | sim | |
client_secret | string | não | Só confidential; mostrado UMA vez. |
400
Erro do protocolo (RFC 6749 §5.2).
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim | invalid_request, invalid_client, invalid_grant, unauthorized_client, unsupported_grant_type, invalid_scope, invalid_token, insufficient_scope, access_denied, login_required, consent_required, enrollment_required, rate_limited, not_found, server_error. |
error_description | string | não |
401
Sem sessão válida.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim | invalid_request, invalid_client, invalid_grant, unauthorized_client, unsupported_grant_type, invalid_scope, invalid_token, insufficient_scope, access_denied, login_required, consent_required, enrollment_required, rate_limited, not_found, server_error. |
error_description | string | não |
403
Sessão restrita (menos de 2 fatores fortes). Cadastre fatores primeiro.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim | invalid_request, invalid_client, invalid_grant, unauthorized_client, unsupported_grant_type, invalid_scope, invalid_token, insufficient_scope, access_denied, login_required, consent_required, enrollment_required, rate_limited, not_found, server_error. |
error_description | string | não |
409
Limite de clients atingido.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim | invalid_request, invalid_client, invalid_grant, unauthorized_client, unsupported_grant_type, invalid_scope, invalid_token, insufficient_scope, access_denied, login_required, consent_required, enrollment_required, rate_limited, not_found, server_error. |
error_description | string | não |
429
Limite de requisições excedido.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
500
Erro interno. Tente de novo com backoff; reporte o X-Request-Id.
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
error | string | sim |
Exemplos
O "Try it" está desligado nesta referência. Use os exemplos com a sua credencial de teste.
curl
curl -sS -X POST 'https://auth-api.axuz.net/oauth/clients' \
-H "Cookie: access_token=$AXUZ_SESSION_JWT" \
-H "Content-Type: application/json" \
-d '{"name":"string","client_type":"public","redirect_uris":["string"],"scopes":["string"],"team_id":"00000000-0000-0000-0000-000000000000"}'Node.js
const res = await fetch("https://auth-api.axuz.net/oauth/clients", {
method: 'POST',
headers: {
Cookie: `access_token=${process.env.AXUZ_SESSION_JWT}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "string",
"client_type": "public",
"redirect_uris": [
"string"
],
"scopes": [
"string"
],
"team_id": "00000000-0000-0000-0000-000000000000"
}),
});
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
console.log(await res.json());Python
import os
import requests
res = requests.request(
"POST",
"https://auth-api.axuz.net/oauth/clients",
headers={
"Cookie": f"access_token={os.environ['AXUZ_SESSION_JWT']}",
},
json={
"name": "string",
"client_type": "public",
"redirect_uris": [
"string",
],
"scopes": [
"string",
],
"team_id": "00000000-0000-0000-0000-000000000000",
},
timeout=30,
)
res.raise_for_status()
print(res.json())