openapi: 3.1.0
info:
  title: api-service-case-data
  contact: {}
  license:
    name: MIT License
    url: https://opensource.org/licenses/MIT
  version: "13.0"
servers:
- url: http://localhost:36179
  description: Generated server url
tags:
- name: Notifications
  description: User notification operations
- name: History
  description: History operations
- name: Conversations
  description: Conversation operations
- name: Metadata for caseTypes
  description: Metadata caseTypes operations
- name: Facilities
  description: Errand facilities operations
- name: Errands extra parameters
  description: Errand extra parameters operations
- name: Notes
  description: Note operations
- name: Status
  description: Errand status operations
- name: Messages
  description: Message operations
- name: Decisions
  description: Decision operations
- name: Stakeholders
  description: Stakeholder operations
- name: Errands
  description: Errand operations
- name: Attachments
  description: Attachment operations
paths:
  /{municipalityId}/{namespace}/errands/{errandId}/stakeholders:
    get:
      tags:
      - Stakeholders
      description: Get all stakeholders on errand.
      operationId: getAllStakeholdersOnErrand
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: stakeholderRole
        in: query
        required: false
        schema:
          type: string
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Stakeholder"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    put:
      tags:
      - Stakeholders
      description: Replace stakeholders on errand.
      operationId: replaceStakeholdersOnErrand
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/Stakeholder"
        required: true
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Stakeholders
      description: Create and add stakeholder to errand.
      operationId: updateErrandWithStakeholder
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Stakeholder"
        required: true
      responses:
        "201":
          description: Created - Successful operation
          headers:
            Location:
              description: Location of the created resource.
              style: simple
              schema:
                type: string
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/stakeholders/{stakeholderId}:
    get:
      tags:
      - Stakeholders
      description: Get stakeholder on errand by stakeholder id.
      operationId: getStakeholderOnErrand
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: stakeholderId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Stakeholder"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    put:
      tags:
      - Stakeholders
      description: Replace stakeholder on errand by stakeholder id.
      operationId: replaceStakeholderOnErrand
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: stakeholderId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Stakeholder"
        required: true
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    delete:
      tags:
      - Stakeholders
      description: Delete stakeholder on errand by stakeholder id.
      operationId: deleteStakeholder
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: stakeholderId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Stakeholders
      description: Update stakeholder on errand by stakeholder id.
      operationId: updateStakeholderOnErrand
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: stakeholderId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Stakeholder"
        required: true
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/notifications/global-acknowledged:
    put:
      tags:
      - Notifications
      summary: Global acknowledge notifications
      description: Set the globalAcknowledged-attribute to 'true' for all notifications
        on the errand
      operationId: globalAcknowledgeNotification
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      responses:
        "204":
          description: Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/messages/{messageId}/viewed/{isViewed}:
    put:
      tags:
      - Messages
      description: Set viewed status for message
      operationId: updateViewedStatus
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: messageId
        in: path
        required: true
        schema:
          type: string
      - name: isViewed
        in: path
        required: true
        schema:
          type: boolean
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/facilities:
    get:
      tags:
      - Facilities
      description: Get all facilities on errand
      operationId: getFacilities
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Facility"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    put:
      tags:
      - Facilities
      description: Add/replace facility on errand
      operationId: putFacilitiesOnErrand
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/Facility"
        required: true
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    post:
      tags:
      - Facilities
      description: Create errand facility
      operationId: postErrandFacility
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Facility"
        required: true
      responses:
        "201":
          description: Created - Successful operation
          headers:
            Location:
              style: simple
              schema:
                type: string
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/decisions/{decisionId}:
    get:
      tags:
      - Decisions
      description: Get decision on errand by decision id.
      operationId: getDecisionById
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: decisionId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Decision"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    put:
      tags:
      - Decisions
      description: Replace decision on errand.
      operationId: putDecision
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: decisionId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Decision"
        required: true
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    delete:
      tags:
      - Decisions
      description: Delete decision on errand.
      operationId: deleteDecision
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: decisionId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Decisions
      description: Update decision on errand.
      operationId: patchDecision
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: decisionId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchDecision"
        required: true
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/attachments/{attachmentId}:
    get:
      tags:
      - Attachments
      summary: Get a streamed attachment.
      description: Fetches the binary content of the attachment that matches the provided
        id in a streamed manner.
      operationId: getAttachment
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: attachmentId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "200":
          description: OK - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    delete:
      tags:
      - Attachments
      description: Delete attachment on errand.
      operationId: deleteAttachment
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: attachmentId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Attachments
      description: "Update attachment metadata on errand. The binary content cannot\
        \ be updated; replace it by deleting and recreating the attachment."
      operationId: patchAttachment
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: attachmentId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Attachment"
        required: true
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/decisions/{decisionId}/attachments/{attachmentId}:
    get:
      tags:
      - Decisions
      summary: Get a streamed decision attachment.
      description: Fetches the binary content of the attachment that matches the provided
        id in a streamed manner.
      operationId: getDecisionAttachment
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: decisionId
        in: path
        description: Decision ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: attachmentId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "200":
          description: OK - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    delete:
      tags:
      - Decisions
      description: Delete attachment on decision.
      operationId: deleteDecisionAttachment
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: decisionId
        in: path
        description: Decision ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: attachmentId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Decisions
      description: Update attachment metadata on decision. The binary content cannot
        be updated; replace it by deleting and recreating the attachment.
      operationId: patchDecisionAttachment
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: decisionId
        in: path
        description: Decision ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: attachmentId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Attachment"
        required: true
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/metadata/casetypes:
    get:
      tags:
      - Metadata for caseTypes
      description: Get all case types
      operationId: getCaseTypes
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/CaseType"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    post:
      tags:
      - Metadata for caseTypes
      description: Create caseType
      operationId: createCaseType
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CaseType"
        required: true
      responses:
        "201":
          description: Created - Successful operation
          headers:
            Location:
              style: simple
              schema:
                type: string
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands:
    get:
      tags:
      - Errands
      description: Get errands with or without query. The query is very flexible and
        allows you as a client to control a lot yourself.
      operationId: getErrands
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: filter
        in: query
        description: "Syntax description: [spring-filter](https://github.com/turkraft/spring-filter/blob/85730f950a5f8623159cc0eb4d737555f9382bb7/README.md#syntax)"
        required: false
        schema:
          type: string
        example: caseType:'PARKING_PERMIT' and stakeholders.firstName~'*mar*' and
          applicationReceived>'2022-09-08T12:18:03.747+02:00'
      - name: page
        in: query
        description: Zero-based page index (0..N)
        required: false
        schema:
          type: integer
          default: 0
          minimum: 0
      - name: size
        in: query
        description: The size of the page to be returned
        required: false
        schema:
          type: integer
          default: 20
          minimum: 1
      - name: sort
        in: query
        description: "Sorting criteria in the format: property,(asc|desc). Default\
          \ sort order is ascending. Multiple sort criteria are supported."
        required: false
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PageErrand"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    post:
      tags:
      - Errands
      description: "Create errand (without attachments). Add attachments to errand\
        \ with PATCH /errands/{id}/attachments afterwards."
      operationId: createErrand
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: referredFrom
        in: query
        description: "Relation reference in format (target part is ignored): '{relationType}|{sourceResourceId};{sourceType};{sourceService};{sourceNamespace}|{targetResourceId};{targetType};{targetService};{targetNamespace}'"
        required: false
        schema:
          type: string
        example: LINK|1234;case;service;MY_NAMESPACE|
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Errand"
        required: true
      responses:
        "201":
          description: Created - Successful operation
          headers:
            Location:
              style: simple
              schema:
                type: string
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/notifications:
    get:
      tags:
      - Notifications
      summary: Get notifications
      description: "Get notifications for the provided namespace, municipality and\
        \ ownerId"
      operationId: getNotificationsForErrand
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: sort
        in: query
        description: "Sorting criteria in the format: property,(asc|desc). Default\
          \ sort order is ascending. Multiple sort criteria are supported."
        required: false
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Notification"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    post:
      tags:
      - Notifications
      summary: Create notification
      description: Create new notification for the namespace and municipality
      operationId: createNotification
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Notification"
        required: true
      responses:
        "201":
          description: Created - Successful operation
          headers:
            Location:
              style: simple
              schema:
                type: string
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/messages:
    get:
      tags:
      - Messages
      description: Get all messages for an errand
      operationId: getMessagesByErrand
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/MessageResponse"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    post:
      tags:
      - Messages
      description: Save a message on an errand
      operationId: createMessage
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/MessageRequest"
        required: true
      responses:
        "201":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/communication/conversations:
    get:
      tags:
      - Conversations
      summary: Get conversations
      description: Get existing conversations
      operationId: getConversations
      parameters:
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 1
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Conversation"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    post:
      tags:
      - Conversations
      summary: Create conversation
      description: Create new conversation
      operationId: createConversation
      parameters:
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 1
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Conversation"
        required: true
      responses:
        "201":
          description: Successful operation
          headers:
            Location:
              style: simple
              schema:
                type: string
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/communication/conversations/{conversationId}/messages:
    get:
      tags:
      - Conversations
      summary: Get message list
      description: Get message list
      operationId: getMessages
      parameters:
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 1
      - name: conversationId
        in: path
        description: Conversation ID
        required: true
        schema:
          type: string
        example: 1aefbbb8-de82-414b-b5d7-ba7c5bbe4506
      - name: page
        in: query
        description: Zero-based page index (0..N)
        required: false
        schema:
          type: integer
          default: 0
          minimum: 0
      - name: size
        in: query
        description: The size of the page to be returned
        required: false
        schema:
          type: integer
          default: 20
          minimum: 1
      - name: sort
        in: query
        description: "Sorting criteria in the format: property,(asc|desc). Default\
          \ sort order is ascending. Multiple sort criteria are supported."
        required: false
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PageMessage"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    post:
      tags:
      - Conversations
      summary: Create new message
      description: Create new message
      operationId: createMessage_1
      parameters:
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 1
      - name: conversationId
        in: path
        description: Conversation ID
        required: true
        schema:
          type: string
        example: 1aefbbb8-de82-414b-b5d7-ba7c5bbe4506
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                message:
                  $ref: "#/components/schemas/Message"
                  description: Message to be posted
                attachments:
                  type: array
                  items:
                    type: string
                    format: binary
              required:
              - message
      responses:
        "204":
          description: Successful operation
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/attachments:
    get:
      tags:
      - Attachments
      description: Get attachments metadata by errand id.
      operationId: getAttachmentsByErrandId
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Attachment"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    post:
      tags:
      - Attachments
      description: "Create attachment on errand. The metadata is supplied as a JSON\
        \ part named 'attachment' and the binary content as a file part named 'file'."
      operationId: postAttachment
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                attachment:
                  $ref: "#/components/schemas/Attachment"
                  description: Attachment metadata
                file:
                  type: string
                  format: binary
              required:
              - attachment
              - file
        required: true
      responses:
        "201":
          description: Created - Successful operation
          headers:
            Location:
              description: Location of the created resource.
              style: simple
              schema:
                type: string
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/decisions/{decisionId}/attachments:
    get:
      tags:
      - Decisions
      description: Get attachments metadata by decision id.
      operationId: getAttachmentsByDecisionId
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: decisionId
        in: path
        description: Decision ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Attachment"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    post:
      tags:
      - Decisions
      description: Create attachment on decision. The metadata is supplied as a JSON
        part named 'attachment' and the binary content as a file part named 'file'.
      operationId: postDecisionAttachment
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: decisionId
        in: path
        description: Decision ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                attachment:
                  $ref: "#/components/schemas/Attachment"
                  description: Attachment metadata
                file:
                  type: string
                  format: binary
              required:
              - attachment
              - file
        required: true
      responses:
        "201":
          description: Created - Successful operation
          headers:
            Location:
              description: Location of the created resource.
              style: simple
              schema:
                type: string
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/notifications:
    get:
      tags:
      - Notifications
      summary: Get notifications
      description: "Get notifications for the provided namespace, municipality and\
        \ ownerId"
      operationId: getNotificationsForOwner
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: ownerId
        in: query
        description: ownerId
        required: true
        schema:
          type: string
        example: AD01
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Notification"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Notifications
      summary: Update notification
      description: Update notifications for the namespace and municipality
      operationId: updateNotifications
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/PatchNotification"
        required: true
      responses:
        "204":
          description: Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}:
    get:
      tags:
      - Errands
      description: Get errand by ID.
      operationId: getErrandById
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Errand"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Errands
      description: Update errand.
      operationId: patchErrand
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PatchErrand"
        required: true
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/status:
    patch:
      tags:
      - Status
      description: Add status to errand
      operationId: updateErrandWithStatus
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Status"
        required: true
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/notes:
    get:
      tags:
      - Notes
      description: "Get notes for a specific errand, possible to filter by note type"
      operationId: getNotesByErrandId
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: noteType
        in: query
        required: false
        schema:
          $ref: "#/components/schemas/NoteType"
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Note"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Notes
      description: Create and add note to errand
      operationId: updateErrandWithNote
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Note"
        required: true
      responses:
        "201":
          description: Created - Successful operation
          headers:
            Location:
              description: Location of the created resource
              style: simple
              schema:
                type: string
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/notes/{noteId}:
    get:
      tags:
      - Notes
      description: Get note on errand by note id
      operationId: getNoteById
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: noteId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Note"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    delete:
      tags:
      - Notes
      description: Delete note on errand by note id
      operationId: deleteNoteOnErrand
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: noteId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Notes
      description: Update note on errand by note id
      operationId: updateNoteOnErrand
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: noteId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Note"
        required: true
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/facilities/{facilityId}:
    get:
      tags:
      - Facilities
      description: Get a specific facility on errand
      operationId: getFacility
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: facilityId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Facility"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    delete:
      tags:
      - Facilities
      description: Delete facility on errand
      operationId: deleteFacility
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: facilityId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Facilities
      description: Update errand facility by facility id
      operationId: patchErrandFacility
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: facilityId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Facility"
        required: true
      responses:
        "204":
          description: No content - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/extraparameters:
    get:
      tags:
      - Errands extra parameters
      summary: Find errand extra parameters
      description: Find the errand parameters that matches the provided attributes
      operationId: findErrandParameters
      parameters:
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: errandId
        in: path
        description: Errand id
        required: true
        schema:
          type: integer
          format: int64
        example: b82bd8ac-1507-4d9a-958d-369261eecc15
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/ExtraParameter"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Errands extra parameters
      summary: Update errand extra parameters
      description: "Adds new extra parameters to errand or updates value of existing\
        \ parameters, based on the supplied attributes (the resource will not remove\
        \ any existing extra parameters, for removal use the delete resource)."
      operationId: updateErrandParameters
      parameters:
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: errandId
        in: path
        description: Errand id
        required: true
        schema:
          type: integer
          format: int64
        example: b82bd8ac-1507-4d9a-958d-369261eecc15
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: "#/components/schemas/ExtraParameter"
        required: true
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/ExtraParameter"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/extraparameters/{parameterKey}:
    get:
      tags:
      - Errands extra parameters
      summary: Read errand extra parameter
      description: Fetches the errand extra parameter that matches the provided errand
        id and parameter id
      operationId: readErrandParameter
      parameters:
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: errandId
        in: path
        description: Errand id
        required: true
        schema:
          type: integer
          format: int64
        example: b82bd8ac-1507-4d9a-958d-369261eecc15
      - name: parameterKey
        in: path
        description: Errand parameter key
        required: true
        schema:
          type: string
          minLength: 1
        example: propertyInfo
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    delete:
      tags:
      - Errands extra parameters
      summary: Delete errand extra parameter
      description: Deletes the errand extra parameter that matches the provided errand
        id and parameter id
      operationId: deleteErrandParameter
      parameters:
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: errandId
        in: path
        description: Errand id
        required: true
        schema:
          type: integer
          format: int64
        example: b82bd8ac-1507-4d9a-958d-369261eecc15
      - name: parameterKey
        in: path
        description: Errand parameter key
        required: true
        schema:
          type: string
          minLength: 1
        example: propertyInfo
      responses:
        "204":
          description: Successful operation
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Errands extra parameters
      summary: Update single errand extra parameter
      description: Updates the errand extra parameter matching provided errand id
        and parameter id with the supplied attributes
      operationId: updateErrandParameter
      parameters:
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: municipalityId
        in: path
        description: Municipality id
        required: true
        schema:
          type: string
        example: 2281
      - name: errandId
        in: path
        description: Errand id
        required: true
        schema:
          type: integer
          format: int64
        example: b82bd8ac-1507-4d9a-958d-369261eecc15
      - name: parameterKey
        in: path
        description: Errand parameter key
        required: true
        schema:
          type: string
          minLength: 1
        example: propertyInfo
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: string
        required: true
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ExtraParameter"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/decisions:
    get:
      tags:
      - Decisions
      description: Get decisions on errand.
      operationId: getDecision
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Decision"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Decisions
      description: Create and add decision to errand.
      operationId: createDecision
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Decision"
        required: true
      responses:
        "201":
          description: Created - Successful operation
          headers:
            Location:
              description: Location of the created resource.
              style: simple
              schema:
                type: string
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/communication/conversations/{conversationId}:
    get:
      tags:
      - Conversations
      summary: Get conversation
      description: Get existing conversation
      operationId: getConversation
      parameters:
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 1
      - name: conversationId
        in: path
        description: Conversation ID
        required: true
        schema:
          type: string
        example: 1aefbbb8-de82-414b-b5d7-ba7c5bbe4506
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Conversation"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    patch:
      tags:
      - Conversations
      summary: Update conversation
      description: Update existing conversation
      operationId: updateConversation
      parameters:
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 1
      - name: conversationId
        in: path
        description: Conversation ID
        required: true
        schema:
          type: string
        example: 1aefbbb8-de82-414b-b5d7-ba7c5bbe4506
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/Conversation"
        required: true
      responses:
        "200":
          description: Successful Operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Conversation"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/metadata/casetypes/{type}:
    get:
      tags:
      - Metadata for caseTypes
      description: Get a specific case type
      operationId: getCaseType
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: type
        in: path
        description: 'type '
        required: true
        schema:
          type: string
        example: PARATRANSIT
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CaseType"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/CaseType"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    delete:
      tags:
      - Metadata for caseTypes
      description: Delete caseType
      operationId: deleteCaseType
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: type
        in: path
        description: 'type '
        required: true
        schema:
          type: string
        example: PARATRANSIT
      responses:
        "204":
          description: No content - Successful operation
        "404":
          description: Not found
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/stakeholders/{stakeholderId}/history:
    get:
      tags:
      - History
      description: Get stakeholder history for an errand
      operationId: getStakeholderHistory
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: stakeholderId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/History"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/notifications/{notificationId}:
    get:
      tags:
      - Notifications
      summary: Get notification
      description: Get a specific notification for the namespace and municipality
      operationId: getNotification
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: notificationId
        in: path
        description: notificationId
        required: true
        schema:
          type: string
        example: 123e4567-e89b-12d3-a456-426614174000
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Notification"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
    delete:
      tags:
      - Notifications
      summary: Delete notification
      description: Delete notification for the namespace and municipality
      operationId: deleteNotification
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: notificationId
        in: path
        description: Notification ID
        required: true
        schema:
          type: string
      responses:
        "204":
          description: Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/notes/{noteId}/history:
    get:
      tags:
      - History
      description: Get note history for an errand
      operationId: getNoteHistory
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: noteId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/History"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/messages/{messageId}:
    get:
      tags:
      - Messages
      description: Get all messages for an errand
      operationId: getMessageByMesssageId
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: messageId
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MessageResponse"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/messages/{messageId}/attachments/{attachmentId}:
    get:
      tags:
      - Messages
      summary: Get a streamed messageAttachment.
      description: Fetches the message attachment that matches the provided id in
        a streamed manner
      operationId: getMessageAttachment
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: messageId
        in: path
        required: true
        schema:
          type: string
      - name: attachmentId
        in: path
        required: true
        schema:
          type: string
      responses:
        "200":
          description: OK - Successful operation
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/messages/external:
    get:
      tags:
      - Messages
      description: Get non internal messages
      operationId: getExternalMessagesByErrand
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/MessageResponse"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/history:
    get:
      tags:
      - History
      description: Get errand history for an errand
      operationId: getErrandHistory
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/History"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/facilities/{facilityId}/history:
    get:
      tags:
      - History
      description: Get facility history for an errand
      operationId: getFacilityHistory
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: facilityId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/History"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/decisions/{decisionId}/history:
    get:
      tags:
      - History
      description: Get decision history for an errand
      operationId: getDecisionHistory
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: decisionId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/History"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  ? /{municipalityId}/{namespace}/errands/{errandId}/communication/conversations/{conversationId}/messages/{messageId}/attachments/{attachmentId}
  : get:
      tags:
      - Conversations
      summary: Get a streamed conversation message attachment.
      description: "Fetches the conversation message attachment that matches the provided\
        \ ID, in a streamed manner"
      operationId: getConversationMessageAttachment
      parameters:
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 1
      - name: conversationId
        in: path
        description: Conversation ID
        required: true
        schema:
          type: string
        example: 1aefbbb8-de82-414b-b5d7-ba7c5bbe4506
      - name: messageId
        in: path
        description: Message ID
        required: true
        schema:
          type: string
        example: be3a5c7b-0f39-4867-8065-6a286b36fcc3
      - name: attachmentId
        in: path
        description: Conversation message attachment ID
        required: true
        schema:
          type: string
        example: b82bd8ac-1507-4d9a-958d-369261eecc15
      responses:
        "200":
          description: Successful Operation
        "404":
          description: Not Found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/{namespace}/errands/{errandId}/attachments/{attachmentId}/history:
    get:
      tags:
      - History
      description: Get attachment history for an errand
      operationId: getAttachmentHistory
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: namespace
        in: path
        description: Namespace
        required: true
        schema:
          type: string
          pattern: "[\\w|\\-]+"
        example: MY_NAMESPACE
      - name: errandId
        in: path
        description: Errand ID
        required: true
        schema:
          type: integer
          format: int64
        example: 123
      - name: attachmentId
        in: path
        required: true
        schema:
          type: integer
          format: int64
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/History"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /{municipalityId}/errands/{partyId}/decisions:
    get:
      tags:
      - Decisions
      description: Get final decisions connected to a partyId.
      operationId: getFinalDecisions
      parameters:
      - name: municipalityId
        in: path
        description: Municipality ID
        required: true
        schema:
          type: string
        example: 2281
      - name: partyId
        in: path
        description: PartyId to find cases for
        required: true
        schema:
          type: string
        example: 123e4567-e89b-12d3-a456-426614174000
      - name: page
        in: query
        description: Zero-based page index (0..N)
        required: false
        schema:
          type: integer
          default: 0
          minimum: 0
      - name: size
        in: query
        description: The size of the page to be returned
        required: false
        schema:
          type: integer
          default: 20
          minimum: 1
      - name: sort
        in: query
        description: "Sorting criteria in the format: property,(asc|desc). Default\
          \ sort order is ascending. Multiple sort criteria are supported."
        required: false
        schema:
          type: array
          items:
            type: string
      responses:
        "200":
          description: OK - Successful operation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PageDecision"
        "400":
          description: Bad request
          content:
            application/problem+json:
              schema:
                oneOf:
                - $ref: "#/components/schemas/Problem"
                - $ref: "#/components/schemas/ConstraintViolationProblem"
        "404":
          description: Not found
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
        "500":
          description: Internal Server error
          content:
            application/problem+json:
              schema:
                $ref: "#/components/schemas/Problem"
  /api-docs:
    get:
      tags:
      - API
      summary: OpenAPI
      operationId: getApiDocs
      responses:
        "200":
          description: OK
          content:
            application/yaml:
              schema:
                type: string
      x-auth-type: None
      x-throttling-tier: Unlimited
      x-wso2-mutual-ssl: Optional
