{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/lumeta-ai/json-schema/lumeta-ai-team-request-schema.json",
  "title": "TeamRequest",
  "description": "A member waiting on the team's admins. `amount` to `add_credits_url` are on credit requests (`limit`, `pool`), `email` to `project_name` on invite requests.",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/lumeta-ai-openapi.json#/components/schemas/TeamRequest",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "`request_<id>`"
    },
    "kind": {
      "type": "string",
      "enum": [
        "limit",
        "pool",
        "invite"
      ],
      "description": "limit: they reached their monthly limit; pool: the team's credits are running low; invite: they want someone off the team added to a project."
    },
    "user": {
      "type": "string",
      "description": "`user_<id>` who asked"
    },
    "name": {
      "type": "string"
    },
    "created_at": {
      "type": "string"
    },
    "answers": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "give",
          "raise",
          "decline",
          "handled",
          "creator",
          "viewer"
        ]
      },
      "description": "What POST .../answer takes for this request, the page's leading button first."
    },
    "amount": {
      "type": "integer",
      "description": "Credits asked for."
    },
    "reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "limit_this_cycle": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Their monthly limit plus anything given this cycle; null when they have none."
    },
    "spent_this_cycle": {
      "type": "integer"
    },
    "credits_left": {
      "type": "integer",
      "description": "In the team's shared pool."
    },
    "add_credits_url": {
      "type": "string",
      "description": "pool: where an admin adds credits on the website. Buying there answers this request by itself and emails the member; answer `handled` only when no credits will be bought."
    },
    "email": {
      "type": "string"
    },
    "project": {
      "type": "string",
      "description": "`proj_<id>` they would join"
    },
    "project_name": {
      "type": "string"
    }
  }
}