{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/methodfi/main/json-schema/methodfi-team-response-schema.json",
  "title": "TeamResponse",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/methodfi-teams-api-openapi.yml#/components/schemas/TeamResponse",
  "allOf": [
    {
      "$ref": "#/$defs/SuccessEnvelope"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "$ref": "#/$defs/Team"
        }
      }
    }
  ],
  "$defs": {
    "SuccessEnvelope": {
      "type": "object",
      "description": "Standard envelope for successful responses that return a single payload.",
      "required": [
        "success",
        "data",
        "message"
      ],
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Always `true` for successful responses."
        },
        "data": {
          "description": "Operation-specific response payload."
        },
        "message": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "Team": {
      "type": "object",
      "description": "A Team represents your organization and its API configuration.",
      "required": [
        "id",
        "parent_id",
        "name",
        "legal_name",
        "logo",
        "api_version",
        "status",
        "products",
        "keys",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the team."
        },
        "parent_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Identifier of the parent team, if this is a child team."
        },
        "name": {
          "type": "string",
          "description": "Display name of the team."
        },
        "legal_name": {
          "type": "string",
          "description": "Legal business name of the team."
        },
        "logo": {
          "type": [
            "string",
            "null"
          ],
          "description": "URL of the team logo."
        },
        "api_version": {
          "type": "string",
          "description": "The API version the team is configured to use."
        },
        "status": {
          "type": "string",
          "description": "Current status of the team.",
          "enum": [
            "active",
            "verified",
            "disabled",
            "pending_disablement"
          ]
        },
        "products": {
          "type": "array",
          "description": "List of products enabled for this team.",
          "items": {
            "$ref": "#/$defs/TeamProduct"
          }
        },
        "keys": {
          "type": "array",
          "description": "API keys associated with this team.",
          "items": {
            "$ref": "#/$defs/TeamKey"
          }
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the team was created."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the team was last updated."
        }
      }
    },
    "TeamKey": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for the key."
        },
        "type": {
          "type": "string",
          "description": "The key type.",
          "enum": [
            "secret",
            "public"
          ]
        },
        "deleted": {
          "type": "boolean",
          "description": "Whether this key has been deleted."
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the key was created."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when the key was last updated."
        },
        "last_used_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Timestamp when the key was last used, if ever."
        }
      }
    },
    "TeamProduct": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "The product type."
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether this product is enabled for the team."
        }
      }
    }
  }
}