components:
  schemas:
    Address:
      type: object
      properties:
        addressCategory:
          type: string
          description: Category of the address
          enum:
          - POSTAL_ADDRESS
          - INVOICE_ADDRESS
          - VISITING_ADDRESS
          examples:
          - RESIDENTIAL
        street:
          type: string
          description: Street name
          examples:
          - Testvägen
          maxLength: 255
          minLength: 0
        houseNumber:
          type: string
          description: House number
          examples:
          - "18"
          maxLength: 255
          minLength: 0
        postalCode:
          type: string
          description: Postal code
          examples:
          - 123 45
          maxLength: 255
          minLength: 0
        city:
          type: string
          description: City name
          examples:
          - Sundsvall
          maxLength: 255
          minLength: 0
        country:
          type: string
          description: Country name
          examples:
          - Sverige
          maxLength: 255
          minLength: 0
        careOf:
          type: string
          description: Care of (c/o)
          examples:
          - Test Testorsson
          maxLength: 255
          minLength: 0
        attention:
          type: string
          description: Attention to
          examples:
          - Test Testorsson
          maxLength: 255
          minLength: 0
        propertyDesignation:
          type: string
          description: Property designation
          examples:
          - SUNDSVALL LJUSTA 7:2
          maxLength: 255
          minLength: 0
        apartmentNumber:
          type: string
          description: Apartment number
          examples:
          - LGH 1001
          maxLength: 255
          minLength: 0
        isZoningPlanArea:
          type: boolean
          description: Indicates if the address is within a zoning plan area
        invoiceMarking:
          type: string
          description: "Invoice marking, only in combination with addressCategory:\
            \ INVOICE_ADDRESS"
          examples:
          - "1234567890"
          maxLength: 255
          minLength: 0
        location:
          $ref: "#/components/schemas/Coordinates"
          description: The location of the address
          examples:
          - latitude: 62.3908
            longitude: 17.3069
    ContactInformation:
      type: object
      properties:
        contactType:
          type: string
          description: The type of contact information
          enum:
          - CELLPHONE
          - PHONE
          - EMAIL
          examples:
          - EMAIL
        value:
          type: string
          description: The value of the contact information
          examples:
          - someEmail@sundsvall.se@
          maxLength: 255
          minLength: 0
    Coordinates:
      type: object
      properties:
        latitude:
          type: number
          format: double
          description: Decimal Degrees (DD)
          examples:
          - 62.390205
        longitude:
          type: number
          format: double
          description: Decimal Degrees (DD)
          examples:
          - 17.306616
    Stakeholder:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: The unique identifier of the stakeholder
          examples:
          - 1
          readOnly: true
        version:
          type: integer
          format: int32
          description: The version of the stakeholder
          examples:
          - 1
          readOnly: true
        municipalityId:
          type: string
          description: The municipality ID
          examples:
          - "2281"
          readOnly: true
        namespace:
          type: string
          description: Namespace
          examples:
          - MY_NAMESPACE
          readOnly: true
        type:
          type: string
          description: The type of stakeholder
          enum:
          - PERSON
          - ORGANIZATION
          examples:
          - PERSON
        firstName:
          type: string
          description: The first name of the stakeholder
          examples:
          - Test
          maxLength: 255
          minLength: 0
        lastName:
          type: string
          description: The last name of the stakeholder
          examples:
          - Testorsson
          maxLength: 255
          minLength: 0
        personId:
          type: string
          description: The person ID of the stakeholder
          examples:
          - 3ed5bc30-6308-4fd5-a5a7-78d7f96f4438
        organizationName:
          type: string
          description: The organization name of the stakeholder
          examples:
          - Sundsvalls testfabrik
          maxLength: 255
          minLength: 0
        organizationNumber:
          type: string
          description: Organization number with 10 or 12 digits.
          examples:
          - 19901010-1234
          maxLength: 13
          minLength: 0
          pattern: "^((18|19|20|21)\\d{6}|\\d{6})-(\\d{4})$"
        authorizedSignatory:
          type: string
          description: The authorized signatory of the stakeholder
          examples:
          - Test Testorsson
          maxLength: 255
          minLength: 0
        adAccount:
          type: string
          description: The AD-account of the stakeholder
          examples:
          - user
          maxLength: 36
          minLength: 0
        roles:
          type: array
          description: A stakeholder can have one or more roles.
          items:
            type: string
        addresses:
          type: array
          description: "A stakeholder may have one or more addresses. For example,\
            \ one POSTAL_ADDRESS and another INVOICE_ADDRESS."
          items:
            $ref: "#/components/schemas/Address"
        contactInformation:
          type: array
          description: The contact information of the stakeholder
          items:
            $ref: "#/components/schemas/ContactInformation"
        extraParameters:
          type: object
          additionalProperties:
            type: string
          description: Additional parameters for the stakeholder
          examples:
          - key1: value1
            key2: value2
        created:
          type: string
          format: date-time
          description: The timestamp when the stakeholder was created
          examples:
          - 2023-01-01T12:00:00Z
          readOnly: true
        updated:
          type: string
          format: date-time
          description: The timestamp when the stakeholder was last updated
          examples:
          - 2023-01-02T12:00:00Z
          readOnly: true
      required:
      - roles
      - type
    Problem:
      type: object
      properties:
        instance:
          type: string
          format: uri
        type:
          type: string
          format: uri
        title:
          type: string
        detail:
          type: string
        status:
          type: integer
          format: int32
    ConstraintViolationProblem:
      type: object
      properties:
        type:
          type: string
          format: uri
        status:
          type: integer
          format: int32
        violations:
          type: array
          items:
            $ref: "#/components/schemas/Violation"
        title:
          type: string
        instance:
          type: string
          format: uri
        detail:
          type: string
        causeAsProblem:
          $ref: "#/components/schemas/ThrowableProblem"
    ThrowableProblem:
      type: object
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
          format: int32
        detail:
          type: string
        instance:
          type: string
          format: uri
        causeAsProblem: {}
    Violation:
      type: object
      properties:
        field:
          type: string
        message:
          type: string
    Facility:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: The id of the facility
          examples:
          - 1
          readOnly: true
        version:
          type: integer
          format: int32
          description: The version of the facility
          examples:
          - 1
          readOnly: true
        municipalityId:
          type: string
          description: The municipality ID
          examples:
          - "2281"
          readOnly: true
        namespace:
          type: string
          description: Namespace
          examples:
          - MY_NAMESPACE
          readOnly: true
        description:
          type: string
          description: Description of the facility
          examples:
          - En fritextbeskrivning av facility.
          maxLength: 255
          minLength: 0
        address:
          $ref: "#/components/schemas/Address"
          description: The address of the facility
        facilityCollectionName:
          type: string
          description: The name on the sign
          examples:
          - Sundsvalls testfabrik
          maxLength: 255
          minLength: 0
        mainFacility:
          type: boolean
          description: Is this the main facility for the case?
        facilityType:
          type: string
          description: Type of the facility
          examples:
          - INDUSTRIAL
        created:
          type: string
          format: date-time
          description: Date and time when the facility was created
          examples:
          - 2023-10-01T12:00:00Z
          readOnly: true
        updated:
          type: string
          format: date-time
          description: Date and time when the facility was last updated
          examples:
          - 2023-10-02T12:00:00Z
          readOnly: true
        extraParameters:
          type: object
          additionalProperties:
            type: string
          description: Extra parameters
          examples:
          - key1: value1
            key2: value2
    Attachment:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: The id of the attachment
          examples:
          - 1
          readOnly: true
        version:
          type: integer
          format: int32
          description: The version of the attachment
          examples:
          - 1
          readOnly: true
        municipalityId:
          type: string
          description: The municipality ID
          examples:
          - "2281"
          readOnly: true
        errandId:
          type: integer
          format: int64
          description: Errand id associated with the attachment
          examples:
          - 123456
          readOnly: true
        decisionId:
          type: integer
          format: int64
          description: "Decision id associated with the attachment, null for attachments\
            \ belonging directly to the errand"
          examples:
          - 123456
          readOnly: true
        namespace:
          type: string
          description: Namespace
          examples:
          - MY_NAMESPACE
          readOnly: true
        created:
          type: string
          format: date-time
          description: The date when this attachment was created
          examples:
          - 2023-10-01T12:00:00Z
          readOnly: true
        updated:
          type: string
          format: date-time
          description: The date when this attachment was last updated
          examples:
          - 2023-10-02T12:00:00Z
          readOnly: true
        category:
          type: string
          description: Category of the attachment
          examples:
          - DOCUMENT
        channel:
          type:
          - string
          - "null"
          description: Channel through which the attachment was received
          enum:
          - EMAIL
          - ESERVICE
          - WEB_UI
          - MY_PAGES
          examples:
          - EMAIL
        name:
          type: string
          description: Name of the attachment
          examples:
          - Test Document
        note:
          type: string
          description: Note about the attachment
          examples:
          - This is a test document.
        extension:
          type: string
          description: File extension of the attachment
          examples:
          - pdf
        mimeType:
          type: string
          description: MIME type of the attachment
          examples:
          - application/pdf
        hash:
          type: string
          description: SHA-256 hash (hex encoded) of the attachment's raw content
          examples:
          - 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
          readOnly: true
        extraParameters:
          type: object
          additionalProperties:
            type: string
          description: Additional parameters for the attachment
          examples:
          - key1: value1
            key2: value2
    Decision:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: The id of the decision
          examples:
          - 1
          readOnly: true
        version:
          type: integer
          format: int32
          description: The version of the decision
          examples:
          - 1
          readOnly: true
        municipalityId:
          type: string
          description: The municipality ID
          examples:
          - "2281"
          readOnly: true
        namespace:
          type: string
          description: Namespace
          examples:
          - MY_NAMESPACE
          readOnly: true
        errandId:
          type: integer
          format: int64
          description: The id of the errand
          examples:
          - 1
          readOnly: true
        errandNumber:
          type: string
          description: Errand number
          examples:
          - SGP-2022-000001
          readOnly: true
        decisionType:
          type: string
          description: Type of the decision
          enum:
          - RECOMMENDED
          - PROPOSED
          - FINAL
          examples:
          - APPROVAL
        decisionOutcome:
          type: string
          description: Outcome of the decision
          enum:
          - APPROVAL
          - REJECTION
          - DISMISSAL
          - CANCELLATION
          examples:
          - GRANTED
        description:
          type: string
          description: Description of the decision
          examples:
          - This decision approves the application.
          maxLength: 100000
          minLength: 0
        law:
          type: array
          description: List of laws related to the decision
          items:
            $ref: "#/components/schemas/Law"
        decidedBy:
          $ref: "#/components/schemas/Stakeholder"
          description: Stakeholder who made the decision
        decidedAt:
          type: string
          format: date-time
          description: Date and time when the decision was made
          examples:
          - 2023-10-01T12:00:00Z
        validFrom:
          type: string
          format: date-time
          description: Date and time when the decision becomes valid
          examples:
          - 2023-10-01T12:00:00Z
        validTo:
          type: string
          format: date-time
          description: Date and time when the decision expires
          examples:
          - 2024-10-01T12:00:00Z
        attachments:
          type: array
          description: List of attachments related to the decision. Attachments are
            managed through the decision attachment endpoints and sending them in
            this payload is rejected
          items:
            $ref: "#/components/schemas/Attachment"
          readOnly: true
        extraParameters:
          type: object
          additionalProperties:
            type: string
          description: Additional parameters for the decision
          examples:
          - key1: value1
            key2: value2
        created:
          type: string
          format: date-time
          description: Date and time when the decision was created
          examples:
          - 2023-10-01T12:00:00Z
          readOnly: true
        updated:
          type: string
          format: date-time
          description: Date and time when the decision was last updated
          examples:
          - 2023-10-02T12:00:00Z
          readOnly: true
    Law:
      type: object
      properties:
        heading:
          type: string
          description: Heading of the law
          examples:
          - Building Act
          maxLength: 255
          minLength: 0
        sfs:
          type: string
          description: Swedish Code of Statutes (SFS)
          examples:
          - SFS 2010:900
          maxLength: 255
          minLength: 0
        chapter:
          type: string
          description: Chapter of the law
          examples:
          - "3"
          maxLength: 255
          minLength: 0
        article:
          type: string
          description: Article of the law
          examples:
          - "1"
          maxLength: 255
          minLength: 0
    CaseType:
      type: object
      properties:
        type:
          type: string
          description: The case type
          examples:
          - PARATRANSIT
        displayName:
          type: string
          description: The display name of the case type
          examples:
          - Färdtjänst
        startProcess:
          type: boolean
          description: Whether errands of this case type should start/update a process
    Errand:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: The id of the errand
          examples:
          - 1
          readOnly: true
        version:
          type: integer
          format: int32
          description: The version of the errand
          examples:
          - 1
          readOnly: true
        errandNumber:
          type: string
          description: Errand number
          examples:
          - SGP-2022-000001
          readOnly: true
        municipalityId:
          type: string
          description: The municipality ID
          examples:
          - "2281"
          readOnly: true
        namespace:
          type: string
          description: Namespace
          examples:
          - MY_NAMESPACE
          readOnly: true
        externalCaseId:
          type: string
          description: Case ID from the client
          examples:
          - caa230c6-abb4-4592-ad9a-34e263c2787b
          maxLength: 255
          minLength: 0
        caseType:
          type: string
          description: Type of the case
          examples:
          - BUILDING_PERMIT
        channel:
          type: string
          description: How the errand was created
          enum:
          - ESERVICE
          - ESERVICE_KATLA
          - EMAIL
          - WEB_UI
          - MOBILE
          - SYSTEM
          - MY_PAGES
          examples:
          - EMAIL
        priority:
          type: string
          default: MEDIUM
          description: Priority of the errand
          enum:
          - HIGH
          - MEDIUM
          - LOW
          examples:
          - HIGH
        description:
          type: string
          description: Description of the errand
          examples:
          - Some description of the case.
        caseTitleAddition:
          type: string
          description: "Additions to the case title. Right now only applicable to\
            \ cases of CaseType: NYBYGGNAD_ANSOKAN_OM_BYGGLOV."
          examples:
          - "Eldstad/rökkanal, Skylt"
          maxLength: 255
          minLength: 0
        diaryNumber:
          type: string
          description: Diary number
          examples:
          - DIA123456
          maxLength: 255
          minLength: 0
        phase:
          type: string
          description: Phase of the errand
          examples:
          - Aktualisering
          maxLength: 255
          minLength: 0
        status:
          $ref: "#/components/schemas/Status"
          description: The current status of the errand
        statuses:
          type: array
          description: The statuses connected to the errand
          items:
            $ref: "#/components/schemas/Status"
          readOnly: true
        startDate:
          type: string
          format: date
          description: Start date for the business
          examples:
          - 2022-01-01
        endDate:
          type: string
          format: date
          description: End date of the business if it is time-limited
          examples:
          - 2022-06-01
        applicationReceived:
          type: string
          format: date-time
          description: The time the application was received
          examples:
          - 2023-10-01T12:00:00Z
        processId:
          type: string
          description: Process-ID from ProcessEngine
          examples:
          - c3cb9123-4ed2-11ed-ac7c-0242ac110003
          readOnly: true
        stakeholders:
          type: array
          description: The applicant and other stakeholders connected to the errand
          items:
            $ref: "#/components/schemas/Stakeholder"
        facilities:
          type: array
          description: The facilities connected to the errand
          items:
            $ref: "#/components/schemas/Facility"
        notifications:
          type: array
          description: List of notifications connected to this errand
          items:
            $ref: "#/components/schemas/Notification"
          readOnly: true
        decisions:
          type: array
          description: The decisions connected to the errand
          items:
            $ref: "#/components/schemas/Decision"
        notes:
          type: array
          description: The notes connected to the errand
          items:
            $ref: "#/components/schemas/Note"
        messageIds:
          type: array
          description: Messages connected to this errand. Get message information
            from Message-API
          items:
            type: string
          readOnly: true
        labels:
          type: array
          description: List of labels for the errand
          examples:
          - - label1
            - label2
          items:
            type: string
        relatesTo:
          type: array
          description: Other errands related to the errand
          items:
            $ref: "#/components/schemas/RelatedErrand"
        createdByClient:
          type: string
          description: The client who created the errand. WSO2-username
          readOnly: true
        updatedByClient:
          type: string
          description: The most recent client who updated the errand. WSO2-username
          readOnly: true
        createdBy:
          type: string
          description: The user who created the errand
          readOnly: true
        updatedBy:
          type: string
          description: The most recent user who updated the errand
          readOnly: true
        suspension:
          $ref: "#/components/schemas/Suspension"
          description: Suspension information
        confidential:
          type: boolean
          description: Whether the errand is confidential or not
        extraParameters:
          type: array
          description: Extra parameters for the errand
          items:
            $ref: "#/components/schemas/ExtraParameter"
        jsonParameters:
          type: array
          description: JSON parameters for the errand
          items:
            $ref: "#/components/schemas/JsonParameter"
        created:
          type: string
          format: date-time
          description: Date and time when the errand was created
          examples:
          - 2023-10-01T12:00:00Z
          readOnly: true
        updated:
          type: string
          format: date-time
          description: Date and time when the errand was last updated
          examples:
          - 2023-10-02T12:00:00Z
          readOnly: true
    ExtraParameter:
      type: object
      properties:
        id:
          type: string
          description: Parameter id
        key:
          type: string
          description: Parameter key
          minLength: 1
        displayName:
          type: string
          description: Parameter display name
        values:
          type: array
          description: Parameter values
          items:
            type: string
      required:
      - key
    JsonNode:
      type: object
      properties:
        empty:
          type: boolean
        array:
          type: boolean
        "null":
          type: boolean
        object:
          type: boolean
        float:
          type: boolean
        container:
          type: boolean
        number:
          type: boolean
        missingNode:
          type: boolean
        nodeType:
          type: string
          enum:
          - ARRAY
          - BINARY
          - BOOLEAN
          - MISSING
          - "NULL"
          - NUMBER
          - OBJECT
          - POJO
          - STRING
        string:
          type: boolean
        integralNumber:
          type: boolean
        pojo:
          type: boolean
        floatingPointNumber:
          type: boolean
        short:
          type: boolean
        int:
          type: boolean
        long:
          type: boolean
        double:
          type: boolean
        bigDecimal:
          type: boolean
        bigInteger:
          type: boolean
        textual:
          type: boolean
          deprecated: true
        boolean:
          type: boolean
        binary:
          type: boolean
        valueNode:
          type: boolean
        embeddedValue:
          type: boolean
    JsonParameter:
      type: object
      properties:
        key:
          type: string
          description: Parameter key
          examples:
          - formData1
          minLength: 1
        value:
          $ref: "#/components/schemas/JsonNode"
          description: JSON structure value
        schemaId:
          type: string
          description: ID referencing a schema in the json-schema service
          examples:
          - 2281_person_1.0
          minLength: 1
      required:
      - key
      - schemaId
      - value
    Note:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: The unique identifier of the note
          examples:
          - 1
          readOnly: true
        version:
          type: integer
          format: int32
          description: The version of the note
          examples:
          - 1
          readOnly: true
        municipalityId:
          type: string
          description: The municipality ID
          examples:
          - "2281"
          readOnly: true
        namespace:
          type: string
          description: Namespace
          examples:
          - MY_NAMESPACE
          readOnly: true
        title:
          type: string
          description: The title of the note
          examples:
          - Motivering till bifall
          maxLength: 255
          minLength: 0
        text:
          type: string
          description: The content of the note
          examples:
          - Den sökande har rätt till parkeringstillstånd eftersom alla kriterier
            uppfylls.
          maxLength: 10000
          minLength: 0
        createdBy:
          type: string
          description: AD-account for the user who created the note
          examples:
          - user
          maxLength: 36
          minLength: 0
          readOnly: true
        updatedBy:
          type: string
          description: AD-account for the user who last modified the note
          examples:
          - user
          maxLength: 36
          minLength: 0
          readOnly: true
        noteType:
          $ref: "#/components/schemas/NoteType"
          description: The type of note
          examples:
          - INTERNAL
        extraParameters:
          type: object
          additionalProperties:
            type: string
          description: Additional parameters for the note
        created:
          type: string
          format: date-time
          description: The timestamp when the note was created
          examples:
          - 2023-01-01T12:00:00Z
          readOnly: true
        updated:
          type: string
          format: date-time
          description: The timestamp when the note was last updated
          examples:
          - 2023-01-02T12:00:00Z
          readOnly: true
    NoteType:
      type: string
      enum:
      - INTERNAL
      - PUBLIC
    Notification:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the notification
          examples:
          - 123e4567-e89b-12d3-a456-426614174000
          readOnly: true
        municipalityId:
          type: string
          description: The municipality ID
          examples:
          - "2281"
          readOnly: true
        namespace:
          type: string
          description: Namespace
          examples:
          - MY_NAMESPACE
          readOnly: true
        created:
          type: string
          format: date-time
          description: Timestamp when the notification was created
          examples:
          - 2000-10-31T01:30:00.000+02:00
          readOnly: true
        modified:
          type: string
          format: date-time
          description: Timestamp when the notification was last modified
          examples:
          - 2000-10-31T01:30:00.000+02:00
          readOnly: true
        ownerFullName:
          type: string
          description: Name of the owner of the notification
          examples:
          - Test Testorsson
          readOnly: true
        ownerId:
          type: string
          description: Owner id of the notification
          examples:
          - AD01
          minLength: 1
        createdBy:
          type: string
          description: User who created the notification
          examples:
          - TestUser
          readOnly: true
        createdByFullName:
          type: string
          description: Full name of the user who created the notification
          examples:
          - Test Testorsson
          readOnly: true
        type:
          type: string
          description: Type of the notification
          examples:
          - CREATE
          minLength: 1
        subType:
          type: string
          description: Sub type of the notification
          examples:
          - PHASE_CHANGE
          readOnly: true
        description:
          type: string
          description: Description of the notification
          examples:
          - Some description of the notification
          minLength: 1
        content:
          type: string
          description: Content of the notification
          examples:
          - Some content of the notification
        expires:
          type: string
          format: date-time
          description: Timestamp when the notification expires
          examples:
          - 2000-10-31T01:30:00.000+02:00
        acknowledged:
          type: boolean
          description: Acknowledged status of the notification
        globalAcknowledged:
          type: boolean
          description: Acknowledged status of the notification (global level). I.e.
            this notification is acknowledged by anyone.
        errandId:
          type: integer
          format: int64
          description: Errand id of the notification
          examples:
          - 1234
          readOnly: true
        errandNumber:
          type: string
          description: Errand number of the notification
          examples:
          - SGP-2022-000001
          readOnly: true
      required:
      - description
      - ownerId
      - type
    RelatedErrand:
      type: object
      description: Related errand for errand
      properties:
        errandId:
          type: integer
          format: int64
          description: Errand id
          examples:
          - 123
        errandNumber:
          type: string
          description: Errand number
          examples:
          - SGP-2022-000001
        relationReason:
          type: string
          description: Relation reason
          examples:
          - Related because of appealed decision on errand
      required:
      - errandNumber
    Status:
      type: object
      properties:
        statusType:
          type: string
          description: The type of status
          examples:
          - Ärende inkommit
          maxLength: 255
          minLength: 0
        description:
          type: string
          description: Description of the status
          examples:
          - Ärende har kommit in från e-tjänsten.
          maxLength: 255
          minLength: 0
        created:
          type: string
          format: date-time
          description: The date and time when the status was created
          examples:
          - 2023-01-01T12:00:00Z
          readOnly: true
      required:
      - statusType
    Suspension:
      type: object
      properties:
        suspendedTo:
          type: string
          format: date-time
          description: Timestamp when the suspension wears off
          examples:
          - 2000-10-31T01:30:00.000+02:00
        suspendedFrom:
          type: string
          format: date-time
          description: Timestamp when the suspension started
          examples:
          - 2000-10-31T01:30:00.000+02:00
    Classification:
      type: string
      description: Message classification
      enum:
      - INFORMATION
      - COMPLETION_REQUEST
      - OBTAIN_OPINION
      - INTERNAL_COMMUNICATION
      - OTHER
    EmailHeader:
      type: object
      properties:
        header:
          $ref: "#/components/schemas/Header"
          description: An email header
          examples:
          - MESSAGE_ID
        values:
          type: array
          description: The value of the email header
          examples:
          - - <this-is-a-test@domain.com>
          items:
            type: string
    Header:
      type: string
      enum:
      - IN_REPLY_TO
      - REFERENCES
      - MESSAGE_ID
      - AUTO_SUBMITTED
      - RETURN_PATH
      - CONTENT_TYPE
    MessageAttachment:
      type: object
      description: MessageResponse
      properties:
        content:
          type: string
          description: The attachment (file) content as a BASE64-encoded string
          examples:
          - aGVsbG8gd29ybGQK
          minLength: 1
        name:
          type: string
          description: The attachment filename
          examples:
          - test.txt
          minLength: 1
        contentType:
          type: string
          description: The attachment content type
          examples:
          - text/plain
      required:
      - content
      - name
    MessageRequest:
      type: object
      properties:
        messageId:
          type: string
          description: The message ID
          examples:
          - "12"
        direction:
          type: string
          description: If the message is inbound or outbound from the perspective
            of case-data/e-service.
          enum:
          - INBOUND
          - OUTBOUND
          examples:
          - INBOUND
        familyId:
          type: string
          description: The E-service ID that the message was created in
          examples:
          - "12"
        externalCaseId:
          type: string
          description: OpenE caseID
          examples:
          - "12"
        message:
          type: string
          description: The message
          examples:
          - Hello world
        htmlMessage:
          type: string
          description: The message in HTML format
          examples:
          - <p>Hello world</p>
        sent:
          type: string
          description: The time the message was sent
          examples:
          - 2020-01-01 12:00:00
        subject:
          type: string
          description: The email-subject of the message
          examples:
          - Hello world
        username:
          type: string
          description: The username of the user that sent the message
          examples:
          - username
        firstName:
          type: string
          description: The first name of the user that sent the message
          examples:
          - Kalle
        lastName:
          type: string
          description: The last name of the user that sent the message
          examples:
          - Anka
        messageType:
          type: string
          description: The message was delivered by
          examples:
          - EMAIL
        mobileNumber:
          type: string
          description: The mobile number of the recipient
          examples:
          - "+46701740605"
        email:
          type: string
          description: The email of the user that sent the message
          examples:
          - kalle.anka@ankeborg.se
        recipients:
          type: array
          description: List of email recipients
          examples:
          - - kalle.anka@ankeborg.se
          items:
            type: string
        ccRecipients:
          type: array
          description: List of CC email recipients
          examples:
          - - cc@ankeborg.se
          items:
            type: string
        userId:
          type: string
          description: The user ID of the user that sent the message
          examples:
          - "12"
        classification:
          $ref: "#/components/schemas/Classification"
          description: The classification of the message
        attachments:
          type: array
          description: List of attachments on the message
          items:
            $ref: "#/components/schemas/MessageAttachment"
        emailHeaders:
          type: array
          description: List of email headers on the message
          items:
            $ref: "#/components/schemas/EmailHeader"
        internal:
          type: boolean
          description: Is message internal
    Conversation:
      type: object
      description: Conversation model
      properties:
        id:
          type: string
          description: Conversation ID
          examples:
          - 1aefbbb8-de82-414b-b5d7-ba7c5bbe4506
          readOnly: true
        topic:
          type: string
          description: The message-exchange topic
          examples:
          - The conversation topic
          minLength: 1
        type:
          $ref: "#/components/schemas/ConversationType"
          description: The conversation type
          examples:
          - INTERNAL
        relationIds:
          type: array
          items:
            type: string
            description: List with relation ID:s
        participants:
          type: array
          items:
            $ref: "#/components/schemas/Identifier"
            description: A list of participants in this conversation
        metadata:
          type: array
          items:
            $ref: "#/components/schemas/KeyValues"
            description: A list of metadata objects associated with the conversation
      required:
      - topic
      - type
    ConversationType:
      type: string
      description: ConversationType model
      enum:
      - INTERNAL
      - EXTERNAL
    Identifier:
      type: object
      description: Identifier model
      properties:
        type:
          type: string
          description: The conversation identifier type
          examples:
          - adAccount
          pattern: ^(adAccount|partyId)$
        value:
          type: string
          description: The conversation identifier value
          examples:
          - joe01doe
          minLength: 1
      required:
      - value
    KeyValues:
      type: object
      description: KeyValues model
      properties:
        key:
          type: string
          description: The key
          examples:
          - key1
        values:
          type: array
          items:
            type: string
    ReadBy:
      type: object
      description: Readby model
      properties:
        identifier:
          $ref: "#/components/schemas/Identifier"
          description: The identifier of the person who read the message.
          examples:
          - joe01doe
        readAt:
          type: string
          format: date-time
          description: The timestamp when the message was read.
          examples:
          - 2023-01-01T12:00:00+01:00
    ConversationAttachment:
      type: object
      description: ConversationAttachment model
      properties:
        id:
          type: string
          description: ConversationAttachment ID
          examples:
          - cb20c51f-fcf3-42c0-b613-de563634a8ec
        fileName:
          type: string
          description: Name of the file
          examples:
          - my-file.txt
        fileSize:
          type: integer
          format: int32
          description: Size of the file in bytes
          examples:
          - 1024
        mimeType:
          type: string
          description: Mime type of the file
        hash:
          type: string
          description: Hash of the file content
          examples:
          - a3b4c5d6e7f8...
        created:
          type: string
          format: date-time
          description: The attachment created date
          examples:
          - 2023-01-01T00:00:00+01:00
    Message:
      type: object
      description: Message model
      properties:
        id:
          type: string
          description: Message ID
          examples:
          - 1aefbbb8-de82-414b-b5d7-ba7c5bbe4506
          readOnly: true
        inReplyToMessageId:
          type: string
          description: The ID of the replied message
          examples:
          - 1aefbbb8-de82-414b-b5d7-ba7c5bbe4506
        created:
          type: string
          format: date-time
          description: The timestamp when the message was created.
          examples:
          - 2023-01-01T12:00:00
          readOnly: true
        createdBy:
          $ref: "#/components/schemas/Identifier"
          description: The participant who created the message.
          readOnly: true
        content:
          type: string
          description: The content of the message.
          examples:
          - "Hello, how can I help you?"
          minLength: 1
        readBy:
          type: array
          items:
            $ref: "#/components/schemas/ReadBy"
            description: A list of users who have read the message.
            readOnly: true
        attachments:
          type: array
          items:
            $ref: "#/components/schemas/ConversationAttachment"
            description: A list of attachments associated with the message.
            readOnly: true
        attachmentIds:
          type: array
          items:
            type: integer
            format: int64
            description: List of attachment IDs referencing existing errand attachments
              to include in the message.
            examples:
            - 123
        type:
          type: string
          description: Type of message (user or system created)
          enum:
          - USER_CREATED
          - SYSTEM_CREATED
          examples:
          - USER_CREATED
          readOnly: true
      required:
      - content
    PatchNotification:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the notification
          examples:
          - 123e4567-e89b-12d3-a456-426614174000
        errandId:
          type: integer
          format: int64
          description: The Errand Id
          examples:
          - 123
        ownerId:
          type: string
          description: Owner id of the notification
          examples:
          - AD01
        type:
          type: string
          description: Type of the notification
          examples:
          - CREATE
        description:
          type: string
          description: Description of the notification
          examples:
          - Some description of the notification
        content:
          type: string
          description: Content of the notification
          examples:
          - Some content of the notification
        expires:
          type: string
          format: date-time
          description: Timestamp when the notification expires
          examples:
          - 2000-10-31T01:30:00.000+02:00
        acknowledged:
          type: boolean
          description: Acknowledged status of the notification
        globalAcknowledged:
          type: boolean
          description: Acknowledged status of the notification (global level). I.e.
            this notification is acknowledged by anyone.
      required:
      - errandId
    PatchErrand:
      type: object
      properties:
        externalCaseId:
          type: string
          description: Case ID from the client.
          examples:
          - caa230c6-abb4-4592-ad9a-34e263c2787b
          maxLength: 255
          minLength: 0
        caseType:
          type: string
          description: The type of case
          examples:
          - NYBYGGNAD_ANSOKAN_OM_BYGGLOV
        priority:
          type: string
          description: The priority of the case
          enum:
          - HIGH
          - MEDIUM
          - LOW
          examples:
          - MEDIUM
        description:
          type: string
          description: Description of the case
          examples:
          - Some description of the case.
        caseTitleAddition:
          type: string
          description: "Additions to the case title. Right now only applicable to\
            \ cases of CaseType: NYBYGGNAD_ANSOKAN_OM_BYGGLOV."
          examples:
          - "Eldstad/rökkanal, Skylt"
          maxLength: 255
          minLength: 0
        diaryNumber:
          type: string
          description: Diary number of the case
          examples:
          - D123456
          maxLength: 255
          minLength: 0
        phase:
          type: string
          description: Phase of the case
          examples:
          - Aktualisering
          maxLength: 255
          minLength: 0
        facilities:
          type: array
          description: The facilities in the case
          items:
            $ref: "#/components/schemas/Facility"
        startDate:
          type: string
          format: date
          description: Start date for the business.
          examples:
          - 2022-01-01
        endDate:
          type: string
          format: date
          description: End date of the business if it is time-limited.
          examples:
          - 2022-06-01
        suspension:
          $ref: "#/components/schemas/Suspension"
          description: Suspension information
        applicationReceived:
          type: string
          format: date-time
          description: The time the application was received.
          examples:
          - 2022-01-01T12:00:00Z
        extraParameters:
          type: array
          description: Extra parameters for the errand
          items:
            $ref: "#/components/schemas/ExtraParameter"
        jsonParameters:
          type: array
          description: JSON parameters for the errand
          items:
            $ref: "#/components/schemas/JsonParameter"
        relatesTo:
          type: array
          description: Other errands related to the errand
          items:
            $ref: "#/components/schemas/RelatedErrand"
        labels:
          type: array
          description: List of labels for the errand
          examples:
          - - label1
            - label2
          items:
            type: string
        status:
          $ref: "#/components/schemas/Status"
          description: The current status of the errand
        confidential:
          type: boolean
          description: Whether the errand is confidential or not
    PatchDecision:
      type: object
      properties:
        decisionType:
          type: string
          description: The type of decision
          enum:
          - RECOMMENDED
          - PROPOSED
          - FINAL
          examples:
          - APPROVAL
        decisionOutcome:
          type: string
          description: The outcome of the decision
          enum:
          - APPROVAL
          - REJECTION
          - DISMISSAL
          - CANCELLATION
          examples:
          - GRANTED
        description:
          type: string
          description: Description of the decision
          examples:
          - The application has been approved.
          maxLength: 1000
          minLength: 0
        decidedAt:
          type: string
          format: date-time
          description: The date and time when the decision was made
          examples:
          - 2023-10-01T12:00:00Z
        validFrom:
          type: string
          format: date-time
          description: The date and time when the decision becomes valid
          examples:
          - 2023-10-01T12:00:00Z
        validTo:
          type: string
          format: date-time
          description: The date and time when the decision expires
          examples:
          - 2023-12-31T12:00:00Z
        extraParameters:
          type: object
          additionalProperties:
            type: string
          description: Additional parameters for the decision
          examples:
          - key1: value1
            key2: value2
    PageErrand:
      type: object
      properties:
        totalPages:
          type: integer
          format: int32
        totalElements:
          type: integer
          format: int64
        size:
          type: integer
          format: int32
        content:
          type: array
          items:
            $ref: "#/components/schemas/Errand"
        number:
          type: integer
          format: int32
        first:
          type: boolean
        last:
          type: boolean
        sort:
          $ref: "#/components/schemas/SortObject"
        numberOfElements:
          type: integer
          format: int32
        pageable:
          $ref: "#/components/schemas/PageableObject"
        empty:
          type: boolean
    PageableObject:
      type: object
      properties:
        offset:
          type: integer
          format: int64
        sort:
          $ref: "#/components/schemas/SortObject"
        paged:
          type: boolean
        pageNumber:
          type: integer
          format: int32
        pageSize:
          type: integer
          format: int32
        unpaged:
          type: boolean
    SortObject:
      type: object
      properties:
        empty:
          type: boolean
        sorted:
          type: boolean
        unsorted:
          type: boolean
    CommitMetadata:
      type: object
      properties:
        author:
          type: string
        commitDateInstant:
          type: string
        id:
          type: number
          format: double
        properties:
          type: array
          items: {}
        commitDate:
          type: string
    ElementChangesItem:
      type: object
      properties:
        elementChangeType:
          type: string
        index:
          type: integer
          format: int32
        value: {}
    EntryChangesItem:
      type: object
      properties:
        entryChangeType:
          type: string
        value:
          type: string
        key:
          type: string
    GlobalId:
      type: object
      properties:
        cdoId:
          type: integer
          format: int32
        entity:
          type: string
        valueObject:
          type: string
        fragment:
          type: string
        ownerId:
          $ref: "#/components/schemas/OwnerId"
    History:
      type: object
      properties:
        changeType:
          type: string
        commitMetadata:
          $ref: "#/components/schemas/CommitMetadata"
        globalId:
          $ref: "#/components/schemas/GlobalId"
        property:
          type: string
        propertyChangeType:
          type: string
        entryChanges:
          type: array
          items:
            $ref: "#/components/schemas/EntryChangesItem"
        left: {}
        right: {}
        elementChanges:
          type: array
          items:
            $ref: "#/components/schemas/ElementChangesItem"
    OwnerId:
      type: object
      properties:
        cdoId:
          type: integer
          format: int32
        entity:
          type: string
    AttachmentResponse:
      type: object
      properties:
        attachmentId:
          type: string
          description: The attachment ID
          examples:
          - aGVsbG8gd29ybGQK
        name:
          type: string
          description: The attachment filename
          examples:
          - test.txt
        contentType:
          type: string
          description: The attachment content type
          examples:
          - text/plain
      required:
      - attachmentId
      - name
    MessageResponse:
      type: object
      properties:
        messageId:
          type: string
          description: The message ID
          examples:
          - "12"
        errandId:
          type: integer
          format: int64
          description: The errand ID
          examples:
          - 123
        municipalityId:
          type: string
          description: The municipality ID
          examples:
          - "2281"
        namespace:
          type: string
          description: Namespace
          examples:
          - MY_NAMESPACE
        direction:
          type: string
          description: If the message is inbound or outbound from the perspective
            of case-data/e-service.
          enum:
          - INBOUND
          - OUTBOUND
          examples:
          - INBOUND
        familyId:
          type: string
          description: The E-service ID that the message was created in
          examples:
          - "12"
        externalCaseId:
          type: string
          description: OpenE caseID
          examples:
          - "12"
        message:
          type: string
          description: The message
          examples:
          - Hello world
        htmlMessage:
          type: string
          description: The message in HTML format
          examples:
          - <p>Hello world</p>
        sent:
          type: string
          description: The time the message was sent
          examples:
          - 2020-01-01 12:00:00
        subject:
          type: string
          description: The email-subject of the message
          examples:
          - Hello world
        username:
          type: string
          description: The username of the user that sent the message
          examples:
          - username
        firstName:
          type: string
          description: The first name of the user that sent the message
          examples:
          - Kalle
        lastName:
          type: string
          description: The last name of the user that sent the message
          examples:
          - Anka
        messageType:
          type: string
          description: The message was delivered by
          examples:
          - EMAIL
        mobileNumber:
          type: string
          description: The mobile number of the recipient
          examples:
          - "+46701740605"
        recipients:
          type: array
          description: "The recipients of the message, if email"
          examples:
          - - kalle.anka@ankeborg.se
          items:
            type: string
        ccRecipients:
          type: array
          description: "The CC recipients of the message, if email"
          examples:
          - - cc@ankeborg.se
          items:
            type: string
        email:
          type: string
          description: The email of the user that sent the message
          examples:
          - kalle.anka@ankeborg.se
        userId:
          type: string
          description: The user ID of the user that sent the message
          examples:
          - "12"
        viewed:
          type: boolean
          description: Signal if the message has been viewed or not
        classification:
          $ref: "#/components/schemas/Classification"
          description: The classification of the message
        attachments:
          type: array
          description: List of attachments on the message
          items:
            $ref: "#/components/schemas/AttachmentResponse"
        emailHeaders:
          type: array
          description: List of email headers on the message
          items:
            $ref: "#/components/schemas/EmailHeader"
        internal:
          type: boolean
          description: Is message internal
    PageMessage:
      type: object
      properties:
        totalPages:
          type: integer
          format: int32
        totalElements:
          type: integer
          format: int64
        size:
          type: integer
          format: int32
        content:
          type: array
          items:
            $ref: "#/components/schemas/Message"
        number:
          type: integer
          format: int32
        first:
          type: boolean
        last:
          type: boolean
        sort:
          $ref: "#/components/schemas/SortObject"
        numberOfElements:
          type: integer
          format: int32
        pageable:
          $ref: "#/components/schemas/PageableObject"
        empty:
          type: boolean
    PageDecision:
      type: object
      properties:
        totalPages:
          type: integer
          format: int32
        totalElements:
          type: integer
          format: int64
        size:
          type: integer
          format: int32
        content:
          type: array
          items:
            $ref: "#/components/schemas/Decision"
        number:
          type: integer
          format: int32
        first:
          type: boolean
        last:
          type: boolean
        sort:
          $ref: "#/components/schemas/SortObject"
        numberOfElements:
          type: integer
          format: int32
        pageable:
          $ref: "#/components/schemas/PageableObject"
        empty:
          type: boolean
  securitySchemes: {}
