{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/coactive/main/json-schema/coactive-create-client-request-schema.json",
  "title": "CreateClientRequest",
  "description": "Create system-level credentials request model",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coactive-system-credentials-api-openapi.yml#/components/schemas/CreateClientRequest",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Display name for the system-level credentials"
    },
    "roles": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "#/$defs/Role"
      },
      "description": "List of roles to assign to the system-level credentials. This is only available to organizations that are RBAC-enabled. Please contact support if you would like to enable RBAC for your organization."
    }
  },
  "required": [
    "name"
  ],
  "$defs": {
    "Role": {
      "type": "object",
      "properties": {
        "role_id": {
          "type": "string",
          "description": "Name of the role (e.g., 'admin', 'editor', 'viewer')"
        },
        "resource": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional resource type the role applies to (e.g., 'dataset')"
        },
        "resource_instance": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional resource instance ID the role applies to"
        }
      },
      "required": [
        "role_id"
      ],
      "description": "Role model for user and client roles",
      "title": "Role"
    }
  }
}