openapi: "3.0.3" info: title: Law as Code version: 0.0.1 servers: - url: https://api.server.test/v1 tags: - name: Law - name: Profile - name: Claim - name: Case paths: /evaluate: post: tags: - Law description: Evaluate the law operationId: evaluate requestBody: $ref: "#/components/requestBodies/EvaluateRequest" responses: "201": $ref: "#/components/responses/EvaluateResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /profiles: get: tags: - Profile description: Get all profiles operationId: profileList responses: "200": $ref: "#/components/responses/ProfileListResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /profiles/{bsn}: get: tags: - Profile description: Get all profiles operationId: profileGet parameters: - $ref: "#/components/parameters/pathBSN" responses: "200": $ref: "#/components/responses/ProfileResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "404": $ref: "#/components/responses/ResourceNotFoundErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /discoverable-service-laws: get: tags: - Law description: Get all discoverable service & laws operationId: serviceLawsDiscoverableList parameters: - $ref: "#/components/parameters/queryDiscoverableBy" responses: "200": $ref: "#/components/responses/ServiceListResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /rule-spec: get: tags: - Law description: Get rule spec operationId: ruleSpecGet parameters: - $ref: "#/components/parameters/queryService" - $ref: "#/components/parameters/queryLaw" - $ref: "#/components/parameters/queryReferenceDate" responses: "200": $ref: "#/components/responses/RuleSpecResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /claims: post: tags: - Claim summary: Submit a new claim description: Submit a new claim. Can be linked to an existing case or standalone. If autoApprove is true, the claim will be automatically approved. operationId: ClaimSubmit requestBody: $ref: "#/components/requestBodies/ClaimSubmitRequest" responses: "201": $ref: "#/components/responses/ClaimSubmitResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /claims/{claimId}/reject: post: tags: - Claim summary: Reject a claim description: Reject a claim with reason operationId: ClaimReject parameters: - $ref: "#/components/parameters/pathClaimID" requestBody: $ref: "#/components/requestBodies/ClaimRejectRequest" responses: "200": $ref: "#/components/responses/ClaimRejectResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "404": $ref: "#/components/responses/ResourceNotFoundErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /claims/{claimId}/approve: post: tags: - Claim summary: Approve a claim description: Approve a claim with verified value operationId: claimApprove parameters: - $ref: "#/components/parameters/pathClaimID" requestBody: $ref: "#/components/requestBodies/ClaimApproveRequest" responses: "200": $ref: "#/components/responses/ClaimApproveResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "404": $ref: "#/components/responses/ResourceNotFoundErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /claims/{bsn}: get: tags: - Claim description: Get all claims parameters: - $ref: "#/components/parameters/pathBSN" - $ref: "#/components/parameters/queryOnlyApproved" - $ref: "#/components/parameters/queryIncludeRejected" operationId: claimListBasedOnBSN responses: "200": $ref: "#/components/responses/ClaimListResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /claims/{bsn}/{service}/{law}: get: tags: - Claim description: Get all claims parameters: - $ref: "#/components/parameters/pathBSN" - $ref: "#/components/parameters/pathService" - $ref: "#/components/parameters/pathLaw" - $ref: "#/components/parameters/queryOnlyApproved" - $ref: "#/components/parameters/queryIncludeRejected" operationId: claimListBasedOnBSNServiceLaw responses: "200": $ref: "#/components/responses/ClaimListWithKeyResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /case: post: tags: - Case description: Submit a case operationId: caseSubmit requestBody: $ref: "#/components/requestBodies/CaseSubmitRequest" responses: "201": $ref: "#/components/responses/CaseSubmitResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /case/{caseID}: get: tags: - Case description: Get a case based on a case id parameters: - $ref: "#/components/parameters/pathCaseID" operationId: caseGet responses: "200": $ref: "#/components/responses/CaseResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "404": $ref: "#/components/responses/ResourceNotFoundErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /cases/{caseID}/review: post: summary: Complete a manual review for a case description: Submit a verification decision for a case that requires manual review operationId: caseReview tags: - Case parameters: - $ref: "#/components/parameters/pathCaseID" requestBody: $ref: "#/components/requestBodies/CaseReviewRequest" responses: "200": $ref: "#/components/responses/CaseReviewResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "404": $ref: "#/components/responses/ResourceNotFoundErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /cases/{bsn}: get: tags: - Case description: Get all cases based on a bsn parameters: - $ref: "#/components/parameters/pathBSN" operationId: caseListBasedOnBSN responses: "200": $ref: "#/components/responses/CaseListResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "404": $ref: "#/components/responses/ResourceNotFoundErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /cases/{bsn}/{service}/{law}: get: tags: - Case description: Get a case based on bsn, service and law parameters: - $ref: "#/components/parameters/pathBSN" - $ref: "#/components/parameters/pathService" - $ref: "#/components/parameters/pathLaw" operationId: caseBasedOnBSNServiceLaw responses: "200": $ref: "#/components/responses/CaseResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "404": $ref: "#/components/responses/ResourceNotFoundErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /cases/{service}/{law}: get: tags: - Case description: Get all cases based on service and law parameters: - $ref: "#/components/parameters/pathService" - $ref: "#/components/parameters/pathLaw" operationId: caseListBasedOnServiceLaw responses: "200": $ref: "#/components/responses/CaseListResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /case/{caseID}/events: get: tags: - Case - Events description: Get a list of events based on a case id parameters: - $ref: "#/components/parameters/pathCaseID" operationId: eventListBasedOnCaseID responses: "200": $ref: "#/components/responses/EventListResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "404": $ref: "#/components/responses/ResourceNotFoundErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /events: get: tags: - Events description: Get a list of events operationId: eventList responses: "200": $ref: "#/components/responses/EventListResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /engine/reset: post: summary: Reset the engine description: Resets the entire engine, clearing all data and returning it to its initial state operationId: resetEngine tags: - Engine responses: "201": $ref: "#/components/responses/EmptyResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" /source-dataframe: post: summary: Set a source data frame description: Inserts data into the engine by setting a source data frame for a specific service and table operationId: setSourceDataFrame tags: - DataFrames requestBody: $ref: "#/components/requestBodies/DataFrameRequest" responses: "201": $ref: "#/components/responses/EmptyResponse" "400": $ref: "#/components/responses/BadRequestErrorResponse" "500": $ref: "#/components/responses/InternalServerErrorResponse" components: schemas: bsn: description: Burgerservicenummer of a Dutch citizen type: string pattern: "^[0-9]{9}$" example: "111222333" caseID: description: Identifier of a case type: string format: uuid claimID: description: Identifier of a claim type: string format: uuid discoverableBy: description: DiscoverableBy is a string that can be used to filter lists type: string example: CITIZEN referenceDate: description: reference date type: string format: date example: 2025-01-31 Error: description: The error that occured while processing this request. type: object properties: message: type: string example: foo went wrong required: - message Evaluate: description: Evaluate. type: object properties: service: type: string description: Specify the service that needs to be executed law: type: string description: Specify the law that needs to be executed parameters: type: object additionalProperties: true date: type: string format: date description: Can be used to overwrite the date used by the service example: "2025-01-31" input: type: object additionalProperties: type: object additionalProperties: true output: type: string description: specify a requested output value approved: type: boolean description: only use approved claims, default to true required: - service - law example: service: "TOESLAGEN" law: "zorgtoeslagwet" EvaluateResponseSchema: description: Evaluate response type: object properties: output: type: object additionalProperties: true input: type: object additionalProperties: true requirementsMet: type: boolean description: Will be true when all requirements where met rulespecId: type: string format: uuid description: Identifier of the rulespec missingRequired: type: boolean description: Will be true when a required value is missing path: $ref: "#/components/schemas/PathNode" required: - output - input - requirementsMet - rulespecId - missingRequired - path PathNode: description: path node type: object properties: type: type: string name: type: string result: {} resolveType: type: string required: type: boolean details: type: object additionalProperties: true children: type: array items: $ref: "#/components/schemas/PathNode" required: - type - name Profile: description: Profile type: object properties: bsn: $ref: "#/components/schemas/bsn" name: type: string description: Name of the burger description: type: string description: Description of the burger sources: type: object description: All sources for a certain profile additionalProperties: $ref: "#/components/schemas/Source" required: - bsn - name - description - sources ProfileList: description: List of all burgers type: array items: $ref: "#/components/schemas/Profile" Source: type: object description: A source additionalProperties: type: array items: type: object additionalProperties: true # 'any' type is not directly supported, using 'object' as a close representation Service: description: Service type: object properties: name: type: string description: Service name laws: type: array items: $ref: "#/components/schemas/Law" required: - name - laws example: name: BELASTINGDIENST laws: - name: wet_inkomstenbelasting discoverableBy: - CITIZEN Law: description: Law type: object properties: name: type: string description: Name of the law discoverableBy: type: array description: Who can discover this law items: type: string required: - name - discoverableBy example: name: wet_inkomstenbelasting discoverableBy: - CITIZEN ServiceList: description: List of all services type: array items: $ref: "#/components/schemas/Service" RuleSpec: description: Rule spec type: object additionalProperties: true Claim: description: Claim type: object properties: id: $ref: "#/components/schemas/claimID" bsn: $ref: "#/components/schemas/bsn" service: type: string description: Specify the service that needs to be executed law: type: string description: Specify the law that needs to be executed key: type: string caseId: $ref: "#/components/schemas/caseID" nullable: true newValue: {} reason: type: string claimant: type: string oldValue: {} evidencePath: type: string status: type: string enum: - PENDING - APPROVED - REJECTED required: - id - service - key - newValue - reason - claimant - law - bsn - status ClaimSubmit: description: Submit a new claim type: object required: - service - key - newValue - reason - claimant - law - bsn properties: service: type: string description: Service identifier key: type: string description: Key to be claimed newValue: {} reason: type: string description: Reason for the claim claimant: type: string description: Identity of the claimant law: type: string description: Legal basis for the claim bsn: $ref: "#/components/schemas/bsn" caseId: type: string format: uuid nullable: true description: Optional identifier of the related case oldValue: {} evidencePath: type: string nullable: true description: Path to evidence supporting the claim autoApprove: type: boolean default: false description: Whether to automatically approve the claim ClaimReject: description: Reject a claim type: object required: - rejectedBy - rejectionReason properties: rejectedBy: type: string description: User that rejected the claim rejectionReason: type: string description: Reason of the rejection ClaimApprove: description: Approve a claim type: object required: - verifiedBy - verifiedValue properties: verifiedBy: type: string description: User that verified the claim verifiedValue: type: string description: Verified value for the claim ClaimList: description: List of all claims type: array items: $ref: "#/components/schemas/Claim" CaseSubmit: description: Case type: object required: - bsn - service - law - parameters - claimedResult - approvedClaimsOnly properties: bsn: $ref: "#/components/schemas/bsn" service: type: string description: Specify the service that needs to be executed law: type: string description: Specify the law that needs to be executed parameters: additionalProperties: true claimedResult: additionalProperties: true approvedClaimsOnly: type: boolean CaseReview: type: object required: - verifierId - approved - reason properties: verifierId: type: string description: ID of the verifier making the decision approved: type: boolean description: Decision outcome - true for approval, false for rejection reason: type: string description: Explanation for the decision Case: description: Case type: object required: - id - bsn - service - law - parameters - claimedResult - verifiedResult - approvedClaimsOnly - rulespecId - status properties: id: $ref: "#/components/schemas/caseID" bsn: $ref: "#/components/schemas/bsn" service: type: string description: Specify the service that needs to be executed law: type: string description: Specify the law that needs to be executed parameters: additionalProperties: true claimedResult: additionalProperties: true verifiedResult: additionalProperties: true approvedClaimsOnly: type: boolean rulespecId: type: string format: uuid description: Identifier of the rulespec status: type: string enum: - SUBMITTED - DECIDED - IN_REVIEW - OBJECTED approved: type: boolean objectionStatus: $ref: "#/components/schemas/CaseObjectionStatus" appealStatus: additionalProperties: true CaseObjectionStatus: description: Parameters to set the objection status type: object properties: possible: type: boolean notPossibleReason: type: string objectionPeriod: type: integer decisionPeriod: type: integer extensionPeriod: type: integer admissable: type: boolean CaseList: description: List of all cases type: array items: $ref: "#/components/schemas/Case" Event: description: Event type: object properties: eventType: type: string description: Type of the event data: additionalProperties: true timestamp: type: string format: date-time required: - eventType - data - timestamp EventList: description: List of all events type: array items: $ref: "#/components/schemas/Event" DataFrame: type: object required: - service - table - data properties: service: type: string table: type: string data: type: array description: Column definitions for the data frame items: additionalProperties: true example: service: CBS table: levensverwachting data: - jaar: 2025 verwachting_65: "20.5" parameters: pathBSN: name: bsn in: path description: Burgerservicenummer of a Dutch citizen required: true schema: $ref: "#/components/schemas/bsn" pathCaseID: name: caseID in: path description: Identifier of a case required: true schema: $ref: "#/components/schemas/caseID" pathClaimID: name: claimId in: path description: Identifier of a claim required: true schema: $ref: "#/components/schemas/claimID" pathService: name: service in: path description: filter for service required: true schema: type: string example: TOESLAGEN pathLaw: name: law in: path description: filter for law required: true schema: type: string example: zorgtoeslagwet queryOnlyApproved: name: approved in: query description: If added to URI only approved claims will be returned. required: false schema: type: boolean example: true queryIncludeRejected: name: includeRejected in: query description: If added to URI rejected claims will be added to the return required: false schema: type: boolean example: false queryDiscoverableBy: name: discoverableBy in: query description: Filter for discoverable by, defaults to 'CITIZEN' required: false schema: $ref: "#/components/schemas/discoverableBy" queryService: name: service in: query description: filter for service required: true schema: type: string example: TOESLAGEN queryLaw: name: law in: query description: filter for law required: true schema: type: string example: zorgtoeslagwet queryReferenceDate: name: referenceDate in: query description: reference date required: true schema: $ref: "#/components/schemas/referenceDate" requestBodies: EvaluateRequest: description: An evaluation request. required: true content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/Evaluate" required: - data ClaimSubmitRequest: description: A request to submit a claim. required: true content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/ClaimSubmit" required: - data ClaimRejectRequest: description: A request to reject a claim. required: true content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/ClaimReject" required: - data ClaimApproveRequest: description: A request to approve a claim. required: true content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/ClaimApprove" required: - data CaseSubmitRequest: description: A request to submit a case. required: true content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/CaseSubmit" required: - data CaseReviewRequest: description: A request to submit a case. required: true content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/CaseReview" required: - data DataFrameRequest: required: true content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/DataFrame" required: - data responses: EmptyResponse: description: Nothing needs to be returned. BadRequestErrorResponse: description: Invalid input supplied. content: application/json: schema: type: object properties: errors: type: array items: $ref: "#/components/schemas/Error" example: - message: foo went wrong required: - errors example: errors: - message: foo went wrong ResourceNotFoundErrorResponse: description: Resource not found. content: application/json: schema: type: object properties: errors: type: array items: $ref: "#/components/schemas/Error" example: - message: foo went wrong example: errors: - message: foo went wrong InternalServerErrorResponse: description: Internal server error. content: application/json: schema: type: object properties: errors: type: array items: $ref: "#/components/schemas/Error" example: - message: foo went wrong required: - errors example: errors: - message: foo went wrong EvaluateResponse: description: Evaluate response content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/EvaluateResponseSchema" required: - data ProfileResponse: description: Profile response content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/Profile" required: - data ProfileListResponse: description: Profile list response content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/ProfileList" required: - data ServiceListResponse: description: Law list response content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/ServiceList" required: - data RuleSpecResponse: description: Rule spec response content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/RuleSpec" required: - data ClaimSubmitResponse: description: Claim submit response content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/claimID" required: - data ClaimListResponse: description: Claim list response content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/ClaimList" required: - data ClaimListWithKeyResponse: description: Successfully filtered claims content: application/json: schema: type: object properties: data: type: object additionalProperties: $ref: "#/components/schemas/Claim" required: - data CaseResponse: description: Case response content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/Case" required: - data CaseListResponse: description: Case list response content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/CaseList" required: - data EventListResponse: description: Event list response content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/EventList" required: - data CaseSubmitResponse: description: Case submit response content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/caseID" required: - data CaseReviewResponse: description: Case submit response content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/caseID" required: - data ClaimApproveResponse: description: Claim approve response content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/claimID" required: - data ClaimRejectResponse: description: Claim reject response content: application/json: schema: type: object properties: data: $ref: "#/components/schemas/claimID" required: - data