{
  "openapi" : "3.1.0",
  "info" : {
    "description" : "This API allows managing customers.",
    "title" : "Customer API",
    "version" : "1.0"
  },
  "externalDocs" : {
    "description" : "Trackunit Developer Hub",
    "url" : "https://developers.trackunit.com/"
  },
  "servers" : [ {
    "url": "https://iris.trackunit.com/api/customer/v1",
    "description" : "Production"
  } ],
  "security" : [ {
    "authorizationBearer" : [ ]
  } ],
  "tags" : [ {
    "description" : "Customers API",
    "name" : "Customers"
  }, {
    "description" : "Contacts API",
    "name" : "Contacts"
  }, {
    "description" : "Customer Portals API",
    "name" : "Customer Portals"
  }, {
    "description" : "Customer Portal Templates API",
    "name" : "Customer Portal Templates"
  }, {
    "description" : "Assets API",
    "name" : "Assets"
  } ],
  "paths" : {
    "/contacts" : {
      "post" : {
        "description" : "Get contacts, across customers.",
        "operationId" : "getContactsByIds",
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "type" : "array",
                "description" : "Contact IDs.",
                "items" : {
                  "type" : "string",
                  "format" : "uuid"
                },
                "maxItems" : 1000,
                "minItems" : 0,
                "uniqueItems" : true
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "$ref" : "#/components/schemas/ContactResponse"
                  }
                }
              }
            },
            "description" : "Contacts"
          },
          "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 Contacts",
        "tags" : [ "Contacts" ]
      }
    },
    "/customer-portal-access" : {
      "post" : {
        "description" : "Provision Customer Portal access for a provided user. Will return an access request ID to keep track of the provisioning process.",
        "operationId" : "provisionCustomerPortalAccess",
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CustomerPortalAccessRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "202" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ProvisionCustomerPortalAccessResponse"
                }
              }
            },
            "description" : "Request was accepted. Use the returned access request ID to keep track of the provisioning process."
          },
          "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" : "Provision Customer Portal Access",
        "tags" : [ "Customer Portals" ]
      }
    },
    "/customer-portal-templates/{templateId}/assignments" : {
      "patch" : {
        "description" : "Assign and/or unassign a customer portal template to/from customer portals.",
        "operationId" : "updateCustomerPortalTemplateAssignments",
        "parameters" : [ {
          "description" : "Customer Portal Template ID",
          "in" : "path",
          "name" : "templateId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/UpdateTemplateAssignmentsRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "Assignments have been 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" : "Assign/Unassign Customer Portals to Template",
        "tags" : [ "Customer Portal Templates" ]
      }
    },
    "/customer-portals/customers/{customerId}/token" : {
      "get" : {
        "description" : "Get Impersonated API Token for Customer Portal",
        "operationId" : "exchangeToken",
        "parameters" : [ {
          "description" : "Invited Customer ID",
          "in" : "path",
          "name" : "customerId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ExchangedTokenResponse"
                }
              }
            },
            "description" : "Impersonated Customer Portal API Token."
          },
          "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 Impersonated API Token",
        "tags" : [ "Customer Portals" ]
      }
    },
    "/customer-portals/{customerPortalId}" : {
      "patch" : {
        "description" : "Update Customer Portal configuration/template assignment.",
        "operationId" : "updateCustomerPortal",
        "parameters" : [ {
          "description" : "Customer Portal ID",
          "in" : "path",
          "name" : "customerPortalId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CustomerPortalUpdateRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CustomerPortalResponse"
                }
              }
            },
            "description" : "Updated customer portal."
          },
          "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 Customer Portal",
        "tags" : [ "Customer Portals" ]
      }
    },
    "/customer-type-summary" : {
      "get" : {
        "description" : "Get summary on customer types",
        "operationId" : "getCustomerTypesSummary",
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CustomerTypeSummaryResponse"
                }
              }
            },
            "description" : "Get summary on customer types"
          },
          "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 Customer Types Summary",
        "tags" : [ "Customers" ]
      }
    },
    "/customers" : {
      "get" : {
        "description" : "Get a list of customers.",
        "operationId" : "getCustomers",
        "parameters" : [ {
          "description" : "Limits to only include items matching the given ids.",
          "in" : "query",
          "name" : "ids",
          "required" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string",
              "format" : "uuid"
            },
            "maxItems" : 20,
            "minItems" : 0,
            "uniqueItems" : true
          }
        }, {
          "description" : "Limits to only include items matching the given types.",
          "in" : "query",
          "name" : "types",
          "required" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string",
              "enum" : [ "CONTRACTOR", "DEALER", "DISTRIBUTOR", "OEM", "RENTAL", "SERVICE", "OTHER" ]
            },
            "maxItems" : 20,
            "minItems" : 0,
            "uniqueItems" : true
          }
        }, {
          "description" : "Limits to only include items matching the given sources.",
          "in" : "query",
          "name" : "sources",
          "required" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string",
              "enum" : [ "USER_DEFINED", "SYSTEM_DEFINED", "CLASSIC_MIGRATION" ]
            },
            "maxItems" : 20,
            "minItems" : 0,
            "uniqueItems" : true
          }
        }, {
          "description" : "Limits to only include items matching the given references.",
          "in" : "query",
          "name" : "externalReferences",
          "required" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string"
            },
            "maxItems" : 20,
            "minItems" : 0,
            "uniqueItems" : true
          }
        }, {
          "description" : "Limits to only include items which name contains the given string. Comparison is case-insensitive.",
          "in" : "query",
          "name" : "nameContains",
          "required" : false,
          "schema" : {
            "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" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PaginatedCustomerResponse"
                }
              }
            },
            "description" : "A list of customers."
          },
          "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 Customers",
        "tags" : [ "Customers" ]
      },
      "post" : {
        "description" : "Add customer information",
        "operationId" : "createCustomer",
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CreateCustomerRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CustomerResponse"
                }
              }
            },
            "description" : "Customer created."
          },
          "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 Customer",
        "tags" : [ "Customers" ]
      }
    },
    "/customers/by-external-reference/{customerExternalReference}/portal" : {
      "patch" : {
        "description" : "Update Customer Portal configuration/template assignment for a given customer external reference.",
        "operationId" : "updateCustomerPortalByCustomerExternalReference",
        "parameters" : [ {
          "description" : "Invited Customer External Reference",
          "in" : "path",
          "name" : "customerExternalReference",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CustomerPortalUpdateRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CustomerPortalResponse"
                }
              }
            },
            "description" : "Updated customer portal."
          },
          "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 Customer Portal by Customer External Reference",
        "tags" : [ "Customer Portals" ]
      },
      "post" : {
        "description" : "Create Customer Portal for a given customer external reference. This operation is asynchronous. The Customer portal will be created in the background. Use customerPortalId to check the status of the creation.",
        "operationId" : "createCustomerPortalByCustomerExternalReference",
        "parameters" : [ {
          "description" : "Invited Customer External Reference",
          "in" : "path",
          "name" : "customerExternalReference",
          "required" : true,
          "schema" : {
            "type" : "string"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CustomerPortalCreateRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "202" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CustomerPortalResponse"
                }
              }
            },
            "description" : "Customer portal creation was accepted and will be created 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 Customer Portal for Customer by External Reference",
        "tags" : [ "Customer Portals" ]
      }
    },
    "/customers/{customerId}" : {
      "delete" : {
        "description" : "Delete customer information.",
        "operationId" : "deleteCustomer",
        "parameters" : [ {
          "description" : "Customer ID.",
          "in" : "path",
          "name" : "customerId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "204" : {
            "description" : "Customer was deleted."
          },
          "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 Customer",
        "tags" : [ "Customers" ]
      },
      "get" : {
        "description" : "Get a customer.",
        "operationId" : "getCustomer",
        "parameters" : [ {
          "description" : "Customer ID.",
          "in" : "path",
          "name" : "customerId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CustomerResponse"
                }
              }
            },
            "description" : "A customer."
          },
          "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 Customer",
        "tags" : [ "Customers" ]
      },
      "patch" : {
        "description" : "Update customer information.",
        "operationId" : "updateCustomer",
        "parameters" : [ {
          "description" : "Customer ID.",
          "in" : "path",
          "name" : "customerId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/UpdateCustomerRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CustomerResponse"
                }
              }
            },
            "description" : "Updated customer."
          },
          "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 Customer",
        "tags" : [ "Customers" ]
      }
    },
    "/customers/{customerId}/assets" : {
      "get" : {
        "description" : "Get list of assets for customer",
        "operationId" : "getAssets",
        "parameters" : [ {
          "description" : "Customer ID",
          "in" : "path",
          "name" : "customerId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "type" : "array",
                  "items" : {
                    "type" : "string",
                    "format" : "uuid"
                  }
                }
              }
            },
            "description" : "A list of assetIds"
          },
          "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 Assets",
        "tags" : [ "Assets" ]
      },
      "patch" : {
        "description" : "Update assets on customer.",
        "operationId" : "updateAsset",
        "parameters" : [ {
          "description" : "Customer ID.",
          "in" : "path",
          "name" : "customerId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/UpdateAssetsRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "description" : "Updated assets."
          },
          "202" : {
            "description" : "Update assets was accepted, but is taking longer than expected."
          },
          "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 Asset",
        "tags" : [ "Assets" ]
      }
    },
    "/customers/{customerId}/contacts" : {
      "get" : {
        "description" : "Get a list of contacts",
        "operationId" : "getContacts",
        "parameters" : [ {
          "description" : "Customer ID.",
          "in" : "path",
          "name" : "customerId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        }, {
          "description" : "Limits to a list containing customers with the ids.",
          "in" : "query",
          "name" : "ids",
          "required" : false,
          "schema" : {
            "type" : "array",
            "items" : {
              "type" : "string",
              "format" : "uuid"
            },
            "maxItems" : 20,
            "minItems" : 0,
            "uniqueItems" : true
          }
        }, {
          "description" : "Limits to only include items which name contains the given string. Comparison is case-insensitive.",
          "in" : "query",
          "name" : "nameContains",
          "required" : false,
          "schema" : {
            "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" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/PaginatedContactResponse"
                }
              }
            },
            "description" : "A list of contacts"
          },
          "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 Contacts",
        "tags" : [ "Contacts" ]
      },
      "post" : {
        "description" : "Add contact information.",
        "operationId" : "createContact",
        "parameters" : [ {
          "description" : "Customer ID.",
          "in" : "path",
          "name" : "customerId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CreateContactRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "201" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ContactResponse"
                }
              }
            },
            "description" : "Newly created contact."
          },
          "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 Contact",
        "tags" : [ "Contacts" ]
      }
    },
    "/customers/{customerId}/contacts/{contactId}" : {
      "delete" : {
        "description" : "Delete contact information.",
        "operationId" : "deleteContact",
        "parameters" : [ {
          "description" : "Customer ID.",
          "in" : "path",
          "name" : "customerId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        }, {
          "description" : "Contact ID.",
          "in" : "path",
          "name" : "contactId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "204" : {
            "description" : "Contact was deleted."
          },
          "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 Contact",
        "tags" : [ "Contacts" ]
      },
      "get" : {
        "description" : "Get a contact",
        "operationId" : "getContact",
        "parameters" : [ {
          "description" : "Customer ID.",
          "in" : "path",
          "name" : "customerId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        }, {
          "description" : "Contact ID.",
          "in" : "path",
          "name" : "contactId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ContactResponse"
                }
              }
            },
            "description" : "A contact"
          },
          "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 Contact",
        "tags" : [ "Contacts" ]
      },
      "patch" : {
        "description" : "Update contact information.",
        "operationId" : "updateContact",
        "parameters" : [ {
          "description" : "Customer ID.",
          "in" : "path",
          "name" : "customerId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        }, {
          "description" : "Contact ID.",
          "in" : "path",
          "name" : "contactId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/UpdateContactRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/ContactResponse"
                }
              }
            },
            "description" : "Updated contact."
          },
          "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 Contact",
        "tags" : [ "Contacts" ]
      }
    },
    "/customers/{customerId}/portal" : {
      "patch" : {
        "description" : "Update Customer Portal configuration for a given customer.",
        "operationId" : "updateCustomerPortalByCustomerId",
        "parameters" : [ {
          "description" : "Invited Customer ID",
          "in" : "path",
          "name" : "customerId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CustomerPortalUpdateRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "200" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CustomerPortalResponse"
                }
              }
            },
            "description" : "Updated customer portal."
          },
          "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 Customer Portal for Customer",
        "tags" : [ "Customer Portals" ]
      },
      "post" : {
        "description" : "Create Customer Portal for a given customer. This operation is asynchronous. The Customer portal will be created in the background. Use customerPortalId to check the status of the creation.",
        "operationId" : "createCustomerPortalByCustomerId",
        "parameters" : [ {
          "description" : "Invited Customer ID",
          "in" : "path",
          "name" : "customerId",
          "required" : true,
          "schema" : {
            "type" : "string",
            "format" : "uuid"
          }
        } ],
        "requestBody" : {
          "content" : {
            "application/json" : {
              "schema" : {
                "$ref" : "#/components/schemas/CustomerPortalCreateRequest"
              }
            }
          },
          "required" : true
        },
        "responses" : {
          "202" : {
            "content" : {
              "application/json" : {
                "schema" : {
                  "$ref" : "#/components/schemas/CustomerPortalResponse"
                }
              }
            },
            "description" : "Customer portal creation was accepted and will be created 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 Customer Portal for Customer",
        "tags" : [ "Customer Portals" ]
      }
    }
  },
  "components" : {
    "schemas" : {
      "Address" : {
        "type" : "object",
        "description" : "Address for a customer.",
        "properties" : {
          "city" : {
            "type" : [ "string", "null" ],
            "example" : "Aalborg",
            "maxLength" : 255,
            "minLength" : 0
          },
          "country" : {
            "type" : [ "string", "null" ],
            "example" : "DK",
            "maxLength" : 255,
            "minLength" : 0
          },
          "streetAddress" : {
            "type" : [ "string", "null" ],
            "example" : "Gasvaerksvej 24",
            "maxLength" : 1024,
            "minLength" : 0
          },
          "zipCode" : {
            "type" : [ "string", "null" ],
            "example" : 9000,
            "maxLength" : 50,
            "minLength" : 0
          }
        }
      },
      "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"
            }
          }
        }
      },
      "ContactResponse" : {
        "type" : "object",
        "description" : "Response for a contact for a customer.",
        "properties" : {
          "customerId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Unique ID for the contacts customer.",
            "example" : "c759a694-67de-45cb-ad24-cf4a169f9ff1"
          },
          "email" : {
            "type" : [ "string", "null" ],
            "example" : "email@domain.com"
          },
          "externalReference" : {
            "type" : [ "string", "null" ],
            "description" : "Identifier helping with integrations. Uniqueness is required."
          },
          "fax" : {
            "type" : [ "string", "null" ]
          },
          "id" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Unique ID for contact.",
            "example" : "c759a694-67de-45cb-ad24-cf4a169f9ff1"
          },
          "name" : {
            "type" : [ "string", "null" ],
            "example" : "Thomas Anderson"
          },
          "phone" : {
            "type" : [ "string", "null" ]
          },
          "title" : {
            "type" : [ "string", "null" ],
            "example" : "Manager"
          }
        },
        "required" : [ "customerId", "id" ]
      },
      "CreateContactRequest" : {
        "type" : "object",
        "description" : "Request for creating a contact for a customer.",
        "properties" : {
          "email" : {
            "type" : [ "string", "null" ],
            "format" : "email",
            "example" : "email@domain.com",
            "maxLength" : 255
          },
          "externalReference" : {
            "type" : [ "string", "null" ],
            "description" : "Identifier helping with integrations. Uniqueness is required.",
            "maxLength" : 255,
            "minLength" : 0
          },
          "fax" : {
            "type" : [ "string", "null" ],
            "maxLength" : 255,
            "minLength" : 0
          },
          "name" : {
            "type" : "string",
            "example" : "Thomas Anderson",
            "maxLength" : 255,
            "minLength" : 1,
            "pattern" : "[^\\t\\r\\n\\f]+"
          },
          "phone" : {
            "type" : [ "string", "null" ],
            "maxLength" : 255,
            "minLength" : 0
          },
          "title" : {
            "type" : [ "string", "null" ],
            "example" : "Manager",
            "maxLength" : 255,
            "minLength" : 0
          }
        },
        "required" : [ "name" ]
      },
      "CreateCustomerRequest" : {
        "type" : "object",
        "description" : "Request for creating a customer.",
        "properties" : {
          "address" : {
            "$ref" : "#/components/schemas/Address"
          },
          "email" : {
            "type" : [ "string", "null" ],
            "format" : "email",
            "example" : "email@domain.com",
            "maxLength" : 255
          },
          "externalReference" : {
            "type" : [ "string", "null" ],
            "description" : "Identifier helping with integrations. Uniqueness is required.",
            "maxLength" : 255,
            "minLength" : 0
          },
          "fax" : {
            "type" : [ "string", "null" ],
            "maxLength" : 255,
            "minLength" : 0
          },
          "name" : {
            "type" : "string",
            "example" : "Thomas Anderson",
            "maxLength" : 255,
            "minLength" : 1,
            "pattern" : "[^\\t\\r\\n\\f]+"
          },
          "note" : {
            "type" : [ "string", "null" ]
          },
          "parentId" : {
            "type" : [ "string", "null" ],
            "format" : "uuid",
            "description" : "ID of the parent customer. The parent should be created first.",
            "example" : "1f01b956-3e48-4f59-89f0-0e1adfedf8e0"
          },
          "phone" : {
            "type" : [ "string", "null" ],
            "maxLength" : 255,
            "minLength" : 0
          },
          "type" : {
            "type" : "string",
            "description" : "Type of customer",
            "enum" : [ "CONTRACTOR", "DEALER", "DISTRIBUTOR", "OEM", "RENTAL", "SERVICE", "OTHER" ],
            "example" : "CONTRACTOR"
          }
        },
        "required" : [ "name", "type" ]
      },
      "CustomerPortalAccessRequest" : {
        "type" : "object",
        "description" : "Request for provisioning Customer Portal access",
        "properties" : {
          "customerExternalReferences" : {
            "type" : "array",
            "description" : "The customer external references.",
            "items" : {
              "type" : "string"
            },
            "uniqueItems" : true
          },
          "customerIds" : {
            "type" : "array",
            "description" : "The customer IDs within Trackunit.",
            "items" : {
              "type" : "string",
              "format" : "uuid"
            },
            "uniqueItems" : true
          },
          "email" : {
            "type" : "string",
            "format" : "email",
            "description" : "The email address for which a user will be created."
          },
          "entireFleetAccess" : {
            "type" : "boolean",
            "description" : "Indicates whether the user should have access to the entire fleet. Defaults to false if not specified."
          },
          "userRole" : {
            "type" : "string",
            "description" : "The user's role. If not provided, defaults to a standard user.",
            "enum" : [ "USER", "ADMIN", "FLEET_ADMIN", "TECHNICIAN" ]
          },
          "username" : {
            "type" : "string",
            "description" : "The user's username. This should match the intended identity provider's 'subjectNameId' authentication response field. The maximum username length is 46 characters.",
            "maxLength" : 46,
            "minLength" : 1
          }
        },
        "required" : [ "email", "username" ]
      },
      "CustomerPortalCreateConfigurationRequest" : {
        "type" : "object",
        "description" : "Customer portal configuration that can be set to create a customer portal without using a template. Any omitted field will take default values.",
        "properties" : {
          "brandingId" : {
            "type" : [ "string", "null" ],
            "format" : "uuid",
            "description" : "The ID of the branding to set on creation:\n- null → select system default branding (Trackunit theme)\n- omitted → apply defaulting policy (use active branding of inviter account)",
            "example" : "33d49745-14be-4a40-ad03-79d3f9a67584"
          },
          "homeCanvasIds" : {
            "type" : [ "array", "null" ],
            "description" : "The list of home canvases to assign. Values:\n- omitted/null/[] - create with no canvases assigned.\n- [ \"4c8a331b-8902-4538-9787-6352c45b8291\" ] - assign exactly this list; any canvases not listed will be unavailable.",
            "example" : [ "33d49745-14be-4a40-ad03-79d3f9a67584" ],
            "items" : {
              "type" : "string",
              "format" : "uuid"
            }
          },
          "irisAppIds" : {
            "type" : [ "array", "null" ],
            "description" : "The list of Iris apps to assign. Values:\n- omitted/null - use system default Customer Portal Iris apps.\n- [] - create with no apps assigned.\n- [ \"@trackunit/notes\" ] - assign exactly this list; any apps not listed will be unavailable.",
            "example" : [ "@trackunit/users", "@trackunit/contracts-app" ],
            "items" : {
              "type" : "string"
            }
          }
        }
      },
      "CustomerPortalCreateRequest" : {
        "type" : "object",
        "description" : "Request to create a customer portal for an existing customer.",
        "properties" : {
          "configuration" : {
            "$ref" : "#/components/schemas/CustomerPortalCreateConfigurationRequest",
            "description" : "Custom portal configuration to use when creating the customer portal. Cannot be used together with customerPortalTemplateId."
          },
          "customerPortalTemplateId" : {
            "type" : [ "string", "null" ],
            "format" : "uuid",
            "description" : "ID of the customer portal template to use. Cannot be used together with configuration. If null/omitted and no configuration is provided, the account default template will be used (if any).",
            "example" : "33d49745-14be-4a40-ad03-79d3f9a67584"
          }
        }
      },
      "CustomerPortalResponse" : {
        "type" : "object",
        "description" : "Response for a customer portal.",
        "properties" : {
          "brandingId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Id of the branding",
            "example" : "33d49745-14be-4a40-ad03-79d3f9a67584"
          },
          "homeCanvasIds" : {
            "type" : "array",
            "description" : "IDs of the assigned home canvases",
            "items" : {
              "type" : "string",
              "format" : "uuid"
            }
          },
          "id" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Id of the customer portal invitation",
            "example" : "6b70c280-fda3-4888-98dc-a245f2328ebf"
          },
          "invitedAccountId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Id of the invited account",
            "example" : "33d49745-14be-4a40-ad03-79d3f9a67584"
          },
          "irisAppsIds" : {
            "type" : "array",
            "description" : "Ids of the enabled Iris apps",
            "items" : {
              "type" : "string"
            }
          },
          "organizationId" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Id of the organization. Null value indicates that the organization is still pending creation",
            "example" : "33d49745-14be-4a40-ad03-79d3f9a67584"
          },
          "status" : {
            "type" : "string",
            "description" : "Status of the customer portal creation",
            "enum" : [ "INITIATED", "ORG_CREATED", "ACCOUNTS_CREATED", "ACCOUNTS_ASSOCIATED_TO_ORG", "FINISHED", "INACTIVE" ],
            "example" : "INITIATED"
          }
        },
        "required" : [ "id", "status" ]
      },
      "CustomerPortalUpdateConfigurationRequest" : {
        "type" : "object",
        "description" : "Customer portal configuration that can be set to update an existing customer portal. Any omitted field will be left unchanged.",
        "properties" : {
          "brandingId" : {
            "type" : [ "string", "null" ],
            "format" : "uuid",
            "description" : "The ID of the branding to set.\n- null → set system default branding (Trackunit theme)\n- omitted → do not change branding",
            "example" : "33d49745-14be-4a40-ad03-79d3f9a67584"
          },
          "homeCanvasIds" : {
            "type" : [ "array", "null" ],
            "description" : "The complete list of home canvases to assign. Values:\n- null - skip the update\n- [] - remove canvases from the portal.\n- [ \"4c8a331b-8902-4538-9787-6352c45b8291\" ] - update the list of available home canvases; any not listed will be removed.",
            "example" : [ "33d49745-14be-4a40-ad03-79d3f9a67584" ],
            "items" : {
              "type" : "string",
              "format" : "uuid"
            }
          },
          "irisAppIds" : {
            "type" : [ "array", "null" ],
            "description" : "The complete list of Iris apps to assign. Values:\n- null - skip the update\n- [] - remove all apps\n- [ \"@trackunit/notes\" ] - update the list of available apps; any not listed will be removed.",
            "example" : [ "@trackunit/users", "@trackunit/contracts-app" ],
            "items" : {
              "type" : "string"
            }
          }
        }
      },
      "CustomerPortalUpdateRequest" : {
        "type" : "object",
        "description" : "Request to update a customer portal configuration/template assignment.",
        "properties" : {
          "configuration" : {
            "$ref" : "#/components/schemas/CustomerPortalUpdateConfigurationRequest",
            "description" : "Custom portal configuration to update. Omitted leaves unchanged. Cannot be used together with non-null customerPortalTemplateId."
          },
          "customerPortalTemplateId" : {
            "type" : [ "string", "null" ],
            "format" : "uuid",
            "description" : "ID of the customer portal template. Omitted leaves unchanged; explicit null unassigns.",
            "example" : "33d49745-14be-4a40-ad03-79d3f9a67584"
          }
        }
      },
      "CustomerResponse" : {
        "type" : "object",
        "description" : "Response for a customer.",
        "properties" : {
          "address" : {
            "$ref" : "#/components/schemas/Address"
          },
          "email" : {
            "type" : [ "string", "null" ],
            "example" : "email@domain.com"
          },
          "externalReference" : {
            "type" : [ "string", "null" ],
            "description" : "Identifier helping with integrations. Uniqueness is required."
          },
          "fax" : {
            "type" : [ "string", "null" ]
          },
          "id" : {
            "type" : "string",
            "format" : "uuid",
            "description" : "Unique ID for customer.",
            "example" : "c759a694-67de-45cb-ad24-cf4a169f9ff1"
          },
          "name" : {
            "type" : "string",
            "example" : "Thomas Anderson"
          },
          "note" : {
            "type" : [ "string", "null" ]
          },
          "parentId" : {
            "type" : [ "string", "null" ],
            "format" : "uuid",
            "description" : "ID of the parent customer.",
            "example" : "1f01b956-3e48-4f59-89f0-0e1adfedf8e0"
          },
          "phone" : {
            "type" : [ "string", "null" ]
          },
          "source" : {
            "type" : "string",
            "description" : "Source of origin of customer",
            "enum" : [ "USER_DEFINED", "SYSTEM_DEFINED", "CLASSIC_MIGRATION" ],
            "example" : "USER_DEFINED"
          },
          "type" : {
            "type" : "string",
            "description" : "Type of customer",
            "enum" : [ "CONTRACTOR", "DEALER", "DISTRIBUTOR", "OEM", "RENTAL", "SERVICE", "OTHER" ],
            "example" : "CONTRACTOR"
          }
        },
        "required" : [ "id" ]
      },
      "CustomerTypeSummary" : {
        "type" : "object",
        "properties" : {
          "count" : {
            "type" : "integer",
            "format" : "int32"
          },
          "type" : {
            "type" : "string",
            "enum" : [ "CONTRACTOR", "DEALER", "DISTRIBUTOR", "OEM", "RENTAL", "SERVICE", "OTHER" ]
          }
        }
      },
      "CustomerTypeSummaryResponse" : {
        "type" : "object",
        "description" : "Response for a getting customer types summary",
        "properties" : {
          "summary" : {
            "type" : "array",
            "items" : {
              "$ref" : "#/components/schemas/CustomerTypeSummary"
            }
          }
        }
      },
      "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"
          }
        }
      },
      "ExchangedTokenResponse" : {
        "type" : "object",
        "properties" : {
          "accessToken" : {
            "type" : "string",
            "description" : "Access Token"
          }
        },
        "required" : [ "accessToken" ]
      },
      "PaginatedContactResponse" : {
        "type" : "object",
        "properties" : {
          "content" : {
            "type" : "array",
            "description" : "The page content as a list.",
            "items" : {
              "$ref" : "#/components/schemas/ContactResponse"
            }
          },
          "number" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of the current page."
          },
          "numberOfElements" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of elements currently on this page."
          },
          "size" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The size of the page."
          },
          "totalElements" : {
            "type" : "integer",
            "format" : "int64",
            "description" : "The total number of elements."
          },
          "totalPages" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of total pages."
          }
        }
      },
      "PaginatedCustomerResponse" : {
        "type" : "object",
        "properties" : {
          "content" : {
            "type" : "array",
            "description" : "The page content as a list.",
            "items" : {
              "$ref" : "#/components/schemas/CustomerResponse"
            }
          },
          "number" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of the current page."
          },
          "numberOfElements" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of elements currently on this page."
          },
          "size" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The size of the page."
          },
          "totalElements" : {
            "type" : "integer",
            "format" : "int64",
            "description" : "The total number of elements."
          },
          "totalPages" : {
            "type" : "integer",
            "format" : "int32",
            "description" : "The number of total pages."
          }
        }
      },
      "ProvisionCustomerPortalAccessResponse" : {
        "type" : "object",
        "description" : "Response for a customer portal provisioning request.",
        "properties" : {
          "error" : {
            "type" : "string",
            "description" : "The request error, if any occurred.",
            "enum" : [ "IDENTITY_PROVIDER_MAPPING_REQUIRED", "CUSTOMER_NOT_FOUND", "ERROR" ],
            "example" : "CUSTOMER_NOT_FOUND"
          },
          "url" : {
            "type" : "string",
            "description" : "The URL to redirect to after the request.",
            "example" : "https://test.manager.trackunit.com/auth/sso/access-request/6b70c280-fda3-4888-98dc-a245f2328ebf"
          }
        }
      },
      "UpdateAssetsRequest" : {
        "type" : "object",
        "description" : "Request for updating assets for a customer.",
        "properties" : {
          "assetIdsToAdd" : {
            "type" : "array",
            "items" : {
              "type" : [ "string", "null" ],
              "format" : "uuid"
            },
            "maxItems" : 1000,
            "minItems" : 0,
            "uniqueItems" : true
          },
          "assetIdsToRemove" : {
            "type" : "array",
            "items" : {
              "type" : [ "string", "null" ],
              "format" : "uuid"
            },
            "maxItems" : 1000,
            "minItems" : 0,
            "uniqueItems" : true
          }
        }
      },
      "UpdateContactRequest" : {
        "type" : "object",
        "description" : "Request for updating a contact for a customer.",
        "properties" : {
          "email" : {
            "type" : [ "string", "null" ],
            "format" : "email",
            "example" : "email@domain.com",
            "maxLength" : 255
          },
          "externalReference" : {
            "type" : [ "string", "null" ],
            "description" : "Identifier helping with integrations. Uniqueness is required.",
            "maxLength" : 255,
            "minLength" : 0
          },
          "fax" : {
            "type" : [ "string", "null" ],
            "maxLength" : 255,
            "minLength" : 0
          },
          "name" : {
            "type" : [ "string", "null" ],
            "example" : "Thomas Anderson",
            "maxLength" : 255,
            "minLength" : 1,
            "pattern" : "[^\\t\\r\\n\\f]+"
          },
          "phone" : {
            "type" : [ "string", "null" ],
            "maxLength" : 255,
            "minLength" : 0
          },
          "title" : {
            "type" : [ "string", "null" ],
            "example" : "Manager",
            "maxLength" : 255,
            "minLength" : 0
          }
        }
      },
      "UpdateCustomerRequest" : {
        "type" : "object",
        "description" : "Request for updating a customer.",
        "properties" : {
          "address" : {
            "$ref" : "#/components/schemas/Address"
          },
          "email" : {
            "type" : [ "string", "null" ],
            "format" : "email",
            "example" : "email@domain.com",
            "maxLength" : 255
          },
          "externalReference" : {
            "type" : [ "string", "null" ],
            "description" : "Identifier helping with integrations. Uniqueness is required.",
            "maxLength" : 255,
            "minLength" : 0
          },
          "fax" : {
            "type" : [ "string", "null" ],
            "maxLength" : 255,
            "minLength" : 0
          },
          "name" : {
            "type" : [ "string", "null" ],
            "example" : "Thomas Anderson",
            "maxLength" : 255,
            "minLength" : 1,
            "pattern" : "[^\\t\\r\\n\\f]+"
          },
          "note" : {
            "type" : [ "string", "null" ]
          },
          "parentId" : {
            "type" : [ "string", "null" ],
            "format" : "uuid",
            "description" : "ID of the parent customer. The parent should be created first.",
            "example" : "1f01b956-3e48-4f59-89f0-0e1adfedf8e0"
          },
          "phone" : {
            "type" : [ "string", "null" ],
            "maxLength" : 255,
            "minLength" : 0
          },
          "type" : {
            "type" : [ "string", "null" ],
            "description" : "Type of customer",
            "enum" : [ "CONTRACTOR", "DEALER", "DISTRIBUTOR", "OEM", "RENTAL", "SERVICE", "OTHER" ],
            "example" : "CONTRACTOR"
          }
        }
      },
      "UpdateTemplateAssignmentsRequest" : {
        "type" : "object",
        "description" : "Request for assigning/unassigning a customer portal template to customer portals.",
        "properties" : {
          "assignIds" : {
            "type" : "array",
            "items" : {
              "type" : "string",
              "format" : "uuid"
            },
            "maxItems" : 1000,
            "minItems" : 0
          },
          "unassignIds" : {
            "type" : "array",
            "items" : {
              "type" : "string",
              "format" : "uuid"
            },
            "maxItems" : 1000,
            "minItems" : 0
          }
        }
      },
      "Violation" : {
        "type" : "object",
        "properties" : {
          "field" : {
            "type" : "string"
          },
          "message" : {
            "type" : "string"
          }
        }
      }
    },
    "securitySchemes" : {
      "authorizationBearer" : {
        "bearerFormat" : "JWT",
        "scheme" : "bearer",
        "type" : "http"
      }
    }
  }
}