Register an OAuth client.
POST
/v1/clients
const url = 'https://example.com/api/auth/v1/clients';const options = { method: 'POST', headers: {cookie: 'access_token=<access_token>', 'Content-Type': 'application/json'}, body: '{"name":"example","redirect_uris":["https://example.com"],"scopes":["user:read"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/auth/v1/clients \ --header 'Content-Type: application/json' \ --cookie access_token=<access_token> \ --data '{ "name": "example", "redirect_uris": [ "https://example.com" ], "scopes": [ "user:read" ] }'The answer holds the client secret, which is shown this once: only its argon2id hash is kept. Redirect URIs are matched exactly, so register every one the client uses.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
required
string
redirect_uris
required
Absolute https URLs, or http on localhost or 127.0.0.1, without fragments.
Array<string>
scopes
required
Array<string>
Responses
Section titled “Responses”Registered.
Media typeapplication/json
object
client
required
object
id
required
string
name
required
string
redirect_uris
required
Array<string>
scopes
required
Array<string>
created_at
required
string format: date-time
client_secret
required
Shown this once.
string
Example
{ "client": { "scopes": [ "user:read" ] }}The request is malformed; errors names the fields.
Media typeapplication/problem+json
An RFC 9457 problem.
object
type
required
string
title
required
string
status
required
integer
detail
string
instance
string
request_id
string
errors
object
key
additional properties
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}No access token, or one that is invalid or expired.
Media typeapplication/problem+json
An RFC 9457 problem.
object
type
required
string
title
required
string
status
required
integer
detail
string
instance
string
request_id
string
errors
object
key
additional properties
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}Headers
Section titled “Headers”WWW-Authenticate
string
The token lacks a scope or isn’t the right kind, or the request came from another origin.
Media typeapplication/problem+json
An RFC 9457 problem.
object
type
required
string
title
required
string
status
required
integer
detail
string
instance
string
request_id
string
errors
object
key
additional properties
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}The body is larger than 64 KiB.
Media typeapplication/problem+json
An RFC 9457 problem.
object
type
required
string
title
required
string
status
required
integer
detail
string
instance
string
request_id
string
errors
object
key
additional properties
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}The service failed; the problem says nothing more.
Media typeapplication/problem+json
An RFC 9457 problem.
object
type
required
string
title
required
string
status
required
integer
detail
string
instance
string
request_id
string
errors
object
key
additional properties
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "request_id": "example", "errors": { "additionalProperty": "example" }}