{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/restivity-ai/json-schema/restivity-ai-profile-schema.json",
  "title": "Profile",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/restivity-ai-openapi.json#/components/schemas/Profile",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$"
    },
    "display_name": {
      "type": "string"
    },
    "photo_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "bio": {
      "type": "string"
    },
    "occupation": {
      "type": "string"
    },
    "theme": {
      "type": "string"
    },
    "language": {
      "type": "string"
    },
    "timezone": {
      "type": "string"
    },
    "first_day_of_week": {
      "type": "integer",
      "minimum": 0,
      "maximum": 6
    },
    "show_weekends": {
      "type": "boolean"
    },
    "weekend_days": {
      "type": "array",
      "items": {
        "type": "integer",
        "minimum": -9007199254740991,
        "maximum": 9007199254740991
      }
    },
    "notifications_enabled": {
      "type": "boolean"
    },
    "preferred_work_method": {
      "type": "string"
    },
    "pomodoro_work_duration": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "pomodoro_short_break": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "pomodoro_long_break": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "pomodoro_long_break_interval": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "pomodoro_preferred_break": {
      "type": "string"
    },
    "pomodoro_auto_start_breaks": {
      "type": "boolean"
    },
    "pomodoro_auto_start_work": {
      "type": "boolean"
    },
    "pomodoro_sound_enabled": {
      "type": "boolean"
    },
    "pomodoro_notifications_enabled": {
      "type": "boolean"
    },
    "pomodoro_volume": {
      "type": "number"
    },
    "timer_sound": {
      "type": "string"
    },
    "focus_music": {
      "type": "string"
    },
    "total_focus_time": {
      "description": "The user's total focus time in seconds, account-wide across every workspace: the sum of their completed work sessions (sessions in the Trash do not count). This is all-time, not today's or this week's figure.",
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "tasks_completed": {
      "description": "Tasks this user has completed: the tasks they moved to completed (still completed, not in the Trash) plus the reminder occurrences they completed. Counted on every read.",
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "current_streak": {
      "description": "Days in a row, on the user’s calendar, with a completed focus session or a task they completed (still completed, not in the Trash), reminder occurrences included. A day off of the user’s (weekend_days) never breaks it, and counts when worked. Recomputed when a focus session is completed, edited, moved to the Trash or restored; when a task is completed, reopened, moved to the Trash or restored, or a reminder occurrence is completed; when a workspace is moved to the Trash or restored; when a change of a status’s category moves tasks into or out of completed; and every night at 01:00 UTC, which also applies a change of time zone or days off.",
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "longest_streak": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "level": {
      "description": "The user's karma level over their account karma points (the same figure the admin table and the account export hold). Account-wide across every workspace; the app's sidebar, which follows the active workspace, can show a different level there.",
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "points": {
      "description": "The user's karma points, account-wide: the total earned in every workspace (`profiles.total_karma_points`). The app's sidebar shows the active workspace's karma, which can be a lower number.",
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "is_premium": {
      "type": "boolean"
    },
    "created_at": {
      "type": "string"
    },
    "locale": {
      "type": "string",
      "pattern": "^[a-z]{2}-[A-Z]{2}$"
    },
    "pomodoro_preferences": {
      "$ref": "#/$defs/PomodoroPreferences"
    },
    "default_view": {
      "type": "string",
      "enum": [
        "today",
        "inbox",
        "project"
      ]
    }
  },
  "required": [
    "id",
    "display_name",
    "photo_url",
    "bio",
    "occupation",
    "theme",
    "language",
    "timezone",
    "first_day_of_week",
    "show_weekends",
    "weekend_days",
    "notifications_enabled",
    "preferred_work_method",
    "pomodoro_work_duration",
    "pomodoro_short_break",
    "pomodoro_long_break",
    "pomodoro_long_break_interval",
    "pomodoro_preferred_break",
    "pomodoro_auto_start_breaks",
    "pomodoro_auto_start_work",
    "pomodoro_sound_enabled",
    "pomodoro_notifications_enabled",
    "pomodoro_volume",
    "timer_sound",
    "focus_music",
    "total_focus_time",
    "tasks_completed",
    "current_streak",
    "longest_streak",
    "level",
    "points",
    "is_premium",
    "locale",
    "pomodoro_preferences",
    "default_view"
  ],
  "additionalProperties": false,
  "$defs": {
    "PomodoroPreferences": {
      "type": "object",
      "properties": {
        "work_duration_seconds": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "short_break_seconds": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "long_break_seconds": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "long_break_every_n_sessions": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "work_duration_seconds",
        "short_break_seconds",
        "long_break_seconds",
        "long_break_every_n_sessions"
      ],
      "additionalProperties": false
    }
  }
}