{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/recruitmcp-com/json-schema/recruitmcp-com-workspace-schema.json",
  "title": "Workspace",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/recruitmcp-com-openapi.json#/components/schemas/Workspace",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "ws_… when the request acts on the account. cus_… when RecruitMCP-Customer or a bound key selects a customer."
    },
    "object": {
      "type": "string",
      "enum": [
        "workspace"
      ]
    },
    "name": {
      "type": "string"
    },
    "email": {
      "type": [
        "string",
        "null"
      ]
    },
    "first_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Owner first name from signup, or null. Not taken from the workspace name."
    },
    "account_id": {
      "type": "string",
      "description": "Always the billing account, ws_…. Credits, keys, and webhooks stay on this id even when id is a customer."
    },
    "customer": {
      "oneOf": [
        {
          "$ref": "#/$defs/Customer"
        },
        {
          "type": "null"
        }
      ]
    },
    "balance_credits": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Account balance. A customer-bound key gets that customer's remaining daily cap, or null when the customer has no cap."
    },
    "low_balance_credits": {
      "type": "integer",
      "description": "credits.low fires when the balance drops below this. Default 250."
    },
    "plan": {
      "type": "string",
      "enum": [
        "free",
        "starter",
        "growth",
        "scale",
        "payg"
      ],
      "description": "Current plan of the account. free without a subscription, payg with developer billing on. A canceled subscription is free."
    },
    "marketing_opt_in": {
      "type": "boolean",
      "description": "True when this workspace asked for product updates and tips."
    },
    "marketing_consent_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the product-updates choice was stored."
    },
    "marketing_consent_source": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "signup",
        "console"
      ],
      "description": "Where the product-updates choice was made."
    },
    "marketing_consent_text_version": {
      "type": [
        "string",
        "null"
      ],
      "description": "Version of the checkbox sentence stored with the choice."
    },
    "lifecycle_suppressed": {
      "type": "boolean",
      "description": "True stops every follow-up email for this workspace."
    },
    "api_key": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "prefix": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "secret",
            "oauth"
          ]
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "sourcing:read",
              "sourcing:spend",
              "lists:write",
              "contacts:spend",
              "outreach:read",
              "outreach:write",
              "outreach:send",
              "outreach:approve",
              "privacy:write",
              "account:read",
              "account:manage",
              "billing:manage"
            ]
          }
        },
        "daily_cap_credits": {
          "type": [
            "integer",
            "null"
          ]
        },
        "approval_threshold_credits": {
          "type": [
            "integer",
            "null"
          ]
        },
        "approval_threshold_enrollments": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Null when unset. HTTP then has no enrollment threshold. MCP uses 25 scheduled enrollments."
        },
        "expires_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "api_version": {
      "type": "string",
      "description": "RecruitMCP-Version this request runs under."
    }
  },
  "required": [
    "id",
    "object",
    "account_id",
    "balance_credits",
    "low_balance_credits",
    "plan",
    "marketing_opt_in",
    "marketing_consent_at",
    "marketing_consent_source",
    "marketing_consent_text_version",
    "lifecycle_suppressed",
    "api_key",
    "api_version"
  ],
  "$defs": {
    "Customer": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "object": {
          "type": "string",
          "enum": [
            "customer"
          ]
        },
        "name": {
          "type": "string"
        },
        "external_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Your id for this tenant."
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "daily_cap_credits": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Credits this customer may spend per UTC day."
        },
        "status": {
          "type": "string",
          "enum": [
            "active",
            "disabled"
          ]
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "id",
        "object",
        "name",
        "status"
      ],
      "description": "A sub-workspace for one of your own customers: its own seen register, lists, suppressions, and cap. Credits come from your account."
    }
  }
}