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

# Boolean

> True/false fields for flags and toggles.

Use `"type": "boolean"` for true/false values.

## Example

<CodeGroup>
  ```json JSON Schema theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  {
    "type": "object",
    "properties": {
      "is_active": { "type": "boolean" },
      "email_verified": { "type": "boolean" }
    },
    "required": ["is_active", "email_verified"],
    "additionalProperties": false
  }
  ```

  ```python Pydantic theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  from pydantic import BaseModel, ConfigDict

  class Payload(BaseModel):
      model_config = ConfigDict(extra="forbid")

      is_active: bool
      email_verified: bool
  ```

  ```typescript Zod theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
  import { z } from "zod";

  const payloadSchema = z
    .object({
      is_active: z.boolean(),
      email_verified: z.boolean(),
    })
    .strict();
  ```
</CodeGroup>

Values must be the literals `true` or `false`, not quoted strings ("true" is rejected). Truthy integers like 1 and 0 are not accepted.

Booleans are best for explicit flags. If you need multiple states, use a string `enum` instead.

## Related

* [String reference](/json-schema/reference/string)
* [Object reference](/json-schema/reference/object)
