---
title: "Add an SSO connection"
method: POST
path: "/api/v1/organizations/{organizationId}/sso-connections"
tags: ["Single sign-on"]
---

# Add an SSO connection

`POST /api/v1/organizations/{organizationId}/sso-connections`

## Request

- Base URL: `https://app.easyscraper.com`
- URL: `https://app.easyscraper.com/api/v1/organizations/{organizationId}/sso-connections`
- Auth: API key in cookie `better-auth.session_token`

Add a single sign-on connection to the organization's identity provider for an email domain, over OIDC (issuer URL, client ID and secret; the endpoints come from the issuer's discovery document) or SAML (the identity provider's metadata, by URL or XML). The domain must then be verified with the returned DNS TXT record before anyone can log in through it. Requires the `sso: ["manage"]` permission (owners)

## Path parameters

- `organizationId` string, uuid, required

## Request body

- object
  - `type` union, required
    - 'oidc'
    - 'saml'
  - `providerId` string, required
  - `domain` string, required
  - `issuer` string, uri
  - `clientId` string
  - `clientSecret` string
  - `metadataUrl` string, uri
  - `metadataXml` string

## Response `200`

OK

- object
  - `providerId` string, required
  - `type` 'oidc' | 'saml', required
  - `issuer` string, required
  - `domain` string, required
  - `domainVerified` boolean, required
  - `domainVerificationRecord` object, nullable, required
    - `name` string, required
    - `value` string, required
  - `serviceProvider` object, required
    - `callbackUrl` string, required
    - `entityId` string, nullable, required
    - `metadataUrl` string, nullable, required

## Other responses

- `400`: 400
- `401`: 401
- `403`: 403
- `404`: 404
- `409`: 409
- `429`: 429

## Changes

- **2026-11-02** `a12cef98c52b`: 1 breaking
  - added `subschema #1` to the response body `oneOf` list for the response status `400`
- **2026-10-31** `3e642e95991a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/easyscraper/apis/easy-scraper-api/changes/api/v1/organizations/:organizationId/sso-connections/post.md)

---

[API](https://skmtc.dev/easyscraper/apis/easy-scraper-api.md) - [All operations](https://skmtc.dev/easyscraper/apis/easy-scraper-api/llms.txt) - [OpenAPI document](https://skmtc.dev/easyscraper/apis/easy-scraper-api/revisions/a12cef98c52b?raw)
