# Update tenant settings

`PATCH /api/v1/settings`

Writes an audit_log entry in the same transaction as the update.

No API key can call this route: it needs a signed-in dashboard user with the right role. A key answers 403.

## Request body

JSON Schema:

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "timezone": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64
    },
    "invoice_prefix": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20
    },
    "settings": {
      "type": "object",
      "additionalProperties": {},
      "description": "Replaces the settings blob wholesale."
    }
  },
  "description": "At least one field is required; an empty patch is rejected with 422."
}
```

## Responses

### 200

The updated tenant profile.

JSON Schema:

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
        },
        "name": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "timezone": {
          "type": "string"
        },
        "tier": {
          "type": "string",
          "enum": [
            "free",
            "starter",
            "growth",
            "scale"
          ]
        },
        "invoicePrefix": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "suspended",
            "deleted"
          ]
        },
        "settings": {
          "type": "object",
          "additionalProperties": {}
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "name",
        "slug",
        "timezone",
        "tier",
        "invoicePrefix",
        "status",
        "settings",
        "createdAt",
        "updatedAt"
      ]
    },
    "_agent": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "ok"
          ]
        },
        "next_actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "summary",
        "status",
        "next_actions",
        "warnings"
      ]
    },
    "api_version": {
      "type": "string",
      "example": "2026-07-01"
    }
  },
  "required": [
    "data",
    "_agent",
    "api_version"
  ]
}
```
