{
  "openapi": "3.0.1",
  "info": {
    "title": "UnityTrip User Manager API",
    "description": "Role-based access over isolated tenants: role assignment, the security manifest that maps each application's operations to permitted roles, per-identity activity, and traveller self-registration. Prototype-derived reference spec: servers and authentication are intentionally omitted.",
    "termsOfService": "https://example.com/terms",
    "contact": {
      "name": "UnityTrip",
      "url": "https://unitytrip.com"
    },
    "license": {
      "name": "Example License",
      "url": "https://example.com/license"
    },
    "version": "prototype-v1"
  },
  "paths": {
    "/api/roles/add": {
      "post": {
        "tags": [
          "Roles"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddToRoleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AddToRoleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AddToRoleRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/roles/remove": {
      "post": {
        "tags": [
          "Roles"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveFromRoleRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveFromRoleRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/RemoveFromRoleRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/securitycenter/manifest": {
      "post": {
        "tags": [
          "SecurityCenter"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityManifest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityManifest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SecurityManifest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/securitycenter/activities": {
      "get": {
        "tags": [
          "SecurityCenter"
        ],
        "parameters": [
          {
            "name": "userId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "appIdentifier",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/securitycenter/apps": {
      "get": {
        "tags": [
          "SecurityCenter"
        ],
        "parameters": [
          {
            "name": "userId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/self-register/add": {
      "post": {
        "tags": [
          "SelfRegister"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserSelfRequestionRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/UserSelfRequestionRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/UserSelfRequestionRequest"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/self-register/addbulk": {
      "post": {
        "tags": [
          "SelfRegister"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UserSelfRequestionRequest"
                }
              }
            },
            "text/json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UserSelfRequestionRequest"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UserSelfRequestionRequest"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "boolean"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/self-register/remove": {
      "delete": {
        "tags": [
          "SelfRegister"
        ],
        "parameters": [
          {
            "name": "Identifier",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Email",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "401": {
            "description": "Unauthorized",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AddToRoleRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          },
          "roleId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "ApplicationDescription": {
        "type": "object",
        "properties": {
          "identifier": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "RemoveFromRoleRequest": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          },
          "roleId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "SecurityManifest": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "Discriminator": {
            "type": "string",
            "nullable": true,
            "readOnly": true
          },
          "application": {
            "$ref": "#/components/schemas/ApplicationDescription"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecurityManifestItem"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SecurityManifestItem": {
        "type": "object",
        "properties": {
          "identifier": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "modifier": {
            "$ref": "#/components/schemas/SecurityManifestItemModifier"
          },
          "dependedOn": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SecurityManifestItemModifier": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SecurityManifestItemModifierOption"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SecurityManifestItemModifierOption": {
        "type": "object",
        "properties": {
          "identifier": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "UserSelfRequestionRequest": {
        "type": "object",
        "properties": {
          "identifier": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "firstname": {
            "type": "string",
            "nullable": true
          },
          "lastname": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    }
  }
}