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

# Settings

> Manage application settings

The Settings API allows administrators to retrieve and update application-wide configuration settings.

## List settings

<api>GET /api/settings</api>

Returns the current application settings.

**Requires superuser authentication.**

<ParamField header="Authorization" type="string" required>
  Admin authentication token
</ParamField>

<ResponseField name="meta" type="object">
  Application metadata configuration

  <Expandable title="properties">
    <ResponseField name="appName" type="string">
      Application name (1-255 characters)
    </ResponseField>

    <ResponseField name="appURL" type="string">
      Application URL
    </ResponseField>

    <ResponseField name="senderName" type="string">
      Default email sender name (1-255 characters)
    </ResponseField>

    <ResponseField name="senderAddress" type="string">
      Default email sender address
    </ResponseField>

    <ResponseField name="hideControls" type="boolean">
      Whether to hide UI controls
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="logs" type="object">
  Logging configuration

  <Expandable title="properties">
    <ResponseField name="maxDays" type="number">
      Maximum days to keep logs (minimum: 0)
    </ResponseField>

    <ResponseField name="minLevel" type="number">
      Minimum log level to record
    </ResponseField>

    <ResponseField name="logIP" type="boolean">
      Whether to log IP addresses
    </ResponseField>

    <ResponseField name="logAuthId" type="boolean">
      Whether to log authenticated user IDs
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="smtp" type="object">
  SMTP email configuration

  <Expandable title="properties">
    <ResponseField name="enabled" type="boolean">
      Whether SMTP is enabled
    </ResponseField>

    <ResponseField name="host" type="string">
      SMTP server hostname (required when enabled)
    </ResponseField>

    <ResponseField name="port" type="number">
      SMTP server port (required when enabled, minimum: 0)
    </ResponseField>

    <ResponseField name="username" type="string">
      SMTP authentication username
    </ResponseField>

    <ResponseField name="password" type="string">
      SMTP authentication password (omitted in responses)
    </ResponseField>

    <ResponseField name="authMethod" type="string">
      SMTP AUTH method: `PLAIN` or `LOGIN`
    </ResponseField>

    <ResponseField name="tls" type="boolean">
      Whether to enforce TLS encryption
    </ResponseField>

    <ResponseField name="localName" type="string">
      Domain name or IP for EHLO/HELO exchange (defaults to "localhost")
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="s3" type="object">
  S3 storage configuration

  <Expandable title="properties">
    <ResponseField name="enabled" type="boolean">
      Whether S3 storage is enabled
    </ResponseField>

    <ResponseField name="bucket" type="string">
      S3 bucket name (required when enabled)
    </ResponseField>

    <ResponseField name="region" type="string">
      S3 region (required when enabled)
    </ResponseField>

    <ResponseField name="endpoint" type="string">
      S3 endpoint URL (required when enabled)
    </ResponseField>

    <ResponseField name="accessKey" type="string">
      S3 access key (required when enabled)
    </ResponseField>

    <ResponseField name="secret" type="string">
      S3 secret key (omitted in responses)
    </ResponseField>

    <ResponseField name="forcePathStyle" type="boolean">
      Whether to use path-style addressing
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="backups" type="object">
  Backups configuration

  <Expandable title="properties">
    <ResponseField name="cron" type="string">
      Cron expression for auto backups (e.g., "\* \* \* \* \*"). Leave empty to disable.
    </ResponseField>

    <ResponseField name="cronMaxKeep" type="number">
      Max number of cron backups to keep (required when cron is set, minimum: 1)
    </ResponseField>

    <ResponseField name="s3" type="object">
      Optional S3 storage config for backups (same structure as main S3 config)
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="trustedProxy" type="object">
  Trusted proxy configuration

  <Expandable title="properties">
    <ResponseField name="headers" type="array">
      List of trusted header names to check
    </ResponseField>

    <ResponseField name="useLeftmostIP" type="boolean">
      Use leftmost IP from trusted headers (may be insecure with X-Forwarded-For)
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="rateLimits" type="object">
  Rate limiting configuration

  <Expandable title="properties">
    <ResponseField name="enabled" type="boolean">
      Whether rate limiting is enabled
    </ResponseField>

    <ResponseField name="rules" type="array">
      Array of rate limit rules

      <Expandable title="rule properties">
        <ResponseField name="label" type="string">
          Rule identifier (tag, path, or path prefix). Examples: `test_a`, `users:create`, `*:create`, `/api/`, `POST /api/collections/`
        </ResponseField>

        <ResponseField name="audience" type="string">
          Auth group: `""` (all), `"@guest"` (guests only), or `"@auth"` (authenticated only)
        </ResponseField>

        <ResponseField name="duration" type="number">
          Interval in seconds to reset tokens (minimum: 1)
        </ResponseField>

        <ResponseField name="maxRequests" type="number">
          Max requests per duration (minimum: 1)
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="batch" type="object">
  Batch request configuration

  <Expandable title="properties">
    <ResponseField name="enabled" type="boolean">
      Whether batch requests are enabled
    </ResponseField>

    <ResponseField name="maxRequests" type="number">
      Max batch requests to execute (minimum: 0)
    </ResponseField>

    <ResponseField name="timeout" type="number">
      Max duration in seconds before cancelling batch transaction (minimum: 0)
    </ResponseField>

    <ResponseField name="maxBodySize" type="number">
      Max batch request body size in bytes (defaults to \~128MB if not set)
    </ResponseField>
  </Expandable>
