Skip to content
getgeolens.com

Create Oauth Provider

POST
/settings/oauth-providers/
curl --request POST \
--url https://example.com/api/settings/oauth-providers/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "slug": "example", "display_name": "example", "provider_type": "google", "client_id": "example", "client_secret": "example", "discovery_url": "example", "authorize_url": "example", "token_url": "example", "userinfo_url": "example", "scopes": "openid profile email", "default_role": "viewer", "group_claim": "example", "group_role_mapping": {}, "enabled": true }'

Create a new OAuth provider (admin only).

Media type application/json
OAuthProviderCreate

Schema for creating a new OAuth provider.

object
slug
required
Slug

URL-safe identifier used in callback URLs (e.g. ‘google’, ‘azure-ad’). Lowercase, digits, and hyphens only.

string
>= 1 characters <= 50 characters /^[a-z0-9-]+$/
display_name
required
Display Name

Human-readable label shown on the login page button.

string
>= 1 characters <= 100 characters
provider_type
required
Provider Type

OAuth provider type. ‘google’ and ‘microsoft’ auto-populate the discovery URL; ‘oidc’ is generic.

string
Allowed values: google microsoft oidc
client_id
required
Client Id

OAuth client ID issued by the IdP.

string
>= 1 characters <= 500 characters
client_secret
required
Client Secret

OAuth client secret issued by the IdP. Stored encrypted; never returned in responses.

string
>= 1 characters <= 1000 characters
discovery_url
Any of:
string
<= 512 characters
authorize_url
Any of:
string
<= 512 characters
token_url
Any of:
string
<= 512 characters
userinfo_url
Any of:
string
<= 512 characters
scopes
Scopes

Space-separated OAuth scopes.

string
default: openid profile email <= 500 characters
default_role
Default Role

Role assigned to new users created via this provider: ‘viewer’, ‘editor’, or ‘admin’.

string
default: viewer <= 50 characters
group_claim
Any of:
string
<= 100 characters
group_role_mapping
Any of:
object
key
additional properties
any
enabled
Enabled

Whether the provider button appears on the login page.

boolean
default: true

Successful Response

Media type application/json
OAuthProviderResponse

Response schema for OAuth provider. Never exposes client_secret.

object
id
required
Id

Unique provider identifier.

string format: uuid
slug
required
Slug

URL-safe identifier used in the callback URL.

string
display_name
required
Display Name

Label shown on the login page button.

string
provider_type
required
Provider Type

Provider type: ‘google’, ‘microsoft’, or ‘oidc’.

string
client_id
required
Client Id

OAuth client ID. Visible to admins; never exposes client_secret.

string
discovery_url
Any of:
string
authorize_url
Any of:
string
token_url
Any of:
string
userinfo_url
Any of:
string
scopes
required
Scopes

Space-separated OAuth scopes.

string
default_role
required
Default Role

Default role assigned to new users.

string
group_claim
Any of:
string
group_role_mapping
Any of:
object
key
additional properties
any
enabled
required
Enabled

Whether the provider button appears on the login page.

boolean
created_at
required
Created At

Timestamp the provider was created.

string format: date-time
updated_at
required
Updated At

Timestamp the provider was last updated.

string format: date-time
Example generated
{
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"slug": "example",
"display_name": "example",
"provider_type": "example",
"client_id": "example",
"discovery_url": "example",
"authorize_url": "example",
"token_url": "example",
"userinfo_url": "example",
"scopes": "example",
"default_role": "example",
"group_claim": "example",
"group_role_mapping": {},
"enabled": true,
"created_at": "2026-04-15T12:00:00Z",
"updated_at": "2026-04-15T12:00:00Z"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}