{
  "openapi": "3.0.4",
  "info": {
    "title": "Principal API",
    "description": "Use this API to manage principals.",
    "termsOfService": "https://www.genetec.com/legal/cloudtos",
    "license": {
      "name": "Source Code License Agreement",
      "url": "https://www.genetec.com/legal/eula"
    },
    "version": "2"
  },
  "servers": [
    {
      "url": "/principal"
    }
  ],
  "paths": {
    "/api/v2/accounts/{accountId}/delegations": {
      "post": {
        "tags": [
          "Delegations"
        ],
        "summary": "Create a delegation for an identity.\nThe identity will be able to perform actions on behalf of another identity specified",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.CreateDelegationModel"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.CreateDelegationModel"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.CreateDelegationModel"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.CreateDelegationModel"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Creates a DelegationModel",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationModel"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/accounts/{accountId}/delegations/{identityId}": {
      "get": {
        "tags": [
          "Delegations"
        ],
        "summary": "Retrieve the list of delegations. This will also return delegations that start in the future.",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          },
          {
            "name": "identityId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          },
          {
            "name": "IncludeDelegatedTo",
            "in": "query",
            "schema": {
              "title": "Nullable`1",
              "type": "boolean"
            }
          },
          {
            "name": "StartDateTimeUtc",
            "in": "query",
            "schema": {
              "title": "Nullable`1",
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "EndDateTimeUtc",
            "in": "query",
            "schema": {
              "title": "Nullable`1",
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationsModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationsModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationsModel"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/accounts/{accountId}/delegations/list": {
      "post": {
        "tags": [
          "Delegations"
        ],
        "summary": "Retrieve the delegates for specific identities.",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          },
          {
            "name": "include",
            "in": "query",
            "description": "",
            "schema": {
              "title": "String[]",
              "type": "array",
              "items": {
                "title": "String",
                "type": "string"
              }
            }
          }
        ],
        "requestBody": {
          "description": "List of identityIds for which the active delegations will be retrieved",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "title": "String[]",
                "type": "array",
                "items": {
                  "title": "String",
                  "type": "string"
                }
              }
            },
            "application/json": {
              "schema": {
                "title": "String[]",
                "type": "array",
                "items": {
                  "title": "String",
                  "type": "string"
                }
              }
            },
            "text/json": {
              "schema": {
                "title": "String[]",
                "type": "array",
                "items": {
                  "title": "String",
                  "type": "string"
                }
              }
            },
            "application/*+json": {
              "schema": {
                "title": "String[]",
                "type": "array",
                "items": {
                  "title": "String",
                  "type": "string"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationsModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationsModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationsModel"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/accounts/{accountId}/delegations/{delegationId}": {
      "put": {
        "tags": [
          "Delegations"
        ],
        "summary": "Update a delegation",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          },
          {
            "name": "delegationId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.UpdateDelegationModel"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.UpdateDelegationModel"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.UpdateDelegationModel"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.UpdateDelegationModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationModel"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Delegations"
        ],
        "summary": "Delete a delegation",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          },
          {
            "name": "delegationId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationModel"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/accounts/{accountId}/identityPrincipals/{identityId}": {
      "get": {
        "tags": [
          "IdentityPrincipals"
        ],
        "summary": "Gets a user principal by identity id.",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "The account id.",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          },
          {
            "name": "identityId",
            "in": "path",
            "description": "The identity id to lookup principal for.",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns UserPrincipalModel response",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.IdentityPrincipalModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.IdentityPrincipalModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.IdentityPrincipalModel"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/principals/{principalId}": {
      "get": {
        "tags": [
          "Principals"
        ],
        "summary": "Gets a principal and it's accounts by id.",
        "parameters": [
          {
            "name": "principalId",
            "in": "path",
            "description": "The principal id to find.",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns PrincipalModel response",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.PrincipalModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.PrincipalModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.PrincipalModel"
                }
              }
            }
          },
          "404": {
            "description": "Could not find a principal with the specified id."
          }
        },
        "deprecated": true
      }
    },
    "/api/v2/accounts/{accountId}/servicePrincipals/{principalId}": {
      "get": {
        "tags": [
          "ServicePrincipals"
        ],
        "summary": "Get a service principal by principalId and accountId.\nThis endpoint can be accessed by an system service,\nand an accountOwner of the accountId requested",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          },
          {
            "name": "principalId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns ServicePrincipalModel response",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.ServicePrincipalModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.ServicePrincipalModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.ServicePrincipalModel"
                }
              }
            }
          },
          "404": {
            "description": "Could not find a service principal with the specified id."
          }
        }
      },
      "put": {
        "tags": [
          "ServicePrincipals"
        ],
        "summary": "Update a service principal.\nThis endpoint can be accessed by a system service\nand an accountOwner of the accountId requested",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          },
          {
            "name": "principalId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.V2.UpdateServicePrincipalModel"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.V2.UpdateServicePrincipalModel"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.V2.UpdateServicePrincipalModel"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.V2.UpdateServicePrincipalModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.ServicePrincipalModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.ServicePrincipalModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.ServicePrincipalModel"
                }
              }
            }
          },
          "201": {
            "description": "Updates a ServicePrincipalModel"
          }
        }
      },
      "delete": {
        "tags": [
          "ServicePrincipals"
        ],
        "summary": "Delete a service principal.\nThis endpoint can be accessed by an system service,\nand an accountOwner of the accountId requested",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          },
          {
            "name": "principalId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "204": {
            "description": "Deletes a ServicePrincipalModel"
          }
        }
      }
    },
    "/api/v2/accounts/{accountId}/servicePrincipals": {
      "get": {
        "tags": [
          "ServicePrincipals"
        ],
        "summary": "List the service principals of an account.\n This endpoint can be accessed by an system service,\n and an account Owner of the accountId requested",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          },
          {
            "name": "take",
            "in": "query",
            "description": "",
            "schema": {
              "title": "Nullable`1",
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "continuationToken",
            "in": "query",
            "description": "",
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns ServicePrincipalListModel response",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.ServicePrincipalListModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.ServicePrincipalListModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.ServicePrincipalListModel"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "ServicePrincipals"
        ],
        "summary": "Create a service principal.\nThis endpoint can be accessed by an system service\nand an accountOwner of the accountId requested",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.CreateServicePrincipalModel"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.CreateServicePrincipalModel"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.CreateServicePrincipalModel"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.CreateServicePrincipalModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.ServicePrincipalModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.ServicePrincipalModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.ServicePrincipalModel"
                }
              }
            }
          },
          "201": {
            "description": "Creates a ServicePrincipalModel"
          }
        }
      }
    },
    "/api/v2/accounts/{accountId}/servicePrincipals/{principalId}/key": {
      "post": {
        "tags": [
          "ServicePrincipals"
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          },
          {
            "name": "principalId",
            "in": "path",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.SignatureKey"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.SignatureKey"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.SignatureKey"
                }
              }
            }
          }
        },
        "deprecated": true
      }
    },
    "/api/v2/accounts/{accountId}/servicePrincipals/{principalId}/secrets": {
      "post": {
        "tags": [
          "ServicePrincipals"
        ],
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          },
          {
            "name": "principalId",
            "in": "path",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Secrets.SecretsCreatedModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Secrets.SecretsCreatedModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Secrets.SecretsCreatedModel"
                }
              }
            }
          }
        }
      }
    },
    "/api/v2/accounts/{accountId}/userPrincipals/{principalId}": {
      "get": {
        "tags": [
          "UserPrincipals"
        ],
        "summary": "Get a principals by principalId and accountId.\nThis endpoint can be accessed by an system service,\na service that have the same accountId as requested\nand an accountOwner of the accountId requested",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          },
          {
            "name": "principalId",
            "in": "path",
            "description": "The principals id as an email to find.",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns PrincipalEmailRouteModel response",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.UserPrincipalModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.UserPrincipalModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.UserPrincipalModel"
                }
              }
            }
          },
          "404": {
            "description": "Could not find a user principals with the specified id."
          }
        }
      },
      "put": {
        "tags": [
          "UserPrincipals"
        ],
        "summary": "Create or update a principals.\nThis endpoint can be accessed by an system service,\na service that have the same accountId as requested\nand an accountOwner of the accountId requested",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          },
          {
            "name": "principalId",
            "in": "path",
            "description": "The principals id as an email to find.",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "description": "",
          "content": {
            "application/json-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.V2.CreateOrUpdateUserPrincipalModel"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.V2.CreateOrUpdateUserPrincipalModel"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.V2.CreateOrUpdateUserPrincipalModel"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.V2.CreateOrUpdateUserPrincipalModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.UserPrincipalModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.UserPrincipalModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.UserPrincipalModel"
                }
              }
            }
          },
          "201": {
            "description": "Creates a PrincipalEmailRouteModel"
          }
        },
        "deprecated": true
      },
      "delete": {
        "tags": [
          "UserPrincipals"
        ],
        "summary": "Delete a user principals.\nThis endpoint can be accessed by an system service,\na service that have the same accountId as requested\nand an accountOwner of the accountId requested",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          },
          {
            "name": "principalId",
            "in": "path",
            "description": "The principals id as an email to find.",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          },
          "204": {
            "description": "Deletes a PrincipalEmailRouteModel"
          }
        }
      }
    },
    "/api/v2/accounts/{accountId}/userPrincipals/admins": {
      "get": {
        "tags": [
          "UserPrincipals"
        ],
        "summary": "Lists admin principals by accountId.\nThis endpoint can be accessed by an system service,\na service that have the same accountId as requested\nand an accountOwner of the accountId requested",
        "parameters": [
          {
            "name": "accountId",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "title": "String",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Returns list of principals",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.UserPrincipalsListModel"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.UserPrincipalsListModel"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.UserPrincipalsListModel"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.CreateDelegationModel": {
        "title": "CreateDelegationModel",
        "required": [
          "delegatedTo",
          "delegator",
          "startDateTimeUtc"
        ],
        "type": "object",
        "properties": {
          "delegatedTo": {
            "title": "String",
            "minLength": 1,
            "type": "string"
          },
          "delegator": {
            "title": "String",
            "minLength": 1,
            "type": "string"
          },
          "startDateTimeUtc": {
            "title": "DateTime",
            "type": "string",
            "format": "date-time"
          },
          "endDateTimeUtc": {
            "title": "Nullable`1",
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "comment": {
            "title": "String",
            "maxLength": 300,
            "minLength": 0,
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationModel": {
        "title": "DelegationModel",
        "type": "object",
        "properties": {
          "delegationId": {
            "title": "String",
            "type": "string",
            "description": "Unique Id of the delegation",
            "nullable": true
          },
          "delegatedTo": {
            "title": "String",
            "type": "string",
            "description": "Identity id of the user receiving the delegation",
            "nullable": true
          },
          "delegator": {
            "title": "String",
            "type": "string",
            "description": "Identity id of the user delegating their permissions",
            "nullable": true
          },
          "startDateTimeUtc": {
            "title": "DateTime",
            "type": "string",
            "description": "Start date time the delegation takes effect",
            "format": "date-time"
          },
          "endDateTimeUtc": {
            "title": "Nullable`1",
            "type": "string",
            "description": "End date time the delegation takes effect",
            "format": "date-time",
            "nullable": true
          },
          "comment": {
            "title": "String",
            "type": "string",
            "description": "Comment associated with the delegation",
            "nullable": true
          },
          "ordinal": {
            "title": "Int64",
            "type": "integer",
            "description": "The commit ordinal",
            "format": "int64"
          },
          "isDeleted": {
            "title": "Boolean",
            "type": "boolean",
            "description": "Whether the delegation is deleted"
          },
          "deletedOnUtc": {
            "title": "Nullable`1",
            "type": "string",
            "description": "Date time of the deletion",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationsModel": {
        "title": "DelegationsModel",
        "type": "object",
        "properties": {
          "delegations": {
            "title": "DelegationModel[]",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.DelegationModel"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.Delegation.UpdateDelegationModel": {
        "title": "UpdateDelegationModel",
        "required": [
          "ordinal",
          "startDateTimeUtc"
        ],
        "type": "object",
        "properties": {
          "startDateTimeUtc": {
            "title": "DateTime",
            "type": "string",
            "format": "date-time"
          },
          "endDateTimeUtc": {
            "title": "Nullable`1",
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "comment": {
            "title": "String",
            "maxLength": 300,
            "minLength": 0,
            "type": "string",
            "nullable": true
          },
          "ordinal": {
            "title": "Int64",
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.IdentityPrincipalModel": {
        "title": "IdentityPrincipalModel",
        "type": "object",
        "properties": {
          "principalId": {
            "title": "String",
            "type": "string",
            "description": "The unique identifier of the principal.",
            "nullable": true
          },
          "accountId": {
            "title": "String",
            "type": "string",
            "description": "The accountId of the principal.",
            "nullable": true
          },
          "roles": {
            "title": "String[]",
            "type": "array",
            "items": {
              "title": "String",
              "type": "string"
            },
            "description": "The roles of the principal.",
            "nullable": true
          },
          "principalState": {
            "title": "String",
            "type": "string",
            "description": "Set the principal state",
            "nullable": true,
            "example": "Active"
          },
          "principalType": {
            "title": "String",
            "type": "string",
            "description": "The role of the principal in the system.",
            "nullable": true,
            "example": "User"
          },
          "identityId": {
            "title": "String",
            "type": "string",
            "description": "The Id of the Identity linked to the principal.",
            "nullable": true
          },
          "restrictedPermissions": {
            "title": "String[]",
            "type": "array",
            "items": {
              "title": "String",
              "type": "string"
            },
            "description": "The restricted permissions of the principal.",
            "nullable": true
          },
          "eTag": {
            "title": "String",
            "type": "string",
            "description": "The Etag of the entity",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.PrincipalAccountModel": {
        "title": "PrincipalAccountModel",
        "type": "object",
        "properties": {
          "accountId": {
            "title": "String",
            "type": "string",
            "description": "The unique identifier of the account.",
            "nullable": true
          },
          "id": {
            "title": "String",
            "type": "string",
            "description": "The unique identifier of the principal within the account.",
            "nullable": true
          },
          "subject": {
            "title": "String",
            "type": "string",
            "description": "The unique identifier of the user from the identity provider.",
            "nullable": true
          },
          "accountState": {
            "title": "String",
            "type": "string",
            "description": "The state of the account. AVOID using this property.",
            "nullable": true,
            "example": "Active"
          },
          "principalState": {
            "title": "String",
            "type": "string",
            "description": "The state of the principal within this account.",
            "nullable": true,
            "example": "Active"
          },
          "roles": {
            "title": "String[]",
            "type": "array",
            "items": {
              "title": "String",
              "type": "string"
            },
            "description": "The list of roles of the user in this account.",
            "nullable": true
          },
          "restrictedPermissions": {
            "title": "String[]",
            "type": "array",
            "items": {
              "title": "String",
              "type": "string"
            },
            "description": "The list of restricted permissions of the user in this account.",
            "nullable": true
          },
          "signatureKey": {
            "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.SignatureKey"
          },
          "sharedSecret": {
            "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Secrets.SharedSecretModel"
          },
          "allowedGrantTypes": {
            "title": "String[]",
            "type": "array",
            "items": {
              "title": "String",
              "type": "string"
            },
            "description": "The allowed grant types for this principal to request a token.",
            "nullable": true
          },
          "identityId": {
            "title": "String",
            "type": "string",
            "description": "The identifier of the user in the region",
            "nullable": true
          },
          "ordinal": {
            "title": "Int64",
            "type": "integer",
            "description": "The ordinal of the principal for the account.",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.PrincipalModel": {
        "title": "PrincipalModel",
        "type": "object",
        "properties": {
          "accounts": {
            "title": "PrincipalAccountModel[]",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.PrincipalAccountModel"
            },
            "description": "The accounts which the principal has access.",
            "nullable": true
          },
          "principalId": {
            "title": "String",
            "type": "string",
            "description": "The unique identifier of the principal.",
            "nullable": true
          },
          "principalType": {
            "title": "String",
            "type": "string",
            "description": "The role of the principal in the system.",
            "nullable": true,
            "example": "User"
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.Secrets.SecretsCreatedModel": {
        "title": "SecretsCreatedModel",
        "type": "object",
        "properties": {
          "sharedSecret": {
            "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.Secrets.SharedSecretCreatedModel"
          },
          "jwkSecret": {
            "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.SignatureKey"
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.Secrets.SharedSecretCreatedModel": {
        "title": "SharedSecretCreatedModel",
        "type": "object",
        "properties": {
          "clientSecret": {
            "title": "String",
            "type": "string",
            "description": "The client secret in clear. Save this value because it cannot be obtained afterwards.",
            "nullable": true
          },
          "clientSecretExpiresAt": {
            "title": "Nullable`1",
            "type": "integer",
            "description": "The epoch time at which the client secret will expire. If 0, it means it never expires.",
            "format": "int64",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.Secrets.SharedSecretModel": {
        "title": "SharedSecretModel",
        "type": "object",
        "properties": {
          "clientSecret": {
            "title": "String",
            "type": "string",
            "description": "The client secret hashed.",
            "nullable": true
          },
          "clientSecretExpiresAt": {
            "title": "Nullable`1",
            "type": "integer",
            "description": "The epoch time at which the client secret will expire. If 0, it means it never expires.",
            "format": "int64",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.CreateServicePrincipalModel": {
        "title": "CreateServicePrincipalModel",
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "title": "String",
            "maxLength": 50,
            "minLength": 1,
            "type": "string"
          },
          "description": {
            "title": "String",
            "maxLength": 100,
            "minLength": 0,
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.ServicePrincipalListModel": {
        "title": "ServicePrincipalListModel",
        "type": "object",
        "properties": {
          "services": {
            "title": "IEnumerable`1",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.ServicePrincipalModel"
            },
            "nullable": true
          },
          "continuationToken": {
            "title": "String",
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.ServicePrincipalModel": {
        "title": "ServicePrincipalModel",
        "type": "object",
        "properties": {
          "principalId": {
            "title": "String",
            "type": "string",
            "description": "The unique identifier of the principal.",
            "nullable": true
          },
          "accountId": {
            "title": "String",
            "type": "string",
            "description": "The accountId of the principal.",
            "nullable": true
          },
          "name": {
            "title": "String",
            "type": "string",
            "description": "The name of the service principal",
            "nullable": true
          },
          "description": {
            "title": "String",
            "type": "string",
            "description": "The description of the service principal",
            "nullable": true
          },
          "eTag": {
            "title": "String",
            "type": "string",
            "description": "The version of the service principal. Required for updates.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.SignatureKey": {
        "title": "SignatureKey",
        "type": "object",
        "properties": {
          "kid": {
            "title": "String",
            "type": "string",
            "description": "SignatureKey identifier.",
            "nullable": true
          },
          "keyType": {
            "title": "String",
            "type": "string",
            "description": "The cryptographic algorithm family used with the key.",
            "nullable": true
          },
          "algorithm": {
            "title": "String",
            "type": "string",
            "description": "The algorithm intended for use with the key.",
            "nullable": true
          },
          "exponent": {
            "title": "String",
            "type": "string",
            "description": "The exponent part of the public key.",
            "nullable": true
          },
          "modulus": {
            "title": "String",
            "type": "string",
            "description": "The modulus part of the public key.",
            "nullable": true
          },
          "d": {
            "title": "String",
            "type": "string",
            "description": "The D part of the private key.",
            "nullable": true
          },
          "dp": {
            "title": "String",
            "type": "string",
            "description": "The DP part of the private key.",
            "nullable": true
          },
          "dq": {
            "title": "String",
            "type": "string",
            "description": "The DQ part of the private key.",
            "nullable": true
          },
          "inverseQ": {
            "title": "String",
            "type": "string",
            "description": "The InverseQ part of the private key.",
            "nullable": true
          },
          "p": {
            "title": "String",
            "type": "string",
            "description": "The P part of the private key.",
            "nullable": true
          },
          "q": {
            "title": "String",
            "type": "string",
            "description": "The InverseQ part of the private key.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.ServicePrincipals.V2.UpdateServicePrincipalModel": {
        "title": "UpdateServicePrincipalModel",
        "required": [
          "eTag",
          "name"
        ],
        "type": "object",
        "properties": {
          "eTag": {
            "title": "String",
            "minLength": 1,
            "type": "string"
          },
          "name": {
            "title": "String",
            "maxLength": 50,
            "minLength": 1,
            "type": "string"
          },
          "description": {
            "title": "String",
            "maxLength": 100,
            "minLength": 0,
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.UserPrincipalModel": {
        "title": "UserPrincipalModel",
        "type": "object",
        "properties": {
          "principalId": {
            "title": "String",
            "type": "string",
            "description": "The unique identifier of the principal.",
            "nullable": true
          },
          "accountId": {
            "title": "String",
            "type": "string",
            "description": "The accountId of the principal.",
            "nullable": true
          },
          "roles": {
            "title": "String[]",
            "type": "array",
            "items": {
              "title": "String",
              "type": "string"
            },
            "description": "The roles of the principal.",
            "nullable": true
          },
          "restrictedPermissions": {
            "title": "String[]",
            "type": "array",
            "items": {
              "title": "String",
              "type": "string"
            },
            "description": "The restricted permissions of the principal",
            "nullable": true
          },
          "principalState": {
            "title": "String",
            "type": "string",
            "description": "Set the principal state",
            "nullable": true,
            "example": "Active"
          },
          "identityId": {
            "title": "String",
            "type": "string",
            "description": "The Id of the Identity linked to the principal.",
            "nullable": true
          },
          "subject": {
            "title": "String",
            "type": "string",
            "description": "The unique identifier from the identity provider (authentication authority).",
            "nullable": true
          },
          "externalSyncSourceId": {
            "title": "String",
            "type": "string",
            "description": "The Id of the external source of synchronization.",
            "nullable": true
          },
          "id": {
            "title": "String",
            "type": "string",
            "description": "The internal unique identifier of the principal.",
            "nullable": true
          },
          "eTag": {
            "title": "String",
            "type": "string",
            "description": "The Etag of the entity",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.UserPrincipalsListModel": {
        "title": "UserPrincipalsListModel",
        "type": "object",
        "properties": {
          "totalCount": {
            "title": "Nullable`1",
            "type": "integer",
            "format": "int64",
            "nullable": true
          },
          "userPrincipals": {
            "title": "UserPrincipalModel[]",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.UserPrincipalModel"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "Genetec.SaaS.Iams.PrincipalService.Business.Models.UserPrincipals.V2.CreateOrUpdateUserPrincipalModel": {
        "title": "CreateOrUpdateUserPrincipalModel",
        "required": [
          "identityId",
          "principalState",
          "roles"
        ],
        "type": "object",
        "properties": {
          "identityId": {
            "title": "String",
            "minLength": 1,
            "type": "string",
            "description": "The id of the identity of the principal."
          },
          "roles": {
            "title": "String[]",
            "minItems": 1,
            "type": "array",
            "items": {
              "title": "String",
              "type": "string"
            },
            "description": "The role of the principal in the account.",
            "example": [
              "admin"
            ]
          },
          "principalState": {
            "title": "String",
            "minLength": 1,
            "type": "string",
            "description": "Set the principal state",
            "example": "Active"
          },
          "restrictedPermissions": {
            "title": "String[]",
            "type": "array",
            "items": {
              "title": "String",
              "type": "string"
            },
            "description": "The restricted permisssions of the principal in the account.",
            "nullable": true
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://sts-demo.clearid.io/connect/authorize",
            "tokenUrl": "https://sts-demo.clearid.io/connect/token",
            "scopes": {
              "openid": "openid"
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "oauth2": [
        "access"
      ]
    }
  ],
  "tags": [
    {
      "name": "Delegations"
    },
    {
      "name": "IdentityPrincipals"
    },
    {
      "name": "Principals"
    },
    {
      "name": "ServicePrincipals"
    },
    {
      "name": "UserPrincipals"
    }
  ]
}