{
  "openapi": "3.0.1",
  "info": {
    "title": "Oberon API",
    "description": "Oberon open api definitions",
    "termsOfService": "https://pleo.io/terms/",
    "contact": {
      "email": "apiteam@pleo.io"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "52.35.0"
  },
  "servers": [
    {
      "url": "https://external.pleo.io",
      "description": "Production server"
    },
    {
      "url": "https://external.staging.pleo.io",
      "description": "Staging server"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    },
    {
      "basicAuth": []
    }
  ],
  "tags": [
    {
      "name": "SCIM",
      "description": "SCIM-compatible User API. The SCIM (System for Cross-domain Identity\nManagement) specification standardises a schema for user representation and\nprovides a RESTful API to create, update, retrieve and delete user identities.\n<br> In particular, this API enables third-party systems to efficiently manage\nuser provisioning and de-provisioning.\n <br> API available at `/scim/v2`",
      "externalDocs": {
        "description": "Read more about SCIM",
        "url": "https://datatracker.ietf.org/doc/html/rfc7644"
      }
    },
    {
      "name": "Employees",
      "description": "The Employees API enables you to search for employee records that\nare managed in Pleo. You can perform the following: \n - Search for multiple\nemployees \n - Search for a specific employee record by employee ID"
    },
    {
      "name": "Companies",
      "description": "The Companies API enables you to search for company records that are managed in Pleo. You can perform the following: \n - Search for multiple companies\n - Search for a specific company record by company ID"
    },
    {
      "name": "Teams",
      "description": "The Teams API enables you to manage teams within a company or organisation that are managed in Pleo. You can perform the following: \n - Search for teams\n - Get a team by ID\n - Create a team\n - Partially update a team\n - Delete a team\n - Add members to a team\n - Remove a member from a team"
    }
  ],
  "paths": {
    "/v1/companies": {
      "get": {
        "tags": [
          "Companies"
        ],
        "summary": "Search for Companies",
        "description": "Use this endpoint to search for companies associated with a specific organisation.",
        "operationId": "Search for Companies",
        "parameters": [
          {
            "name": "organization_id",
            "in": "query",
            "description": "Enter the organisation ID of the companies you are searching for. Ensure that the access token used for authentication has the correct permissions to search for companies in the given organisation.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Lower bound of the page of data to return (cannot be used together with [after] or [offset]).",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "pattern": "^[A-Z2-7=~]+$",
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "Upper bound of the page of data to return (cannot be used together with [before] or [offset]).",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "pattern": "^[A-Z2-7=~]+$",
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Offset of the page of data to return (cannot be used together with [before] or [after]).",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "minimum": 0,
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum amount of items to return.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "minimum": 0,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sorting_keys",
            "in": "query",
            "description": "The keys to sort the results by.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sorting_order",
            "in": "query",
            "description": "The order to sort the results by. Must be the same length as [sortingKeys]; one order per key.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/PageOrder"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Company search successful",
            "content": {
              "application/json;charset=UTF-8": {
                "schema": {
                  "$ref": "#/components/schemas/CursorPaginatedResponseExternalCompanyResponseModel"
                }
              }
            }
          },
          "403": {
            "description": "User lacks the necessary permissions"
          }
        }
      }
    },
    "/v1/companies/{companyId}": {
      "get": {
        "tags": [
          "Companies"
        ],
        "summary": "Search for a Specific Company",
        "description": "Search for a specific company by company ID.",
        "operationId": "Get company by ID",
        "parameters": [
          {
            "name": "companyId",
            "in": "path",
            "description": "Enter the company ID.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Company resource found",
            "content": {
              "application/json;charset=UTF-8": {
                "schema": {
                  "$ref": "#/components/schemas/DataResponseExternalCompanyResponseModel"
                }
              }
            }
          },
          "403": {
            "description": "User lacks the necessary permissions."
          },
          "404": {
            "description": "Company with given ID not found"
          }
        }
      }
    },
    "/v1/teams": {
      "get": {
        "tags": [
          "Teams"
        ],
        "summary": "Search for teams",
        "description": "Use this endpoint to search for teams belonging to a company or an organisation. If employeeId or teamId are provided, the results are further filtered to teams matching those ids.",
        "operationId": "Search Teams",
        "parameters": [
          {
            "name": "companyId",
            "in": "query",
            "description": "Enter the company ID of the teams you are searching for. Ensure that the access token used for authentication has the correct permissions to search for teams in the given company.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "organizationId",
            "in": "query",
            "description": "Enter the organisation ID of the teams you are searching for. Ensure that the access token used for authentication has the correct permissions to search for teams in the given organisation.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "employeeId",
            "in": "query",
            "description": "Search for teams that have the given Employee IDs as members.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "teamId",
            "in": "query",
            "description": "Search for teams with the given Team IDs.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              }
            }
          },
          {
            "name": "includeCompanyTeams",
            "in": "query",
            "description": "When used along side organizationId, returns all teams in the organisation and all companies in the organisation.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "query",
            "in": "query",
            "description": "Filter teams by a partial match on the team name.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "includeTotal",
            "in": "query",
            "description": "Whether to include the total count of teams matching the search in the response.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Lower bound of the page of data to return (cannot be used together with [after] or [offset]).",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "pattern": "^[A-Z2-7=~]+$",
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "Upper bound of the page of data to return (cannot be used together with [before] or [offset]).",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "pattern": "^[A-Z2-7=~]+$",
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Offset of the page of data to return (cannot be used together with [before] or [after]).",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "minimum": 0,
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum amount of items to return.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "minimum": 0,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sorting_keys",
            "in": "query",
            "description": "The keys to sort the results by.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sorting_order",
            "in": "query",
            "description": "The order to sort the results by. Must be the same length as [sortingKeys]; one order per key.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/PageOrder"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Team search successful",
            "content": {
              "application/json;charset=UTF-8": {
                "schema": {
                  "$ref": "#/components/schemas/CursorPaginatedResponseExternalTeamResponseModel"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: Invalid combination of search parameters"
          },
          "403": {
            "description": "Forbidden: User lacks the necessary permissions"
          }
        }
      },
      "post": {
        "tags": [
          "Teams"
        ],
        "summary": "Create a Team",
        "description": "Use this endpoint to create a new team for the company or organisation the access token is scoped to. If organizationId is supplied, it takes precedence and the access token must be scoped to that organisation. Otherwise, companyId is used if supplied (the access token must have access to that company), defaulting to the company the access token is scoped to if neither is supplied. Team names must be unique (case-insensitive) within the company and its organisation.",
        "operationId": "Create Team",
        "requestBody": {
          "content": {
            "application/json;charset=UTF-8": {
              "schema": {
                "$ref": "#/components/schemas/ExternalTeamCreateRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Team resource created",
            "content": {
              "application/json;charset=UTF-8": {
                "schema": {
                  "$ref": "#/components/schemas/DataResponseExternalTeamResponseModel"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: Invalid team name, or a team with that name already exists"
          },
          "403": {
            "description": "Forbidden: User lacks the necessary permissions"
          }
        }
      }
    },
    "/v1/teams/{teamId}": {
      "get": {
        "tags": [
          "Teams"
        ],
        "summary": "Get a Team by ID",
        "description": "Use this endpoint to fetch a specific team by teamId.",
        "operationId": "Get Team by ID",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "description": "Enter the team ID.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Team resource found",
            "content": {
              "application/json;charset=UTF-8": {
                "schema": {
                  "$ref": "#/components/schemas/DataResponseExternalTeamResponseModel"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: User lacks the necessary permissions"
          },
          "404": {
            "description": "Not found: Team with given ID not found"
          }
        }
      },
      "delete": {
        "tags": [
          "Teams"
        ],
        "summary": "Delete a Team by ID",
        "description": "Use this endpoint to delete a specific team by its teamId.",
        "operationId": "Delete Team by ID",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "description": "Enter the team ID.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Team resource deleted"
          },
          "403": {
            "description": "Forbidden: User lacks the necessary permissions"
          },
          "404": {
            "description": "Not found: Team with given ID not found"
          }
        }
      },
      "patch": {
        "tags": [
          "Teams"
        ],
        "summary": "Partially update a Team",
        "description": "Use this endpoint to update a Team's name and/or code. Both fields are optional. Any field you leave out of the request stays unchanged. To clear the code, send an empty string (\"\"). Leaving out the code field, or sending it as null, also leaves the code unchanged.",
        "operationId": "Update Team",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "description": "Enter the team ID.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json;charset=UTF-8": {
              "schema": {
                "$ref": "#/components/schemas/ExternalTeamUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Team resource was updated successfully",
            "content": {
              "application/json;charset=UTF-8": {
                "schema": {
                  "$ref": "#/components/schemas/DataResponseExternalTeamResponseModel"
                }
              }
            }
          },
          "400": {
            "description": "Bad request: Invalid team name, or a team with the new name already exists"
          },
          "403": {
            "description": "Forbidden: User lacks the necessary permissions"
          },
          "404": {
            "description": "Not found: Team with given ID not found"
          }
        }
      }
    },
    "/v1/teams/{teamId}/members": {
      "post": {
        "tags": [
          "Teams"
        ],
        "summary": "Add members to a Team",
        "description": "Use this endpoint to add one or more Employees to a Team. An Employee can only be an active member of one Team at a time, so adding an Employee who is already a member of this Team or a different Team does not move them; it returns a per-employee failure with error 'EMPLOYEE_ALREADY_IN_TEAM' for that Employee.",
        "operationId": "Add Team Members",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "description": "Enter the team ID.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json;charset=UTF-8": {
              "schema": {
                "$ref": "#/components/schemas/ExternalTeamAddMembersRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Members were added to the team",
            "content": {
              "application/json;charset=UTF-8": {
                "schema": {
                  "$ref": "#/components/schemas/DataResponseListExternalTeamMemberResponseModel"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: User lacks the necessary permissions"
          },
          "404": {
            "description": "Not found: Team with given ID not found"
          }
        }
      }
    },
    "/v1/teams/{teamId}/members/{employeeId}": {
      "delete": {
        "tags": [
          "Teams"
        ],
        "summary": "Remove a member from a Team",
        "description": "Use this endpoint to remove an Employee from a Team. If the Employee is not currently a member of the Team, no changes are made, and the call returns '200 OK' with 'false' in the body instead of an error.",
        "operationId": "Remove Team Member",
        "parameters": [
          {
            "name": "teamId",
            "in": "path",
            "description": "Enter the team ID.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "employeeId",
            "in": "path",
            "description": "Enter the employee ID.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Request processed. The response body indicates whether the Employee was removed: 'false' means the Employee was not a member of the Team, which is treated as a no-op rather than an error.",
            "content": {
              "application/json;charset=UTF-8": {
                "schema": {
                  "type": "boolean"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: User lacks the necessary permissions"
          },
          "404": {
            "description": "Not found: Team with given ID not found"
          }
        }
      }
    },
    "/v2/employees": {
      "get": {
        "tags": [
          "Employees"
        ],
        "summary": "Search for employees",
        "description": "Use this endpoint to search for multiple employees.",
        "operationId": "Search Employees",
        "parameters": [
          {
            "name": "companyId",
            "in": "query",
            "description": "Enter the company ID of the employees you are searching for. This is not a mandatory parameter; hence, if you do not know the company ID, the response message contains details of all employees to which you have access. If you are searching for employees at the organisation level, ensure that the access token used for authentication has the correct permissions.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "email",
            "in": "query",
            "description": "The email of the Employee you are searching for.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "code",
            "in": "query",
            "description": "The external ID of the Employee you are searching for.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Lower bound of the page of data to return (cannot be used together with [after] or [offset]).",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "pattern": "^[A-Z2-7=~]+$",
              "type": "string"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "Upper bound of the page of data to return (cannot be used together with [before] or [offset]).",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "pattern": "^[A-Z2-7=~]+$",
              "type": "string"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "description": "Offset of the page of data to return (cannot be used together with [before] or [after]).",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "minimum": 0,
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum amount of items to return.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "minimum": 0,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "sorting_keys",
            "in": "query",
            "description": "The keys to sort the results by.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sorting_order",
            "in": "query",
            "description": "The order to sort the results by. Must be the same length as [sortingKeys]; one order per key.",
            "required": false,
            "style": "form",
            "explode": true,
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/PageOrder"
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Employee search successful",
            "content": {
              "application/json;charset=UTF-8": {
                "schema": {
                  "$ref": "#/components/schemas/CursorPaginatedResponseExternalEmployeeResponseModel"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: User lacks the necessary permissions"
          }
        }
      }
    },
    "/v2/employees/{employeeId}": {
      "get": {
        "tags": [
          "Employees"
        ],
        "summary": "Search for a specific employee",
        "description": "Search for a specific employee by employee ID.",
        "operationId": "Get employee by ID",
        "parameters": [
          {
            "name": "employeeId",
            "in": "path",
            "description": "Enter the employee ID.",
            "required": true,
            "style": "simple",
            "explode": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Employee resource found",
            "content": {
              "application/json;charset=UTF-8": {
                "schema": {
                  "$ref": "#/components/schemas/DataResponseExternalEmployeeResponseModel"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden: User lacks the necessary permissions to access this Employee"
          },
          "404": {
            "description": "Not Found: Employee with given ID not found"
          }
        }
      }
    },
    "/scim/v2/{subResource}": {}
  },
  "components": {
    "schemas": {
      "Avatar": {
        "required": [
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          }
        }
      },
      "CursorPageCurrentRequestInfo": {
        "required": [
          "parameters"
        ],
        "type": "object",
        "properties": {
          "after": {
            "type": "string"
          },
          "before": {
            "type": "string"
          },
          "limit": {
            "type": "integer",
            "format": "int32"
          },
          "offset": {
            "type": "integer",
            "format": "int64"
          },
          "parameters": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "sortingKeys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "sortingOrder": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PageOrder"
            }
          }
        }
      },
      "CursorPageInfo": {
        "required": [
          "currentRequestPagination",
          "hasNextPage",
          "hasPreviousPage"
        ],
        "type": "object",
        "properties": {
          "currentRequestPagination": {
            "$ref": "#/components/schemas/CursorPageCurrentRequestInfo"
          },
          "endCursor": {
            "type": "string"
          },
          "hasNextPage": {
            "type": "boolean"
          },
          "hasPreviousPage": {
            "type": "boolean"
          },
          "startCursor": {
            "type": "string"
          },
          "total": {
            "type": "integer",
            "format": "int64"
          }
        }
      },
      "CursorPaginatedResponseExternalCompanyResponseModel": {
        "required": [
          "data",
          "pagination"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalCompanyResponseModel"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPageInfo"
          }
        }
      },
      "CursorPaginatedResponseExternalEmployeeResponseModel": {
        "required": [
          "data",
          "pagination"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalEmployeeResponseModel"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPageInfo"
          }
        }
      },
      "CursorPaginatedResponseExternalTeamResponseModel": {
        "required": [
          "data",
          "pagination"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalTeamResponseModel"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/CursorPageInfo"
          }
        }
      },
      "DataResponseExternalCompanyResponseModel": {
        "required": [
          "data"
        ],
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ExternalCompanyResponseModel"
          }
        }
      },
      "DataResponseExternalEmployeeResponseModel": {
        "required": [
          "data"
        ],
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ExternalEmployeeResponseModel"
          }
        }
      },
      "DataResponseExternalTeamResponseModel": {
        "required": [
          "data"
        ],
        "type": "object",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ExternalTeamResponseModel"
          }
        }
      },
      "DataResponseListExternalTeamMemberResponseModel": {
        "required": [
          "data"
        ],
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ExternalTeamMemberResponseModel"
            }
          }
        }
      },
      "ExternalAddressResponseModel": {
        "type": "object",
        "properties": {
          "addressLine1": {
            "type": "string",
            "description": "Line 1 of the company address."
          },
          "addressLine2": {
            "type": "string",
            "description": "Line 2 of the company address."
          },
          "country": {
            "type": "string",
            "description": "Country of the company."
          },
          "locality": {
            "type": "string",
            "description": "Locality of the company address."
          },
          "postalCode": {
            "type": "string",
            "description": "Postal code of the company address."
          },
          "region": {
            "type": "string",
            "description": "Region of the company."
          }
        },
        "description": "Address of the company"
      },
      "ExternalCompanyResponseModel": {
        "required": [
          "address",
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "address": {
            "$ref": "#/components/schemas/ExternalAddressResponseModel"
          },
          "id": {
            "type": "string",
            "description": "ID of the Company",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Name of the Company"
          },
          "organizationId": {
            "type": "string",
            "description": "Organisation ID of the Company",
            "format": "uuid"
          },
          "registrationNumber": {
            "type": "string",
            "description": "Registration number of the company"
          }
        }
      },
      "ExternalEmployeeResponseModel": {
        "required": [
          "companyId",
          "email",
          "firstName",
          "id",
          "lastName"
        ],
        "type": "object",
        "properties": {
          "avatar": {
            "$ref": "#/components/schemas/Avatar"
          },
          "code": {
            "type": "string",
            "description": "External ID of the Employee"
          },
          "companyId": {
            "type": "string",
            "description": "Company ID of the Employee",
            "format": "uuid"
          },
          "email": {
            "type": "string",
            "description": "Email of the Employee"
          },
          "firstName": {
            "type": "string",
            "description": "First name of the Employee"
          },
          "id": {
            "type": "string",
            "description": "ID of the Employee",
            "format": "uuid"
          },
          "jobTitle": {
            "type": "string",
            "description": "Job title of the Employee"
          },
          "lastName": {
            "type": "string",
            "description": "Last name of the Employee"
          },
          "phone": {
            "type": "string",
            "description": "Phone number of the Employee"
          },
          "role": {
            "type": "string",
            "description": "Role of the Employee"
          }
        }
      },
      "ExternalTeamAddMembersRequest": {
        "required": [
          "employeeIds"
        ],
        "type": "object",
        "properties": {
          "employeeIds": {
            "type": "array",
            "description": "IDs of the Employees to add to the Team.",
            "items": {
              "type": "string",
              "description": "IDs of the Employees to add to the Team.",
              "format": "uuid"
            }
          }
        }
      },
      "ExternalTeamCreateRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "External ID of the Team"
          },
          "companyId": {
            "type": "string",
            "description": "ID of the Company to create the Team under. Defaults to the company the access token is scoped to if omitted. Ignored if organizationId is provided.",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Name of the Team"
          },
          "organizationId": {
            "type": "string",
            "description": "ID of the Organisation to create the Team under. The access token must be scoped to this organisation. Takes precedence over companyId if both are provided.",
            "format": "uuid"
          }
        }
      },
      "ExternalTeamMemberResponseModel": {
        "required": [
          "employeeId",
          "success"
        ],
        "type": "object",
        "properties": {
          "employeeId": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "success": {
            "type": "boolean"
          }
        }
      },
      "ExternalTeamResponseModel": {
        "required": [
          "createdAt",
          "id",
          "name",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "External ID of the Team"
          },
          "companyId": {
            "type": "string",
            "description": "Company ID of the Team",
            "format": "uuid"
          },
          "createdAt": {
            "type": "string",
            "description": "Creation date of the Team",
            "format": "date-time"
          },
          "employees": {
            "type": "array",
            "description": "Employee IDs of the Team's employees",
            "items": {
              "type": "string",
              "description": "Employee IDs of the Team's employees",
              "format": "uuid"
            }
          },
          "id": {
            "type": "string",
            "description": "ID of the Team",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "Name of the Team"
          },
          "organizationId": {
            "type": "string",
            "description": "Organisation ID of the Team",
            "format": "uuid"
          },
          "updatedAt": {
            "type": "string",
            "description": "Last update date of the Team",
            "format": "date-time"
          }
        }
      },
      "ExternalTeamUpdateRequest": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "External ID of the Team. Set to an empty string (\"\") to delete the code. Omit the field, or send null, to leave the current code unchanged."
          },
          "name": {
            "type": "string",
            "description": "Name of the Team. Omit to leave the current name unchanged."
          }
        }
      },
      "PageOrder": {
        "type": "string",
        "enum": [
          "ASC",
          "ASC_NULLS_FIRST",
          "ASC_NULLS_LAST",
          "DESC",
          "DESC_NULLS_FIRST",
          "DESC_NULLS_LAST"
        ]
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "description": "JWT Bearer token authentication. Include the token in the Authorization header as: `Bearer <token>`",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "basicAuth": {
        "type": "http",
        "description": "Basic HTTP authentication using API key. Use your API key as the username and leave the password empty. The credentials will be Base64 encoded automatically.",
        "scheme": "basic"
      }
    }
  }
}
