{
  "openapi": "3.0.3",
  "info": {
    "title": "Privileged Session Management API",
    "version": "1.0.0",
    "description": "Privileged session management \u2014 credential-injecting SSH/HTTPS brokers, recording, and audit."
  },
  "servers": [
    {
      "url": "https://versus-demo.com"
    }
  ],
  "paths": {
    "/api/psm/policies/": {
      "get": {
        "operationId": "psm_policies_list",
        "parameters": [
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "A page number within the paginated result set.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page_size",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "A search term.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "psm"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedSessionPolicyList"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "List policys"
      },
      "post": {
        "operationId": "psm_policies_create",
        "tags": [
          "psm"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionPolicyRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/SessionPolicyRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/SessionPolicyRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionPolicy"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Create policy"
      }
    },
    "/api/psm/policies/{id}/": {
      "get": {
        "operationId": "psm_policies_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this session policy.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionPolicy"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Retrieve policy"
      },
      "put": {
        "operationId": "psm_policies_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this session policy.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionPolicyRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/SessionPolicyRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/SessionPolicyRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionPolicy"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Update policy"
      },
      "patch": {
        "operationId": "psm_policies_partial_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this session policy.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchedSessionPolicyRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PatchedSessionPolicyRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PatchedSessionPolicyRequest"
              }
            }
          }
        },
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionPolicy"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Update policy"
      },
      "delete": {
        "operationId": "psm_policies_destroy",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this session policy.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "No response body"
          }
        },
        "summary": "Delete policy"
      }
    },
    "/api/psm/sessions/": {
      "get": {
        "operationId": "psm_sessions_list",
        "parameters": [
          {
            "name": "ordering",
            "required": false,
            "in": "query",
            "description": "Which field to use when ordering the results.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "A page number within the paginated result set.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "page_size",
            "required": false,
            "in": "query",
            "description": "Number of results to return per page.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "A search term.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "tags": [
          "psm"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaginatedPrivilegedSessionList"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "List sessions"
      },
      "post": {
        "operationId": "psm_sessions_create",
        "tags": [
          "psm"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivilegedSession"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Create session"
      }
    },
    "/api/psm/sessions/{id}/": {
      "get": {
        "operationId": "psm_sessions_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this privileged session.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivilegedSession"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Retrieve session"
      },
      "put": {
        "operationId": "psm_sessions_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this privileged session.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivilegedSession"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Update session"
      },
      "patch": {
        "operationId": "psm_sessions_partial_update",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this privileged session.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchedPrivilegedSessionRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PatchedPrivilegedSessionRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PatchedPrivilegedSessionRequest"
              }
            }
          }
        },
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivilegedSession"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Update session"
      },
      "delete": {
        "operationId": "psm_sessions_destroy",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this privileged session.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "204": {
            "description": "No response body"
          }
        },
        "summary": "Delete session"
      }
    },
    "/api/psm/sessions/{id}/approve/": {
      "post": {
        "operationId": "psm_sessions_approve_create",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this privileged session.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivilegedSession"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Approve: session"
      }
    },
    "/api/psm/sessions/{id}/close/": {
      "post": {
        "operationId": "psm_sessions_close_create",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this privileged session.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivilegedSession"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Close: session"
      }
    },
    "/api/psm/sessions/{id}/connect/": {
      "get": {
        "operationId": "psm_sessions_connect_retrieve",
        "description": "Download the one-time .rdp for an RDP session (actor-owned).",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this privileged session.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivilegedSession"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Connect: session"
      }
    },
    "/api/psm/sessions/{id}/deny/": {
      "post": {
        "operationId": "psm_sessions_deny_create",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this privileged session.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivilegedSession"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Deny: session"
      }
    },
    "/api/psm/sessions/{id}/events/": {
      "get": {
        "operationId": "psm_sessions_events_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this privileged session.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivilegedSession"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Events: session"
      }
    },
    "/api/psm/sessions/{id}/exec/": {
      "post": {
        "operationId": "psm_sessions_exec_create",
        "description": "SSH session: run a command through the broker (credential injected).",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this privileged session.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivilegedSession"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Exec: session"
      }
    },
    "/api/psm/sessions/{id}/proxy/": {
      "post": {
        "operationId": "psm_sessions_proxy_create",
        "description": "HTTPS session: forward a request through the broker (credential injected).",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this privileged session.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivilegedSession"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Proxy: session"
      }
    },
    "/api/psm/sessions/{id}/recording/": {
      "get": {
        "operationId": "psm_sessions_recording_retrieve",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this privileged session.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivilegedSession"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Recording: session"
      }
    },
    "/api/psm/sessions/{id}/terminate/": {
      "post": {
        "operationId": "psm_sessions_terminate_create",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "A UUID string identifying this privileged session.",
            "required": true
          }
        ],
        "tags": [
          "psm"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/PrivilegedSessionRequest"
              }
            }
          },
          "required": true
        },
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivilegedSession"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "Terminate: session"
      }
    },
    "/api/psm/sessions/machine/": {
      "get": {
        "operationId": "psm_sessions_machine_retrieve",
        "description": "Read-only view of the collector machine/API sessions (TunnelSession)\nrendered in the session shape, so the console shows human + machine.",
        "tags": [
          "psm"
        ],
        "security": [
          {
            "jwtAuth": []
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PrivilegedSession"
                }
              }
            },
            "description": ""
          }
        },
        "summary": "List machines"
      }
    }
  },
  "components": {
    "schemas": {
      "ActorKindEnum": {
        "enum": [
          "user",
          "app_principal"
        ],
        "type": "string",
        "description": "* `user` - User\n* `app_principal` - App principal"
      },
      "PrivilegedSession": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          },
          "kind": {
            "$ref": "#/components/schemas/PrivilegedSessionKindEnum"
          },
          "actor_kind": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ActorKindEnum"
              }
            ],
            "readOnly": true
          },
          "actor_ref": {
            "type": "string",
            "readOnly": true
          },
          "target_kind": {
            "$ref": "#/components/schemas/TargetKindEnum"
          },
          "target_ref": {
            "type": "string",
            "maxLength": 500
          },
          "credential_ref": {
            "type": "string",
            "maxLength": 500
          },
          "inject_point": {
            "$ref": "#/components/schemas/InjectPointEnum"
          },
          "policy": {
            "type": "string",
            "format": "uuid",
            "readOnly": true,
            "nullable": true
          },
          "policy_name": {
            "type": "string",
            "readOnly": true,
            "default": ""
          },
          "state": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PrivilegedSessionStateEnum"
              }
            ],
            "readOnly": true
          },
          "reason": {
            "type": "string",
            "maxLength": 400
          },
          "approval_state": {
            "type": "string",
            "readOnly": true,
            "default": ""
          },
          "lease_expires_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true,
            "nullable": true
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true,
            "nullable": true
          },
          "ended_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true,
            "nullable": true
          },
          "closed_reason": {
            "type": "string",
            "readOnly": true
          },
          "bytes_up": {
            "type": "integer",
            "readOnly": true
          },
          "bytes_down": {
            "type": "integer",
            "readOnly": true
          },
          "rotate_on_close": {
            "type": "boolean"
          },
          "rotated": {
            "type": "boolean",
            "readOnly": true
          },
          "has_recording": {
            "type": "string",
            "readOnly": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "actor_kind",
          "actor_ref",
          "approval_state",
          "bytes_down",
          "bytes_up",
          "closed_reason",
          "created_at",
          "ended_at",
          "has_recording",
          "id",
          "lease_expires_at",
          "policy",
          "policy_name",
          "rotated",
          "started_at",
          "state",
          "target_ref"
        ]
      },
      "PrivilegedSessionStateEnum": {
        "enum": [
          "requested",
          "approved",
          "active",
          "closed",
          "denied",
          "expired",
          "terminated"
        ],
        "type": "string",
        "description": "* `requested` - Requested\n* `approved` - Approved\n* `active` - Active\n* `closed` - Closed\n* `denied` - Denied\n* `expired` - Expired\n* `terminated` - Terminated"
      },
      "PaginatedSessionPolicyList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?page=4"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?page=2"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SessionPolicy"
            }
          }
        }
      },
      "SessionPolicyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "description": {
            "type": "string",
            "maxLength": 400
          },
          "target_glob": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "allowed_kinds": {},
          "required_capability": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "approval_required": {
            "type": "boolean"
          },
          "approver_roles": {},
          "record": {
            "type": "boolean"
          },
          "max_duration_s": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": -2147483648
          },
          "idle_timeout_s": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": -2147483648
          },
          "rotate_on_close": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "required": [
          "name"
        ]
      },
      "PrivilegedSessionKindEnum": {
        "enum": [
          "ssh",
          "rdp",
          "https",
          "db",
          "api"
        ],
        "type": "string",
        "description": "* `ssh` - SSH\n* `rdp` - RDP\n* `https` - HTTPS\n* `db` - Database\n* `api` - Machine / API"
      },
      "PaginatedPrivilegedSessionList": {
        "type": "object",
        "required": [
          "count",
          "results"
        ],
        "properties": {
          "count": {
            "type": "integer",
            "example": 123
          },
          "next": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?page=4"
          },
          "previous": {
            "type": "string",
            "nullable": true,
            "format": "uri",
            "example": "http://api.example.org/accounts/?page=2"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PrivilegedSession"
            }
          }
        }
      },
      "PatchedPrivilegedSessionRequest": {
        "type": "object",
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/PrivilegedSessionKindEnum"
          },
          "target_kind": {
            "$ref": "#/components/schemas/TargetKindEnum"
          },
          "target_ref": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "credential_ref": {
            "type": "string",
            "maxLength": 500
          },
          "inject_point": {
            "$ref": "#/components/schemas/InjectPointEnum"
          },
          "reason": {
            "type": "string",
            "maxLength": 400
          },
          "rotate_on_close": {
            "type": "boolean"
          }
        }
      },
      "InjectPointEnum": {
        "enum": [
          "cloud",
          "collector"
        ],
        "type": "string",
        "description": "* `cloud` - Cloud broker\n* `collector` - Collector (on-network)"
      },
      "SessionPolicy": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "readOnly": true
          },
          "name": {
            "type": "string",
            "maxLength": 160
          },
          "description": {
            "type": "string",
            "maxLength": 400
          },
          "target_glob": {
            "type": "string",
            "maxLength": 512
          },
          "allowed_kinds": {},
          "required_capability": {
            "type": "string",
            "maxLength": 40
          },
          "approval_required": {
            "type": "boolean"
          },
          "approver_roles": {},
          "record": {
            "type": "boolean"
          },
          "max_duration_s": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": -2147483648
          },
          "idle_timeout_s": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": -2147483648
          },
          "rotate_on_close": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "readOnly": true
          }
        },
        "required": [
          "created_at",
          "id",
          "name"
        ]
      },
      "PrivilegedSessionRequest": {
        "type": "object",
        "properties": {
          "kind": {
            "$ref": "#/components/schemas/PrivilegedSessionKindEnum"
          },
          "target_kind": {
            "$ref": "#/components/schemas/TargetKindEnum"
          },
          "target_ref": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "credential_ref": {
            "type": "string",
            "maxLength": 500
          },
          "inject_point": {
            "$ref": "#/components/schemas/InjectPointEnum"
          },
          "reason": {
            "type": "string",
            "maxLength": 400
          },
          "rotate_on_close": {
            "type": "boolean"
          }
        },
        "required": [
          "target_ref"
        ]
      },
      "PatchedSessionPolicyRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "description": {
            "type": "string",
            "maxLength": 400
          },
          "target_glob": {
            "type": "string",
            "minLength": 1,
            "maxLength": 512
          },
          "allowed_kinds": {},
          "required_capability": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "approval_required": {
            "type": "boolean"
          },
          "approver_roles": {},
          "record": {
            "type": "boolean"
          },
          "max_duration_s": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": -2147483648
          },
          "idle_timeout_s": {
            "type": "integer",
            "maximum": 2147483647,
            "minimum": -2147483648
          },
          "rotate_on_close": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          }
        }
      },
      "TargetKindEnum": {
        "enum": [
          "device",
          "host",
          "url",
          "database"
        ],
        "type": "string",
        "description": "* `device` - Device\n* `host` - Host\n* `url` - URL\n* `database` - Database"
      }
    }
  }
}