> ## Documentation Index
> Fetch the complete documentation index at: https://weights.fyi/run/llms.txt

# PATCH /v1/workspaces/domains/{domain}

```text
PATCH https://weights.fyi/run/v1/workspaces/domains/<domain>
Authorization: Bearer <token>                    scope: manage
Content-Type: application/json
```

**Available since:** 2026-11-15 workspace domains: included in this build; see [What is live](/run/docs/what-is-live.md) for deployment status.

**Answer time:** synchronous: one database write.

Changes how a claimed email domain admits people whose verified address is at that domain: `invite_only` keeps invitations as the only way in, `discoverable` lets them join in one click, and `auto_join` adds them as members at sign-in.

The setting takes effect only while `status` is `verified`. Existing workspace owners and admins keep their roles; members previously removed by an owner or admin remain excluded until invited again.

## Request

| Name | Where | Required | Meaning |
|---|---|---|---|
| `Authorization` | header | yes | `Bearer` and a token with `manage` on the workspace. |
| `domain` | path | yes | The claimed email domain, such as `awow.io`. |
| `join_mode` | body | yes | `invite_only`, `discoverable` or `auto_join`. |

## Return value

**200 OK**:

| Field | Meaning |
|---|---|
| `domain`, `status`, `join_mode` | Domain name, verification state, and the updated admission mode. |
| `created_at`, `verified_at`, `last_checked_at` | Timestamps in UTC. |
| `dns_record`, `accepted_records` | The TXT record instructions for this claim. |

## Errors

| Status | Code | When it happens | What to do |
|---|---|---|---|
| `400` | `invalid_request`, `invalid_json` | Unknown fields or an invalid `join_mode`. | Send `invite_only`, `discoverable` or `auto_join`. |
| `401` | `unauthorized`, `invalid_token`, `token_revoked`, `token_expired` | No token, or one that does not work. | Use a valid token. |
| `403` | `scope_required`, `workspace_role_required`, `operator_workspace_domain` | Token lacks `manage`, caller is not an owner or admin, or open join mode is not allowed here. | Use an owner or admin `manage` token on a team workspace. |
| `404` | `domain_not_found` | This workspace has not claimed that domain. | Check `workspace.domains` in [GET /v1/workspaces](/run/docs/reference/workspaces-get.md). |

## Examples

```sh
curl -s -X PATCH https://weights.fyi/run/v1/workspaces/domains/DOMAIN \
  -H "Authorization: Bearer $WEIGHTS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"join_mode": "auto_join"}'
```

```json
{"domain": "awow.io", "status": "verified", "join_mode": "auto_join", "created_at": "2026-11-15T10:00:00Z", "verified_at": "2026-11-15T10:05:00Z", "last_checked_at": "2026-11-15T10:05:00Z"}
```

## History

- 2026-11-15 workspace domains: added.

## See also

- [DELETE /v1/workspaces/domains/{domain}](/run/docs/reference/workspaces-domains-delete.md) to remove the domain claim.
- [Teams and workspaces](/run/docs/teams.md#verify-your-domain), the topic.
