Axuz Developers

PATCH /oauth/clients/{client_id}

Altera nome, redirect_uris e escopos (não troca o tipo public/confidential)

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

This operation's description comes from the handler comment in the code (in Portuguese).

Parameters

NameInTypeRequiredDescription
client_idpathstringyes

Request body

application/json · Required

NameTypeRequiredDescription
namestringno
redirect_urisarray<string>no
scopesarray<string>no
{
  "name": "string",
  "redirect_uris": [
    "string"
  ],
  "scopes": [
    "string"
  ]
}

Responses

200

Atualizado.

NameTypeRequiredDescription
client_idstringyes
namestringyes
client_typestringyes

enum: "public", "confidential"

redirect_urisarray<string>yes
scopesarray<string>yes
team_idstring<uuid> | nullno
verifiedbooleanyes
created_atstring<date-time>yes

400

Erro do protocolo (RFC 6749 §5.2).

NameTypeRequiredDescription
errorstringyes

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_descriptionstringno

401

Sem sessão válida.

NameTypeRequiredDescription
errorstringyes

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_descriptionstringno

404

Inexistente ou de outro dono.

NameTypeRequiredDescription
errorstringyes

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_descriptionstringno

429

Limite de requisições excedido.

NameTypeRequiredDescription
errorstringyes

500

Erro interno. Tente de novo com backoff; reporte o X-Request-Id.

NameTypeRequiredDescription
errorstringyes

Examples

"Try it" is turned off in this reference. Use the examples with your test credential.

curl

curl -sS -X PATCH 'https://auth-api.axuz.net/oauth/clients/CLIENT_ID' \
  -H "Cookie: access_token=$AXUZ_SESSION_JWT" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","redirect_uris":["string"],"scopes":["string"]}'

Node.js

const res = await fetch("https://auth-api.axuz.net/oauth/clients/CLIENT_ID", {
  method: 'PATCH',
  headers: {
    Cookie: `access_token=${process.env.AXUZ_SESSION_JWT}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "name": "string",
    "redirect_uris": [
      "string"
    ],
    "scopes": [
      "string"
    ]
  }),
});
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(
    "PATCH",
    "https://auth-api.axuz.net/oauth/clients/CLIENT_ID",
    headers={
        "Cookie": f"access_token={os.environ['AXUZ_SESSION_JWT']}",
    },
    json={
        "name": "string",
        "redirect_uris": [
            "string",
        ],
        "scopes": [
            "string",
        ],
    },
    timeout=30,
)
res.raise_for_status()
print(res.json())