{"components":{"parameters":{"CanonicalEmissionActivityType":{"explode":true,"in":"query","name":"activityType","schema":{"items":{"type":"string"},"type":"array"},"style":"form"},"CanonicalEmissionAmountUnit":{"explode":true,"in":"query","name":"amountUnit","schema":{"items":{"type":"string"},"type":"array"},"style":"form"},"CanonicalEmissionCategoryName":{"explode":true,"in":"query","name":"categoryName","schema":{"items":{"type":"string"},"type":"array"},"style":"form"},"CanonicalEmissionDocumentId":{"description":"Upload ID used to restrict canonical emissions to one document.","in":"query","name":"documentId","schema":{"pattern":"^[1-9][0-9]*$","type":"string"}},"CanonicalEmissionEndDate":{"in":"query","name":"endDate","schema":{"format":"date-time","type":"string"}},"CanonicalEmissionFactorType":{"explode":true,"in":"query","name":"factorType","schema":{"items":{"type":"string"},"type":"array"},"style":"form"},"CanonicalEmissionItemType":{"in":"query","name":"item_type","schema":{"default":"carbon","enum":["carbon","all"],"type":"string"}},"CanonicalEmissionLocationId":{"explode":true,"in":"query","name":"locationId","schema":{"items":{"type":"string"},"type":"array"},"style":"form"},"CanonicalEmissionMaxCo2eTonnes":{"in":"query","name":"maxCo2eTonnes","schema":{"type":"number"}},"CanonicalEmissionMinCo2eTonnes":{"in":"query","name":"minCo2eTonnes","schema":{"type":"number"}},"CanonicalEmissionOrigin":{"explode":true,"in":"query","name":"origin","schema":{"items":{"enum":["template","direct_upload"],"type":"string"},"type":"array"},"style":"form"},"CanonicalEmissionProvenanceStatus":{"explode":true,"in":"query","name":"provenanceStatus","schema":{"items":{"enum":["authoritative"],"type":"string"},"type":"array"},"style":"form"},"CanonicalEmissionQuery":{"in":"query","name":"query","schema":{"type":"string"}},"CanonicalEmissionRegionCode":{"explode":true,"in":"query","name":"regionCode","schema":{"items":{"type":"string"},"type":"array"},"style":"form"},"CanonicalEmissionScope":{"explode":true,"in":"query","name":"scope","schema":{"items":{"type":"integer"},"type":"array"},"style":"form"},"CanonicalEmissionStartDate":{"in":"query","name":"startDate","schema":{"format":"date-time","type":"string"}},"CanonicalEmissionSubCategoryName":{"explode":true,"in":"query","name":"subCategoryName","schema":{"items":{"type":"string"},"type":"array"},"style":"form"},"CanonicalEmissionSupplierDisplay":{"explode":true,"in":"query","name":"supplierDisplay","schema":{"items":{"type":"string"},"type":"array"},"style":"form"}},"responses":{"BadRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Bad Request"},"Conflict":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Conflict"},"Forbidden":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Forbidden"},"NotFound":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Not Found"},"PayloadTooLarge":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Payload Too Large"},"Unauthorized":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unauthorized"},"UnsupportedMediaType":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Unsupported Media Type"}},"schemas":{"AccessActivityEvent":{"properties":{"actorUserId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"eventType":{"example":"access.organization_role_changed","type":"string"},"id":{"format":"int64","type":"integer"},"newRole":{"$ref":"#/components/schemas/OrganizationAccessRole"},"oldRole":{"$ref":"#/components/schemas/OrganizationAccessRole"},"organizationId":{"type":"string"},"targetUserId":{"type":"string"}},"required":["id","eventType","createdAt"],"type":"object"},"AccessActivityResponse":{"properties":{"data":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AccessActivityEvent"},"type":"array"}},"required":["items"],"type":"object"}},"required":["data"],"type":"object"},"AccessMember":{"properties":{"accountRole":{"type":"string"},"displayName":{"type":"string"},"email":{"type":"string"},"name":{"type":"string"},"organizationRoles":{"items":{"$ref":"#/components/schemas/AccessOrganizationRole"},"type":"array"},"userId":{"type":"string"}},"required":["userId","accountRole","organizationRoles"],"type":"object"},"AccessMemberResponse":{"properties":{"data":{"$ref":"#/components/schemas/AccessMember"}},"required":["data"],"type":"object"},"AccessMembersContext":{"properties":{"account":{"$ref":"#/components/schemas/AccountContext"},"members":{"items":{"$ref":"#/components/schemas/AccessMember"},"type":"array"},"organizations":{"items":{"$ref":"#/components/schemas/BusinessOrganizationContext"},"type":"array"}},"required":["account","organizations","members"],"type":"object"},"AccessMembersResponse":{"properties":{"data":{"$ref":"#/components/schemas/AccessMembersContext"}},"required":["data"],"type":"object"},"AccessOrganizationRole":{"properties":{"isDefault":{"type":"boolean"},"name":{"type":"string"},"organizationId":{"type":"string"},"role":{"$ref":"#/components/schemas/OrganizationAccessRole"},"slug":{"type":"string"}},"required":["organizationId","name","slug","role","isDefault"],"type":"object"},"AccessRoleOption":{"properties":{"baseRole":{"type":"string"},"capabilities":{"additionalProperties":{"type":"boolean"},"type":"object"},"createdAt":{"format":"date-time","type":"string"},"description":{"type":"string"},"isCustom":{"type":"boolean"},"name":{"type":"string"},"role":{"type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["role","name","description","baseRole","isCustom","capabilities"],"type":"object"},"AccessRoleResponse":{"properties":{"data":{"$ref":"#/components/schemas/AccessRoleOption"}},"required":["data"],"type":"object"},"AccessRolesResponse":{"properties":{"data":{"properties":{"actionKeys":{"items":{"type":"string"},"type":"array"},"items":{"items":{"$ref":"#/components/schemas/AccessRoleOption"},"type":"array"}},"required":["actionKeys","items"],"type":"object"}},"required":["data"],"type":"object"},"AccountContext":{"properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug"],"type":"object"},"ApiKey":{"properties":{"createdAt":{"format":"date-time","type":"string"},"id":{"type":"string"},"remark":{"type":"string"}},"required":["id","remark","createdAt"],"type":"object"},"ApiKeyCreateRequest":{"properties":{"remark":{"type":"string"}},"type":"object"},"ApiKeyCreated":{"allOf":[{"$ref":"#/components/schemas/ApiKey"},{"properties":{"secretKey":{"description":"Raw API key returned only by the create operation.","type":"string"}},"required":["secretKey"],"type":"object"}]},"ApiKeyCreatedResponse":{"properties":{"data":{"$ref":"#/components/schemas/ApiKeyCreated"}},"required":["data"],"type":"object"},"ApiKeyDeletedResponse":{"properties":{"data":{"properties":{"id":{"type":"string"}},"required":["id"],"type":"object"}},"required":["data"],"type":"object"},"ApiKeyListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ApiKey"},"type":"array"}},"required":["data"],"type":"object"},"AssignSupplierSourceRecordRequest":{"properties":{"sourceRecordId":{"type":"string"},"supplierId":{"type":"string"}},"required":["sourceRecordId","supplierId"],"type":"object"},"BillingAccountListResponse":{"properties":{"data":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BillingAccountRow"},"type":"array"}},"required":["items"],"type":"object"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"BillingAccountRow":{"properties":{"accountId":{"type":"string"},"accountName":{"type":"string"},"accountSlug":{"type":"string"},"balance":{"$ref":"#/components/schemas/CreditBalance"},"initialized":{"type":"boolean"},"plan":{"$ref":"#/components/schemas/BillingPlan"},"source":{"type":"string"}},"required":["accountId","initialized","balance"],"type":"object"},"BillingPlan":{"properties":{"active":{"type":"boolean"},"code":{"type":"string"},"featureGates":{"additionalProperties":true,"type":"object"},"id":{"type":"string"},"includedMonthlyCredits":{"format":"int64","type":"integer"},"name":{"type":"string"},"overageEnabled":{"type":"boolean"}},"required":["id","code","name","includedMonthlyCredits","overageEnabled","featureGates","active"],"type":"object"},"BillingSummary":{"properties":{"accountId":{"type":"string"},"accountName":{"type":"string"},"accountSlug":{"type":"string"},"balance":{"$ref":"#/components/schemas/CreditBalance"},"plan":{"$ref":"#/components/schemas/BillingPlan"},"transactions":{"items":{"$ref":"#/components/schemas/CreditTransaction"},"type":"array"},"usage":{"$ref":"#/components/schemas/BillingUsage"}},"required":["accountId","plan","balance","usage"],"type":"object"},"BillingSummaryResponse":{"properties":{"data":{"$ref":"#/components/schemas/BillingSummary"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"BillingTransactionListResponse":{"properties":{"data":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CreditTransaction"},"type":"array"}},"required":["items"],"type":"object"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"BillingUsage":{"properties":{"byFeature":{"items":{"$ref":"#/components/schemas/BillingUsageGroup"},"type":"array"},"byOrg":{"items":{"$ref":"#/components/schemas/BillingUsageGroup"},"type":"array"},"totalCredits":{"format":"int64","type":"integer"},"totalTokens":{"format":"int64","type":"integer"}},"required":["totalCredits","totalTokens","byFeature","byOrg"],"type":"object"},"BillingUsageGroup":{"properties":{"credits":{"format":"int64","type":"integer"},"displayName":{"type":"string"},"key":{"type":"string"},"tokens":{"format":"int64","type":"integer"}},"required":["key","credits","tokens"],"type":"object"},"BillingUsageResponse":{"properties":{"data":{"$ref":"#/components/schemas/BillingUsage"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"BusinessOrganizationContext":{"properties":{"id":{"type":"string"},"isDefault":{"type":"boolean"},"name":{"type":"string"},"role":{"type":"string"},"slug":{"type":"string"}},"required":["id","name","slug","role","isDefault"],"type":"object"},"BusinessOrganizationCreateRequest":{"properties":{"copyAccessFromOrganizationId":{"type":"string"},"description":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"}},"required":["name"],"type":"object"},"BusinessOrganizationResponse":{"properties":{"data":{"$ref":"#/components/schemas/BusinessOrganizationSummary"}},"required":["data"],"type":"object"},"BusinessOrganizationStatus":{"enum":["active","archived"],"type":"string"},"BusinessOrganizationSummary":{"properties":{"adminCount":{"type":"integer"},"archivedAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"currentRole":{"type":"string"},"description":{"type":"string"},"editorCount":{"type":"integer"},"id":{"type":"string"},"isDefault":{"type":"boolean"},"memberCount":{"type":"integer"},"name":{"type":"string"},"slug":{"type":"string"},"status":{"$ref":"#/components/schemas/BusinessOrganizationStatus"},"updatedAt":{"format":"date-time","type":"string"},"viewerCount":{"type":"integer"}},"required":["id","name","slug","description","status","isDefault","memberCount","adminCount","editorCount","viewerCount","createdAt","updatedAt"],"type":"object"},"BusinessOrganizationUpdateRequest":{"properties":{"description":{"type":"string"},"isDefault":{"type":"boolean"},"name":{"type":"string"}},"type":"object"},"BusinessOrganizationsResponse":{"properties":{"data":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BusinessOrganizationSummary"},"type":"array"}},"required":["items"],"type":"object"}},"required":["data"],"type":"object"},"CanonicalEmissionExportRequest":{"properties":{"activityType":{"items":{"type":"string"},"type":"array"},"amountUnit":{"items":{"type":"string"},"type":"array"},"categoryName":{"items":{"type":"string"},"type":"array"},"documentId":{"pattern":"^[1-9][0-9]*$","type":"string"},"endDate":{"format":"date-time","type":"string"},"factorType":{"items":{"type":"string"},"type":"array"},"itemType":{"default":"carbon","enum":["carbon","all"],"type":"string"},"locationId":{"items":{"type":"string"},"type":"array"},"maxCo2eTonnes":{"type":"number"},"minCo2eTonnes":{"type":"number"},"origin":{"items":{"enum":["template","direct_upload"],"type":"string"},"type":"array"},"provenanceStatus":{"items":{"enum":["authoritative"],"type":"string"},"type":"array"},"query":{"type":"string"},"regionCode":{"items":{"type":"string"},"type":"array"},"scope":{"items":{"type":"integer"},"type":"array"},"startDate":{"format":"date-time","type":"string"},"subCategoryName":{"items":{"type":"string"},"type":"array"},"supplierDisplay":{"items":{"type":"string"},"type":"array"}},"type":"object"},"CanonicalEmissionFacets":{"properties":{"amountUnits":{"items":{"type":"string"},"type":"array"},"categoryNames":{"items":{"type":"string"},"type":"array"},"origins":{"items":{"enum":["template","direct_upload"],"type":"string"},"type":"array"},"provenanceStatuses":{"items":{"enum":["authoritative"],"type":"string"},"type":"array"},"regionCodes":{"items":{"type":"string"},"type":"array"},"scopes":{"items":{"type":"integer"},"type":"array"},"supplierDisplays":{"items":{"type":"string"},"type":"array"}},"required":["categoryNames","supplierDisplays","amountUnits","scopes","regionCodes","origins","provenanceStatuses"],"type":"object"},"CanonicalEmissionFacetsResponse":{"properties":{"data":{"$ref":"#/components/schemas/CanonicalEmissionFacets"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"CanonicalEmissionItem":{"properties":{"activityType":{"nullable":true,"type":"string"},"amountUnit":{"nullable":true,"type":"string"},"categoryName":{"nullable":true,"type":"string"},"createdAt":{"format":"date-time","type":"string"},"description":{"nullable":true,"type":"string"},"editable":{"type":"boolean"},"endDate":{"format":"date-time","nullable":true,"type":"string"},"factorArchived":{"description":"True when the linked factor entry was archived after this emission was created.","type":"boolean"},"factorDisplayName":{"nullable":true,"type":"string"},"factorEntryId":{"nullable":true,"type":"string"},"factorLibraryId":{"nullable":true,"type":"string"},"factorProvenance":{"$ref":"#/components/schemas/CanonicalFactorProvenance","nullable":true},"factorReleaseId":{"nullable":true,"type":"string"},"factorValue":{"format":"double","nullable":true,"type":"number"},"id":{"type":"string"},"isCarbon":{"type":"boolean"},"locationDisplay":{"nullable":true,"type":"string"},"locationId":{"nullable":true,"type":"string"},"metricKind":{"enum":["emission_output"],"type":"string"},"name":{"type":"string"},"origin":{"enum":["template","direct_upload"],"type":"string"},"provenanceStatus":{"enum":["authoritative"],"type":"string"},"rawValue":{"format":"double","nullable":true,"type":"number"},"scope":{"nullable":true,"type":"integer"},"sourceFile":{"allOf":[{"$ref":"#/components/schemas/CanonicalEmissionSourceFile"}],"nullable":true},"sourceRecordId":{"nullable":true,"type":"string"},"sourceType":{"type":"string"},"spendCurrency":{"nullable":true,"type":"string"},"spendValue":{"format":"double","nullable":true,"type":"number"},"startDate":{"format":"date-time","type":"string"},"subCategoryName":{"nullable":true,"type":"string"},"supplierDisplay":{"nullable":true,"type":"string"},"supplierId":{"nullable":true,"type":"string"},"unit":{"type":"string"},"value":{"format":"double","type":"number"}},"required":["id","origin","sourceType","name","value","unit","startDate","createdAt","metricKind","provenanceStatus","factorArchived","editable","isCarbon"],"type":"object"},"CanonicalEmissionList":{"properties":{"hasMore":{"type":"boolean"},"items":{"items":{"$ref":"#/components/schemas/CanonicalEmissionItem"},"type":"array"},"nextCursor":{"nullable":true,"type":"string"},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer"}},"required":["items","hasMore"],"type":"object"},"CanonicalEmissionListResponse":{"properties":{"data":{"$ref":"#/components/schemas/CanonicalEmissionList"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"CanonicalEmissionResponse":{"properties":{"data":{"$ref":"#/components/schemas/CanonicalEmissionItem"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"CanonicalEmissionSourceFile":{"properties":{"contentType":{"nullable":true,"type":"string"},"fileName":{"type":"string"},"uploadId":{"type":"string"}},"required":["uploadId","fileName"],"type":"object"},"CanonicalEmissionUpdateRequest":{"properties":{"factorEntryId":{"type":"string"},"rawValue":{"format":"double","type":"number"}},"required":["rawValue","factorEntryId"],"type":"object"},"CanonicalFactorProvenance":{"additionalProperties":true,"type":"object"},"ChatStreamRequest":{"properties":{"conversationId":{"type":"string"},"message":{"type":"string"}},"required":["message"],"type":"object"},"CreateSupplierFromRawTextClusterRequest":{"properties":{"clusterId":{"type":"string"},"supplierName":{"type":"string"}},"required":["clusterId","supplierName"],"type":"object"},"CreateSupplierRequest":{"properties":{"name":{"type":"string"}},"required":["name"],"type":"object"},"CreditBalance":{"properties":{"accountId":{"type":"string"},"credits":{"format":"int64","type":"integer"},"frozen":{"type":"boolean"},"initialized":{"type":"boolean"},"reason":{"type":"string"}},"required":["accountId","credits","frozen","initialized"],"type":"object"},"CreditBalanceResponse":{"properties":{"data":{"$ref":"#/components/schemas/CreditBalance"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"CreditTransaction":{"properties":{"accountId":{"type":"string"},"amountCredits":{"format":"int64","type":"integer"},"balanceAfterCredits":{"format":"int64","type":"integer"},"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"expiresAt":{"format":"date-time","type":"string"},"id":{"type":"string"},"reason":{"type":"string"},"resourceLabel":{"type":"string"},"sourceId":{"type":"string"},"sourceType":{"type":"string"},"type":{"type":"string"}},"required":["id","accountId","type","amountCredits","balanceAfterCredits","sourceType","sourceId","reason","createdBy","createdAt"],"type":"object"},"CustomAccessRoleUpsertRequest":{"properties":{"baseRole":{"enum":["org:viewer","org:editor","org:admin"],"type":"string"},"capabilities":{"additionalProperties":{"type":"boolean"},"type":"object"},"description":{"type":"string"},"name":{"type":"string"}},"required":["name","baseRole","capabilities"],"type":"object"},"DashboardLayout":{"properties":{"createdAt":{"format":"date-time","type":"string"},"id":{"type":"string"},"layoutJson":{"additionalProperties":true,"type":"object"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","layoutJson","createdAt","updatedAt"],"type":"object"},"DashboardLayoutResponse":{"properties":{"data":{"$ref":"#/components/schemas/DashboardLayout"}},"required":["data"],"type":"object"},"DashboardLayoutSaveRequest":{"properties":{"id":{"type":"string"},"layoutJson":{"additionalProperties":true,"type":"object"}},"required":["layoutJson"],"type":"object"},"DataFeedJob":{"properties":{"actorUserId":{"type":"string"},"committedAt":{"format":"date-time","type":"string"},"createdAt":{"format":"date-time","type":"string"},"feedType":{"type":"string"},"feedVersion":{"type":"string"},"id":{"type":"string"},"idempotencyKey":{"type":"string"},"mode":{"type":"string"},"organizationId":{"type":"string"},"result":{"additionalProperties":true,"type":"object"},"status":{"enum":["previewed","imported","failed"],"type":"string"},"summary":{"$ref":"#/components/schemas/DataFeedSummary"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","organizationId","actorUserId","feedType","feedVersion","idempotencyKey","mode","status","summary","result","createdAt","updatedAt"],"type":"object"},"DataFeedJobListResponse":{"properties":{"data":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DataFeedJob"},"type":"array"}},"required":["items"],"type":"object"}},"required":["data"],"type":"object"},"DataFeedJobResponse":{"properties":{"data":{"$ref":"#/components/schemas/DataFeedJob"}},"required":["data"],"type":"object"},"DataFeedPreviewRequest":{"properties":{"feedType":{"enum":["emissions.seed.v1"],"type":"string"},"feedVersion":{"example":"2026-06-data-feed-v1","type":"string"},"idempotencyKey":{"type":"string"},"mode":{"enum":["upsert"],"type":"string"},"organizationExternalId":{"deprecated":true,"description":"Optional legacy cross-check only. The selected Greentally organization header is authoritative.","type":"string"},"rows":{"items":{"$ref":"#/components/schemas/EmissionSeedFeedRow"},"type":"array"}},"required":["feedVersion","feedType","idempotencyKey","mode","rows"],"type":"object"},"DataFeedSummary":{"properties":{"activityRowCount":{"type":"integer"},"endDate":{"format":"date-time","type":"string"},"errors":{"items":{"type":"string"},"type":"array"},"metricRowCount":{"type":"integer"},"rowCount":{"type":"integer"},"spendRowCount":{"type":"integer"},"startDate":{"format":"date-time","type":"string"},"totalEmissionKgCO2e":{"type":"number"},"warnings":{"items":{"type":"string"},"type":"array"}},"required":["rowCount","activityRowCount","spendRowCount","metricRowCount","totalEmissionKgCO2e","warnings","errors"],"type":"object"},"DeletedFactorResourceResponse":{"properties":{"data":{"properties":{"id":{"type":"string"}},"required":["id"],"type":"object"}},"required":["data"],"type":"object"},"DirectCustomFactor":{"properties":{"comment":{"type":"string"},"name":{"type":"string"},"scope":{"type":"integer"},"sourceType":{"type":"string"},"url":{"type":"string"},"value":{"type":"number"}},"required":["value","scope"],"type":"object"},"DirectFactorSelection":{"properties":{"factorId":{"type":"string"},"mode":{"$ref":"#/components/schemas/DirectFactorSelectionMode"}},"required":["mode","factorId"],"type":"object"},"DirectFactorSelectionMode":{"enum":["emission_factor_id"],"type":"string"},"DirectUploadFactorAnalysisResponse":{"properties":{"data":{"additionalProperties":true,"properties":{"allItems":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"confirmationMessage":{"type":"string"},"customPrompt":{"maxLength":500,"type":"string"},"extractionProvenance":{"additionalProperties":false,"properties":{"agentVariant":{"enum":["legacy","skill_v1"],"type":"string"},"attemptCount":{"minimum":1,"type":"integer"},"diagnosticCodes":{"items":{"type":"string"},"type":"array"},"model":{"type":"string"},"policyVersion":{"type":"string"},"provider":{"type":"string"},"traceId":{"type":"string"}},"required":["diagnosticCodes"],"type":"object"},"items":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"message":{"type":"string"},"provenance":{"enum":["web","cli"],"type":"string"},"schemaVersion":{"enum":["direct-upload-factor-review/v2"],"type":"string"},"sessionId":{"type":"string"},"sourceFileSha256":{"pattern":"^[0-9a-fA-F]{64}$","type":"string"},"status":{"enum":["processing","completed","needs_input","error"],"type":"string"},"submitted":{"type":"boolean"},"submittedAt":{"format":"date-time","type":"string"},"summary":{"type":"string"},"uploadId":{"format":"int64","type":"integer"},"userReviewHints":{"$ref":"#/components/schemas/DirectUploadUserReviewHints"},"versionId":{"format":"uuid","type":"string"},"warnings":{"items":{"type":"string"},"type":"array"}},"required":["schemaVersion","uploadId","versionId","provenance","sourceFileSha256","status","submitted","items","allItems","diagnostics","warnings","summary","message"],"type":"object"}},"required":["data"],"type":"object"},"DirectUploadFactorAnalysisUpsertCandidate":{"additionalProperties":false,"properties":{"activityUnit":{"type":"string"},"confidence":{"enum":["high","medium","low"],"type":"string"},"factorValue":{"format":"double","type":"number"},"id":{"minLength":1,"type":"string"},"libraryId":{"type":"string"},"libraryName":{"type":"string"},"name":{"type":"string"},"reason":{"minLength":1,"type":"string"},"regionCode":{"type":"string"},"releaseId":{"type":"string"},"releaseYear":{"format":"int32","type":"integer"},"scope":{"format":"int32","type":"integer"},"unit":{"type":"string"},"warnings":{"items":{"type":"string"},"type":"array"}},"required":["id","confidence","reason","warnings"],"type":"object"},"DirectUploadFactorAnalysisUpsertItem":{"additionalProperties":false,"properties":{"candidates":{"items":{"$ref":"#/components/schemas/DirectUploadFactorAnalysisUpsertCandidate"},"maxItems":3,"type":"array"},"emissionPreview":{"additionalProperties":false,"properties":{"unit":{"type":"string"},"value":{"format":"double","type":"number"}},"required":["value","unit"],"type":"object"},"itemId":{"minLength":1,"type":"string"},"itemIndex":{"minimum":0,"type":"integer"},"matchingHints":{"additionalProperties":true,"description":"Strict matching hints v2 contract.","type":"object"},"message":{"type":"string"},"selectedFactor":{"$ref":"#/components/schemas/DirectUploadFactorCandidate"},"selectedFactorId":{"type":"string"},"sourceRecord":{"additionalProperties":true,"description":"Strict emission-source-record/v2 contract.","type":"object"},"status":{"enum":["completed","needs_input"],"type":"string"}},"required":["itemId","itemIndex","status","sourceRecord","matchingHints","candidates"],"type":"object"},"DirectUploadFactorAnalysisUpsertRequest":{"additionalProperties":false,"properties":{"allItems":{"items":{"additionalProperties":true,"description":"Strict emission-source-record/v2 contract.","type":"object"},"type":"array"},"diagnostics":{"items":{"additionalProperties":false,"properties":{"code":{"type":"string"},"fields":{"items":{"type":"string"},"type":"array"},"itemId":{"type":"string"},"message":{"type":"string"},"severity":{"enum":["warning","error"],"type":"string"}},"required":["code","severity","fields","message"],"type":"object"},"type":"array"},"filterOptions":{"additionalProperties":false,"properties":{"activityUnits":{"items":{"type":"string"},"type":"array"},"regionCodes":{"items":{"type":"string"},"type":"array"},"scopes":{"items":{"format":"int32","type":"integer"},"type":"array"},"units":{"items":{"type":"string"},"type":"array"}},"type":"object"},"items":{"items":{"$ref":"#/components/schemas/DirectUploadFactorAnalysisUpsertItem"},"type":"array"},"message":{"type":"string"},"schemaVersion":{"enum":["direct-upload-factor-review/v2"],"type":"string"},"sourceFileSha256":{"pattern":"^[0-9a-fA-F]{64}$","type":"string"},"status":{"enum":["completed","needs_input"],"type":"string"},"summary":{"type":"string"},"warnings":{"items":{"type":"string"},"type":"array"}},"required":["schemaVersion","status","sourceFileSha256","items","allItems","diagnostics","warnings","summary","message"],"type":"object"},"DirectUploadFactorAnalyzeRequest":{"additionalProperties":false,"properties":{"customPrompt":{"description":"Optional user guidance. The server trims surrounding whitespace; omission reuses the saved prompt.","maxLength":500,"minLength":1,"type":"string"},"reanalyze":{"default":false,"type":"boolean"}},"type":"object"},"DirectUploadFactorCandidate":{"additionalProperties":false,"properties":{"activityUnit":{"type":"string"},"confidence":{"enum":["high","medium","low"],"type":"string"},"factorValue":{"format":"double","type":"number"},"id":{"type":"string"},"libraryId":{"type":"string"},"libraryName":{"type":"string"},"name":{"type":"string"},"reason":{"type":"string"},"regionCode":{"type":"string"},"releaseId":{"type":"string"},"releaseYear":{"format":"int32","type":"integer"},"scope":{"format":"int32","type":"integer"},"unit":{"type":"string"},"warnings":{"items":{"type":"string"},"type":"array"}},"required":["id","name"],"type":"object"},"DirectUploadFactorSaveRequest":{"additionalProperties":false,"properties":{"items":{"items":{"additionalProperties":false,"properties":{"factorId":{"type":"string"},"itemId":{"minLength":1,"type":"string"},"matchingHints":{"additionalProperties":true,"description":"Strict matching hints v2 contract.","type":"object"},"selectedFactor":{"$ref":"#/components/schemas/DirectUploadFactorCandidate"},"sourceRecord":{"additionalProperties":true,"description":"Strict emission-source-record/v2 contract.","type":"object"}},"required":["itemId","sourceRecord","matchingHints"],"type":"object"},"type":"array"},"removedItemIds":{"items":{"minLength":1,"type":"string"},"type":"array","uniqueItems":true},"userReviewHints":{"$ref":"#/components/schemas/DirectUploadUserReviewHints"}},"required":["items"],"type":"object"},"DirectUploadFactorSubmitRequest":{"additionalProperties":false,"properties":{"analysisVersionId":{"format":"uuid","type":"string"},"confirm":{"type":"boolean"}},"required":["analysisVersionId"],"type":"object"},"DirectUploadUserReviewHints":{"additionalProperties":false,"properties":{"itemTypes":{"additionalProperties":{"enum":["activity","spend"],"type":"string"},"type":"object"}},"type":"object"},"EmissionSeedFeedRow":{"properties":{"activityType":{"type":"string"},"amount":{"type":"number"},"categoryName":{"type":"string"},"cost":{"type":"number"},"currency":{"type":"string"},"departmentId":{"type":"string"},"emission":{"type":"number"},"endDate":{"format":"date-time","type":"string"},"factor":{"type":"number"},"factorName":{"type":"string"},"id":{"type":"string"},"kind":{"enum":["activity","spend"],"type":"string"},"locationId":{"type":"string"},"metadata":{"additionalProperties":true,"type":"object"},"productId":{"type":"string"},"recycledAmount":{"type":"number"},"scope":{"maximum":3,"minimum":1,"type":"integer"},"startDate":{"format":"date-time","type":"string"},"subCategoryName":{"type":"string"},"supplierDisplay":{"type":"string"},"unit":{"type":"string"}},"required":["id","kind","scope","startDate","endDate","categoryName","subCategoryName","unit","amount","emission"],"type":"object"},"EmissionSourceRecordBusinessValues":{"additionalProperties":false,"description":"Fixed source-business projection. Every response includes each property; unavailable values are null.","properties":{"description":{"nullable":true,"type":"string"},"documentDate":{"format":"date","nullable":true,"type":"string"},"documentNumber":{"nullable":true,"type":"string"},"documentType":{"nullable":true,"type":"string"},"endDate":{"format":"date","nullable":true,"type":"string"},"itemName":{"nullable":true,"type":"string"},"location":{"nullable":true,"type":"string"},"rawUnit":{"nullable":true,"type":"string"},"rawValue":{"format":"double","nullable":true,"type":"number"},"regionCode":{"nullable":true,"type":"string"},"sourceName":{"nullable":true,"type":"string"},"startDate":{"format":"date","nullable":true,"type":"string"},"supplier":{"nullable":true,"type":"string"}},"required":["sourceName","documentType","documentNumber","documentDate","supplier","itemName","description","rawValue","rawUnit","regionCode","location","startDate","endDate"],"type":"object"},"EmissionSourceRecordTableField":{"additionalProperties":false,"properties":{"key":{"enum":["sourceName","documentType","documentNumber","documentDate","supplier","itemName","description","rawValue","rawUnit","regionCode","location","startDate","endDate"],"type":"string"},"label":{"type":"string"},"type":{"enum":["string","number","date"],"type":"string"}},"required":["key","label","type"],"type":"object"},"EmissionSourceRecordTableResponse":{"properties":{"data":{"additionalProperties":false,"properties":{"fields":{"items":{"$ref":"#/components/schemas/EmissionSourceRecordTableField"},"type":"array"},"rows":{"items":{"$ref":"#/components/schemas/EmissionSourceRecordTableRow"},"type":"array"}},"required":["fields","rows"],"type":"object"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"EmissionSourceRecordTableRow":{"additionalProperties":false,"properties":{"rowKey":{"description":"Stable UI identity derived from sourceId/itemId. It is not a database source-record ID and must not be displayed as a business field.","type":"string"},"values":{"$ref":"#/components/schemas/EmissionSourceRecordBusinessValues"}},"required":["rowKey","values"],"type":"object"},"ErrorResponse":{"properties":{"error":{"properties":{"code":{"type":"string"},"details":{"additionalProperties":true,"type":"object"},"message":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"},"ExportResponse":{"properties":{"data":{"properties":{"contentBase64":{"type":"string"},"downloadUrl":{"type":"string"}},"type":"object"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"FactorCategory":{"properties":{"canManage":{"type":"boolean"},"id":{"type":"string"},"name":{"type":"string"},"public":{"type":"boolean"}},"required":["id","name","public","canManage"],"type":"object"},"FactorCategoryCreateRequest":{"properties":{"name":{"type":"string"},"public":{"type":"boolean"}},"required":["name","public"],"type":"object"},"FactorCategoryListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/FactorCategory"},"type":"array"}},"required":["data"],"type":"object"},"FactorCategoryResponse":{"properties":{"data":{"$ref":"#/components/schemas/FactorCategory"}},"required":["data"],"type":"object"},"FactorEntry":{"properties":{"activityCode":{"type":"string"},"activityUnit":{"type":"string"},"canManage":{"type":"boolean"},"categoryId":{"type":"string"},"categoryName":{"type":"string"},"description":{"type":"string"},"factorValue":{"format":"double","type":"number"},"id":{"type":"string"},"metadata":{"additionalProperties":true,"type":"object"},"name":{"type":"string"},"regionCode":{"type":"string"},"releaseId":{"type":"string"},"scope":{"enum":[0,1,2,3],"type":"integer"},"unit":{"type":"string"}},"required":["id","releaseId","categoryId","categoryName","name","description","activityCode","regionCode","activityUnit","factorValue","unit","scope","metadata","canManage"],"type":"object"},"FactorEntryBulkMoveRequest":{"description":"Exactly one of categoryId or releaseId must be provided. The target and all entries must belong to the selected organization.","properties":{"categoryId":{"type":"string"},"entryIds":{"items":{"type":"string"},"maxItems":100,"minItems":1,"type":"array","uniqueItems":true},"releaseId":{"type":"string"}},"required":["entryIds"],"type":"object"},"FactorEntryBulkMoveResponse":{"properties":{"data":{"properties":{"updatedCount":{"type":"integer"}},"required":["updatedCount"],"type":"object"}},"required":["data"],"type":"object"},"FactorEntryDeleteRequest":{"properties":{"entryId":{"type":"string"}},"required":["entryId"],"type":"object"},"FactorEntryDeleteResponse":{"properties":{"data":{"$ref":"#/components/schemas/FactorEntryDeleteResult"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"FactorEntryDeleteResult":{"properties":{"id":{"type":"string"},"outcome":{"enum":["deleted","archived"],"type":"string"}},"required":["id","outcome"],"type":"object"},"FactorEntryImportFailure":{"properties":{"message":{"type":"string"},"rowNumber":{"minimum":2,"type":"integer"}},"required":["rowNumber","message"],"type":"object"},"FactorEntryImportResponse":{"properties":{"data":{"$ref":"#/components/schemas/FactorEntryImportResult"}},"required":["data"],"type":"object"},"FactorEntryImportResult":{"properties":{"failedRows":{"items":{"$ref":"#/components/schemas/FactorEntryImportFailure"},"type":"array"},"importedCount":{"minimum":0,"type":"integer"},"skippedCount":{"minimum":0,"type":"integer"},"totalRows":{"minimum":0,"type":"integer"}},"required":["totalRows","importedCount","skippedCount","failedRows"],"type":"object"},"FactorEntryListResponse":{"properties":{"data":{"$ref":"#/components/schemas/FactorEntryPage"}},"required":["data"],"type":"object"},"FactorEntryPage":{"properties":{"items":{"items":{"$ref":"#/components/schemas/FactorEntry"},"type":"array"},"page":{"type":"integer"},"size":{"type":"integer"},"total":{"type":"integer"}},"required":["items","total","page","size"],"type":"object"},"FactorEntryResponse":{"properties":{"data":{"$ref":"#/components/schemas/FactorEntry"}},"required":["data"],"type":"object"},"FactorEntryUpsertRequest":{"properties":{"activityUnit":{"type":"string"},"categoryId":{"type":"string"},"description":{"type":"string"},"factorValue":{"format":"double","type":"number"},"metadata":{"additionalProperties":{"type":"string"},"type":"object"},"name":{"type":"string"},"releaseId":{"type":"string"},"scope":{"enum":[0,1,2,3],"type":"integer"},"unit":{"type":"string"}},"required":["releaseId","categoryId","name","activityUnit","factorValue","unit","scope","metadata"],"type":"object"},"FactorLibrary":{"properties":{"canManage":{"type":"boolean"},"description":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"public":{"type":"boolean"},"publisher":{"type":"string"}},"required":["id","name","publisher","description","public","canManage"],"type":"object"},"FactorLibraryListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/FactorLibrary"},"type":"array"}},"required":["data"],"type":"object"},"FactorLibraryResponse":{"properties":{"data":{"$ref":"#/components/schemas/FactorLibrary"}},"required":["data"],"type":"object"},"FactorLibraryUpsertRequest":{"properties":{"description":{"type":"string"},"name":{"type":"string"},"public":{"type":"boolean"},"publisher":{"type":"string"}},"required":["name","publisher","public"],"type":"object"},"FactorRelease":{"properties":{"canManage":{"type":"boolean"},"description":{"type":"string"},"id":{"type":"string"},"libraryId":{"type":"string"},"name":{"type":"string"},"regionCode":{"type":"string"},"releaseYear":{"type":"integer"}},"required":["id","libraryId","name","releaseYear","regionCode","description","canManage"],"type":"object"},"FactorReleaseListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/FactorRelease"},"type":"array"}},"required":["data"],"type":"object"},"FactorReleaseResponse":{"properties":{"data":{"$ref":"#/components/schemas/FactorRelease"}},"required":["data"],"type":"object"},"FactorReleaseUpsertRequest":{"properties":{"description":{"type":"string"},"libraryId":{"type":"string"},"name":{"type":"string"},"regionCode":{"type":"string"},"releaseYear":{"minimum":1990,"type":"integer"}},"required":["name","releaseYear","regionCode","libraryId"],"type":"object"},"HealthResponse":{"properties":{"data":{"properties":{"status":{"enum":["healthy"],"type":"string"},"timestamp":{"format":"date-time","type":"string"}},"required":["status","timestamp"],"type":"object"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"IgnoreSupplierRawTextClusterRequest":{"properties":{"clusterId":{"type":"string"}},"required":["clusterId"],"type":"object"},"Me":{"properties":{"organizationId":{"type":"string"},"role":{"type":"string"},"slug":{"type":"string"},"userId":{"type":"string"}},"required":["userId","organizationId","role","slug"],"type":"object"},"MeContext":{"properties":{"account":{"$ref":"#/components/schemas/AccountContext"},"activeOrganization":{"$ref":"#/components/schemas/BusinessOrganizationContext"},"availableOrganizations":{"items":{"$ref":"#/components/schemas/BusinessOrganizationContext"},"type":"array"},"capabilities":{"additionalProperties":{"type":"boolean"},"type":"object"},"userId":{"type":"string"}},"required":["userId","account","activeOrganization","availableOrganizations","capabilities"],"type":"object"},"MeContextResponse":{"properties":{"data":{"$ref":"#/components/schemas/MeContext"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"MeResponse":{"properties":{"data":{"$ref":"#/components/schemas/Me"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"MetricsDatapointMeasureRequest":{"properties":{"aggregation":{"enum":["SUM","AVG","MAX","MIN","COUNT"],"type":"string"},"baseParameter":{"enum":["emission","raw","spend"],"type":"string"}},"required":["baseParameter","aggregation"],"type":"object"},"MetricsDatapointsQueryRequest":{"properties":{"dimension":{"enum":["month","year"],"type":"string"},"endMonth":{"example":"2025-12","type":"string"},"filters":{"items":{"$ref":"#/components/schemas/MetricsFilter"},"type":"array"},"groupBy":{"items":{"$ref":"#/components/schemas/MetricsLabelField"},"type":"array","uniqueItems":true},"measures":{"items":{"$ref":"#/components/schemas/MetricsDatapointMeasureRequest"},"maxItems":1,"minItems":1,"type":"array"},"startMonth":{"example":"2025-01","type":"string"}},"required":["startMonth","endMonth","dimension","measures"],"type":"object"},"MetricsDatapointsQueryResponse":{"properties":{"data":{"properties":{"datapoints":{"items":{"additionalProperties":true,"type":"object"},"type":"array"}},"required":["datapoints"],"type":"object"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"MetricsFilter":{"properties":{"field":{"$ref":"#/components/schemas/MetricsLabelField"},"operator":{"enum":["is","is-not","including","not-including","is-empty","is-not-empty"],"type":"string"},"value":{"type":"string"},"values":{"items":{"type":"string"},"minItems":1,"type":"array","uniqueItems":true}},"required":["field","operator"],"type":"object"},"MetricsFilterOption":{"properties":{"field":{"$ref":"#/components/schemas/MetricsLabelField"},"values":{"items":{"type":"string"},"type":"array"}},"required":["field","values"],"type":"object"},"MetricsFilterOptionsResponse":{"properties":{"data":{"properties":{"options":{"items":{"$ref":"#/components/schemas/MetricsFilterOption"},"type":"array"}},"required":["options"],"type":"object"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"MetricsLabelField":{"enum":["factor_scope","factor_region","factor_category","activity_unit","spend_currency"],"type":"string"},"NetZeroAnnualInventories":{"additionalProperties":false,"properties":{"items":{"items":{"$ref":"#/components/schemas/NetZeroInventoryPreview"},"type":"array"}},"required":["items"],"type":"object"},"NetZeroAnnualInventoriesResponse":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/NetZeroAnnualInventories"}},"required":["data"],"type":"object"},"NetZeroBaseline":{"additionalProperties":false,"properties":{"calculationVersion":{"enum":["inventory-preview/v1"],"type":"string"},"confirmedAt":{"format":"date-time","type":"string"},"confirmedBy":{"type":"string"},"dataCutoffAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"periodEnd":{"format":"date","type":"string"},"periodStart":{"format":"date","type":"string"},"snapshot":{"$ref":"#/components/schemas/NetZeroBaselineSnapshot"},"supersedesId":{"format":"uuid","nullable":true,"type":"string"}},"required":["id","periodStart","periodEnd","calculationVersion","snapshot","dataCutoffAt","confirmedBy","confirmedAt","supersedesId"],"type":"object"},"NetZeroBaselineConfirmationRequest":{"additionalProperties":false,"properties":{"manualReplacements":{"items":{"$ref":"#/components/schemas/NetZeroManualScopeReplacement"},"maxItems":3,"type":"array"},"periodEnd":{"format":"date","type":"string"},"periodStart":{"format":"date","type":"string"}},"required":["periodStart","periodEnd"],"type":"object"},"NetZeroBaselineResponse":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/NetZeroBaseline"}},"required":["data"],"type":"object"},"NetZeroBaselineSnapshot":{"additionalProperties":false,"properties":{"calculatedPreview":{"$ref":"#/components/schemas/NetZeroInventoryPreview"},"manualReplacements":{"items":{"$ref":"#/components/schemas/NetZeroManualScopeReplacement"},"maxItems":3,"type":"array"}},"required":["calculatedPreview","manualReplacements"],"type":"object"},"NetZeroInventoryDiagnostics":{"additionalProperties":false,"properties":{"crossBoundaryRowCount":{"minimum":0,"type":"integer"},"excludedNonCarbonRowCount":{"minimum":0,"type":"integer"},"includedEmissionRowCount":{"minimum":0,"type":"integer"},"missingScopeRowCount":{"minimum":0,"type":"integer"},"unsupportedUnitRowCount":{"minimum":0,"type":"integer"}},"required":["includedEmissionRowCount","excludedNonCarbonRowCount","missingScopeRowCount","unsupportedUnitRowCount","crossBoundaryRowCount"],"type":"object"},"NetZeroInventoryPreview":{"additionalProperties":false,"properties":{"calculationVersion":{"enum":["inventory-preview/v1"],"type":"string"},"diagnostics":{"$ref":"#/components/schemas/NetZeroInventoryDiagnostics"},"periodEnd":{"format":"date","type":"string"},"periodStart":{"format":"date","type":"string"},"scopes":{"items":{"$ref":"#/components/schemas/NetZeroScopePreview"},"maxItems":3,"minItems":3,"type":"array"}},"required":["periodStart","periodEnd","calculationVersion","scopes","diagnostics"],"type":"object"},"NetZeroInventoryPreviewResponse":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/NetZeroInventoryPreview"}},"required":["data"],"type":"object"},"NetZeroManualScopeReplacement":{"additionalProperties":false,"properties":{"justification":{"minLength":1,"type":"string"},"replacementKgCo2e":{"format":"double","minimum":0,"type":"number"},"scope":{"maximum":3,"minimum":1,"type":"integer"},"sourceType":{"enum":["external_report","manual_adjustment"],"type":"string"}},"required":["scope","replacementKgCo2e","justification"],"type":"object"},"NetZeroScopePreview":{"additionalProperties":false,"properties":{"emissionRowCount":{"minimum":0,"type":"integer"},"measuredKgCo2e":{"format":"double","nullable":true,"type":"number"},"monthsWithData":{"minimum":0,"type":"integer"},"observedData":{"enum":["none","some","all_months"],"type":"string"},"scope":{"maximum":3,"minimum":1,"type":"integer"}},"required":["scope","measuredKgCo2e","emissionRowCount","monthsWithData","observedData"],"type":"object"},"NetZeroTarget":{"additionalProperties":false,"properties":{"baselineId":{"format":"uuid","type":"string"},"createdAt":{"format":"date-time","type":"string"},"id":{"format":"uuid","type":"string"},"method":{"enum":["custom"],"type":"string"},"methodVersion":{"enum":["custom-linear/v1"],"type":"string"},"scope1TargetKgCo2e":{"format":"double","nullable":true,"type":"number"},"scope2TargetKgCo2e":{"format":"double","nullable":true,"type":"number"},"scope3TargetKgCo2e":{"format":"double","nullable":true,"type":"number"},"targetYear":{"maximum":2100,"type":"integer"},"trajectory":{"items":{"$ref":"#/components/schemas/NetZeroTargetTrajectoryPoint"},"type":"array"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","baselineId","method","methodVersion","targetYear","scope1TargetKgCo2e","scope2TargetKgCo2e","scope3TargetKgCo2e","createdAt","updatedAt","trajectory"],"type":"object"},"NetZeroTargetResponse":{"additionalProperties":false,"properties":{"data":{"$ref":"#/components/schemas/NetZeroTarget"}},"required":["data"],"type":"object"},"NetZeroTargetTrajectoryPoint":{"additionalProperties":false,"properties":{"scope1KgCo2e":{"format":"double","nullable":true,"type":"number"},"scope2KgCo2e":{"format":"double","nullable":true,"type":"number"},"scope3KgCo2e":{"format":"double","nullable":true,"type":"number"},"year":{"type":"integer"}},"required":["year","scope1KgCo2e","scope2KgCo2e","scope3KgCo2e"],"type":"object"},"NetZeroTargetUpsertRequest":{"additionalProperties":false,"properties":{"baselineId":{"format":"uuid","type":"string"},"scope1TargetKgCo2e":{"format":"double","minimum":0,"nullable":true,"type":"number"},"scope2TargetKgCo2e":{"format":"double","minimum":0,"nullable":true,"type":"number"},"scope3TargetKgCo2e":{"format":"double","minimum":0,"nullable":true,"type":"number"},"targetYear":{"maximum":2100,"type":"integer"}},"required":["baselineId","targetYear"],"type":"object"},"NoSignalSupplierBucket":{"properties":{"recordCount":{"type":"integer"},"records":{"items":{"$ref":"#/components/schemas/CanonicalEmissionItem"},"type":"array"},"totalEmissionsKgCo2e":{"format":"double","type":"number"}},"required":["totalEmissionsKgCo2e","recordCount","records"],"type":"object"},"NoSignalSupplierBucketResponse":{"properties":{"data":{"$ref":"#/components/schemas/NoSignalSupplierBucket"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"OrganizationAccessRole":{"description":"Preset role values or custom role values in the form custom:{externalId}.","examples":["none","org:viewer","org:editor","org:admin","custom:role-labc123"],"type":"string"},"OrganizationAccessUpdateRequest":{"properties":{"role":{"$ref":"#/components/schemas/OrganizationAccessRole"}},"required":["role"],"type":"object"},"RemapSupplierRawTextClusterRequest":{"properties":{"clusterId":{"type":"string"},"supplierId":{"type":"string"}},"required":["clusterId","supplierId"],"type":"object"},"ReportAccessGrant":{"properties":{"createdAt":{"format":"date-time","type":"string"},"id":{"type":"string"},"reportId":{"type":"string"},"role":{"$ref":"#/components/schemas/ReportAccessRole"},"userId":{"type":"string"}},"required":["id","reportId","userId","role","createdAt"],"type":"object"},"ReportAccessGrantCreateRequest":{"properties":{"role":{"$ref":"#/components/schemas/ReportAccessRole"},"userId":{"type":"string"}},"required":["userId","role"],"type":"object"},"ReportAccessGrantListResponse":{"properties":{"data":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReportAccessGrant"},"type":"array"}},"required":["items"],"type":"object"}},"required":["data"],"type":"object"},"ReportAccessGrantResponse":{"properties":{"data":{"$ref":"#/components/schemas/ReportAccessGrant"}},"required":["data"],"type":"object"},"ReportAccessGrantUpdateRequest":{"properties":{"role":{"$ref":"#/components/schemas/ReportAccessRole"}},"required":["role"],"type":"object"},"ReportAccessRole":{"enum":["report:viewer","report:reviewer","report:editor"],"type":"string"},"ReportActivityEvent":{"properties":{"actorUserId":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"event":{"additionalProperties":true,"type":"object"},"eventType":{"example":"report.internal_access_granted","type":"string"},"id":{"format":"int64","type":"integer"},"reportId":{"type":"string"}},"required":["id","reportId","eventType","event","createdAt"],"type":"object"},"ReportActivityResponse":{"properties":{"data":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReportActivityEvent"},"type":"array"}},"required":["items"],"type":"object"}},"required":["data"],"type":"object"},"ReportConsultantAction":{"enum":["explain_key_changes","find_data_gaps","draft_executive_summary","recommend_next_actions"],"type":"string"},"ReportConsultantActionItem":{"properties":{"body":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"evidenceIds":{"items":{"type":"string"},"type":"array"},"id":{"type":"string"},"priority":{"enum":["high","medium","low"],"type":"string"},"reportId":{"type":"string"},"sourceRunId":{"type":"string"},"status":{"enum":["suggested","saved","dismissed","completed"],"type":"string"},"title":{"type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","reportId","title","body","priority","evidenceIds","status","createdAt","updatedAt"],"type":"object"},"ReportConsultantActionResponse":{"properties":{"data":{"$ref":"#/components/schemas/ReportConsultantActionItem"}},"required":["data"],"type":"object"},"ReportConsultantCard":{"properties":{"body":{"type":"string"},"confidence":{"$ref":"#/components/schemas/ReportConsultantConfidence"},"evidenceIds":{"items":{"type":"string"},"type":"array"},"id":{"type":"string"},"priority":{"enum":["high","medium","low"],"type":"string"},"suggestedDestination":{"type":"string"},"title":{"type":"string"},"type":{"$ref":"#/components/schemas/ReportConsultantCardType"}},"required":["id","type","title","body","confidence","evidenceIds"],"type":"object"},"ReportConsultantCardType":{"enum":["finding","risk","data_gap","assumption","summary","action"],"type":"string"},"ReportConsultantConfidence":{"enum":["high","medium","low"],"type":"string"},"ReportConsultantInsight":{"properties":{"body":{"type":"string"},"confidence":{"$ref":"#/components/schemas/ReportConsultantConfidence"},"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"evidenceIds":{"items":{"type":"string"},"type":"array"},"id":{"type":"string"},"reportId":{"type":"string"},"sourceRunId":{"type":"string"},"status":{"enum":["suggested","saved","inserted","dismissed"],"type":"string"},"suggestedDestination":{"type":"string"},"title":{"type":"string"},"type":{"$ref":"#/components/schemas/ReportConsultantCardType"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","reportId","type","title","body","confidence","evidenceIds","status","createdAt","updatedAt"],"type":"object"},"ReportConsultantInsightResponse":{"properties":{"data":{"$ref":"#/components/schemas/ReportConsultantInsight"}},"required":["data"],"type":"object"},"ReportConsultantRun":{"properties":{"action":{"$ref":"#/components/schemas/ReportConsultantAction"},"cards":{"items":{"$ref":"#/components/schemas/ReportConsultantCard"},"type":"array"},"createdAt":{"format":"date-time","type":"string"},"createdBy":{"type":"string"},"draftTarget":{"type":"string"},"id":{"type":"string"},"instruction":{"type":"string"},"reportId":{"type":"string"},"status":{"enum":["completed","failed"],"type":"string"},"updatedAt":{"format":"date-time","type":"string"},"warnings":{"items":{"type":"string"},"type":"array"}},"required":["id","reportId","action","status","cards","warnings","createdAt","updatedAt"],"type":"object"},"ReportConsultantRunRequest":{"properties":{"action":{"$ref":"#/components/schemas/ReportConsultantAction"},"draftTarget":{"type":"string"},"instruction":{"type":"string"}},"required":["action"],"type":"object"},"ReportConsultantRunResponse":{"properties":{"data":{"$ref":"#/components/schemas/ReportConsultantRun"}},"required":["data"],"type":"object"},"ReportConsultantSaveCardRequest":{"properties":{"card":{"$ref":"#/components/schemas/ReportConsultantCard"},"sourceRunId":{"type":"string"}},"required":["card"],"type":"object"},"ReportConsultantStatusUpdateRequest":{"properties":{"status":{"type":"string"}},"required":["status"],"type":"object"},"ReportConsultantWorkspace":{"properties":{"actions":{"items":{"$ref":"#/components/schemas/ReportConsultantActionItem"},"type":"array"},"insights":{"items":{"$ref":"#/components/schemas/ReportConsultantInsight"},"type":"array"},"runs":{"items":{"$ref":"#/components/schemas/ReportConsultantRun"},"type":"array"}},"required":["runs","insights","actions"],"type":"object"},"ReportConsultantWorkspaceResponse":{"properties":{"data":{"$ref":"#/components/schemas/ReportConsultantWorkspace"}},"required":["data"],"type":"object"},"ReportDetail":{"allOf":[{"$ref":"#/components/schemas/ReportSummary"},{"properties":{"draft":{"additionalProperties":true,"type":"object"},"evidencePack":{"additionalProperties":true,"type":"object"},"validation":{"additionalProperties":true,"type":"object"},"versionId":{"type":"string"},"versionStatus":{"$ref":"#/components/schemas/ReportVersionStatus"}},"type":"object"}]},"ReportDetailResponse":{"properties":{"data":{"$ref":"#/components/schemas/ReportDetail"}},"required":["data"],"type":"object"},"ReportDraftUpdateRequest":{"properties":{"draft":{"additionalProperties":true,"type":"object"}},"required":["draft"],"type":"object"},"ReportFramework":{"enum":["ghg_protocol","csrd_esrs","management"],"type":"string"},"ReportGenerationRequest":{"properties":{"advancedFilters":{"additionalProperties":true,"type":"object"},"dashboardContext":{"additionalProperties":true,"type":"object"},"dashboardLayoutId":{"type":"string"},"framework":{"$ref":"#/components/schemas/ReportFramework"},"period":{"properties":{"endDate":{"format":"date-time","type":"string"},"startDate":{"format":"date-time","type":"string"}},"required":["startDate","endDate"],"type":"object"},"template":{"$ref":"#/components/schemas/ReportTemplate"},"tone":{"$ref":"#/components/schemas/ReportTone"}},"required":["template","framework","tone","period"],"type":"object"},"ReportGenerationResponse":{"properties":{"data":{"properties":{"generationId":{"type":"string"},"report":{"$ref":"#/components/schemas/ReportDetail"}},"required":["generationId","report"],"type":"object"}},"required":["data"],"type":"object"},"ReportListResponse":{"properties":{"data":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReportSummary"},"type":"array"}},"required":["items"],"type":"object"}},"required":["data"],"type":"object"},"ReportShareLink":{"properties":{"accessCount":{"format":"int32","type":"integer"},"createdAt":{"format":"date-time","type":"string"},"expiresAt":{"format":"date-time","type":"string"},"id":{"type":"string"},"lastAccessedAt":{"format":"date-time","type":"string"},"recipientLabel":{"type":"string"},"reportVersionId":{"type":"string"},"revokedAt":{"format":"date-time","type":"string"},"status":{"enum":["active","expired","revoked"],"type":"string"},"token":{"description":"Returned only when creating a new link.","type":"string"},"url":{"type":"string"}},"required":["id","reportVersionId","url","status","accessCount","createdAt"],"type":"object"},"ReportShareLinkCreateRequest":{"properties":{"expiresAt":{"format":"date-time","type":"string"},"recipientLabel":{"description":"Optional human-readable recipient or customer label.","type":"string"}},"type":"object"},"ReportShareLinkListResponse":{"properties":{"data":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReportShareLink"},"type":"array"}},"required":["items"],"type":"object"}},"required":["data"],"type":"object"},"ReportShareLinkResponse":{"properties":{"data":{"$ref":"#/components/schemas/ReportShareLink"}},"required":["data"],"type":"object"},"ReportSummary":{"properties":{"accessReason":{"enum":["owned_by_me","shared_with_me","organization_access"],"type":"string"},"createdAt":{"format":"date-time","type":"string"},"draftVersionId":{"type":"string"},"framework":{"$ref":"#/components/schemas/ReportFramework"},"id":{"type":"string"},"latestPublishedAt":{"format":"date-time","type":"string"},"latestPublishedVersionId":{"type":"string"},"sourceOrganizationName":{"type":"string"},"template":{"$ref":"#/components/schemas/ReportTemplate"},"title":{"type":"string"},"tone":{"$ref":"#/components/schemas/ReportTone"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","title","template","framework","tone","createdAt","updatedAt"],"type":"object"},"ReportTemplate":{"enum":["executive_carbon_summary","dashboard_snapshot_report"],"type":"string"},"ReportTone":{"enum":["conservative","consultant","executive_narrative"],"type":"string"},"ReportVersionStatus":{"enum":["draft","published","archived"],"type":"string"},"SubmitResponse":{"properties":{"data":{"additionalProperties":true,"type":"object"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"Supplier":{"properties":{"name":{"type":"string"},"supplierId":{"type":"string"}},"required":["supplierId","name"],"type":"object"},"SupplierDetail":{"properties":{"records":{"items":{"$ref":"#/components/schemas/CanonicalEmissionItem"},"type":"array"},"sourceEvidence":{"items":{"$ref":"#/components/schemas/SupplierSourceEvidence"},"type":"array"},"supplier":{"$ref":"#/components/schemas/SupplierSummary"}},"required":["supplier","sourceEvidence","records"],"type":"object"},"SupplierDetailResponse":{"properties":{"data":{"$ref":"#/components/schemas/SupplierDetail"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"SupplierIntensityTotal":{"properties":{"currency":{"type":"string"},"kgCo2ePerUnit":{"format":"double","type":"number"}},"required":["currency","kgCo2ePerUnit"],"type":"object"},"SupplierMethodMixItem":{"properties":{"method":{"enum":["activity_based","spend_based"],"type":"string"},"recordCount":{"type":"integer"},"totalEmissionsKgCo2e":{"format":"double","type":"number"}},"required":["method","recordCount","totalEmissionsKgCo2e"],"type":"object"},"SupplierRawTextResolution":{"properties":{"clusterId":{"type":"string"},"status":{"enum":["resolved","ignored","unresolved"],"type":"string"},"supplierId":{"type":"string"}},"required":["clusterId","status"],"type":"object"},"SupplierRawTextResolutionResponse":{"properties":{"data":{"$ref":"#/components/schemas/SupplierRawTextResolution"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"SupplierResponse":{"properties":{"data":{"$ref":"#/components/schemas/Supplier"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"SupplierSourceEvidence":{"properties":{"provenanceStatus":{"enum":["authoritative"],"type":"string"},"recordCount":{"type":"integer"},"sourceType":{"type":"string"},"totalEmissionsKgCo2e":{"format":"double","type":"number"}},"required":["sourceType","provenanceStatus","recordCount","totalEmissionsKgCo2e"],"type":"object"},"SupplierSourceRecordResolution":{"properties":{"sourceRecordId":{"type":"string"},"status":{"enum":["resolved","unresolved"],"type":"string"},"supplierId":{"type":"string"}},"required":["sourceRecordId","status"],"type":"object"},"SupplierSourceRecordResolutionResponse":{"properties":{"data":{"$ref":"#/components/schemas/SupplierSourceRecordResolution"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"SupplierSpendTotal":{"properties":{"amount":{"format":"double","type":"number"},"currency":{"type":"string"}},"required":["currency","amount"],"type":"object"},"SupplierSummary":{"properties":{"intensityByCurrency":{"items":{"$ref":"#/components/schemas/SupplierIntensityTotal"},"type":"array"},"methodMix":{"items":{"$ref":"#/components/schemas/SupplierMethodMixItem"},"type":"array"},"name":{"type":"string"},"recordCount":{"type":"integer"},"spendByCurrency":{"items":{"$ref":"#/components/schemas/SupplierSpendTotal"},"type":"array"},"supplierId":{"type":"string"},"totalEmissionsKgCo2e":{"format":"double","type":"number"}},"required":["supplierId","name","totalEmissionsKgCo2e","recordCount","spendByCurrency","intensityByCurrency","methodMix"],"type":"object"},"SuppliersList":{"properties":{"items":{"items":{"$ref":"#/components/schemas/SupplierSummary"},"type":"array"}},"required":["items"],"type":"object"},"SuppliersListResponse":{"properties":{"data":{"$ref":"#/components/schemas/SuppliersList"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"UndoSupplierRawTextClusterRequest":{"properties":{"clusterId":{"type":"string"}},"required":["clusterId"],"type":"object"},"UndoSupplierSourceRecordRequest":{"properties":{"sourceRecordId":{"type":"string"}},"required":["sourceRecordId"],"type":"object"},"UnresolvedSupplierCluster":{"properties":{"clusterId":{"type":"string"},"normalizedText":{"type":"string"},"rawTexts":{"items":{"type":"string"},"type":"array"},"recordCount":{"type":"integer"},"totalEmissionsKgCo2e":{"format":"double","type":"number"}},"required":["clusterId","normalizedText","rawTexts","totalEmissionsKgCo2e","recordCount"],"type":"object"},"UnresolvedSupplierClusters":{"properties":{"items":{"items":{"$ref":"#/components/schemas/UnresolvedSupplierCluster"},"type":"array"}},"required":["items"],"type":"object"},"UnresolvedSupplierClustersResponse":{"properties":{"data":{"$ref":"#/components/schemas/UnresolvedSupplierClusters"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"UpdateSupplierRequest":{"properties":{"name":{"type":"string"}},"required":["name"],"type":"object"},"Upload":{"properties":{"contentType":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"currency":{"type":"string"},"departmentId":{"type":"string"},"documentCategory":{"enum":["utility_bill","invoice","travel_document","waste_document","statement","data_table","other"],"type":"string"},"documentType":{"pattern":"^[a-z][a-z0-9_]{0,63}$","type":"string"},"emissions":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"factorType":{"type":"string"},"fileName":{"type":"string"},"fileType":{"type":"string"},"id":{"format":"int64","type":"integer"},"locationId":{"type":"string"},"recognitionOnly":{"type":"boolean"},"recognitionStatus":{"enum":["recognized","needs_review","unsupported"],"type":"string"},"sheets":{"items":{"$ref":"#/components/schemas/UploadParsedSheet"},"type":"array"},"sizeBytes":{"format":"int64","type":"integer"},"source":{"$ref":"#/components/schemas/UploadSource"},"status":{"$ref":"#/components/schemas/UploadStatus"},"submittedAt":{"format":"date-time","nullable":true,"type":"string"},"submittedBy":{"nullable":true,"type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","source","status","fileName","contentType","sizeBytes","createdAt","updatedAt"],"type":"object"},"UploadFileDownloadUrlResponse":{"properties":{"data":{"properties":{"url":{"type":"string"}},"required":["url"],"type":"object"}},"required":["data"],"type":"object"},"UploadFileList":{"properties":{"hasMore":{"type":"boolean"},"items":{"items":{"$ref":"#/components/schemas/UploadFileListItem"},"type":"array"},"nextCursor":{"nullable":true,"type":"string"},"page":{"type":"integer"},"pageSize":{"type":"integer"},"total":{"type":"integer"}},"required":["items","hasMore"],"type":"object"},"UploadFileListItem":{"properties":{"contentType":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"fileName":{"type":"string"},"hasOriginalFile":{"type":"boolean"},"id":{"format":"int64","type":"integer"},"sizeBytes":{"format":"int64","type":"integer"},"source":{"$ref":"#/components/schemas/UploadSource"},"sourceRecordCount":{"format":"int64","type":"integer"},"status":{"$ref":"#/components/schemas/UploadStatus"},"submittedAt":{"format":"date-time","nullable":true,"type":"string"},"updatedAt":{"format":"date-time","type":"string"}},"required":["id","fileName","source","status","contentType","sizeBytes","createdAt","updatedAt","sourceRecordCount","hasOriginalFile"],"type":"object"},"UploadFileListResponse":{"properties":{"data":{"$ref":"#/components/schemas/UploadFileList"}},"required":["data"],"type":"object"},"UploadImportSettings":{"properties":{"currencies":{"items":{"type":"string"},"type":"array"},"factors":{"items":{"$ref":"#/components/schemas/UploadImportSettingsFactor"},"type":"array"},"libraries":{"items":{"$ref":"#/components/schemas/UploadImportSettingsLibrary"},"type":"array"},"releases":{"items":{"$ref":"#/components/schemas/UploadImportSettingsRelease"},"type":"array"}},"required":["currencies","libraries","releases","factors"],"type":"object"},"UploadImportSettingsFactor":{"properties":{"activityCode":{"type":"string"},"activityUnit":{"type":"string"},"categoryId":{"type":"string"},"categoryName":{"type":"string"},"description":{"type":"string"},"id":{"type":"string"},"libraryId":{"type":"string"},"name":{"type":"string"},"regionCode":{"type":"string"},"releaseId":{"type":"string"},"scope":{"type":"integer"}},"required":["id","libraryId","releaseId","categoryId","categoryName","name","description","activityCode","activityUnit","regionCode","scope"],"type":"object"},"UploadImportSettingsLibrary":{"properties":{"description":{"type":"string"},"id":{"type":"string"},"name":{"type":"string"},"publisher":{"type":"string"}},"required":["id","name","publisher","description"],"type":"object"},"UploadImportSettingsRelease":{"properties":{"activityTypes":{"items":{"type":"string"},"type":"array"},"currencies":{"items":{"type":"string"},"type":"array"},"description":{"type":"string"},"factorCount":{"type":"integer"},"id":{"type":"string"},"libraryId":{"type":"string"},"name":{"type":"string"},"regionCode":{"type":"string"},"sourceUrl":{"type":"string"},"version":{"type":"string"},"year":{"type":"integer"}},"required":["id","libraryId","name","year","version","regionCode","sourceUrl","description","factorCount","currencies","activityTypes"],"type":"object"},"UploadImportSettingsResponse":{"properties":{"data":{"$ref":"#/components/schemas/UploadImportSettings"}},"required":["data"],"type":"object"},"UploadParsedRow":{"properties":{"rowNumber":{"type":"integer"},"values":{"additionalProperties":{"type":"string"},"type":"object"}},"required":["rowNumber","values"],"type":"object"},"UploadParsedSheet":{"properties":{"activityType":{"$ref":"#/components/schemas/UploadTemplateActivityType"},"headers":{"items":{"type":"string"},"type":"array"},"rowCount":{"type":"integer"},"rows":{"items":{"$ref":"#/components/schemas/UploadParsedRow"},"type":"array"},"sheetName":{"type":"string"},"warnings":{"items":{"type":"string"},"type":"array"}},"required":["sheetName","activityType","headers","rows","rowCount"],"type":"object"},"UploadResponse":{"properties":{"data":{"$ref":"#/components/schemas/Upload"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"UploadSource":{"enum":["direct","template"],"type":"string"},"UploadStatus":{"enum":["uploaded","processing","unsubmitted","submitted","error"],"type":"string"},"UploadSubmitAuthoritativeDirectEmissionRow":{"properties":{"activityType":{"type":"string"},"amount":{"type":"number"},"attachments":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"calculationMethod":{"type":"string"},"categoryName":{"type":"string"},"country":{"type":"string"},"currency":{"type":"string"},"departmentId":{"type":"string"},"endDate":{"format":"date-time","type":"string"},"factorSelection":{"$ref":"#/components/schemas/DirectFactorSelection"},"id":{"type":"string"},"locationId":{"type":"string"},"metadata":{"additionalProperties":true,"type":"object"},"productId":{"type":"string"},"startDate":{"format":"date-time","type":"string"},"subCategoryName":{"type":"string"},"supplierId":{"type":"string"},"type":{"enum":["activity","spend"],"type":"string"},"unit":{"type":"string"},"waterCategory":{"type":"string"}},"required":["type","startDate","endDate","categoryName","subCategoryName","amount","factorSelection"],"type":"object"},"UploadSubmitEmissionItem":{"properties":{"emissions":{"items":{"$ref":"#/components/schemas/UploadSubmitEmissionRow"},"type":"array"},"error":{"type":"string"},"fileId":{"format":"int64","type":"integer"},"remotePath":{"type":"string"},"status":{"enum":["finished","processing","error"],"type":"string"}},"required":["fileId","status","emissions"],"type":"object"},"UploadSubmitEmissionRow":{"$ref":"#/components/schemas/UploadSubmitAuthoritativeDirectEmissionRow"},"UploadSubmitRequest":{"properties":{"emissions":{"items":{"$ref":"#/components/schemas/UploadSubmitEmissionItem"},"type":"array"},"metadata":{"additionalProperties":true,"properties":{"currency":{"description":"Managed factor currency (e.g. EUR, GBP). Typed replacement for the legacy currency metadata key.","type":"string"},"departmentId":{"type":"string"},"locationId":{"type":"string"},"sourceRegion":{"description":"Managed factor source region (e.g. IE, UK). Typed replacement for the legacy sourceRegion/source_region/region metadata keys.","type":"string"}},"type":"object"},"sheets":{"description":"Optional reviewed template sheets submitted from the UI instead of the stored worker preview.","items":{"$ref":"#/components/schemas/UploadSubmitSheet"},"type":"array"}},"required":["emissions"],"type":"object"},"UploadSubmitRowReview":{"properties":{"editedInApp":{"description":"Whether the user edited this row inline before submit.","type":"boolean"},"fileName":{"description":"Source workbook file name shown to the user.","type":"string"},"origin":{"description":"Upload origin for reviewed template rows.","enum":["workbook"],"type":"string"}},"type":"object"},"UploadSubmitSheet":{"properties":{"activityType":{"$ref":"#/components/schemas/UploadTemplateActivityType"},"headers":{"items":{"type":"string"},"type":"array"},"rowCount":{"type":"integer"},"rows":{"items":{"$ref":"#/components/schemas/UploadSubmitSheetRow"},"type":"array"},"sheetName":{"type":"string"},"warnings":{"items":{"type":"string"},"type":"array"}},"required":["sheetName","activityType","headers","rows","rowCount"],"type":"object"},"UploadSubmitSheetRow":{"properties":{"factorId":{"type":"string"},"review":{"$ref":"#/components/schemas/UploadSubmitRowReview"},"rowNumber":{"type":"integer"},"values":{"additionalProperties":{"type":"string"},"type":"object"}},"required":["rowNumber","values"],"type":"object"},"UploadTemplateActivityType":{"enum":["stationary_energy","electricity","mobile_transport_passenger","water","purchased_goods_and_services","freight_transport","refrigerant_and_other"],"type":"string"},"WasteDisposalEmissionFactor":{"properties":{"activity":{"type":"string"},"description":{"nullable":true,"type":"string"},"ewcCode":{"type":"string"},"factor":{"type":"number"},"id":{"type":"string"},"isDefault":{"type":"boolean"},"method":{"type":"string"},"scope":{"type":"integer"},"unit":{"type":"string"},"versionId":{"type":"string"}},"required":["id","versionId","ewcCode","method","factor","activity","isDefault","scope","unit"],"type":"object"},"WasteEmissionFactorsResponse":{"properties":{"data":{"properties":{"factors":{"items":{"$ref":"#/components/schemas/WasteDisposalEmissionFactor"},"type":"array"},"version":{"$ref":"#/components/schemas/WasteFactorVersion"}},"required":["version","factors"],"type":"object"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"WasteFactorVersion":{"properties":{"country":{"type":"string"},"description":{"type":"string"},"id":{"type":"string"},"isActive":{"type":"boolean"},"versionName":{"type":"string"},"year":{"type":"integer"}},"required":["id","versionName","year","country","isActive"],"type":"object"},"WasteKpiQueryRequest":{"properties":{"aggregation":{"enum":["SUM","AVG","MAX","MIN","COUNT"],"type":"string"},"dataKey":{"enum":["emission","weight","recycledAmount"],"type":"string"},"endMonth":{"example":"2025-12","type":"string"},"filters":{"additionalProperties":true,"type":"object"},"startMonth":{"example":"2025-01","type":"string"}},"required":["startMonth","endMonth","dataKey","aggregation"],"type":"object"},"WasteKpiQueryResponse":{"properties":{"data":{"properties":{"value":{"oneOf":[{"type":"number"},{"type":"string"}]}},"required":["value"],"type":"object"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"WasteRow":{"properties":{"account":{"type":"string"},"address":{"type":"string"},"batchId":{"type":"string"},"customerOrderNo":{"type":"string"},"date":{"format":"date-time","type":"string"},"errorMessage":{"nullable":true,"type":"string"},"ewcCode":{"type":"string"},"id":{"type":"string"},"material":{"type":"string"},"movement":{"type":"string"},"movementType":{"type":"string"},"nettWeight":{"type":"number"},"postcode":{"type":"string"},"processedAt":{"format":"date-time","nullable":true,"type":"string"},"productType":{"type":"string"},"recycledAmount":{"nullable":true,"type":"number"},"ticketNo":{"type":"string"},"unit":{"type":"string"},"vehicle":{"type":"string"},"weighbridgeTicket":{"type":"string"}},"required":["id","batchId","date","ticketNo","nettWeight","unit"],"type":"object"},"WasteRowListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/WasteRow"},"type":"array"},"meta":{"type":"object"}},"required":["data"],"type":"object"},"WebhookResponse":{"properties":{"data":{"properties":{"ok":{"type":"boolean"}},"required":["ok"],"type":"object"},"meta":{"type":"object"}},"required":["data"],"type":"object"}},"securitySchemes":{"bearerAuth":{"bearerFormat":"JWT","scheme":"bearer","type":"http"}}},"info":{"title":"ESGAI API","version":"0.1.0"},"openapi":"3.0.3","paths":{"/access/activity":{"get":{"operationId":"listAccessActivity","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessActivityResponse"}}},"description":"Recent account access activity"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["Access"]}},"/access/business-organizations":{"get":{"operationId":"listBusinessOrganizations","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessOrganizationsResponse"}}},"description":"Greentally business organizations under the current account"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["Access"]},"post":{"operationId":"createBusinessOrganization","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessOrganizationCreateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessOrganizationResponse"}}},"description":"Created Greentally business organization"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Access"]}},"/access/business-organizations/{organizationId}":{"patch":{"operationId":"updateBusinessOrganization","parameters":[{"in":"path","name":"organizationId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessOrganizationUpdateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessOrganizationResponse"}}},"description":"Updated Greentally business organization"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Access"]}},"/access/business-organizations/{organizationId}/archive":{"post":{"operationId":"archiveBusinessOrganization","parameters":[{"in":"path","name":"organizationId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BusinessOrganizationResponse"}}},"description":"Archived Greentally business organization"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Access"]}},"/access/members":{"get":{"operationId":"listAccessMembers","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessMembersResponse"}}},"description":"Account members and Greentally business organization roles"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["Access"]}},"/access/members/{userId}/organizations/{organizationId}":{"patch":{"operationId":"updateOrganizationAccess","parameters":[{"in":"path","name":"userId","required":true,"schema":{"type":"string"}},{"in":"path","name":"organizationId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrganizationAccessUpdateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessMemberResponse"}}},"description":"Updated account member access"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Access"]}},"/access/roles":{"get":{"operationId":"listAccessRoles","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRolesResponse"}}},"description":"Predefined and custom access roles"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["Access"]},"post":{"operationId":"createCustomAccessRole","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomAccessRoleUpsertRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRoleResponse"}}},"description":"Created custom access role"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["Access"]}},"/access/roles/{roleId}":{"patch":{"operationId":"updateCustomAccessRole","parameters":[{"description":"Custom role value, for example custom:role-labc123.","in":"path","name":"roleId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomAccessRoleUpsertRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessRoleResponse"}}},"description":"Updated custom access role"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Access"]}},"/api-keys":{"get":{"operationId":"listApiKeys","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyListResponse"}}},"description":"Personal API keys for the selected business organization"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["Access"]},"post":{"operationId":"createApiKey","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreateRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreatedResponse"}}},"description":"Created API key; secretKey is returned only once"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["Access"]}},"/api-keys/{id}":{"delete":{"operationId":"deleteApiKey","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyDeletedResponse"}}},"description":"Deleted API key identity"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Access"]}},"/billing/coupons/redeem":{"post":{"operationId":"redeemBillingCoupon","requestBody":{"content":{"application/json":{"schema":{"properties":{"code":{"type":"string"}},"required":["code"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBalanceResponse"}}},"description":"Coupon redeemed and balance updated"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]}],"tags":["Billing"]}},"/billing/estimate":{"post":{"operationId":"estimateBillingCredits","requestBody":{"content":{"application/json":{"schema":{"properties":{"inputTokens":{"format":"int64","type":"integer"},"outputTokens":{"format":"int64","type":"integer"},"totalTokens":{"format":"int64","type":"integer"}},"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"properties":{"credits":{"format":"int64","type":"integer"},"pricingVersion":{"type":"string"},"totalTokens":{"format":"int64","type":"integer"}},"required":["pricingVersion","totalTokens","credits"],"type":"object"}},"required":["data"],"type":"object"}}},"description":"Estimated credit charge"},"400":{"$ref":"#/components/responses/BadRequest"}},"security":[{"bearerAuth":[]}],"tags":["Billing"]}},"/billing/summary":{"get":{"operationId":"getBillingSummary","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSummaryResponse"}}},"description":"Current workspace billing summary"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]}],"tags":["Billing"]}},"/billing/transactions":{"get":{"operationId":"listBillingTransactions","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingTransactionListResponse"}}},"description":"Current workspace credit transactions"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]}],"tags":["Billing"]}},"/billing/usage":{"get":{"operationId":"getBillingUsage","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingUsageResponse"}}},"description":"Current workspace credit usage"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]}],"tags":["Billing"]}},"/chat/stream":{"post":{"operationId":"streamChat","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatStreamRequest"}}},"required":true},"responses":{"200":{"content":{"text/event-stream":{"schema":{"type":"string"}}},"description":"SSE stream"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]}]}},"/dashboard/layouts":{"post":{"operationId":"upsertDashboardLayout","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardLayoutSaveRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardLayoutResponse"}}},"description":"OK"}},"security":[{"bearerAuth":[]}]}},"/dashboard/layouts/latest":{"get":{"operationId":"getLatestDashboardLayout","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardLayoutResponse"}}},"description":"OK"}},"security":[{"bearerAuth":[]}]}},"/data-feeds":{"get":{"operationId":"listDataFeeds","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataFeedJobListResponse"}}},"description":"Data feed history"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"summary":"List data feed jobs for the selected business organization","tags":["DataFeeds"]}},"/data-feeds/preview":{"post":{"operationId":"previewDataFeed","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataFeedPreviewRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataFeedJobResponse"}}},"description":"Previewed data feed job"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"summary":"Validate a data feed without writing rows","tags":["DataFeeds"]}},"/data-feeds/{jobId}/commit":{"post":{"operationId":"commitDataFeed","parameters":[{"in":"path","name":"jobId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataFeedJobResponse"}}},"description":"Imported data feed job"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"summary":"Import a previously previewed data feed job","tags":["DataFeeds"]}},"/emissions/canonical":{"get":{"operationId":"listCanonicalEmissions","parameters":[{"$ref":"#/components/parameters/CanonicalEmissionStartDate"},{"$ref":"#/components/parameters/CanonicalEmissionEndDate"},{"$ref":"#/components/parameters/CanonicalEmissionQuery"},{"$ref":"#/components/parameters/CanonicalEmissionScope"},{"$ref":"#/components/parameters/CanonicalEmissionFactorType"},{"$ref":"#/components/parameters/CanonicalEmissionRegionCode"},{"$ref":"#/components/parameters/CanonicalEmissionLocationId"},{"$ref":"#/components/parameters/CanonicalEmissionCategoryName"},{"$ref":"#/components/parameters/CanonicalEmissionSubCategoryName"},{"$ref":"#/components/parameters/CanonicalEmissionActivityType"},{"$ref":"#/components/parameters/CanonicalEmissionSupplierDisplay"},{"$ref":"#/components/parameters/CanonicalEmissionAmountUnit"},{"$ref":"#/components/parameters/CanonicalEmissionOrigin"},{"$ref":"#/components/parameters/CanonicalEmissionProvenanceStatus"},{"$ref":"#/components/parameters/CanonicalEmissionMinCo2eTonnes"},{"$ref":"#/components/parameters/CanonicalEmissionMaxCo2eTonnes"},{"$ref":"#/components/parameters/CanonicalEmissionDocumentId"},{"$ref":"#/components/parameters/CanonicalEmissionItemType"},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"maximum":200,"minimum":1,"type":"integer"}},{"in":"query","name":"page","schema":{"minimum":1,"type":"integer"}},{"in":"query","name":"pageSize","schema":{"maximum":200,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CanonicalEmissionListResponse"}}},"description":"Canonical emissions list"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]}],"summary":"List canonical emission outputs","tags":["Emissions"]}},"/emissions/canonical/delete/{id}":{"post":{"operationId":"deleteCanonicalEmission","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Canonical emission deleted"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}},"security":[{"bearerAuth":[]}],"summary":"Permanently delete one editable canonical emission output","tags":["Emissions"]}},"/emissions/canonical/export":{"post":{"operationId":"exportCanonicalEmissions","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CanonicalEmissionExportRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportResponse"}}},"description":"Base64-encoded UTF-8 CSV with one row per unique canonical emission and normalized Factor fields"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]}],"summary":"Export canonical emission outputs","tags":["Emissions"]}},"/emissions/canonical/facets":{"get":{"operationId":"listCanonicalEmissionFacets","parameters":[{"$ref":"#/components/parameters/CanonicalEmissionStartDate"},{"$ref":"#/components/parameters/CanonicalEmissionEndDate"},{"$ref":"#/components/parameters/CanonicalEmissionQuery"},{"$ref":"#/components/parameters/CanonicalEmissionScope"},{"$ref":"#/components/parameters/CanonicalEmissionRegionCode"},{"$ref":"#/components/parameters/CanonicalEmissionLocationId"},{"$ref":"#/components/parameters/CanonicalEmissionCategoryName"},{"$ref":"#/components/parameters/CanonicalEmissionSupplierDisplay"},{"$ref":"#/components/parameters/CanonicalEmissionAmountUnit"},{"$ref":"#/components/parameters/CanonicalEmissionOrigin"},{"$ref":"#/components/parameters/CanonicalEmissionProvenanceStatus"},{"$ref":"#/components/parameters/CanonicalEmissionMinCo2eTonnes"},{"$ref":"#/components/parameters/CanonicalEmissionMaxCo2eTonnes"},{"$ref":"#/components/parameters/CanonicalEmissionDocumentId"},{"$ref":"#/components/parameters/CanonicalEmissionItemType"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CanonicalEmissionFacetsResponse"}}},"description":"Canonical emission filter facets"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]}],"summary":"List canonical emission filter facets","tags":["Emissions"]}},"/emissions/canonical/{id}":{"patch":{"operationId":"updateCanonicalEmission","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CanonicalEmissionUpdateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CanonicalEmissionResponse"}}},"description":"Updated canonical emission"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}},"security":[{"bearerAuth":[]}],"summary":"Update an editable canonical emission and recalculate it with a managed factor","tags":["Emissions"]}},"/emissions/source-records":{"get":{"description":"Returns only source-record business fields whose associated raw metrics overlap the inclusive global date range. Factor, emission, label, and database identity fields are never returned.","operationId":"listEmissionSourceRecords","parameters":[{"description":"Inclusive UTC date in YYYY-MM-DD format.","in":"query","name":"startDate","required":true,"schema":{"format":"date","type":"string"}},{"description":"Inclusive UTC date in YYYY-MM-DD format.","in":"query","name":"endDate","required":true,"schema":{"format":"date","type":"string"}},{"in":"query","name":"take","schema":{"default":100,"maximum":500,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmissionSourceRecordTableResponse"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequest"}},"security":[{"bearerAuth":[]}],"summary":"List fixed source business fields for Dashboard tables"}},"/factor/categories":{"get":{"operationId":"listFactorCategories","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorCategoryListResponse"}}},"description":"Visible factor categories"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]},"post":{"operationId":"createFactorCategory","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorCategoryCreateRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorCategoryResponse"}}},"description":"Created factor category"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]}},"/factor/categories/{categoryId}":{"delete":{"operationId":"deleteFactorCategory","parameters":[{"in":"path","name":"categoryId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeletedFactorResourceResponse"}}},"description":"Deleted category identity"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]}},"/factor/entries":{"get":{"operationId":"listFactorEntries","parameters":[{"in":"query","name":"releaseId","required":true,"schema":{"type":"string"}},{"in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}},{"in":"query","name":"size","required":false,"schema":{"default":25,"maximum":100,"minimum":1,"type":"integer"}},{"in":"query","name":"scope","required":false,"schema":{"enum":[0,1,2,3],"type":"integer"}},{"in":"query","name":"regionCode","required":false,"schema":{"type":"string"}},{"in":"query","name":"categoryId","required":false,"schema":{"type":"string"}},{"in":"query","name":"query","required":false,"schema":{"type":"string"}},{"in":"query","name":"publishedOnly","required":false,"schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorEntryListResponse"}}},"description":"Paginated factor entries"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]},"post":{"operationId":"createFactorEntry","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorEntryUpsertRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorEntryResponse"}}},"description":"Created factor entry"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"A factor with the same signature already exists in this release."}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]}},"/factor/entries/bulk":{"patch":{"operationId":"bulkMoveFactorEntries","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorEntryBulkMoveRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorEntryBulkMoveResponse"}}},"description":"Factor entries moved to an organization-owned category or release"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]}},"/factor/entries/delete":{"post":{"operationId":"deleteFactorEntry","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorEntryDeleteRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorEntryDeleteResponse"}}},"description":"Factor deleted when unused, otherwise archived and deactivated."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]}},"/factor/entries/import":{"post":{"operationId":"importFactorEntries","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"file":{"format":"binary","type":"string"},"libraryId":{"type":"string"},"releaseId":{"type":"string"}},"required":["file","libraryId","releaseId"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorEntryImportResponse"}}},"description":"Factor import completed; invalid data rows are returned as skipped."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"413":{"description":"Import file exceeds the supported size."}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]}},"/factor/entries/{entryId}":{"get":{"operationId":"getFactorEntry","parameters":[{"in":"path","name":"entryId","required":true,"schema":{"type":"string"}},{"in":"query","name":"publishedOnly","required":false,"schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorEntryResponse"}}},"description":"Factor entry detail"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]},"patch":{"operationId":"updateFactorEntry","parameters":[{"in":"path","name":"entryId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorEntryUpsertRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorEntryResponse"}}},"description":"Updated factor entry"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"description":"A factor with the same signature already exists in this release."}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]}},"/factor/libraries":{"get":{"operationId":"listFactorLibraries","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorLibraryListResponse"}}},"description":"Visible factor libraries"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]},"post":{"operationId":"createFactorLibrary","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorLibraryUpsertRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorLibraryResponse"}}},"description":"Created factor library"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]}},"/factor/libraries/{libraryId}":{"patch":{"operationId":"updateFactorLibrary","parameters":[{"in":"path","name":"libraryId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorLibraryUpsertRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorLibraryResponse"}}},"description":"Updated factor library"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]}},"/factor/releases":{"get":{"operationId":"listFactorReleases","parameters":[{"in":"query","name":"libraryId","required":true,"schema":{"type":"string"}},{"in":"query","name":"releaseYear","required":false,"schema":{"type":"integer"}},{"in":"query","name":"regionCode","required":false,"schema":{"type":"string"}},{"in":"query","name":"publishedOnly","required":false,"schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorReleaseListResponse"}}},"description":"Visible releases for a library"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]},"post":{"operationId":"createFactorRelease","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorReleaseUpsertRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorReleaseResponse"}}},"description":"Created factor release"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]}},"/factor/releases/{releaseId}":{"patch":{"operationId":"updateFactorRelease","parameters":[{"in":"path","name":"releaseId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorReleaseUpsertRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FactorReleaseResponse"}}},"description":"Updated factor release"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"}},"security":[{"bearerAuth":[]}],"tags":["Factor Manage"]}},"/health":{"get":{"operationId":"healthCheck","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}},"description":"OK"}}}},"/internal/billing-ops/accounts":{"get":{"operationId":"billingOpsListAccounts","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingAccountListResponse"}}},"description":"Billing account rows for internal operators"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["BillingOps"]}},"/internal/billing-ops/accounts/{accountId}":{"get":{"operationId":"billingOpsGetAccount","parameters":[{"in":"path","name":"accountId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSummaryResponse"}}},"description":"Internal billing account summary"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["BillingOps"]}},"/internal/billing-ops/accounts/{accountId}/credits/adjust":{"post":{"operationId":"billingOpsAdjustCredits","parameters":[{"in":"path","name":"accountId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"amountCredits":{"format":"int64","type":"integer"},"reason":{"type":"string"}},"required":["amountCredits","reason"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBalanceResponse"}}},"description":"Account credits adjusted"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["BillingOps"]}},"/internal/billing-ops/accounts/{accountId}/initialize":{"post":{"operationId":"billingOpsInitializeAccount","parameters":[{"in":"path","name":"accountId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"properties":{"initialCredits":{"format":"int64","type":"integer"},"reason":{"type":"string"}},"type":"object"}}},"required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditBalanceResponse"}}},"description":"Account credit balance initialized"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"tags":["BillingOps"]}},"/me":{"get":{"operationId":"getMe","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}},"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]}]}},"/me/context":{"get":{"operationId":"getMeContext","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeContextResponse"}}},"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]}]}},"/metrics/query/datapoints":{"post":{"operationId":"metricsQueryDatapoints","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsDatapointsQueryRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsDatapointsQueryResponse"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequest"}},"security":[{"bearerAuth":[]}]}},"/metrics/query/filter-options":{"get":{"description":"Scope values are fixed client-side as Scope 1, Scope 2, and Scope 3 and are not returned by this endpoint.","operationId":"metricsQueryFilterOptions","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricsFilterOptionsResponse"}}},"description":"Metrics filter options"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"summary":"List organization-wide dynamic metrics filter values"}},"/net-zero/annual-inventories":{"get":{"operationId":"getNetZeroAnnualInventories","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetZeroAnnualInventoriesResponse"}}},"description":"Observed annual inventories"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"summary":"List observed emissions for completed calendar years"}},"/net-zero/baselines":{"post":{"operationId":"confirmNetZeroBaseline","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetZeroBaselineConfirmationRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetZeroBaselineResponse"}}},"description":"Confirmed baseline"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"summary":"Confirm an immutable annual emissions baseline"}},"/net-zero/baselines/latest":{"get":{"operationId":"getLatestNetZeroBaseline","parameters":[{"in":"query","name":"periodStart","required":true,"schema":{"format":"date","type":"string"}},{"in":"query","name":"periodEnd","required":true,"schema":{"format":"date","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetZeroBaselineResponse"}}},"description":"Latest confirmed baseline"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"summary":"Read the latest confirmed baseline for one reporting year"}},"/net-zero/inventory-preview":{"get":{"operationId":"getNetZeroInventoryPreview","parameters":[{"description":"Inclusive reporting-period start date.","in":"query","name":"periodStart","required":true,"schema":{"format":"date","type":"string"}},{"description":"Exclusive reporting-period end date, exactly one calendar year after periodStart.","in":"query","name":"periodEnd","required":true,"schema":{"format":"date","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetZeroInventoryPreviewResponse"}}},"description":"Observed inventory preview"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"summary":"Preview observed emissions for one reporting year"}},"/net-zero/targets/current":{"get":{"operationId":"getCurrentNetZeroTarget","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetZeroTargetResponse"}}},"description":"Current custom target and annual trajectory"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"summary":"Read the organization's current custom target"},"put":{"operationId":"putCurrentNetZeroTarget","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetZeroTargetUpsertRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetZeroTargetResponse"}}},"description":"Saved custom target and annual trajectory"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"summary":"Create or update the organization's current custom target"}},"/reports":{"get":{"operationId":"listReports","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportListResponse"}}},"description":"Reports"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/generations":{"post":{"operationId":"createReportGeneration","parameters":[{"description":"Selected Greentally business organization scope for report generation.","in":"header","name":"X-Greentally-Organization-Id","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportGenerationRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportGenerationResponse"}}},"description":"Report draft created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}":{"get":{"operationId":"getReport","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetailResponse"}}},"description":"Report detail"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/access":{"get":{"operationId":"getReportAccess","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportAccessGrantListResponse"}}},"description":"Report access grants"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/access-grants":{"post":{"operationId":"createReportAccessGrant","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportAccessGrantCreateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportAccessGrantResponse"}}},"description":"Created report access grant"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/access-grants/{grantId}":{"delete":{"operationId":"revokeReportAccessGrant","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"grantId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}},"description":"Revoked report access grant"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]},"patch":{"operationId":"updateReportAccessGrant","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"grantId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportAccessGrantUpdateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportAccessGrantResponse"}}},"description":"Updated report access grant"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/activity":{"get":{"operationId":"getReportActivity","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportActivityResponse"}}},"description":"Report activity events"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/consultant/actions":{"post":{"operationId":"createReportConsultantAction","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConsultantSaveCardRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConsultantActionResponse"}}},"description":"Saved consultant action"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/consultant/actions/{actionId}":{"patch":{"operationId":"updateReportConsultantAction","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"actionId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConsultantStatusUpdateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConsultantActionResponse"}}},"description":"Updated consultant action"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/consultant/actions/{actionId}/update":{"post":{"description":"Compatibility endpoint for clients or proxies that do not reliably pass PATCH requests.","operationId":"updateReportConsultantActionPost","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"actionId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConsultantStatusUpdateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConsultantActionResponse"}}},"description":"Updated consultant action"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/consultant/insights":{"post":{"operationId":"createReportConsultantInsight","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConsultantSaveCardRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConsultantInsightResponse"}}},"description":"Saved consultant insight"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/consultant/insights/{insightId}":{"patch":{"operationId":"updateReportConsultantInsight","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"insightId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConsultantStatusUpdateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConsultantInsightResponse"}}},"description":"Updated consultant insight"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/consultant/insights/{insightId}/update":{"post":{"description":"Compatibility endpoint for clients or proxies that do not reliably pass PATCH requests.","operationId":"updateReportConsultantInsightPost","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"insightId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConsultantStatusUpdateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConsultantInsightResponse"}}},"description":"Updated consultant insight"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/consultant/runs":{"post":{"operationId":"runReportConsultantAnalysis","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConsultantRunRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConsultantRunResponse"}}},"description":"Completed consultant analysis run"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/consultant/workspace":{"get":{"operationId":"getReportConsultantWorkspace","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportConsultantWorkspaceResponse"}}},"description":"Report consultant workspace"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/draft":{"patch":{"operationId":"updateReportDraft","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDraftUpdateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetailResponse"}}},"description":"Updated draft"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]},"post":{"description":"Compatibility endpoint for clients or proxies that do not reliably pass PATCH requests.","operationId":"saveReportDraft","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDraftUpdateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetailResponse"}}},"description":"Updated draft"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/export/pdf":{"post":{"operationId":"exportReportPDF","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportResponse"}}},"description":"PDF export"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/publish":{"post":{"operationId":"publishReport","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetailResponse"}}},"description":"Published report"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/share-links":{"get":{"operationId":"listReportShareLinks","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportShareLinkListResponse"}}},"description":"Report share links"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]},"post":{"operationId":"createReportShareLink","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportShareLinkCreateRequest"}}},"required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportShareLinkResponse"}}},"description":"Created share link"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/reports/{id}/share-links/{tokenId}":{"delete":{"operationId":"revokeReportShareLink","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}},{"in":"path","name":"tokenId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}},"description":"Revoked share link"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Reports"]}},"/shared/reports/{token}":{"get":{"operationId":"getSharedReport","parameters":[{"in":"path","name":"token","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportDetailResponse"}}},"description":"Shared report detail"},"404":{"$ref":"#/components/responses/NotFound"}},"tags":["Reports"]}},"/suppliers":{"get":{"operationId":"listSuppliers","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuppliersListResponse"}}},"description":"Resolved supplier impact list"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"summary":"List resolved suppliers ranked by emissions impact","tags":["Suppliers"]},"post":{"operationId":"createSupplier","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSupplierRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierResponse"}}},"description":"Supplier created"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"}},"security":[{"bearerAuth":[]}],"summary":"Create a supplier","tags":["Suppliers"]}},"/suppliers/no-signal":{"get":{"operationId":"getSupplierNoSignalBucket","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NoSignalSupplierBucketResponse"}}},"description":"Supplier no-signal bucket"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"summary":"Get the supplier no-signal bucket","tags":["Suppliers"]}},"/suppliers/raw-text-clusters/confirm":{"post":{"operationId":"confirmSupplierRawTextCluster","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemapSupplierRawTextClusterRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierRawTextResolutionResponse"}}},"description":"Raw text cluster confirmed"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"summary":"Confirm a raw supplier text cluster to an existing supplier","tags":["Suppliers"]}},"/suppliers/raw-text-clusters/create-supplier":{"post":{"operationId":"createSupplierFromRawTextCluster","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSupplierFromRawTextClusterRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierRawTextResolutionResponse"}}},"description":"Supplier created and raw text cluster confirmed"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"summary":"Create a supplier from a raw supplier text cluster","tags":["Suppliers"]}},"/suppliers/raw-text-clusters/ignore":{"post":{"operationId":"ignoreSupplierRawTextCluster","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IgnoreSupplierRawTextClusterRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierRawTextResolutionResponse"}}},"description":"Raw text cluster ignored"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}},"security":[{"bearerAuth":[]}],"summary":"Ignore a raw supplier text cluster","tags":["Suppliers"]}},"/suppliers/raw-text-clusters/remap":{"post":{"operationId":"remapSupplierRawTextCluster","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemapSupplierRawTextClusterRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierRawTextResolutionResponse"}}},"description":"Raw text cluster remapped"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"summary":"Remap a raw supplier text cluster to an existing supplier","tags":["Suppliers"]}},"/suppliers/raw-text-clusters/undo":{"post":{"operationId":"undoSupplierRawTextCluster","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UndoSupplierRawTextClusterRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierRawTextResolutionResponse"}}},"description":"Raw text cluster decision removed"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"summary":"Undo a raw supplier text cluster decision","tags":["Suppliers"]}},"/suppliers/source-records/assign":{"post":{"operationId":"assignSupplierSourceRecord","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignSupplierSourceRecordRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierSourceRecordResolutionResponse"}}},"description":"Source record assigned"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"summary":"Assign a source record to a supplier","tags":["Suppliers"]}},"/suppliers/source-records/undo":{"post":{"operationId":"undoSupplierSourceRecord","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UndoSupplierSourceRecordRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierSourceRecordResolutionResponse"}}},"description":"Source record assignment removed"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"summary":"Undo a source-record supplier assignment","tags":["Suppliers"]}},"/suppliers/unresolved-clusters":{"get":{"operationId":"listUnresolvedSupplierClusters","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnresolvedSupplierClustersResponse"}}},"description":"Unresolved supplier clusters"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"}},"security":[{"bearerAuth":[]}],"summary":"List unresolved supplier text clusters","tags":["Suppliers"]}},"/suppliers/{supplierId}":{"delete":{"operationId":"deleteSupplier","parameters":[{"in":"path","name":"supplierId","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Supplier deleted"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}},"security":[{"bearerAuth":[]}],"summary":"Delete an empty supplier","tags":["Suppliers"]},"get":{"operationId":"getSupplier","parameters":[{"in":"path","name":"supplierId","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierDetailResponse"}}},"description":"Supplier detail read model"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"summary":"Get a resolved supplier detail read model","tags":["Suppliers"]},"patch":{"operationId":"updateSupplier","parameters":[{"in":"path","name":"supplierId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateSupplierRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierResponse"}}},"description":"Supplier updated"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}},"security":[{"bearerAuth":[]}],"summary":"Rename a supplier","tags":["Suppliers"]}},"/uploads":{"get":{"operationId":"listUploadFiles","parameters":[{"in":"query","name":"id","schema":{"format":"int64","minimum":1,"type":"integer"}},{"in":"query","name":"cursor","schema":{"type":"string"}},{"in":"query","name":"limit","schema":{"maximum":200,"minimum":1,"type":"integer"}},{"in":"query","name":"page","schema":{"minimum":1,"type":"integer"}},{"in":"query","name":"pageSize","schema":{"maximum":200,"minimum":1,"type":"integer"}},{"in":"query","name":"source","schema":{"$ref":"#/components/schemas/UploadSource"}},{"in":"query","name":"status","schema":{"$ref":"#/components/schemas/UploadStatus"}},{"in":"query","name":"query","schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadFileListResponse"}}},"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]}]},"post":{"operationId":"createUploadJob","requestBody":{"content":{"multipart/form-data":{"schema":{"properties":{"currency":{"type":"string"},"departmentId":{"type":"string"},"factorType":{"type":"string"},"file":{"format":"binary","type":"string"},"fileType":{"type":"string"},"locationId":{"type":"string"},"source":{"$ref":"#/components/schemas/UploadSource"}},"required":["file","source"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResponse"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"$ref":"#/components/responses/Conflict"},"413":{"$ref":"#/components/responses/PayloadTooLarge"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"}},"security":[{"bearerAuth":[]}]}},"/uploads/import-settings":{"get":{"operationId":"getUploadImportSettings","parameters":[{"in":"query","name":"uploadId","required":true,"schema":{"type":"string"}},{"in":"query","name":"sourceRegion","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadImportSettingsResponse"}}},"description":"Upload import settings"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}]}},"/uploads/templates":{"get":{"operationId":"downloadUploadTemplate","parameters":[{"description":"Optional activity type. When omitted, the response contains the full workbook with all template sheets.","in":"query","name":"activityType","required":false,"schema":{"$ref":"#/components/schemas/UploadTemplateActivityType"}}],"responses":{"200":{"content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"format":"binary","type":"string"}}},"description":"Upload template workbook"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"bearerAuth":[]}]}},"/uploads/{id}":{"delete":{"operationId":"deleteUploadFile","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}},"security":[{"bearerAuth":[]}]},"get":{"operationId":"getUploadJob","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResponse"}}},"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}]}},"/uploads/{id}/factor-agent/analysis":{"get":{"operationId":"getDirectUploadFactorAnalysis","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"int64","minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectUploadFactorAnalysisResponse"}}},"description":"Current direct-upload factor review"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Uploads"]}},"/uploads/{id}/factor-agent/analysis/upsert":{"post":{"operationId":"upsertDirectUploadFactorAnalysis","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"int64","minimum":1,"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectUploadFactorAnalysisUpsertRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectUploadFactorAnalysisResponse"}}},"description":"Analysis created or replaced with a new version"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Source file hash does not match the upload"}},"security":[{"bearerAuth":[]}],"tags":["Uploads"]}},"/uploads/{id}/factor-agent/analyze":{"post":{"operationId":"analyzeDirectUploadFactor","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"int64","minimum":1,"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectUploadFactorAnalyzeRequest"}}},"required":false},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectUploadFactorAnalysisResponse"}}},"description":"Analysis completed or an existing analysis was returned"},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid prompt or request body"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}],"tags":["Uploads"]}},"/uploads/{id}/factor-agent/save":{"post":{"operationId":"saveDirectUploadFactorReview","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"int64","minimum":1,"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectUploadFactorSaveRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectUploadFactorAnalysisResponse"}}},"description":"Review saved with a new analysis version"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"}},"security":[{"bearerAuth":[]}],"tags":["Uploads"]}},"/uploads/{id}/factor-agent/submit":{"post":{"operationId":"submitDirectUploadFactorAnalysis","parameters":[{"in":"path","name":"id","required":true,"schema":{"format":"int64","minimum":1,"type":"integer"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DirectUploadFactorSubmitRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"additionalProperties":true,"type":"object"}},"required":["data"],"type":"object"}}},"description":"Submitted emission rows"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The analysis changed or requires additional confirmation"}},"security":[{"bearerAuth":[]}],"tags":["Uploads"]}},"/uploads/{id}/submit":{"post":{"operationId":"submitUploadJob","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadSubmitRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitResponse"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"bearerAuth":[]}]}},"/uploads/{id}:download-url":{"post":{"operationId":"getUploadFileDownloadUrl","parameters":[{"in":"path","name":"id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadFileDownloadUrlResponse"}}},"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Service Unavailable"}},"security":[{"bearerAuth":[]}]}},"/waste/query/emission-factors":{"get":{"operationId":"wasteQueryEmissionFactors","parameters":[{"in":"query","name":"startMonth","schema":{"example":"2025-01","type":"string"}},{"in":"query","name":"endMonth","schema":{"example":"2025-12","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WasteEmissionFactorsResponse"}}},"description":"OK"}},"security":[{"bearerAuth":[]}]}},"/waste/query/kpi":{"post":{"operationId":"wasteQueryKPI","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WasteKpiQueryRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WasteKpiQueryResponse"}}},"description":"OK"}},"security":[{"bearerAuth":[]}]}},"/waste/query/raw-rows":{"get":{"operationId":"wasteQueryRawRows","parameters":[{"in":"query","name":"startMonth","schema":{"example":"2025-01","type":"string"}},{"in":"query","name":"endMonth","schema":{"example":"2025-12","type":"string"}},{"in":"query","name":"take","schema":{"maximum":500,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WasteRowListResponse"}}},"description":"OK"}},"security":[{"bearerAuth":[]}]}},"/webhooks/clerk":{"post":{"operationId":"clerkWebhook","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookResponse"}}},"description":"OK"},"400":{"$ref":"#/components/responses/BadRequest"}}}}},"servers":[{"url":"/v1"}]}