openapi: 3.0.3 info: title: api description: '' version: 1.0.0 servers: - url: 'http://api.test' tags: - name: Projects description: '' - name: 'Project Trades' description: '' - name: 'Project Templates' description: '' - name: Organizations description: '' - name: Contractors description: '' - name: Trades description: '' - name: Tools description: '' - name: 'PFo User Roles' description: '' - name: Internal description: '' components: securitySchemes: default: type: http scheme: bearer description: 'You can retrieve your token by visiting your dashboard and clicking Generate API token.' security: - default: [] paths: /api/aos/v1/projects: get: summary: 'List projects' operationId: listProjects description: 'List all projects accessible to the authenticated user.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - Projects post: summary: 'Create a project' operationId: createAProject description: "Create a new project in the authenticated user's organization (or a specified one)." parameters: [] responses: {} tags: - Projects requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: '' example: architecto organization_id: type: string description: 'Must be a valid UUID.' example: a4855dc5-0acb-33c3-b921-f4291f719ca0 nullable: true construction_type: type: string description: '' example: office enum: - collective_building - extension - health_building - mall - office - other - public_building - public_space - single_flat - warehouse managers: type: array description: 'Must have at least 1 items.' example: - [] items: type: object properties: id: type: string description: 'Must be a valid UUID.' example: 977e5426-8d13-3824-86aa-b092f8ae52c5 required: - id trade_list_id: type: string description: 'Must be a valid UUID.' example: 6ff8f7f6-1eb3-3525-be4a-3932c805afed response_type: type: string description: '' example: DPGF enum: - DPGF - DPGF_QUOTE - QUOTE end_of_offer_date: type: string description: 'Must be a valid date.' example: '2025-01-01T00:00:00' end_works_construction: type: string description: 'Must be a valid date.' example: '2025-01-01T00:00:00' commencement_works_construction: type: string description: 'Must be a valid date.' example: '2025-01-01T00:00:00' tenders_closing_activated: type: boolean description: '' example: true published_on_chantier_prive: type: boolean description: '' example: false scopes: type: object description: '' example: [] properties: currency: type: string description: '' example: EUR enum: - CHF - DZD - EUR - GBP - MAD - TND - USD vat: type: number description: 'Must be at least 1. Must not be greater than 100.' example: 7 prorate: type: number description: 'Must be at least 0. Must not be greater than 100.' example: 16 levels: type: number description: 'Must be at least 1.' example: 27 required: - vat site_address: type: object description: '' example: [] properties: number: type: number description: 'Must be at least 1.' example: 35 zip_code: type: number description: '' example: 4326.41688 optional_dates: type: object description: '' example: [] properties: noc: type: string description: 'Must be a valid date.' example: '2025-01-01T00:00:00' responses_opening_date: type: string description: 'Must be a valid date.' example: '2025-01-01T00:00:00' required: - name - construction_type - managers - trade_list_id - response_type '/api/aos/v1/projects/{projectId}': get: summary: 'Get a project' operationId: getAProject description: 'Get a project by its UUID.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - Projects parameters: - in: path name: projectId description: '' example: architecto required: true schema: type: string '/api/aos/v1/projects/{projectId}/archive': put: summary: 'Archive a project' operationId: archiveAProject description: 'Mark a project as archived.' parameters: [] responses: {} tags: - Projects parameters: - in: path name: projectId description: '' example: architecto required: true schema: type: string '/api/aos/v1/projects/{projectId}/statistics': get: summary: 'Get project statistics' operationId: getProjectStatistics description: 'Get statistics for a project, including contractor counts and DCE downloads.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - Projects parameters: - in: path name: projectId description: '' example: architecto required: true schema: type: string '/api/aos/v1/projects/{projectId}/trades': get: summary: 'List project trades' operationId: listProjectTrades description: 'List all trades for a given project.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - 'Project Trades' post: summary: 'Add a trade' operationId: addATrade description: "Add a new trade to a project's trade list." parameters: [] responses: {} tags: - 'Project Trades' requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: '' example: architecto number: type: string description: '' example: architecto short_name: type: string description: '' example: architecto required: - name - number - short_name parameters: - in: path name: projectId description: '' example: architecto required: true schema: type: string '/api/aos/v1/projects/{projectId}/trades/{tradeId}': put: summary: 'Update a project trade' operationId: updateAProjectTrade description: 'Update the name, number or short name of a trade within a project.' parameters: [] responses: {} tags: - 'Project Trades' requestBody: required: true content: application/json: schema: type: object properties: name: type: string description: '' example: architecto number: type: string description: '' example: architecto short_name: type: string description: '' example: architecto comment: type: string description: '' example: architecto required: - name - number - short_name delete: summary: 'Remove a project trade' operationId: removeAProjectTrade description: "Remove a trade from a project's trade list." parameters: [] responses: {} tags: - 'Project Trades' parameters: - in: path name: projectId description: '' example: architecto required: true schema: type: string - in: path name: tradeId description: '' example: architecto required: true schema: type: string '/api/aos/v1/projects/{projectId}/templates': get: summary: 'List DPGF templates' operationId: listDPGFTemplates description: 'List all DPGF templates for a project.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - 'Project Templates' post: summary: 'Add a DPGF template' operationId: addADPGFTemplate description: 'Add a DPGF template to a project, or add a slice if a template already exists for the trade.' parameters: [] responses: {} tags: - 'Project Templates' requestBody: required: true content: application/json: schema: type: object properties: trade_id: type: string description: 'Must be a valid UUID.' example: 6ff8f7f6-1eb3-3525-be4a-3932c805afed slice_name: type: string description: '' example: architecto budget: type: number description: '' example: 4326.41688 required: - trade_id parameters: - in: path name: projectId description: '' example: architecto required: true schema: type: string '/api/aos/v1/projects/{projectId}/templates/documents': get: summary: 'List DPGF templates with documents' operationId: listDPGFTemplatesWithDocuments description: 'Retrieve templates with contractor documents for a specific project UUID.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - 'Project Templates' parameters: - in: path name: projectId description: '' example: architecto required: true schema: type: string '/api/aos/v1/projects/{projectId}/templates/{templateId}': get: summary: 'Get a DPGF template' operationId: getADPGFTemplate description: 'Get a DPGF template with its associated contractor documents.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - 'Project Templates' delete: summary: 'Delete a DPGF template' operationId: deleteADPGFTemplate description: 'Delete a DPGF template from a project, or delete a slice if the template is of type "slice".' parameters: [] responses: {} tags: - 'Project Templates' parameters: - in: path name: projectId description: '' example: architecto required: true schema: type: string - in: path name: templateId description: '' example: architecto required: true schema: type: string '/api/aos/v1/projects/{projectId}/templates/{templateId}/contractors': post: summary: 'Invite contractors to a template' operationId: inviteContractorsToATemplate description: 'Invite a list of contractors into a project trade template.' parameters: [] responses: {} tags: - 'Project Templates' requestBody: required: true content: application/json: schema: type: object properties: contractors: type: array description: '' example: - [] items: type: object properties: name: type: string description: '' example: architecto email: type: string description: '' example: architecto phone: type: string description: '' example: null required: - name - email required: - contractors parameters: - in: path name: projectId description: '' example: architecto required: true schema: type: string - in: path name: templateId description: '' example: architecto required: true schema: type: string '/api/aos/v1/projects/{projectId}/templates/{templateId}/documents/{documentId}/download/{version}': get: summary: 'Download a contractor document' operationId: downloadAContractorDocument description: 'Get download URLs for a specific contractor document version within a project template. Returns available versions if none specified.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - 'Project Templates' parameters: - in: path name: projectId description: '' example: architecto required: true schema: type: string - in: path name: templateId description: '' example: architecto required: true schema: type: string - in: path name: documentId description: '' example: architecto required: true schema: type: string - in: path name: version description: 'Optional parameter.' required: true schema: type: string examples: omitted: summary: 'When the value is omitted' value: '' present: summary: 'When the value is present' value: architecto /api/aos/v1/organizations: get: summary: 'List organizations' operationId: listOrganizations description: 'List architect organizations accessible to the authenticated user.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - Organizations '/api/aos/v1/organizations/users/{userId}': get: summary: 'List organizations for a user' operationId: listOrganizationsForAUser description: 'List architect organizations accessible to a specific user.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - Organizations parameters: - in: path name: userId description: '' example: architecto required: true schema: type: string /api/aos/v1/organizations/switch: post: summary: 'Switch active organization' operationId: switchActiveOrganization description: "Switch the authenticated user's active organization." parameters: [] responses: {} tags: - Organizations requestBody: required: true content: application/json: schema: type: object properties: organization_id: type: string description: 'Must be a valid UUID.' example: 6ff8f7f6-1eb3-3525-be4a-3932c805afed required: - organization_id '/api/aos/v1/organizations/{organizationId}': get: summary: 'Get an organization' operationId: getAnOrganization description: 'Get an architect organization by its UUID.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - Organizations parameters: - in: path name: organizationId description: '' example: architecto required: true schema: type: string '/api/aos/v1/organizations/headquarters/{organizationId}': get: summary: 'Get organization headquarters' operationId: getOrganizationHeadquarters description: 'Get the headquarters associated with an organization.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - Organizations parameters: - in: path name: organizationId description: '' example: architecto required: true schema: type: string '/api/aos/v1/contractors/{contractorId}': get: summary: 'Get a contractor' operationId: getAContractor description: "Get a contractor from the current organization's directory." parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - Contractors parameters: - in: path name: contractorId description: '' example: architecto required: true schema: type: string /api/aos/v1/trades/list: get: summary: 'List trade lists' operationId: listTradeLists description: 'List trade list templates accessible to the authenticated user.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - Trades '/api/aos/v1/trades/list/{tradeListId}': get: summary: 'Get a trade list' operationId: getATradeList description: 'Get a trade list with all its associated trades.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - Trades parameters: - in: path name: tradeListId description: '' example: architecto required: true schema: type: string /api/aos/v1/tools/ids-to-uuids: post: summary: 'Convert IDs to UUIDs' operationId: convertIDsToUUIDs description: 'Convert a list of MongoDB IDs to their corresponding UUIDs.' parameters: [] responses: {} tags: - Tools requestBody: required: false content: application/json: schema: type: object properties: resources: type: array description: 'Must be 17 characters.' example: - - bngzmiyvdljnikhwa items: type: array description: '' example: - bngzmiyvdljnikhwa items: type: string '/api/aos/v1/pfo/{userId}/roles': get: summary: 'Get PFo roles for a user' operationId: getPFoRolesForAUser description: 'Get the PFo roles currently authorized for a user.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - 'PFo User Roles' post: summary: 'Assign a PFo role' operationId: assignAPFoRole description: 'Assign a PFo role to a user.' parameters: [] responses: {} tags: - 'PFo User Roles' delete: summary: 'Remove PFo roles from a user' operationId: removePFoRolesFromAUser description: 'Remove all PFo roles from a user.' parameters: [] responses: {} tags: - 'PFo User Roles' parameters: - in: path name: userId description: '' example: architecto required: true schema: type: string '/api/internal/v1/trades/mapping/{tradeName}': get: summary: 'Get trade categories by name' operationId: getTradeCategoriesByName description: 'Get trade categories from a trade name.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - Internal parameters: - in: path name: tradeName description: '' example: architecto required: true schema: type: string '/api/internal/v1/trades/mapping/AOS/{tradeId}': get: summary: 'Get trade categories by AOS ID' operationId: getTradeCategoriesByAOSID description: 'Get trade categories from an AOS trade ID.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - Internal parameters: - in: path name: tradeId description: '' example: architecto required: true schema: type: string '/api/internal/v1/trades/mapping/CP/{tradeId}': get: summary: 'Get trade categories by CP ID' operationId: getTradeCategoriesByCPID description: 'Get trade categories from a CP trade ID.' parameters: [] responses: 401: description: '' content: application/json: schema: type: object example: code: 401 message: 'You are not authenticated' properties: code: type: integer example: 401 message: type: string example: 'You are not authenticated' tags: - Internal parameters: - in: path name: tradeId description: '' example: architecto required: true schema: type: string '/api/internal/v1/company/contacts/{siret}': get: summary: 'Get company contacts by SIRET.' operationId: getCompanyContactsBySIRET description: "Retrieves all contractor organizations matching a given SIRET (fiscal number)\nand returns their users as contacts." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: siret: '12345678901234' companies: - id: 550e8400-e29b-41d4-a716-446655440000 name: 'Acme Corp' contacts: - first_name: Jean last_name: Dupont email: jean@example.com phone: '+33123456789' mobile: '+33612345678' properties: siret: type: string example: '12345678901234' companies: type: array example: - id: 550e8400-e29b-41d4-a716-446655440000 name: 'Acme Corp' contacts: - first_name: Jean last_name: Dupont email: jean@example.com phone: '+33123456789' mobile: '+33612345678' items: type: object properties: id: type: string example: 550e8400-e29b-41d4-a716-446655440000 name: type: string example: 'Acme Corp' contacts: type: array example: - first_name: Jean last_name: Dupont email: jean@example.com phone: '+33123456789' mobile: '+33612345678' items: type: object properties: first_name: type: string example: Jean last_name: type: string example: Dupont email: type: string example: jean@example.com phone: type: string example: '+33123456789' mobile: type: string example: '+33612345678' 400: description: 'Invalid SIRET format' content: application/json: schema: type: object example: message: 'Invalid SIRET format. Must be 14 digits.' properties: message: type: string example: 'Invalid SIRET format. Must be 14 digits.' 404: description: 'No organizations found' content: application/json: schema: type: object example: siret: '12345678901234' message: 'No contractor organizations found for this SIRET.' data: [] properties: siret: type: string example: '12345678901234' message: type: string example: 'No contractor organizations found for this SIRET.' data: type: array example: [] tags: - Internal requestBody: required: true content: application/json: schema: type: object properties: siret: type: string description: 'Must be 14 digits.' example: '82256977549171' required: - siret parameters: - in: path name: siret description: 'The company SIRET code (14 digits).' example: '12345678901234' required: true schema: type: string '/api/internal/v1/company/trades/{siret}': get: summary: 'Get company trades by SIRET.' operationId: getCompanyTradesBySIRET description: "Retrieves contractor organizations matching the given SIRET,\nthen resolves their business sectors and trades from DPGF documents/templates." parameters: [] responses: 200: description: '' content: application/json: schema: type: object example: siret: '12345678901234' companies: - id: 550e8400-e29b-41d4-a716-446655440000 name: 'Acme Corp' business_sectors: - Maconnerie trades: - id: 660e8400-e29b-41d4-a716-446655440000 name: Electricite properties: siret: type: string example: '12345678901234' companies: type: array example: - id: 550e8400-e29b-41d4-a716-446655440000 name: 'Acme Corp' business_sectors: - Maconnerie trades: - id: 660e8400-e29b-41d4-a716-446655440000 name: Electricite items: type: object properties: id: type: string example: 550e8400-e29b-41d4-a716-446655440000 name: type: string example: 'Acme Corp' business_sectors: type: array example: - Maconnerie items: type: string trades: type: array example: - id: 660e8400-e29b-41d4-a716-446655440000 name: Electricite items: type: object properties: id: type: string example: 660e8400-e29b-41d4-a716-446655440000 name: type: string example: Electricite 400: description: 'Invalid SIRET format' content: application/json: schema: type: object example: message: 'Invalid SIRET format. Must be 14 digits.' properties: message: type: string example: 'Invalid SIRET format. Must be 14 digits.' 404: description: 'No organizations found' content: application/json: schema: type: object example: siret: '12345678901234' message: 'No contractor organizations found for this SIRET.' data: [] properties: siret: type: string example: '12345678901234' message: type: string example: 'No contractor organizations found for this SIRET.' data: type: array example: [] tags: - Internal requestBody: required: true content: application/json: schema: type: object properties: siret: type: string description: 'Must be 14 digits.' example: '82256977549171' required: - siret parameters: - in: path name: siret description: 'The company SIRET code (14 digits).' example: '12345678901234' required: true schema: type: string /api/internal/v1/tools/uuids-to-ids: post: summary: 'Convert UUIDs to IDs' operationId: convertUUIDsToIDs description: 'Convert a list of UUIDs to their corresponding MongoDB IDs.' parameters: [] responses: {} tags: - Internal requestBody: required: false content: application/json: schema: type: object properties: resources: type: array description: 'Must be 36 characters.' example: - - bngzmiyvdljnikhwaykcmyuwpwlvqwrsitcp items: type: array description: '' example: - bngzmiyvdljnikhwaykcmyuwpwlvqwrsitcp items: type: string