> ## Documentation Index
> Fetch the complete documentation index at: https://trygradient.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Settings

> Update organization settings and brand assets

# Settings

Manage your organization's display settings and brand assets.

## Update Settings

```
PATCH /api/settings
```

<Info>This endpoint requires a session cookie - API key authentication is not currently supported for settings updates.</Info>

<ParamField body="userName" type="string">
  Your display name
</ParamField>

<ParamField body="orgName" type="string">
  Organization name
</ParamField>

<ParamField body="jobRole" type="string">
  Your job role
</ParamField>

<ParamField body="autoJoinEnabled" type="boolean">
  Turn email-domain auto-join on or off for the organization. Owners/admins only.
</ParamField>

<ParamField body="autoJoinDomains" type="string[]">
  Allowed email domains for auto-join (e.g. `["acme.com"]`). Generic providers (gmail.com, outlook.com, etc.) are rejected.
</ParamField>

<ParamField body="notifyOnSubmit" type="boolean">
  Email the org when a candidate submits an assessment.
</ParamField>

<ParamField body="companyDescription" type="string">
  Free-text description of the company, used to ground AI generation. Trimmed; an empty string clears it.
</ParamField>

<ParamField body="captureReplaysEnabled" type="boolean">
  Org-wide toggle for capturing candidate session replays.
</ParamField>

<Accordion title="Response">
  ```json theme={null}
  {
    "ok": true
  }
  ```
</Accordion>

## Upload Logo or Wordmark

```
POST /api/settings/logo
```

Upload a square logo or horizontal wordmark for your organization. The image is stored in Supabase storage and the URL is saved to the organization record.

<Info>Requires session cookie with owner or admin role.</Info>

<ParamField body="file" type="file" required>
  Image file (PNG, JPG, SVG, or WebP). Max 2 MB.
</ParamField>

<ParamField body="kind" type="string" required>
  Either `logo` (square icon) or `wordmark` (horizontal lockup).
</ParamField>

<Accordion title="Response">
  ```json theme={null}
  {
    "url": "https://your-project.supabase.co/storage/v1/object/public/org-assets/org-id/wordmark.png?v=1713000000000"
  }
  ```
</Accordion>

## Remove Logo or Wordmark

```
DELETE /api/settings/logo
```

Remove a previously uploaded logo or wordmark.

<Info>Requires session cookie with owner or admin role.</Info>

<ParamField body="kind" type="string" required>
  Either `logo` or `wordmark`.
</ParamField>

<Accordion title="Response">
  ```json theme={null}
  {
    "ok": true
  }
  ```
</Accordion>

## Preview Branded Invite Email

```
POST /api/settings/branding/preview
```

<Info>Requires admin role (owner or admin).</Info>

Renders the real candidate invite email (the same builder that sends it) with the supplied branding values — which may be **unsaved** edits from the Branding settings form — so the settings page can show a truthful live preview. The Gradient logo (shown only when no wordmark is set) is inlined as a data URI so it renders in-browser.

<ParamField body="orgName" type="string">
  Company name shown in the copy/subject. Falls back to the saved org name.
</ParamField>

<ParamField body="wordmarkUrl" type="string">
  Public wordmark URL to render on a white header. Omit/null for the Gradient header.
</ParamField>

<ParamField body="accentColor" type="string">
  `#rrggbb` accent applied to the stripe and button. Ignored when not a valid hex.
</ParamField>

<ParamField body="inviteIntro" type="string">
  Custom first sentence. Blank uses the default org/role sentence.
</ParamField>

<Accordion title="Response">
  ```json theme={null}
  {
    "subject": "Assessment invitation from Acme",
    "html": "<!DOCTYPE html> … "
  }
  ```
</Accordion>

## Upload Profile Photo

```
POST /api/settings/avatar
```

Upload a profile photo for the signed-in user. The image is stored in Supabase storage and the URL is saved to the user record, replacing the initials avatar shown in the top bar.

<Info>Requires an admin-portal session cookie. Candidate sessions are rejected.</Info>

<ParamField body="file" type="file" required>
  Image file (PNG, JPG, or WebP). Max 5 MB.
</ParamField>

<Accordion title="Response">
  ```json theme={null}
  {
    "url": "https://your-project.supabase.co/storage/v1/object/public/user-avatars/user-id/avatar.png?v=1713000000000"
  }
  ```
</Accordion>

## Remove Profile Photo

```
DELETE /api/settings/avatar
```

Remove the signed-in user's profile photo, reverting to initials.

<Info>Requires an admin-portal session cookie. Candidate sessions are rejected.</Info>

<Accordion title="Response">
  ```json theme={null}
  {
    "ok": true
  }
  ```
</Accordion>