</ResponseField>

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET http://127.0.0.1:8090/api/settings \
    -H 'Authorization: TOKEN'
  ```

  ```javascript JavaScript theme={null}
  const settings = await pb.settings.getAll();
  ```
</CodeGroup>

## Update settings

<api>PATCH /api/settings</api>

Updates application settings. Only provided fields will be updated.

**Requires superuser authentication.**

<ParamField header="Authorization" type="string" required>
  Admin authentication token
</ParamField>

<ParamField body="meta" type="object">
  Application metadata configuration

  <Expandable title="properties">
    <ParamField body="meta.appName" type="string">
      Application name (1-255 characters)
    </ParamField>

    <ParamField body="meta.appURL" type="string">
      Application URL
    </ParamField>

    <ParamField body="meta.senderName" type="string">
      Default email sender name (1-255 characters)
    </ParamField>

    <ParamField body="meta.senderAddress" type="string">
      Default email sender address
    </ParamField>

    <ParamField body="meta.hideControls" type="boolean">
      Whether to hide UI controls
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="logs" type="object">
  Logging configuration

  <Expandable title="properties">
    <ParamField body="logs.maxDays" type="number">
      Maximum days to keep logs (minimum: 0)
    </ParamField>

    <ParamField body="logs.minLevel" type="number">
      Minimum log level to record
    </ParamField>

    <ParamField body="logs.logIP" type="boolean">
      Whether to log IP addresses
    </ParamField>

    <ParamField body="logs.logAuthId" type="boolean">
      Whether to log authenticated user IDs
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="smtp" type="object">
  SMTP email configuration

  <Expandable title="properties">
    <ParamField body="smtp.enabled" type="boolean">
      Whether SMTP is enabled
    </ParamField>

    <ParamField body="smtp.host" type="string">
      SMTP server hostname (required when enabled)
    </ParamField>

    <ParamField body="smtp.port" type="number">
      SMTP server port (required when enabled, minimum: 0)
    </ParamField>

    <ParamField body="smtp.username" type="string">
      SMTP authentication username
    </ParamField>

    <ParamField body="smtp.password" type="string">
      SMTP authentication password
    </ParamField>

    <ParamField body="smtp.authMethod" type="string">
      SMTP AUTH method: `PLAIN` or `LOGIN`
    </ParamField>

    <ParamField body="smtp.tls" type="boolean">
      Whether to enforce TLS encryption
    </ParamField>

    <ParamField body="smtp.localName" type="string">
      Domain name or IP for EHLO/HELO exchange
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="s3" type="object">
  S3 storage configuration

  <Expandable title="properties">
    <ParamField body="s3.enabled" type="boolean">
      Whether S3 storage is enabled
    </ParamField>

    <ParamField body="s3.bucket" type="string">
      S3 bucket name (required when enabled)
    </ParamField>

    <ParamField body="s3.region" type="string">
      S3 region (required when enabled)
    </ParamField>

    <ParamField body="s3.endpoint" type="string">
      S3 endpoint URL (required when enabled)
    </ParamField>

    <ParamField body="s3.accessKey" type="string">
      S3 access key (required when enabled)
    </ParamField>

    <ParamField body="s3.secret" type="string">
      S3 secret key (required when enabled)
    </ParamField>

    <ParamField body="s3.forcePathStyle" type="boolean">
      Whether to use path-style addressing
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="backups" type="object">
  Backups configuration

  <Expandable title="properties">
    <ParamField body="backups.cron" type="string">
      Cron expression for auto backups
    </ParamField>

    <ParamField body="backups.cronMaxKeep" type="number">
      Max number of cron backups to keep (required when cron is set, minimum: 1)
    </ParamField>

    <ParamField body="backups.s3" type="object">
      Optional S3 storage config for backups
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="trustedProxy" type="object">
  Trusted proxy configuration

  <Expandable title="properties">
    <ParamField body="trustedProxy.headers" type="array">
      List of trusted header names
    </ParamField>

    <ParamField body="trustedProxy.useLeftmostIP" type="boolean">
      Use leftmost IP from trusted headers
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="rateLimits" type="object">
  Rate limiting configuration

  <Expandable title="properties">
    <ParamField body="rateLimits.enabled" type="boolean">
      Whether rate limiting is enabled
    </ParamField>

    <ParamField body="rateLimits.rules" type="array">
      Array of rate limit rules
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="batch" type="object">
  Batch request configuration

  <Expandable title="properties">
    <ParamField body="batch.enabled" type="boolean">
      Whether batch requests are enabled
    </ParamField>

    <ParamField body="batch.maxRequests" type="number">
      Max batch requests to execute
    </ParamField>

    <ParamField body="batch.timeout" type="number">
      Max duration in seconds before cancelling
    </ParamField>

    <ParamField body="batch.maxBodySize" type="number">
      Max batch request body size in bytes
    </ParamField>
  </Expandable>
</ParamField>

Returns the updated settings object with the same structure as the GET endpoint.

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PATCH http://127.0.0.1:8090/api/settings \
    -H 'Authorization: TOKEN' \
    -H 'Content-Type: application/json' \
    -d '{
      "meta": {
        "appName": "My App"
      },
      "logs": {
        "maxDays": 7
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  const settings = await pb.settings.update({
    meta: {
      appName: 'My App'
    },
    logs: {
      maxDays: 7
    }
  });
  ```
</CodeGroup>
