---
title: "Update security policies"
method: PUT
path: "/api/v1/organizations/{organizationId}/security-policy"
tags: ["Single sign-on"]
---

# Update security policies

`PUT /api/v1/organizations/{organizationId}/security-policy`

## Request

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

Set the organization's security policies: whether members must have two-factor authentication or log in with its single sign-on (`requireTwoFactor`; members who don't get `TWO_FACTOR_REQUIRED` from the organization's endpoints until they do), and the email domains people must have to be invited or join (`allowedEmailDomains`, empty for any; current members stay). Requiring two-factor authentication needs the caller to meet it. Requires the `sso: ["manage"]` permission (owners)

## Path parameters

- `organizationId` string, uuid, required

## Request body

- object
  - `requireTwoFactor` boolean, required
  - `allowedEmailDomains` string[], required

## Response `200`

OK

- object
  - `requireTwoFactor` boolean, required
  - `allowedEmailDomains` string[], required

## Other responses

- `400`: 400
- `401`: 401
- `403`: 403
- `404`: 404
- `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/security-policy/put.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)
