{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/propertypixel-app/json-schema/propertypixel-app-account-schema.json",
  "title": "Account",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/propertypixel-app-openapi.json#/components/schemas/Account",
  "type": "object",
  "properties": {
    "object": {
      "type": "string",
      "const": "account"
    },
    "email": {
      "type": [
        "string",
        "null"
      ]
    },
    "workspace": {
      "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|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "personal",
            "team"
          ]
        },
        "role": {
          "type": "string",
          "enum": [
            "owner",
            "editor",
            "reviewer"
          ]
        }
      },
      "required": [
        "id",
        "name",
        "kind",
        "role"
      ],
      "additionalProperties": false
    },
    "scope": {
      "type": "object",
      "properties": {
        "effective": {
          "type": "string",
          "enum": [
            "read",
            "write"
          ],
          "description": "What this connection can do now: `write` can create, delete and spend credits; `read` can only view, pick and download."
        },
        "granted": {
          "type": "string",
          "enum": [
            "read",
            "write"
          ],
          "description": "What was granted when connecting. Effective is lower only if the user's workspace role was reduced since."
        }
      },
      "required": [
        "effective",
        "granted"
      ],
      "additionalProperties": false,
      "description": "Access level of this connection."
    },
    "credits": {
      "type": "object",
      "properties": {
        "available": {
          "type": "integer",
          "description": "Total credits that can be spent now."
        },
        "subscription": {
          "type": "integer"
        },
        "topup": {
          "type": "integer"
        },
        "trial": {
          "type": "integer"
        }
      },
      "required": [
        "available",
        "subscription",
        "topup",
        "trial"
      ],
      "additionalProperties": false,
      "description": "100 credits = one standard photo enhancement."
    },
    "plan": {
      "type": "object",
      "properties": {
        "tier": {
          "type": "string",
          "description": "Plan name, e.g. starter, professional, studio or trial."
        },
        "status": {
          "type": "string",
          "description": "trial, active, past_due, cancelled or expired."
        },
        "is_trial": {
          "type": "boolean"
        },
        "watermarked": {
          "type": "boolean",
          "description": "True when results carry the PropertyPixel watermark."
        }
      },
      "required": [
        "tier",
        "status",
        "is_trial",
        "watermarked"
      ],
      "additionalProperties": false
    },
    "manage_credits_url": {
      "description": "Where to add credits or change plan. Null inside ChatGPT.",
      "type": [
        "string",
        "null"
      ]
    },
    "studio_url": {
      "type": "string",
      "format": "uri",
      "description": "The PropertyPixel Studio, to open projects on the web."
    }
  },
  "required": [
    "object",
    "email",
    "workspace",
    "scope",
    "credits",
    "plan",
    "manage_credits_url",
    "studio_url"
  ],
  "additionalProperties": false
}