{
  "schemaVersion": 1,
  "operation": {
    "operationId": "disablePrincipal",
    "method": "POST",
    "path": "/api/v1/principals/{principal}/disable",
    "summary": "Block a principal in LeapView and reject its credentials",
    "description": "Sets an independent LeapView administrator block. External provisioning cannot clear this block.",
    "tags": [
      "Access"
    ],
    "effect": "write",
    "confirmation": "conditional",
    "parameters": [
      {
        "name": "principal",
        "in": "path",
        "required": true,
        "description": "",
        "schema": {
          "type": "string"
        }
      },
      {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "",
        "schema": {
          "maxLength": 200,
          "minLength": 1,
          "type": "string"
        }
      }
    ],
    "responses": [
      {
        "status": "200",
        "description": "The request has succeeded.",
        "content": [
          {
            "contentType": "application/json",
            "schema": {
              "$ref": "#/components/schemas/PrincipalAdministrationResponse"
            }
          }
        ]
      },
      {
        "status": "400",
        "description": "The server could not understand the request due to invalid syntax.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "401",
        "description": "Access is unauthorized.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "403",
        "description": "Access is forbidden.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "404",
        "description": "The server cannot find the requested resource.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "409",
        "description": "The request conflicts with the current state of the server.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "412",
        "description": "Precondition failed.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "413",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "415",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "422",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "429",
        "description": "Client error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "500",
        "description": "Server error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "502",
        "description": "Server error",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      },
      {
        "status": "503",
        "description": "Service unavailable.",
        "content": [
          {
            "contentType": "application/problem+json",
            "schema": {
              "$ref": "#/components/schemas/ProblemDetails"
            }
          }
        ]
      }
    ]
  },
  "schemas": {
    "IdentityManagementResponse": {
      "example": {
        "provider": "example",
        "source": "local"
      },
      "properties": {
        "provider": {
          "example": "example",
          "type": "string"
        },
        "source": {
          "$ref": "#/components/schemas/IdentityManagementSource"
        }
      },
      "required": [
        "source"
      ],
      "type": "object"
    },
    "IdentityManagementSource": {
      "enum": [
        "local",
        "external",
        "system"
      ],
      "example": "local",
      "type": "string"
    },
    "PrincipalAdministrationCapabilities": {
      "example": {
        "canBlock": true,
        "canDelete": true,
        "canManageAuthorization": true,
        "canManageSessions": true,
        "canResetPassword": true,
        "canUnblock": true,
        "canUpdateProfile": true
      },
      "properties": {
        "canBlock": {
          "example": true,
          "type": "boolean"
        },
        "canDelete": {
          "example": true,
          "type": "boolean"
        },
        "canManageAuthorization": {
          "example": true,
          "type": "boolean"
        },
        "canManageSessions": {
          "example": true,
          "type": "boolean"
        },
        "canResetPassword": {
          "example": true,
          "type": "boolean"
        },
        "canUnblock": {
          "example": true,
          "type": "boolean"
        },
        "canUpdateProfile": {
          "example": true,
          "type": "boolean"
        }
      },
      "required": [
        "canUpdateProfile",
        "canResetPassword",
        "canBlock",
        "canUnblock",
        "canDelete",
        "canManageSessions",
        "canManageAuthorization"
      ],
      "type": "object"
    },
    "PrincipalAdministrationResponse": {
      "example": {
        "blockedAt": "2026-01-02T15:04:05Z",
        "capabilities": {
          "canBlock": true,
          "canDelete": true,
          "canManageAuthorization": true,
          "canManageSessions": true,
          "canResetPassword": true,
          "canUnblock": true,
          "canUpdateProfile": true
        },
        "createdAt": "2026-01-02T15:04:05Z",
        "disabledAt": "2026-01-02T15:04:05Z",
        "displayName": "example",
        "email": "example",
        "id": "example",
        "identityManagement": {
          "provider": "example",
          "source": "local"
        },
        "kind": "example",
        "updatedAt": "2026-01-02T15:04:05Z"
      },
      "properties": {
        "blockedAt": {
          "description": "LeapView administrator block. This is independent from externally managed lifecycle state.",
          "example": "2026-01-02T15:04:05Z",
          "format": "date-time",
          "type": "string"
        },
        "capabilities": {
          "$ref": "#/components/schemas/PrincipalAdministrationCapabilities"
        },
        "createdAt": {
          "example": "2026-01-02T15:04:05Z",
          "format": "date-time",
          "type": "string"
        },
        "disabledAt": {
          "description": "Lifecycle disable owned by the identity provisioning authority, such as SCIM active=false.",
          "example": "2026-01-02T15:04:05Z",
          "format": "date-time",
          "type": "string"
        },
        "displayName": {
          "example": "example",
          "type": "string"
        },
        "email": {
          "example": "example",
          "type": "string"
        },
        "id": {
          "example": "example",
          "type": "string"
        },
        "identityManagement": {
          "$ref": "#/components/schemas/IdentityManagementResponse"
        },
        "kind": {
          "example": "example",
          "type": "string"
        },
        "updatedAt": {
          "example": "2026-01-02T15:04:05Z",
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "id",
        "kind",
        "email",
        "displayName",
        "createdAt",
        "updatedAt",
        "identityManagement",
        "capabilities"
      ],
      "type": "object"
    },
    "ProblemDetails": {
      "example": {
        "code": "example",
        "detail": "example",
        "errors": [
          {
            "code": "example",
            "detail": "example",
            "field": "example"
          }
        ],
        "instance": "example",
        "requestId": "example",
        "status": 1,
        "title": "example",
        "type": "example"
      },
      "properties": {
        "code": {
          "example": "example",
          "type": "string"
        },
        "detail": {
          "example": "example",
          "type": "string"
        },
        "errors": {
          "example": [
            {
              "code": "example",
              "detail": "example",
              "field": "example"
            }
          ],
          "items": {
            "$ref": "#/components/schemas/ProblemFieldError"
          },
          "type": "array"
        },
        "instance": {
          "example": "example",
          "type": "string"
        },
        "requestId": {
          "example": "example",
          "type": "string"
        },
        "status": {
          "example": 1,
          "format": "int32",
          "type": "integer"
        },
        "title": {
          "example": "example",
          "type": "string"
        },
        "type": {
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "type",
        "title",
        "status",
        "detail",
        "instance",
        "code",
        "requestId",
        "errors"
      ],
      "type": "object"
    },
    "ProblemFieldError": {
      "example": {
        "code": "example",
        "detail": "example",
        "field": "example"
      },
      "properties": {
        "code": {
          "example": "example",
          "type": "string"
        },
        "detail": {
          "example": "example",
          "type": "string"
        },
        "field": {
          "example": "example",
          "type": "string"
        }
      },
      "required": [
        "field",
        "code",
        "detail"
      ],
      "type": "object"
    }
  }
}
