{
  "openapi" : "3.1.0",
  "info" : {
    "description" : "Accounts API",
    "title" : "Accounts",
    "version" : "1.0"
  },
  "externalDocs" : {
    "description" : "Trackunit Developer Hub",
    "url" : "https://dev.trackunit.com/v3.0/"
  },
  "servers" : [ {
    "url" : "https://iris.trackunit.com/api/organization/v1",
    "description" : "Production"
  } ],
  "security" : [ {
    "authorizationBearer" : [ ]
  } ],
  "paths" : {
    "/accounts" : {
      "get" : {
        "operationId" : "getAccounts",
        "parameters" : [ {
          "description" : "filter by account names",
          "in" : "query",
          "name" : "names",
          "required" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          }
        }, {
          "description" : "filter by account external references",
          "in" : "query",
          "name" : "externalReferences",
          "required" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          }
        }, {
          "description" : "Zero-based page index (0..N)",
          "example" : 0,
          "in" : "query",
          "name" : "page",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 0,
            "minimum" : 0
          }
        }, {
          "description" : "The size of the page to be returned",
          "example" : 20,
          "in" : "query",
          "name" : "size",
          "required" : false,
          "schema" : {
            "type" : "integer",
            "format" : "int32",
            "default" : 20,
            "minimum" : 1
          }
        }, {
          "description" : "Sort order: `property` (ascending by default), `+property` (ascending), `-property` (descending).",
          "in" : "query",
          "name" : "sort",
          "required" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            }
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Account"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get accounts",
        "tags" : [ "Accounts" ]
      },
      "post" : {
        "operationId" : "createAccount",
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CreateAccountRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Account"
                }
              }
            },
            "description" : "Account was created"
          },
          "202" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Account"
                }
              }
            },
            "description" : "Account creation was accepted, but is taking longer than expected. The account will be visible shortly."
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Create account",
        "tags" : [ "Accounts" ]
      }
    },
    "/accounts/idByCustomerId/{customerId}" : {
      "get" : {
        "operationId" : "getAccountIdByCustomerId",
        "parameters" : [ {
          "description" : "Classic customer id of the account",
          "in" : "path",
          "name" : "customerId",
          "required" : true,
          "schema" : {
            "type" : "integer",
            "format" : "int32"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "type" : "string",
                  "format" : "uuid"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get account id by customer id",
        "tags" : [ "Accounts" ]
      }
    },
    "/accounts/my" : {
      "get" : {
        "operationId" : "getMyAccount",
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Account"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get my account",
        "tags" : [ "Accounts" ]
      }
    },
    "/accounts/{accountId}" : {
      "delete" : {
        "operationId" : "deleteAccountById",
        "parameters" : [ {
          "in" : "path",
          "name" : "accountId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "204" : {
            "description" : "OK"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Delete account",
        "tags" : [ "Accounts" ]
      },
      "get" : {
        "operationId" : "getAccount",
        "parameters" : [ {
          "in" : "path",
          "name" : "accountId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Account"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get account by id",
        "tags" : [ "Accounts" ]
      },
      "put" : {
        "operationId" : "updateAccount",
        "parameters" : [ {
          "in" : "path",
          "name" : "accountId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/UpdateAccountRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/Account"
                }
              }
            },
            "description" : "Account was updated"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Update account",
        "tags" : [ "Accounts" ]
      }
    },
    "/accounts/{accountId}/disabled" : {
      "delete" : {
        "description" : "Clears the account expiry. Takes effect asynchronously. Requires Trackunit staff permissions.",
        "operationId" : "enableAccount",
        "parameters" : [ {
          "description" : "ID of the account",
          "in" : "path",
          "name" : "accountId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "204" : {
            "description" : "Account was enabled"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Enable account",
        "tags" : [ "Accounts" ]
      },
      "get" : {
        "description" : "Derived from the account expiry.",
        "operationId" : "getAccountDisabled",
        "parameters" : [ {
          "description" : "ID of the account",
          "in" : "path",
          "name" : "accountId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "type" : "boolean"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get whether account is disabled",
        "tags" : [ "Accounts" ]
      },
      "post" : {
        "description" : "Sets the account expiry to the start of the current UTC day. Takes effect asynchronously. Requires Trackunit staff permissions.",
        "operationId" : "disableAccount",
        "parameters" : [ {
          "description" : "ID of the account",
          "in" : "path",
          "name" : "accountId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        }, {
          "description" : "Reason for the change",
          "in" : "query",
          "name" : "note",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "204" : {
            "description" : "Account was disabled"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Disable account",
        "tags" : [ "Accounts" ]
      }
    },
    "/accounts/{accountId}/expires-at" : {
      "get" : {
        "description" : "Returns when the account is disabled. No value means the account is enabled.",
        "operationId" : "getAccountExpiresAt",
        "parameters" : [ {
          "description" : "ID of the account",
          "in" : "path",
          "name" : "accountId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "type" : "string",
                  "format" : "date-time"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get account expiry",
        "tags" : [ "Accounts" ]
      },
      "post" : {
        "description" : "Disables the account from the given time, or enables it when no time is given. Takes effect asynchronously. Requires Trackunit staff permissions.",
        "operationId" : "expireAccount",
        "parameters" : [ {
          "description" : "ID of the account",
          "in" : "path",
          "name" : "accountId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        }, {
          "description" : "When the account is disabled. Omit to enable the account.",
          "in" : "query",
          "name" : "expiresAt",
          "required" : false,
          "schema" : {
            "type" : "string",
            "format" : "date-time"
          }
        }, {
          "description" : "Reason for the change",
          "in" : "query",
          "name" : "note",
          "required" : false,
          "schema" : {
            "type" : "string"
          }
        } ],
        "responses" : {
          "204" : {
            "description" : "Expiry was set"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Set account expiry",
        "tags" : [ "Accounts" ]
      }
    },
    "/accounts/{accountId}/hierarchy" : {
      "get" : {
        "description" : "Returns the account hierarchy for the specified account and downwards",
        "operationId" : "getHierarchy",
        "parameters" : [ {
          "description" : "ID of the account",
          "in" : "path",
          "name" : "accountId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "*/*" : {
                "schema" : {
                  "$ref" : "#/components/schemas/AccountHierarchy"
                }
              }
            },
            "description" : "OK"
          },
          "400" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ConstraintViolationError"
                }
              }
            },
            "description" : "Bad request"
          },
          "401" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Invalid or missing bearer token in Authorization header"
          },
          "403" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "User not allowed to make this request"
          },
          "404" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Resource not found"
          },
          "500" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/DefaultError"
                }
              }
            },
            "description" : "Internal server error"
          }
        },
        "summary" : "Get hierarchy",
        "tags" : [ "Accounts" ]
      }
    }
  },
  "components" : {
    "schemas" : {
      "Account" : {
        "type" : "object",
        "properties" : {
          "address" : {
            "$ref" : "#/components/schemas/Address"
          },
          "contact" : {
            "$ref" : "#/components/schemas/Contact"
          },
          "externalReference" : {
            "type" : "string",
            "description" : "External reference to account"
          },
          "id" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Id of account"
          },
          "language" : {
            "type" : "string",
            "description" : "Language code"
          },
          "name" : {
            "type" : "string",
            "description" : "Name of account"
          },
          "parentId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Id of parent account"
          },
          "timeZoneId" : {
            "type" : "string",
            "description" : "Time zone identifier in IANA format"
          }
        },
        "required" : [ "id", "name", "parentId" ]
      },
      "AccountHierarchy" : {
        "type" : "object",
        "properties" : {
          "accountId" : {
            "type" : "string",
            "format" : "uuid"
          },
          "name" : {
            "type" : "string"
          },
          "subAccounts" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/AccountHierarchy"
            }
          }
        }
      },
      "Address" : {
        "type" : "object",
        "properties" : {
          "city" : {
            "type" : "string",
            "description" : "City",
            "pattern" : "^(?!\\s*$).+"
          },
          "country" : {
            "type" : "string",
            "description" : "Country code (ISO 3166-1 format)",
            "pattern" : "([A-Z]{2})"
          },
          "postalCode" : {
            "type" : "string",
            "description" : "Postal code",
            "pattern" : "^(?!\\s*$).+"
          },
          "streetAddress" : {
            "type" : "string",
            "description" : "Street name and number",
            "pattern" : "^(?!\\s*$).+"
          }
        }
      },
      "ConstraintViolationError" : {
        "type" : "object",
        "properties" : {
          "code" : {
            "type" : [ "string", "null" ],
            "description" : "Alphanumeric code (snake case) describing use case specific error"
          },
          "message" : {
            "type" : "string",
            "description" : "Detailed description of error"
          },
          "properties" : {
            "type" : [ "object", "null" ],
            "additionalProperties" : { },
            "description" : "Additional properties to be included in the error response"
          },
          "status" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "HTTP status code"
          },
          "violations" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/Violation"
            }
          }
        }
      },
      "Contact" : {
        "type" : "object",
        "properties" : {
          "email" : {
            "type" : "string",
            "description" : "Email for account contact",
            "example" : "email@domain.com",
            "pattern" : "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$"
          },
          "phone" : {
            "$ref" : "#/components/schemas/Phone"
          }
        }
      },
      "CreateAccountRequest" : {
        "type" : "object",
        "properties" : {
          "address" : {
            "$ref" : "#/components/schemas/Address"
          },
          "contact" : {
            "$ref" : "#/components/schemas/Contact"
          },
          "externalReference" : {
            "type" : "string",
            "description" : "The external reference to account",
            "pattern" : "^(?![\\s]).*$"
          },
          "language" : {
            "type" : "string",
            "description" : "The language of account",
            "example" : "en-GB",
            "pattern" : "^[a-zA-Z]{2}([-_]{1}[a-zA-Z]{2}){0,1}$"
          },
          "name" : {
            "type" : "string",
            "description" : "The name of the account"
          },
          "parentAccountId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Id of parent account"
          }
        },
        "required" : [ "name" ]
      },
      "DefaultError" : {
        "type" : "object",
        "properties" : {
          "code" : {
            "type" : [ "string", "null" ],
            "description" : "Alphanumeric code (snake case) describing use case specific error"
          },
          "message" : {
            "type" : "string",
            "description" : "Detailed description of error"
          },
          "properties" : {
            "type" : [ "object", "null" ],
            "additionalProperties" : { },
            "description" : "Additional properties to be included in the error response"
          },
          "status" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "HTTP status code"
          }
        }
      },
      "Phone" : {
        "type" : "object",
        "properties" : {
          "countryCode" : {
            "type" : "string",
            "description" : "Country code without any call prefix (plus sign or leading zeros)",
            "example" : 45,
            "minLength" : 1,
            "pattern" : "^[1-9][0-9]{0,3}$"
          },
          "number" : {
            "type" : "string",
            "description" : "Subscriber number",
            "example" : 12345678,
            "minLength" : 1,
            "pattern" : "^[0-9]{1,14}$"
          }
        },
        "required" : [ "countryCode", "number" ]
      },
      "UpdateAccountRequest" : {
        "type" : "object",
        "properties" : {
          "address" : {
            "$ref" : "#/components/schemas/Address"
          },
          "contact" : {
            "$ref" : "#/components/schemas/Contact"
          },
          "externalReference" : {
            "type" : "string",
            "description" : "The external reference to account",
            "pattern" : "^(?![\\s]).*$"
          },
          "language" : {
            "type" : "string",
            "description" : "The language of account in ",
            "example" : "en-GB"
          },
          "name" : {
            "type" : "string",
            "description" : "The name of the account"
          },
          "parentAccountId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Id of parent account"
          }
        },
        "required" : [ "name" ]
      },
      "Violation" : {
        "type" : "object",
        "properties" : {
          "field" : {
            "type" : "string"
          },
          "message" : {
            "type" : "string"
          }
        }
      }
    },
    "securitySchemes" : {
      "authorizationBearer" : {
        "bearerFormat" : "JWT",
        "scheme" : "bearer",
        "type" : "http"
      }
    }
  }
}
