{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/connic-co/json-schema/connic-co-deployment-list-item-response-schema.json",
  "title": "DeploymentListItemResponse",
  "description": "A deployment with the number of test cases that failed in its deploy-gate test phase.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/connic-co-public-openapi.json#/components/schemas/DeploymentListItemResponse",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
    },
    "project_id": {
      "type": "string",
      "format": "uuid",
      "title": "Project Id",
      "description": "Project the deployment belongs to."
    },
    "environment_id": {
      "type": "string",
      "format": "uuid",
      "title": "Environment Id",
      "description": "Environment the deployment belongs to."
    },
    "commit_hash": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Commit Hash",
      "description": "Git commit or ref that was built. null for CLI uploads."
    },
    "source_type": {
      "type": "string",
      "enum": [
        "git",
        "cli_upload"
      ],
      "title": "Source Type",
      "description": "`git` for builds from the connected repository, `cli_upload` for code uploaded with the CLI."
    },
    "status": {
      "$ref": "#/$defs/DeploymentStatus",
      "description": "Lifecycle state of the build. A `deployed` deployment serves traffic only while `is_active` is true."
    },
    "is_active": {
      "type": "boolean",
      "title": "Is Active",
      "description": "Whether this deployment currently serves the environment."
    },
    "agents_metadata": {
      "type": "string",
      "title": "Agents Metadata",
      "description": "JSON-encoded array with the configuration of each agent found in the code. `[]` until the build discovers agents."
    },
    "agents_count": {
      "type": "integer",
      "title": "Agents Count",
      "description": "Number of agents in the deployment."
    },
    "tools_count": {
      "type": "integer",
      "title": "Tools Count",
      "description": "Number of distinct tools referenced by the agents."
    },
    "middlewares_count": {
      "type": "integer",
      "title": "Middlewares Count",
      "description": "Number of middleware modules found."
    },
    "guardrails_count": {
      "type": "integer",
      "title": "Guardrails Count",
      "description": "Number of distinct guardrail types used by the agents."
    },
    "logs": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Logs",
      "description": "Build and activation log output. null until the build writes output."
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error",
      "description": "Why the deployment failed, such as a validation error or failing deploy-gate tests. null unless `status` is `failed`."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "started_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Started At",
      "description": "When the build started. null while pending."
    },
    "ended_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ended At",
      "description": "When the deployment finished, failed or was cancelled."
    },
    "testing_started_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Testing Started At",
      "description": "When the test phase started. null if it has not run."
    },
    "deploy_started_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Deploy Started At",
      "description": "When activation started. null if it has not started."
    },
    "tests_status": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "running",
            "passed",
            "failed",
            "skipped",
            "cancelled"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Tests Status",
      "description": "Result of the deploy-gate test phase. null when tests have not run or the code has no tests."
    },
    "skip_tests": {
      "type": "boolean",
      "title": "Skip Tests",
      "description": "Whether the deploy-gate test phase was skipped for this deployment."
    },
    "connic_triggered": {
      "type": "boolean",
      "title": "Connic Triggered",
      "description": "Whether connic started this deployment on the project's behalf."
    },
    "kind": {
      "type": "string",
      "enum": [
        "deploy",
        "dev_session",
        "test_run"
      ],
      "title": "Kind",
      "description": "`deploy` for a regular deployment, `dev_session` for code synced by `connic dev`, `test_run` for a build that only runs tests."
    },
    "current_phase": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Current Phase",
      "description": "Current phase: `building`, `testing`, `deploying`, `active` or `done`. null before the build starts."
    },
    "connectors_status": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "applied",
            "partial",
            "failed"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Connectors Status",
      "description": "Result of applying the connectors declared in code: `applied`, `partial` when some failed and kept their previous state, or `failed`. null until connectors are applied."
    },
    "skip_failed_connectors": {
      "type": "boolean",
      "title": "Skip Failed Connectors",
      "description": "Whether connectors declared in code that fail to apply keep their previous state instead of failing the deployment.",
      "default": false
    },
    "tests_failed_count": {
      "type": "integer",
      "title": "Tests Failed Count",
      "description": "Number of test cases that failed in the deploy-gate test phase."
    }
  },
  "type": "object",
  "required": [
    "id",
    "project_id",
    "environment_id",
    "commit_hash",
    "source_type",
    "status",
    "is_active",
    "agents_metadata",
    "agents_count",
    "tools_count",
    "middlewares_count",
    "guardrails_count",
    "logs",
    "created_at",
    "started_at",
    "ended_at",
    "testing_started_at",
    "deploy_started_at",
    "tests_status",
    "skip_tests",
    "connic_triggered",
    "kind",
    "current_phase",
    "tests_failed_count"
  ],
  "$defs": {
    "DeploymentStatus": {
      "type": "string",
      "enum": [
        "pending",
        "building",
        "deployed",
        "failed",
        "blocked",
        "cancelled"
      ],
      "title": "DeploymentStatus",
      "description": "Deployment state: `pending` until the build starts, `building` while it builds, tests and activates, then `deployed`, `failed` or `cancelled`."
    }
  }
}