Browse documentation
← API reference

Accounts & authentication

Register a public OAuth client

POST /oauth/register

Registers a public client with one to ten HTTPS or loopback HTTP redirect URIs. Only authorization_code and refresh_token grants, the code response and token_endpoint_auth_method none are supported. Client names are self-declared and cannot contain control, format, tag, line or paragraph separator characters or double quotes. Registrations that never obtain a grant are swept after one day unless a live authorization request names them. Registration errors use OAuth client-registration JSON. A 429 can be an OAuth error from registration limits or a problem from the shared address limit; both carry Retry-After.

Parameters

Idempotency-Keyheader · optional · string

Makes a retry safe: a request with the same key and the same method, path, and body as an earlier one gets the earlier response instead of doing the work again. 1 to 255 visible ASCII characters; use a new key for each new request, such as a UUID. Keys are kept per caller for a day, and ignored for requests without credentials.

Minimum length: 1 · Maximum length: 255

Example request

curl --request POST 'https://commitscale.com/oauth/register' \
  --header 'Content-Type: application/json' \
  --data '{
  "redirect_uris": [
    "example"
  ]
}'

Example values illustrate the format. Use your own credentials and identifiers.

Request body

application/json

application_typeoptional · string

Web or native. Defaults to web.

client_nameoptional · string

Self-declared, at most 100 characters. No control, format, tag, separator or double-quote characters.

grant_typesoptional · array of string

Authorization code and optionally refresh token. Defaults to authorization code.

Fields of grant_types

Authorization code and optionally refresh token. Defaults to authorization code.

Each item has this shape.

redirect_urisrequired · array of string

One to ten HTTPS or loopback HTTP redirect URIs.

Fields of redirect_uris

One to ten HTTPS or loopback HTTP redirect URIs.

Each item has this shape.

response_typesoptional · array of string

The supported response type is code.

Fields of response_types

The supported response type is code.

Each item has this shape.

token_endpoint_auth_methodoptional · string

Public clients use none.

Responses

201 The registered client metadata.

application/json

{
  "application_type": "example",
  "client_id": "example",
  "client_id_issued_at": 1,
  "client_name": "example",
  "grant_types": [
    "example"
  ],
  "redirect_uris": [
    "example"
  ],
  "response_types": [
    "example"
  ],
  "token_endpoint_auth_method": "example"
}

application_typerequired · string

Web or native.

client_idrequired · string

The public client's identifier.

client_id_issued_atrequired · integer (int64)

When the identifier was issued, in Unix seconds.

client_namerequired · string

The client's self-declared name.

grant_typesrequired · array of string

The registered grant types.

Fields of grant_types

The registered grant types.

Each item has this shape.

redirect_urisrequired · array of string

The registered redirect URIs.

Fields of redirect_uris

The registered redirect URIs.

Each item has this shape.

response_typesrequired · array of string

The registered response types.

Fields of response_types

The registered response types.

Each item has this shape.

token_endpoint_auth_methodrequired · string

Public clients use none.

RateLimit and RateLimit-Policy describe the request rate. Follow Retry-After when a response asks you to wait.

Problem responses

Errors use application/problem+json. Act on the stable code, and follow next when present. See the problem format.

quota_exceeded429

With 429, the caller used its requests for the minute. With 422, a count limit was reached.

With 429, wait Retry-After seconds and retry. With 422, remove one first.