Register
Register an OAuth client and get a client_id (dynamic client registration, RFC 7591). Use this only if you can't host a client ID metadata document, which needs no registration at all.
Every call creates a new client. Register once per app and store the client_id; don't register per user or per sign-in.
Endpoint
POST https://api.arsel.sa/oauth/register
Returns: 201 Created
Headers
| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes |
No Authorization header.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
redirect_uris | string[] | Yes | 1–10 redirect URIs, each at most 2048 characters. |
client_name | string | No | Shown on the consent screen. Max 255 characters. Defaults to Unnamed app. |
grant_types | string[] | No | authorization_code and/or refresh_token. Defaults to both. |
token_endpoint_auth_method | string | No | If sent, must be none. |
logo_uri | string | No | An https URL, at most 2048 characters. Not shown on the consent screen yet. |
{
"client_name": "Example CLI",
"redirect_uris": ["http://127.0.0.1/callback"]
}
curl -X POST https://api.arsel.sa/oauth/register \
-H "Content-Type: application/json" \
-d '{"client_name": "Example CLI", "redirect_uris": ["http://127.0.0.1/callback"]}'
Response
{
"client_id": "arsel_client_3q2-7wEJgk1zZ9vT0bQfXcYp4LmN8sRd",
"client_id_issued_at": 1793961600,
"client_name": "Example CLI",
"redirect_uris": ["http://127.0.0.1/callback"],
"grant_types": ["authorization_code", "refresh_token"],
"response_types": ["code"],
"token_endpoint_auth_method": "none"
}
| Field | Type | Description |
|---|---|---|
client_id | string | Your client ID. It doesn't expire. |
client_id_issued_at | number | When it was issued (Unix seconds) |
client_name | string | The name shown on the consent screen |
redirect_uris | string[] | The registered redirect URIs |
grant_types | string[] | The registered grant types |
response_types | string[] | Always ["code"] |
token_endpoint_auth_method | string | Always none: there is no client secret |
Rate Limit
10 requests per minute per IP address. Above it the endpoint returns 429.
Error Responses
Errors use the OAuth format, not the Arsel API error format.
- 400 Invalid Redirect URI
- 400 Invalid Client Metadata
{
"error": "invalid_redirect_uri",
"error_description": "redirect_uris must be 1-10 https, loopback http or private-use scheme URIs, each at most 2048 characters"
}
{
"error": "invalid_client_metadata",
"error_description": "Only public clients (token_endpoint_auth_method \"none\") are supported"
}
Also returned for an unsupported grant_types value, a client_name over 255 characters, or an invalid logo_uri.