POST /oauth/clients
Registra um client
- Access: Public
- Service:
https://auth-api.axuz.net
Accepted authentication
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:.
This operation's description comes from the handler comment in the code (in Portuguese).
Parameters
No parameters.
Request body
application/json · Required
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | |
client_type | string | yes | enum: |
redirect_uris | array<string> | yes | |
scopes | array<string> | yes | |
team_id | string<uuid> | no | Opcional; exige owner/admin do time. |
{
"name": "string",
"client_type": "public",
"redirect_uris": [
"string"
],
"scopes": [
"string"
],
"team_id": "00000000-0000-0000-0000-000000000000"
}Responses
201
Criado.
| Name | Type | Required | Description |
|---|---|---|---|
client_id | string | yes | |
name | string | yes | |
client_type | string | yes | enum: |
redirect_uris | array<string> | yes | |
scopes | array<string> | yes | |
team_id | string<uuid> | null | no | |
verified | boolean | yes | |
created_at | string<date-time> | yes | |
client_secret | string | no | Só confidential; mostrado UMA vez. |
400
Erro do protocolo (RFC 6749 §5.2).
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes | 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 | no |
401
Sem sessão válida.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes | 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 | no |
403
Sessão restrita (menos de 2 fatores fortes). Cadastre fatores primeiro.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes | 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 | no |
409
Limite de clients atingido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes | 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 | no |
429
Limite de requisições excedido.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
500
Erro interno. Tente de novo com backoff; reporte o X-Request-Id.
| Name | Type | Required | Description |
|---|---|---|---|
error | string | yes |
Examples
"Try it" is turned off in this reference. Use the examples with your test credential.
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())