{"openapi":"3.1.0","info":{"title":"Hyyr Public API","version":"0.1.0","description":"Public API for the Hyyr procurement platform. Generate an API key under Innstillinger → Brukere og tilganger → API, then authenticate with `Authorization: Bearer hyyr_…`."},"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"bearer","description":"API key generated in Hyyr settings (Innstillinger → API). Format: hyyr_xxxxxxxx…"}},"schemas":{"AgreementSupplier":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"orgNumber":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"contactPersonName":{"type":"string","nullable":true}},"required":["id","name","orgNumber","email","contactPersonName"]},"UpdateAgreementRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Agreement name"},"description":{"type":"string","nullable":true,"description":"Free-text description"},"maxValue":{"type":"integer","nullable":true,"description":"Maximum contract value"},"valueSpent":{"type":"integer","nullable":true,"description":"Value spent so far"},"contractId":{"type":"string","nullable":true,"description":"External contract number (kontraktsnummer)"},"startDate":{"type":"string","nullable":true,"format":"date-time","description":"Agreement start date (ISO 8601)"},"endDate":{"type":"string","nullable":true,"format":"date-time","description":"Agreement end date (ISO 8601)"}}},"UpdateProcurementRequest":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Title of the procurement"},"background":{"type":"string","description":"Description / background text"},"contractId":{"type":"string","nullable":true,"description":"Tenant-customizable contract identifier"},"procedureDescription":{"type":"string","nullable":true,"description":"Custom override for the procedure description"}}},"CreateCompetitionExistingRequest":{"type":"object","properties":{"procurementId":{"type":"string","minLength":1,"description":"ID of the procurement"}},"required":["procurementId"]},"CreateCompetitionNewRequest":{"type":"object","properties":{"name":{"type":"string","description":"Title of the procurement"},"description":{"type":"string","description":"Short description"},"ownerUserId":{"type":"string","minLength":1,"description":"User ID of the owner (must belong to your organization)"},"lot":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"duration":{"type":"integer","minimum":0},"deadlineReceiptTenders":{"type":"string","format":"date-time"},"durationStart":{"type":"string","format":"date-time"},"durationEnd":{"type":"string","format":"date-time"},"estValue":{"type":"integer","nullable":true,"minimum":0},"awardCriteria":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["PRICE","COST","QUALITY","ENVIRONMENT"]},"weight":{"type":"integer","minimum":0,"maximum":100},"priceHandlingType":{"type":"string","enum":["TOTAL_PRICE","PRICE_SCHEMA"]}},"required":["name","description","type"]},"minItems":1}},"required":["description","duration","deadlineReceiptTenders","durationStart","durationEnd","awardCriteria"]}},"required":["name","description","ownerUserId","lot"]},"CreateMarketDialogExistingRequest":{"type":"object","properties":{"procurementId":{"type":"string","minLength":1,"description":"ID of the procurement"}},"required":["procurementId"]},"CreateMarketDialogNewRequest":{"type":"object","properties":{"name":{"type":"string","description":"Title of the procurement"},"description":{"type":"string","description":"Short description"},"ownerUserId":{"type":"string","minLength":1,"description":"User ID of the owner (must belong to your organization)"},"lot":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"duration":{"type":"integer","minimum":0},"deadlineReceiptTenders":{"type":"string","format":"date-time"},"durationStart":{"type":"string","format":"date-time"},"durationEnd":{"type":"string","format":"date-time"},"estValue":{"type":"integer","nullable":true,"minimum":0},"awardCriteria":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["PRICE","COST","QUALITY","ENVIRONMENT"]},"weight":{"type":"integer","minimum":0,"maximum":100},"priceHandlingType":{"type":"string","enum":["TOTAL_PRICE","PRICE_SCHEMA"]}},"required":["name","description","type"]},"minItems":1}},"required":["description","duration","deadlineReceiptTenders","durationStart","durationEnd","awardCriteria"]}},"required":["name","description","ownerUserId","lot"]}},"parameters":{}},"paths":{"/health":{"get":{"tags":["Health"],"summary":"Health check","responses":{"200":{"description":"API is healthy","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}}}}}}},"/agreements":{"get":{"tags":["Agreements"],"summary":"List all agreements for your organization","description":"Returns agreements for the authenticated organization. Each agreement includes its suppliers.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["FRAMEWORK_AGREEMENT","SIMPLE_AGREEMENT"],"description":"Filter by agreement type","example":"FRAMEWORK_AGREEMENT"},"required":false,"description":"Filter by agreement type","name":"type","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Number of results to return (1-100)"},"required":false,"description":"Number of results to return (1-100)","name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0,"description":"Number of results to skip"},"required":false,"description":"Number of results to skip","name":"offset","in":"query"}],"responses":{"200":{"description":"List of agreements","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["FRAMEWORK_AGREEMENT","SIMPLE_AGREEMENT"]},"maxValue":{"type":"integer","nullable":true},"valueSpent":{"type":"integer","nullable":true},"contractId":{"type":"string","nullable":true,"description":"External contract number (kontraktsnummer)"},"startDate":{"type":"string","nullable":true,"format":"date-time","description":"Agreement start date (ISO 8601)"},"endDate":{"type":"string","nullable":true,"format":"date-time","description":"Agreement end date (ISO 8601)"},"procurementId":{"type":"string","nullable":true},"lotId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"contactPerson":{"type":"object","nullable":true,"properties":{"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true}},"required":["firstName","lastName","email","phone"]},"suppliers":{"type":"array","items":{"$ref":"#/components/schemas/AgreementSupplier"}}},"required":["id","name","description","type","maxValue","valueSpent","contractId","startDate","endDate","procurementId","lotId","createdAt","updatedAt","contactPerson","suppliers"]}},"pagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["total","limit","offset"]}},"required":["data","pagination"]}}}}}}},"/agreements/:id":{"get":{"tags":["Agreements"],"summary":"Get a single agreement by ID","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Agreement ID"},"required":true,"description":"Agreement ID","name":"id","in":"path"}],"responses":{"200":{"description":"Agreement details","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["FRAMEWORK_AGREEMENT","SIMPLE_AGREEMENT"]},"maxValue":{"type":"integer","nullable":true},"valueSpent":{"type":"integer","nullable":true},"contractId":{"type":"string","nullable":true,"description":"External contract number (kontraktsnummer)"},"startDate":{"type":"string","nullable":true,"format":"date-time","description":"Agreement start date (ISO 8601)"},"endDate":{"type":"string","nullable":true,"format":"date-time","description":"Agreement end date (ISO 8601)"},"procurementId":{"type":"string","nullable":true},"lotId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"contactPerson":{"type":"object","nullable":true,"properties":{"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true}},"required":["firstName","lastName","email","phone"]},"suppliers":{"type":"array","items":{"$ref":"#/components/schemas/AgreementSupplier"}}},"required":["id","name","description","type","maxValue","valueSpent","contractId","startDate","endDate","procurementId","lotId","createdAt","updatedAt","contactPerson","suppliers"]}},"required":["data"]}}}},"404":{"description":"Agreement not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"tags":["Agreements"],"summary":"Update an agreement","description":"Partially updates an agreement. Only the provided fields are changed.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Agreement ID"},"required":true,"description":"Agreement ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateAgreementRequest"}}}},"responses":{"200":{"description":"Updated agreement","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["FRAMEWORK_AGREEMENT","SIMPLE_AGREEMENT"]},"maxValue":{"type":"integer","nullable":true},"valueSpent":{"type":"integer","nullable":true},"contractId":{"type":"string","nullable":true,"description":"External contract number (kontraktsnummer)"},"startDate":{"type":"string","nullable":true,"format":"date-time","description":"Agreement start date (ISO 8601)"},"endDate":{"type":"string","nullable":true,"format":"date-time","description":"Agreement end date (ISO 8601)"},"procurementId":{"type":"string","nullable":true},"lotId":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"contactPerson":{"type":"object","nullable":true,"properties":{"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true}},"required":["firstName","lastName","email","phone"]},"suppliers":{"type":"array","items":{"$ref":"#/components/schemas/AgreementSupplier"}}},"required":["id","name","description","type","maxValue","valueSpent","contractId","startDate","endDate","procurementId","lotId","createdAt","updatedAt","contactPerson","suppliers"]}},"required":["data"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agreement not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/events":{"get":{"tags":["Events"],"summary":"List activity events","description":"Returns a unified, newest-first feed of procurement and agreement activity for your organization. Poll with `since` (an ISO 8601 timestamp) to fetch only events created after your last check.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","format":"date-time","description":"Only return events created at or after this timestamp","example":"2026-01-01T00:00:00.000Z"},"required":false,"description":"Only return events created at or after this timestamp","name":"since","in":"query"},{"schema":{"type":"string","enum":["procurement","agreement"],"description":"Filter by resource type","example":"procurement"},"required":false,"description":"Filter by resource type","name":"type","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Number of results to return (1-100)"},"required":false,"description":"Number of results to return (1-100)","name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0,"description":"Number of results to skip"},"required":false,"description":"Number of results to skip","name":"offset","in":"query"}],"responses":{"200":{"description":"List of activity events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Audit log entry ID"},"type":{"type":"string","enum":["procurement","agreement"],"description":"Which resource the event relates to"},"resourceId":{"type":"string","description":"ID of the procurement or agreement the event relates to"},"action":{"type":"string","description":"Machine-readable action code"},"description":{"type":"string","description":"Human-readable description of the event"},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true},"description":"Structured details about the change"},"performedBy":{"type":"object","nullable":true,"properties":{"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["firstName","lastName","email"],"description":"User who performed the action, if known"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","type","resourceId","action","description","metadata","performedBy","createdAt"]}},"pagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["total","limit","offset"]}},"required":["data","pagination"]}}}}}}},"/organization/members":{"get":{"tags":["Organization"],"summary":"Get all members in your organization","description":"Returns all users that belong to the organization (tenant) associated with your API key.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Number of results to return (1-100)"},"required":false,"description":"Number of results to return (1-100)","name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0,"description":"Number of results to skip"},"required":false,"description":"Number of results to skip","name":"offset","in":"query"}],"responses":{"200":{"description":"List of organization members","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"User ID"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"department":{"type":"string","nullable":true},"roles":{"type":"array","items":{"type":"string","enum":["ADMIN","REQUESTOR","PURCHASER"]}},"joinedAt":{"type":"string","format":"date-time"}},"required":["id","firstName","lastName","email","phone","title","department","roles","joinedAt"]}},"pagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["total","limit","offset"]}},"required":["data","pagination"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/procurements/active":{"get":{"tags":["Procurements"],"summary":"List active procurements","description":"Returns procurements that are published and open for tenders. Filtered to status \"published\".","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Number of results to return (1-100)"},"required":false,"description":"Number of results to return (1-100)","name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0,"description":"Number of results to skip"},"required":false,"description":"Number of results to skip","name":"offset","in":"query"}],"responses":{"200":{"description":"List of active procurements","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","published","closed","cancelled"]},"procedureType":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lots":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string"},"estValue":{"type":"number","nullable":true},"deadlineReceiptTenders":{"type":"string","format":"date-time"},"durationStart":{"type":"string","format":"date-time"},"durationEnd":{"type":"string","format":"date-time"},"cpvCodes":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"},"isMain":{"type":"boolean"}},"required":["code","description","isMain"]}}},"required":["id","name","description","estValue","deadlineReceiptTenders","durationStart","durationEnd","cpvCodes"]}},"contactPerson":{"type":"object","nullable":true,"properties":{"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true}},"required":["firstName","lastName","email","phone"]}},"required":["id","name","status","procedureType","createdAt","updatedAt","lots","contactPerson"]}},"pagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["total","limit","offset"]}},"required":["data","pagination"]}}}}}}},"/procurements":{"get":{"tags":["Procurements"],"summary":"List procurements","description":"Returns procurements for your organization. Optionally filter by status (draft, published, closed, cancelled).","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","enum":["draft","published","closed","cancelled"],"description":"Filter by status","example":"published"},"required":false,"description":"Filter by status","name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50,"description":"Number of results to return (1-100)"},"required":false,"description":"Number of results to return (1-100)","name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0,"description":"Number of results to skip"},"required":false,"description":"Number of results to skip","name":"offset","in":"query"}],"responses":{"200":{"description":"List of procurements","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","published","closed","cancelled"]},"procedureType":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lots":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string"},"estValue":{"type":"number","nullable":true},"deadlineReceiptTenders":{"type":"string","format":"date-time"},"durationStart":{"type":"string","format":"date-time"},"durationEnd":{"type":"string","format":"date-time"},"cpvCodes":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"},"isMain":{"type":"boolean"}},"required":["code","description","isMain"]}}},"required":["id","name","description","estValue","deadlineReceiptTenders","durationStart","durationEnd","cpvCodes"]}},"contactPerson":{"type":"object","nullable":true,"properties":{"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true}},"required":["firstName","lastName","email","phone"]}},"required":["id","name","status","procedureType","createdAt","updatedAt","lots","contactPerson"]}},"pagination":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["total","limit","offset"]}},"required":["data","pagination"]}}}}}}},"/procurements/:id":{"get":{"tags":["Procurements"],"summary":"Get one procurement","description":"Returns a single procurement by ID, including lots and contact person.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Procurement ID"},"required":true,"description":"Procurement ID","name":"id","in":"path"}],"responses":{"200":{"description":"Procurement details","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","published","closed","cancelled"]},"procedureType":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lots":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string"},"estValue":{"type":"number","nullable":true},"deadlineReceiptTenders":{"type":"string","format":"date-time"},"durationStart":{"type":"string","format":"date-time"},"durationEnd":{"type":"string","format":"date-time"},"cpvCodes":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"},"isMain":{"type":"boolean"}},"required":["code","description","isMain"]}}},"required":["id","name","description","estValue","deadlineReceiptTenders","durationStart","durationEnd","cpvCodes"]}},"contactPerson":{"type":"object","nullable":true,"properties":{"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true}},"required":["firstName","lastName","email","phone"]}},"required":["id","name","status","procedureType","createdAt","updatedAt","lots","contactPerson"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"tags":["Procurements"],"summary":"Update a procurement","description":"Partially updates a procurement. Only the provided fields are changed.","security":[{"Bearer":[]}],"parameters":[{"schema":{"type":"string","description":"Procurement ID"},"required":true,"description":"Procurement ID","name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProcurementRequest"}}}},"responses":{"200":{"description":"Updated procurement","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["draft","published","closed","cancelled"]},"procedureType":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"lots":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string"},"estValue":{"type":"number","nullable":true},"deadlineReceiptTenders":{"type":"string","format":"date-time"},"durationStart":{"type":"string","format":"date-time"},"durationEnd":{"type":"string","format":"date-time"},"cpvCodes":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"},"isMain":{"type":"boolean"}},"required":["code","description","isMain"]}}},"required":["id","name","description","estValue","deadlineReceiptTenders","durationStart","durationEnd","cpvCodes"]}},"contactPerson":{"type":"object","nullable":true,"properties":{"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true}},"required":["firstName","lastName","email","phone"]}},"required":["id","name","status","procedureType","createdAt","updatedAt","lots","contactPerson"]}},"required":["data"]}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/procurements/rfp":{"post":{"tags":["Procurements"],"summary":"Create a need (behov)","description":"Creates a new need (behov). Send a short description and the user who will own it. Returns the new need ID. Legacy path `/rfp` is retained for compatibility.","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string"},"ownerUserId":{"type":"string","minLength":1}},"required":["description","ownerUserId"]}}}},"responses":{"201":{"description":"RFP created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"required":["data"]}}}},"400":{"description":"Invalid input or owner user","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Tenant not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/procurements/competitions":{"post":{"tags":["Procurements"],"summary":"Create a competition","description":"Either start a competition for an existing procurement (send procurementId) or create a new procurement and competition (send name, description, owner, and a simplified lot with description, dates, and award criteria).","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CreateCompetitionExistingRequest"},{"$ref":"#/components/schemas/CreateCompetitionNewRequest"}]}}}},"responses":{"201":{"description":"Competition created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"required":["data"]}}}},"400":{"description":"Invalid input or owner user","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Tenant not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Procurement not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/procurements/market-dialogs":{"post":{"tags":["Procurements"],"summary":"Create a market dialogue","description":"Either add a market dialogue to an existing procurement (send procurementId) or create a new procurement and market dialogue (send name, description, owner, and a simplified lot with description, dates, and award criteria).","security":[{"Bearer":[]}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/CreateMarketDialogExistingRequest"},{"$ref":"#/components/schemas/CreateMarketDialogNewRequest"}]}}}},"responses":{"201":{"description":"Market dialogue created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"procurementId":{"type":"string"},"marketDialogId":{"type":"string"}},"required":["procurementId","marketDialogId"]}},"required":["data"]}}}},"400":{"description":"Invalid input or owner user","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Tenant not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Procurement not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}}}