openapi: 3.0.3 info: title: BauMaster2 API description: |- This is the specification of the public API of BauMaster2. Access to the endpoints requires an ApplicationToken generated by BauMaster2 client. That ApplicationToken can be revoked in BauMaster2 client. Links to the BauMaster2 application: - [STAGING](https://web2.stage.bau-master.com/) - [PRODUCTION](https://web2.bau-master.com/) contact: email: support@bau-master.com version: 1.0.1 externalDocs: description: Hompeage url: https://bau-master.com/ servers: - url: https://api.stage.bau-master.at description: Staging server - url: https://api.bau-master.at description: Production server tags: - name: Project description: Access to BauMaster2 projects - name: CompanyProfile description: Access to BauMaster2 company and contacts (profiles) - name: Profile description: Access to BauMaster2 contacts of companies (profiles) - name: ProjectRoom description: Access to BauMaster2 project room (attachments, PDF-documents, ...)) paths: /api/ext/projects: get: tags: - Project summary: Returns a list of all active projects. description: No search parameters supported. operationId: findAllProjects responses: '200': description: successful operation content: application/json: schema: type: array items: $ref: '#/components/schemas/Project' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission post: tags: - Project summary: Add a new project description: id is generated by the server operationId: addProject requestBody: content: application/json: schema: $ref: '#/components/schemas/ProjectForInsert' required: true responses: '200': description: Successful operation content: application/json: schema: $ref: '#/components/schemas/Project' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission '422': description: Validation error /api/ext/projects/{projectId}: get: tags: - Project summary: Returns one project by id. operationId: findProject parameters: - name: projectId in: path description: ID of of the project to return required: true schema: $ref: '#/components/schemas/IdType' responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/Project' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission '404': description: Project with id not found post: tags: - Project summary: Add a new project description: ID is provided by the client operationId: addProjectWithId parameters: - name: projectId in: path description: ID of of the project to be added required: true schema: $ref: '#/components/schemas/IdType' requestBody: content: application/json: schema: $ref: '#/components/schemas/ProjectForInsert' required: true responses: '200': description: Successful operation content: application/json: schema: $ref: '#/components/schemas/Project' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission '422': description: Validation error put: tags: - Project summary: Update a project description: If property changedAt is provided, it must match the value on the sever. operationId: updateProject parameters: - name: projectId in: path description: ID of of the project to return required: true schema: $ref: '#/components/schemas/IdType' requestBody: content: application/json: schema: $ref: '#/components/schemas/ProjectForUpdate' required: true responses: '200': description: Successful operation content: application/json: schema: $ref: '#/components/schemas/Project' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission '404': description: Project with id not found '422': description: Validation error /api/ext/companyProfiles: get: tags: - CompanyProfile summary: Returns a list of all active companies and active profiles (contacts). description: No search parameters supported. operationId: findAllCompanyContacts responses: '200': description: successful operation content: application/json: schema: type: array items: $ref: '#/components/schemas/CompanyProfile' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission post: tags: - CompanyProfile summary: Add a new Company and optionally new profiles (contacts) description: id is generated on the server operationId: addCompanyContact requestBody: content: application/json: schema: $ref: '#/components/schemas/CompanyProfileForInsert' required: true responses: '200': description: Successful operation content: application/json: schema: $ref: '#/components/schemas/CompanyProfile' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission '422': description: Validation error /api/ext/companyProfiles/{companyId}: get: tags: - CompanyProfile summary: Returns a Company by id with all active profiles (contacts). description: No search parameters supported. operationId: findCompanyContactById parameters: - name: companyId in: path description: ID of of the Company to return required: true schema: $ref: '#/components/schemas/IdType' responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/CompanyProfile' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission post: tags: - CompanyProfile summary: Add a new Company and optoinally new profiles (contacts) description: ID of the company provided by the client. IDs of the profiles are generated by the server. operationId: addCompanyProfileWithId parameters: - name: companyId in: path description: ID of of the Company to add required: true schema: $ref: '#/components/schemas/IdType' requestBody: content: application/json: schema: $ref: '#/components/schemas/CompanyProfileForInsert' required: true responses: '200': description: Successful operation content: application/json: schema: $ref: '#/components/schemas/CompanyProfile' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission '422': description: Validation error put: tags: - CompanyProfile summary: Update a Company and/or profiles description: If property changedAt is provided, it must match the value on the sever. If you omit properties, they are not being updated. If you want to set a value to null, provide the value null. operationId: updateCompanyProfile parameters: - name: companyId in: path description: ID of the company to update required: true schema: $ref: '#/components/schemas/IdType' requestBody: content: application/json: schema: $ref: '#/components/schemas/CompanyProfileForUpdate' required: true responses: '200': description: Successful operation content: application/json: schema: $ref: '#/components/schemas/CompanyProfile' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission '404': description: Company with id not found '422': description: Validation error /api/ext/companyProfiles/{companyId}/profiles: get: tags: - Profile summary: Returns a list of all active profiles (contacts) of a company. description: No search parameters supported. operationId: findAllProfilesOfCompany parameters: - name: companyId in: path description: ID of the company to read data from required: true schema: $ref: '#/components/schemas/IdType' responses: '200': description: successful operation content: application/json: schema: type: array items: $ref: '#/components/schemas/Profile' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission post: tags: - Profile summary: Add a new profile (contact) to a company description: id is generated on the server operationId: addProfileToCompany parameters: - name: companyId in: path description: ID of the company the profile should be added to required: true schema: $ref: '#/components/schemas/IdType' requestBody: content: application/json: schema: $ref: '#/components/schemas/ProfileForInsert' required: true responses: '200': description: Successful operation content: application/json: schema: $ref: '#/components/schemas/Profile' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission '422': description: Validation error /api/ext/companyProfiles/{companyId}/profiles/{profileId}: get: tags: - Profile summary: Returns a profile (contact) of a company by id. description: No search parameters supported. operationId: findProfileOfCompany parameters: - name: companyId in: path description: ID of of the company required: true schema: $ref: '#/components/schemas/IdType' - name: profileId in: path description: ID of of the profile required: true schema: $ref: '#/components/schemas/IdType' responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/Profile' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission post: tags: - Profile summary: Add a new profile (contact) to a company description: ID is provided by the client operationId: addProfileToCompanyById parameters: - name: companyId in: path description: ID of of the company the profile should be added to required: true schema: $ref: '#/components/schemas/IdType' - name: profileId in: path description: ID of of the profile required: true schema: $ref: '#/components/schemas/IdType' requestBody: content: application/json: schema: $ref: '#/components/schemas/ProfileForInsert' required: true responses: '200': description: Successful operation content: application/json: schema: $ref: '#/components/schemas/Profile' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission '422': description: Validation error put: tags: - Profile summary: Update a Profile description: If property changedAt is provided, it must match the value on the sever. If you omit properties, they are not being updated. If you want to set a value to null, provide the value null. operationId: updateProfile parameters: - name: companyId in: path description: ID of the company the profile belongs to required: true schema: $ref: '#/components/schemas/IdType' - name: profileId in: path description: ID of the profile to update required: true schema: $ref: '#/components/schemas/IdType' requestBody: content: application/json: schema: $ref: '#/components/schemas/ProfileForUpdate' required: true responses: '200': description: Successful operation content: application/json: schema: $ref: '#/components/schemas/Profile' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission '404': description: Company or Profile with id not found '422': description: Validation error /api/ext/projectRoom/{projectId}: get: tags: - ProjectRoom summary: Returns the ProjectRoom (all attachments) of a project. It returns only data not the attachments itself. The data contains the URLs to download the attachments. The file download requires the same authentication as the API. description: No search parameters supported. operationId: findProjectRoom parameters: - name: projectId in: path description: ID of of the Project to return data for required: true schema: $ref: '#/components/schemas/IdType' responses: '200': description: successful operation content: application/json: schema: $ref: '#/components/schemas/ProjectRoom' '401': description: Not authenticated. Probably header Authentication missing '403': description: No permission components: schemas: IdType: type: string format: uuidv4 minLength: 36 maxLength: 36 example: "bc6b821d-ee55-4ddf-a23b-f93d6192256510" Phone: type: string maxLength: 255 pattern: '([0-9]|[()-_+#]|[ ])+' example: '01 233343434' File: type: object properties: name: type: string url: type: string ProjectBase: type: object properties: number: type: string maxLength: 12 example: "4500" name: type: string maxLength: 255 example: "Casino Royal" description: type: string example: "This is about building the new Casino Royal in LasVegas" contractee: type: string description: "Name of the contractee" example: "Casino LTD" currency: type: integer enum: [ 1, 2, 3 ] description: "1=EUR, 2=GBP, 3=CHF" example: 1 language: type: string maxLength: 3 enum: - de - en - fr example: "de" addressSite: type: string description: "Address (location) of the project" example: "Main square 1, Las Vegas" addressContractee: type: string description: "Address of the contractee" startAt: type: string format: date-time description: "Date when the project started" example: '2023-01-01T00:00:00Z' completeAt: type: string format: date-time description: "Date when the project ended" example: '2023-01-01T00:00:00Z' taxRate: type: number minimum: 0 maximum: 100 description: "The tax rate for that project used for calculation" example: 20 Project: allOf: - type: object properties: id: $ref: '#/components/schemas/IdType' status: type: integer enum: [10, 20, 30] description: "ACTIVE = 10, ARCHIVED = 20, DELETED = 30" clientId: $ref: '#/components/schemas/IdType' changedAt: type: string format: date-time example: '2023-01-01T00:00:00Z' createdAt: type: string format: date-time example: '2023-01-01T00:00:00Z' projectImage: type: string maxLength: 100 description: "The project's image location. This is internally used and cannot be updated." - $ref: "#/components/schemas/ProjectBase" ProjectForInsert: required: - number - name - contractee - currency - language - taxRate allOf: - $ref: "#/components/schemas/ProjectBase" ProjectForUpdate: allOf: - type: object properties: status: type: integer enum: [ 10, 20, 30 ] description: "ACTIVE = 10, ARCHIVED = 20, DELETED = 30" example: 10 changedAt: type: string format: date-time description: "This is optional. If provided, the value is checked against the value on the server and update fails, if it does not match." example: '2023-01-01T00:00:00Z' - $ref: "#/components/schemas/ProjectBase" CompanyAddressBase: type: object properties: city: type: string maxLength: 255 example: 'Las Vegas' country: type: string maxLength: 255 example: 'US' email: type: string maxLength: 255 pattern: '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$' example: 'john.doe@company.com' phone: $ref: '#/components/schemas/Phone' fax: $ref: '#/components/schemas/Phone' street1: type: string maxLength: 255 example: "Main road" street2: type: string maxLength: 255 example: "1" zipCode: type: string maxLength: 255 example: "88901" CompanyAddress: allOf: - type: object properties: id: $ref: '#/components/schemas/IdType' changedAt: type: string format: date-time example: '2023-01-01T00:00:00Z' - $ref: '#/components/schemas/CompanyAddressBase' CompanyAddressForInsert: allOf: - $ref: '#/components/schemas/CompanyAddressBase' CompanyAddressForUpdate: allOf: - type: object properties: changedAt: type: string format: date-time example: '2023-01-01T00:00:00Z' description: "This is optional. If provided, the value is checked against the value on the server and update fails, if it does not match." - $ref: '#/components/schemas/CompanyAddressBase' ProfileAddressBase: type: object properties: firstName: type: string maxLength: 255 example: "John" lastName: type: string maxLength: 255 example: "Doe" email: type: string maxLength: 255 pattern: '^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$' example: 'john.doe@company.com' phone: $ref: '#/components/schemas/Phone' mobile: $ref: '#/components/schemas/Phone' fax: $ref: '#/components/schemas/Phone' ProfileAddress: allOf: - type: object properties: id: $ref: '#/components/schemas/IdType' changedAt: type: string format: date-time example: '2023-01-01T00:00:00Z' - $ref: '#/components/schemas/ProfileAddressBase' ProfileAddressForInsert: allOf: - $ref: '#/components/schemas/ProfileAddressBase' ProfileAddressForUpdate: allOf: - type: object properties: changedAt: type: string format: date-time example: '2023-01-01T00:00:00Z' description: "This is optional. If provided, the value is checked against the value on the server and update fails, if it does not match." - $ref: '#/components/schemas/ProfileAddressBase' ProfileBase: type: object properties: note: type: string description: "Any note to that profile (contact)" profession: type: string maxLength: 255 example: 'Polier' dsgvoShowEmail: type: boolean example: true dsgvoShowTel: type: boolean example: false Profile: allOf: - type: object properties: id: $ref: '#/components/schemas/IdType' changedAt: type: string format: date-time example: '2023-01-01T00:00:00Z' address: $ref: '#/components/schemas/ProfileAddress' - $ref: '#/components/schemas/ProfileBase' ProfileForInsert: required: - dsgvoShowEmail - dsgvoShowTel allOf: - type: object properties: address: $ref: '#/components/schemas/ProfileAddressForInsert' - $ref: '#/components/schemas/ProfileBase' ProfileForUpdate: allOf: - type: object properties: changedAt: type: string format: date-time example: '2023-01-01T00:00:00Z' description: "This is optional. If provided, the value is checked against the value on the server and update fails, if it does not match." address: $ref: '#/components/schemas/ProfileAddressForUpdate' - $ref: '#/components/schemas/ProfileBase' CompanyProfileBase: type: object properties: name: type: string maxLength: 255 description: "Name of the company" example: "Casino LTD" note: type: string CompanyProfile: allOf: - type: object properties: id: $ref: '#/components/schemas/IdType' changedAt: type: string format: date-time example: '2023-01-01T00:00:00Z' address: $ref: '#/components/schemas/CompanyAddress' profiles: type: array items: $ref: '#/components/schemas/Profile' - $ref: '#/components/schemas/CompanyProfileBase' CompanyProfileForInsert: required: - name allOf: - type: object properties: address: $ref: '#/components/schemas/CompanyAddressForInsert' profiles: type: array items: $ref: '#/components/schemas/ProfileForInsert' - $ref: '#/components/schemas/CompanyProfileBase' CompanyProfileForUpdate: allOf: - type: object properties: changedAt: type: string format: date-time example: '2023-01-01T00:00:00Z' description: "This is optional. If provided, the value is checked against the value on the server and update fails, if it does not match." address: $ref: '#/components/schemas/CompanyAddressForUpdate' profiles: type: array items: allOf: - type: object properties: id: $ref: '#/components/schemas/IdType' - $ref: '#/components/schemas/ProfileForUpdate' - $ref: '#/components/schemas/CompanyProfileBase' ProjectRoom: type: object properties: id: $ref: '#/components/schemas/IdType' ProjectRoom: type: object properties: PdfPlans: type: object additionalProperties: type: object additionalProperties: $ref: '#/components/schemas/File' ProjectImages: type: array items: $ref: '#/components/schemas/File' Reports: type: object properties: PdfReports: type: array items: $ref: '#/components/schemas/File' Attachments: type: array items: $ref: '#/components/schemas/File' Protocols: type: object properties: PdfProtocols: type: array items: $ref: '#/components/schemas/File' Attachments: type: array items: $ref: '#/components/schemas/File' requestBodies: ProjectInsert: description: Project that need to be added content: application/json: schema: $ref: '#/components/schemas/ProjectForInsert' ProjectUpdate: description: Project that need to be updated content: application/json: schema: $ref: '#/components/schemas/ProjectForInsert' ProfileInsert: description: Profile that need to be added content: application/json: schema: $ref: '#/components/schemas/ProfileForInsert' ProfileUpdate: description: Profile that need to be added content: application/json: schema: $ref: '#/components/schemas/ProfileForUpdate' CompanyProfileInsert: description: CompanyProfiles that need to be added content: application/json: schema: $ref: '#/components/schemas/CompanyProfileForInsert' CompanyProfileUpdate: description: CompanyProfiles that need to be updated content: application/json: schema: $ref: '#/components/schemas/CompanyProfileForUpdate' securitySchemes: ApiKeyAuth: type: apiKey in: header name: Authentication security: - ApiKeyAuth: []