{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendmux-ai/json-schema/sendmux-ai-connection-response-schema.json",
  "title": "ConnectionResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sendmux-ai-connection-api-openapi.yml#/components/schemas/ConnectionResponse",
  "allOf": [
    {
      "$ref": "#/$defs/SuccessEnvelope"
    },
    {
      "properties": {
        "data": {
          "$ref": "#/$defs/Connection"
        },
        "meta": {
          "$ref": "#/$defs/ResponseMeta"
        }
      },
      "required": [
        "data"
      ],
      "type": "object"
    }
  ],
  "unevaluatedProperties": false,
  "$defs": {
    "Connection": {
      "additionalProperties": false,
      "properties": {
        "credential": {
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "enum": [
                "api_key",
                "oauth",
                "agent_token"
              ],
              "type": "string"
            }
          },
          "required": [
            "id",
            "type",
            "name"
          ],
          "type": "object"
        },
        "label": {
          "description": "Display label for this connection.",
          "type": "string"
        },
        "mailboxes": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "email": {
                "format": "email",
                "type": "string"
              },
              "id": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "email"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "permissions": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "team": {
          "additionalProperties": false,
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "name"
          ],
          "type": "object"
        }
      },
      "required": [
        "team",
        "credential",
        "label",
        "permissions",
        "mailboxes"
      ],
      "type": "object"
    },
    "ResponseMeta": {
      "additionalProperties": false,
      "properties": {
        "request_id": {
          "type": "string"
        }
      },
      "required": [
        "request_id"
      ],
      "type": "object"
    },
    "SuccessEnvelope": {
      "properties": {
        "meta": {
          "additionalProperties": {},
          "properties": {},
          "type": "object"
        },
        "ok": {
          "enum": [
            true
          ],
          "type": "boolean"
        }
      },
      "required": [
        "ok",
        "meta"
      ],
      "type": "object"
    }
  }
}