{
  "openapi": "3.0.4",
  "info": {
    "title": "Messages API",
    "description": "**Welcome to the Messages API documentation.**\r\n\r\nYou can test the API using **[Swagger](/messaging/demo/v10-0/docs/swagger)**.\r\n\r\nYou can find a detailed documentation by following **[this link](https://docs.egov4.ch/docs/9.1/category/messages-api)**.\r\n",
    "contact": {
      "name": "Artionet",
      "url": "https://www.artionet.ch/",
      "email": "support@artionet.com"
    },
    "version": "v10.0",
    "x-logo": {
      "url": "/messaging/demo/v10-0/Documentation/Images/logo_artionet.png",
      "backgroundColor": "#fafafa",
      "altText": "Artionet Logo"
    }
  },
  "servers": [
    {
      "url": "/messaging/demo/v10-0"
    }
  ],
  "paths": {
    "/messages": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "Get a list of messages",
        "description": "Allows to retrieve a list of messages (GET only) according to certain criteria.",
        "parameters": [
          {
            "name": "RecipientId",
            "in": "query",
            "description": "Profile Id from eGuichet",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SearchTerm",
            "in": "query",
            "description": "Term searched in messages `Body` and `Title`",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SenderOrigin",
            "in": "query",
            "description": "Filters messages by `SenderOrigin` property",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IsImportant",
            "in": "query",
            "description": "Filters messages by `IsImportant` property",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "IsFollowed",
            "in": "query",
            "description": "Filters messages by `IsFollowed` property",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "IsRead",
            "in": "query",
            "description": "Messages read have a not null `ReadStamp`",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "IsConfirmed",
            "in": "query",
            "description": "Messages confirmed have a not null `ConfirmStamp`",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "ThreadId",
            "in": "query",
            "description": "Filters messages by `ThreadId` property",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "LastInThread",
            "in": "query",
            "description": "When enabled, only retrieve the last message in each thread",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "CreationTaskId",
            "in": "query",
            "description": "Filters messages by `CreationTaskId` property",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "MinMessageStamp",
            "in": "query",
            "description": "Messages with a later or equal `MessageStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "MaxMessageStamp",
            "in": "query",
            "description": "Messages with an earlier or equal `MessageStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "MinCreationStamp",
            "in": "query",
            "description": "Messages with a later or equal `CreationStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "MaxCreationStamp",
            "in": "query",
            "description": "Messages with an earlier or equal `CreationStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "RecipientIsOrgAdmin",
            "in": "query",
            "description": "Indicate if the recipient is admin of its organization",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "Metadata",
            "in": "query",
            "description": "Filters by metadata key-value. \r\nIt is possible to use the following synthax multiple time for the same _metadataName_.\r\n\r\n**Usage :** `metadata[metadataName]=metadataValue`\r\n\r\n**Other :** using `-1` as value for name `prestationid` to also retrieve messages without prestation Id specified.\r\n\r\n**Swagger :** use the following example format with Swagger : `{\"metadata[externalid]\":\"ExtId333111\",\"metadata[prestationid]\":\"1020\"}`",
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          {
            "name": "PrestaDates",
            "in": "query",
            "description": "Filters by date of access by prestation. The `MessageStamp` property has to be later or equal to provided date concerned by given prestation.\r\nRequire to filter first by `metadata[prestationId]` **AND** for each occurrence a date has to be provided.\r\n\r\n**Usage :** `prestaDates[prestationId]=utcDate`\r\n\r\n**Swagger :** use the following example format with Swagger : `{\"prestaDates[1020]\": \"2020-06-26T07:19:25.83Z\"}`",
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          {
            "name": "PageNumber",
            "in": "query",
            "description": "Page number",
            "schema": {
              "maximum": 2147483647,
              "minimum": 1,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "PageSize",
            "in": "query",
            "description": "Number of messages per page. Using value `-1` disable pagination and gives all results at once.",
            "schema": {
              "maximum": 2147483647,
              "minimum": -1,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "OrderBy",
            "in": "query",
            "description": "Sorting option. \r\n\r\n**Usage (no square brackets !) :** `orderBy=[property] [asc,desc],[property] [asc,desc],...`",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of selected messages (GET only)",
            "headers": {
              "X-Pagination-Total-Count": {
                "description": "Total number of elements",
                "schema": {
                  "type": "integer",
                  "description": "Total number of elements",
                  "format": ""
                }
              },
              "X-Pagination-Page-Size": {
                "description": "Size of a page of element",
                "schema": {
                  "type": "integer",
                  "description": "Size of a page of element",
                  "format": ""
                }
              },
              "X-Pagination-Current-Page": {
                "description": "Index of the current page",
                "schema": {
                  "type": "integer",
                  "description": "Index of the current page",
                  "format": ""
                }
              },
              "X-Pagination-Total-Pages": {
                "description": "Total number of pages",
                "schema": {
                  "type": "integer",
                  "description": "Total number of pages",
                  "format": ""
                }
              },
              "X-Pagination-Next-Page-Link": {
                "description": "Link to the next page",
                "schema": {
                  "type": "string",
                  "description": "Link to the next page",
                  "format": ""
                }
              },
              "X-Pagination-Previous-Page-Link": {
                "description": "Link to the previous page",
                "schema": {
                  "type": "string",
                  "description": "Link to the previous page",
                  "format": ""
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MessageDto"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "head": {
        "tags": [
          "Messages"
        ],
        "summary": "Get a list of messages",
        "description": "Allows to retrieve a list of messages (GET only) according to certain criteria.",
        "parameters": [
          {
            "name": "RecipientId",
            "in": "query",
            "description": "Profile Id from eGuichet",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SearchTerm",
            "in": "query",
            "description": "Term searched in messages `Body` and `Title`",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "SenderOrigin",
            "in": "query",
            "description": "Filters messages by `SenderOrigin` property",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IsImportant",
            "in": "query",
            "description": "Filters messages by `IsImportant` property",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "IsFollowed",
            "in": "query",
            "description": "Filters messages by `IsFollowed` property",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "IsRead",
            "in": "query",
            "description": "Messages read have a not null `ReadStamp`",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "IsConfirmed",
            "in": "query",
            "description": "Messages confirmed have a not null `ConfirmStamp`",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "ThreadId",
            "in": "query",
            "description": "Filters messages by `ThreadId` property",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "LastInThread",
            "in": "query",
            "description": "When enabled, only retrieve the last message in each thread",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "CreationTaskId",
            "in": "query",
            "description": "Filters messages by `CreationTaskId` property",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "MinMessageStamp",
            "in": "query",
            "description": "Messages with a later or equal `MessageStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "MaxMessageStamp",
            "in": "query",
            "description": "Messages with an earlier or equal `MessageStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "MinCreationStamp",
            "in": "query",
            "description": "Messages with a later or equal `CreationStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "MaxCreationStamp",
            "in": "query",
            "description": "Messages with an earlier or equal `CreationStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "RecipientIsOrgAdmin",
            "in": "query",
            "description": "Indicate if the recipient is admin of its organization",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "Metadata",
            "in": "query",
            "description": "Filters by metadata key-value. \r\nIt is possible to use the following synthax multiple time for the same _metadataName_.\r\n\r\n**Usage :** `metadata[metadataName]=metadataValue`\r\n\r\n**Other :** using `-1` as value for name `prestationid` to also retrieve messages without prestation Id specified.\r\n\r\n**Swagger :** use the following example format with Swagger : `{\"metadata[externalid]\":\"ExtId333111\",\"metadata[prestationid]\":\"1020\"}`",
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          {
            "name": "PrestaDates",
            "in": "query",
            "description": "Filters by date of access by prestation. The `MessageStamp` property has to be later or equal to provided date concerned by given prestation.\r\nRequire to filter first by `metadata[prestationId]` **AND** for each occurrence a date has to be provided.\r\n\r\n**Usage :** `prestaDates[prestationId]=utcDate`\r\n\r\n**Swagger :** use the following example format with Swagger : `{\"prestaDates[1020]\": \"2020-06-26T07:19:25.83Z\"}`",
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          {
            "name": "PageNumber",
            "in": "query",
            "description": "Page number",
            "schema": {
              "maximum": 2147483647,
              "minimum": 1,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "PageSize",
            "in": "query",
            "description": "Number of messages per page. Using value `-1` disable pagination and gives all results at once.",
            "schema": {
              "maximum": 2147483647,
              "minimum": -1,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "OrderBy",
            "in": "query",
            "description": "Sorting option. \r\n\r\n**Usage (no square brackets !) :** `orderBy=[property] [asc,desc],[property] [asc,desc],...`",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of selected messages (GET only)",
            "headers": {
              "X-Pagination-Total-Count": {
                "description": "Total number of elements",
                "schema": {
                  "type": "integer",
                  "description": "Total number of elements",
                  "format": ""
                }
              },
              "X-Pagination-Page-Size": {
                "description": "Size of a page of element",
                "schema": {
                  "type": "integer",
                  "description": "Size of a page of element",
                  "format": ""
                }
              },
              "X-Pagination-Current-Page": {
                "description": "Index of the current page",
                "schema": {
                  "type": "integer",
                  "description": "Index of the current page",
                  "format": ""
                }
              },
              "X-Pagination-Total-Pages": {
                "description": "Total number of pages",
                "schema": {
                  "type": "integer",
                  "description": "Total number of pages",
                  "format": ""
                }
              },
              "X-Pagination-Next-Page-Link": {
                "description": "Link to the next page",
                "schema": {
                  "type": "string",
                  "description": "Link to the next page",
                  "format": ""
                }
              },
              "X-Pagination-Previous-Page-Link": {
                "description": "Link to the previous page",
                "schema": {
                  "type": "string",
                  "description": "Link to the previous page",
                  "format": ""
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MessageDto"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Messages"
        ],
        "summary": "Create a new message",
        "description": "Allows to create a new message.",
        "requestBody": {
          "description": "Message to create",
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/MessageForCreationDto"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageDto"
                }
              }
            }
          },
          "400": {
            "description": "Request body is null or synthax is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Messages"
        ],
        "summary": "Delete messages by criteria",
        "description": "Allows to delete existing messages by criteria and all their metadata. **Also deletes every messages in the same thread.**",
        "parameters": [
          {
            "name": "RecipientId",
            "in": "query",
            "description": "Profile Id from eGuichet",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content",
            "headers": {
              "X-Deletion-Total-Count": {
                "description": "Number of messages deleted",
                "schema": {
                  "type": "integer",
                  "description": "Number of messages deleted",
                  "format": ""
                }
              },
              "X-Deletion-Ids-List": {
                "description": "Ids of the deleted messages",
                "schema": {
                  "type": "array",
                  "description": "Ids of the deleted messages",
                  "format": ""
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "options": {
        "tags": [
          "Messages"
        ],
        "summary": "Get the allowed HTTP Methods for URI",
        "description": "Allows to know which methods are allowed for this URI.",
        "responses": {
          "200": {
            "description": "HTTP Methods allowed (HTTP header)",
            "headers": {
              "Allow": {
                "description": "HTTP Methods allowed for this URI",
                "schema": {
                  "type": "string",
                  "description": "HTTP Methods allowed for this URI",
                  "format": ""
                }
              }
            }
          }
        }
      }
    },
    "/messages/{messageId}": {
      "get": {
        "tags": [
          "Messages"
        ],
        "summary": "Get a single message",
        "description": "Allows to retrieve a specific message identified by its `Id`.",
        "operationId": "MessageById",
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "description": "Message `Id`",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Selected message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageDto"
                }
              }
            }
          },
          "404": {
            "description": "Selected message doesn't exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Messages"
        ],
        "summary": "Delete a message and all its metadata",
        "description": "Allows to delete an existing message and all its metadata. **Also deletes every messages in the same thread.**",
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "description": "Message `Id`",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "404": {
            "description": "Selected message doesn't exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "Messages"
        ],
        "summary": "Update a message",
        "description": "Allows to update certain properties of an existing message. When a message is marked as read, messages in the same thread also are.",
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "description": "Message `Id`",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "description": "Updated properties",
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/MessageForUpdateDto"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageDto"
                }
              }
            }
          },
          "400": {
            "description": "Request body is null or synthax is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Selected message doesn't exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/messages/{messageId}/metadata": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "summary": "Get all metadata for a message",
        "description": "Allows to retrieve the list of metadata for a specific message.",
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "description": "Message `Id`",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "PageNumber",
            "in": "query",
            "description": "Page number",
            "schema": {
              "maximum": 2147483647,
              "minimum": 1,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "PageSize",
            "in": "query",
            "description": "Number of messages per page. Using value `-1` disable pagination and gives all results at once.",
            "schema": {
              "maximum": 2147483647,
              "minimum": -1,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "OrderBy",
            "in": "query",
            "description": "Sorting option. \r\n\r\n**Usage (no square brackets !) :** `orderBy=[property] [asc,desc],[property] [asc,desc],...`",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of metadata for the selected message",
            "headers": {
              "X-Pagination-Total-Count": {
                "description": "Total number of elements",
                "schema": {
                  "type": "integer",
                  "description": "Total number of elements",
                  "format": ""
                }
              },
              "X-Pagination-Page-Size": {
                "description": "Size of a page of element",
                "schema": {
                  "type": "integer",
                  "description": "Size of a page of element",
                  "format": ""
                }
              },
              "X-Pagination-Current-Page": {
                "description": "Index of the current page",
                "schema": {
                  "type": "integer",
                  "description": "Index of the current page",
                  "format": ""
                }
              },
              "X-Pagination-Total-Pages": {
                "description": "Total number of pages",
                "schema": {
                  "type": "integer",
                  "description": "Total number of pages",
                  "format": ""
                }
              },
              "X-Pagination-Next-Page-Link": {
                "description": "Link to the next page",
                "schema": {
                  "type": "string",
                  "description": "Link to the next page",
                  "format": ""
                }
              },
              "X-Pagination-Previous-Page-Link": {
                "description": "Link to the previous page",
                "schema": {
                  "type": "string",
                  "description": "Link to the previous page",
                  "format": ""
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/MetadataDto"
                  }
                }
              }
            }
          },
          "404": {
            "description": "Selected message doesn't exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/messages/{messageId}/metadata/{name}": {
      "get": {
        "tags": [
          "Metadata"
        ],
        "summary": "Get a single metadata for a specific message",
        "description": "Allows to retrieve a specific metadata for a specific message, identified respectively by `Name` and `Id`.",
        "parameters": [
          {
            "name": "messageId",
            "in": "path",
            "description": "Message `Id`",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "name",
            "in": "path",
            "description": "Metadata Name (case insensitive)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Selected metadata for the selecte message",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MetadataDto"
                }
              }
            }
          },
          "404": {
            "description": "Selected message or metadata doesn't exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/messages/recipients": {
      "get": {
        "tags": [
          "Recipients"
        ],
        "summary": "Get the recipients of the messages created in the last X seconds",
        "description": "Allows to retrieve the list of recipients of the messages created in the last X seconds",
        "parameters": [
          {
            "name": "timeOffsetInSeconds",
            "in": "query",
            "description": "Time offset in seconds that will be substracted from current time",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of recipients",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "HttpValidationProblemDetails": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProblemDetails"
          },
          {
            "type": "object",
            "properties": {
              "errors": {
                "type": "object",
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            },
            "additionalProperties": { }
          }
        ]
      },
      "MessageDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique ID of the message",
            "format": "int32"
          },
          "creationTaskId": {
            "type": "string",
            "description": "Guid identifying messages created in the same operation",
            "format": "uuid",
            "nullable": true
          },
          "creationStamp": {
            "type": "string",
            "description": "Date of message creation by the API",
            "format": "date-time"
          },
          "threadId": {
            "type": "integer",
            "description": "ID of the thread containing the message",
            "format": "int32"
          },
          "title": {
            "type": "string",
            "description": "Title of the message"
          },
          "body": {
            "type": "string",
            "description": "Body content of the message"
          },
          "messageStamp": {
            "type": "string",
            "description": "Official date of the message",
            "format": "date-time"
          },
          "recipientId": {
            "type": "string",
            "description": "Recipient's Profile ID (from eGuichet)"
          },
          "senderOrigin": {
            "type": "string",
            "description": "Source of the message",
            "nullable": true
          },
          "senderDisplayName": {
            "type": "string",
            "description": "Name of the sender, used for display"
          },
          "isImportant": {
            "type": "boolean",
            "description": "Indicates if the message is important (requiring a confirmation)"
          },
          "isFollowed": {
            "type": "boolean",
            "description": "Indicates if the message is followed by its recipient"
          },
          "isReplyable": {
            "type": "boolean",
            "description": "Indicates if the message is replyable"
          },
          "hasAttachment": {
            "type": "boolean",
            "description": "Indicates if the message has at least one attachment"
          },
          "readStamp": {
            "type": "string",
            "description": "Date of reading",
            "format": "date-time",
            "nullable": true
          },
          "confirmStamp": {
            "type": "string",
            "description": "Date of confirmation",
            "format": "date-time",
            "nullable": true
          },
          "metadata": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetadataDto"
            },
            "description": "List of the metadata linked to the message",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "MessageForCreationDto": {
        "required": [
          "body",
          "recipientId",
          "senderDisplayName",
          "title"
        ],
        "type": "object",
        "properties": {
          "creationTaskId": {
            "type": "string",
            "description": "Guid identifying messages created in the same operation.\r\nDefault value : `Guid.NewGuid()`",
            "format": "uuid",
            "nullable": true
          },
          "threadId": {
            "type": "integer",
            "description": "ID of the thread containing the message.\r\nDefault value : the new message `Id`",
            "format": "int32"
          },
          "title": {
            "minLength": 1,
            "type": "string",
            "description": "Title of the message"
          },
          "body": {
            "minLength": 1,
            "type": "string",
            "description": "Body content of the message"
          },
          "messageStamp": {
            "type": "string",
            "description": "Official date of the message\r\nDefault value : `Datetime.Now`",
            "format": "date-time",
            "nullable": true
          },
          "recipientId": {
            "maxLength": 50,
            "minLength": 1,
            "type": "string",
            "description": "Recipient's Profile ID (from eGuichet)"
          },
          "senderOrigin": {
            "maxLength": 128,
            "type": "string",
            "description": "Source of the message.\r\nDefault value : `string.empty`",
            "nullable": true
          },
          "senderDisplayName": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string",
            "description": "Name of the sender, used for display."
          },
          "isImportant": {
            "type": "boolean",
            "description": "Indicates if the message is important (requiring a confirmation).\r\nDefault value : `false`"
          },
          "isFollowed": {
            "type": "boolean",
            "description": "Indicates if the message is followed by its recipient.\r\nDefault value : `false`"
          },
          "isReplyable": {
            "type": "boolean",
            "description": "Indicates if the message is replyable.\r\nDefault value : `false`"
          },
          "hasAttachment": {
            "type": "boolean",
            "description": "Indicates if the message has at least one attachment.\r\nDefault value : `false`"
          },
          "metadata": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MetadataForCreationDto"
            },
            "description": "List of the metadata linked to the message.\r\nDefault value : `null`",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "MessageForUpdateDto": {
        "type": "object",
        "properties": {
          "isFollowed": {
            "type": "boolean",
            "description": "Indicates if the message is followed by its recipient"
          },
          "hasAttachment": {
            "type": "boolean",
            "description": "Indicates if the message has at least one attachment"
          },
          "readStamp": {
            "type": "string",
            "description": "Date of reading.",
            "format": "date-time",
            "nullable": true
          },
          "confirmStamp": {
            "type": "string",
            "description": "Date of confirmation. A confirm date can only be set when the message is important and is read.",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "MetadataDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique ID of the metadata",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "description": "Unique metadata name per message"
          },
          "value": {
            "type": "string",
            "description": "Value of the metadata"
          }
        },
        "additionalProperties": false
      },
      "MetadataForCreationDto": {
        "required": [
          "name",
          "value"
        ],
        "type": "object",
        "properties": {
          "name": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string",
            "description": "Unique metadata name per message"
          },
          "value": {
            "maxLength": 128,
            "minLength": 1,
            "type": "string",
            "description": "Value of the metadata"
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "URI that identifies the problem detail type",
            "nullable": true
          },
          "title": {
            "type": "string",
            "description": "A short human-readable summary about the problem",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "description": "HTTP Status Code",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "description": "A human-readable explanation about the problem",
            "nullable": true
          },
          "traceId": {
            "type": "string",
            "description": "Guid to trace the error in the log files",
            "format": "uuid"
          }
        },
        "additionalProperties": { }
      }
    }
  },
  "tags": [
    {
      "name": "Messages"
    },
    {
      "name": "Metadata"
    },
    {
      "name": "Recipients"
    },
    {
      "name": "message_model",
      "description": "<SchemaDefinition schemaRef=\"#/components/schemas/MessageDto\" />",
      "x-displayName": "Message Model"
    },
    {
      "name": "message_model_for_creation",
      "description": "<SchemaDefinition schemaRef=\"#/components/schemas/MessageForCreationDto\" />",
      "x-displayName": "Message Creation Model"
    },
    {
      "name": "message_model_for_update",
      "description": "<SchemaDefinition schemaRef=\"#/components/schemas/MessageForUpdateDto\" />",
      "x-displayName": "Message Update Model"
    },
    {
      "name": "metadata_model",
      "description": "<SchemaDefinition schemaRef=\"#/components/schemas/MetadataDto\" />",
      "x-displayName": "Metadata Model"
    },
    {
      "name": "problem_details_model",
      "description": "<SchemaDefinition schemaRef=\"#/components/schemas/ProblemDetails\" />",
      "x-displayName": "Error Model"
    }
  ],
  "x-tagGroups": [
    {
      "name": "General",
      "tags": [
        "Messages",
        "Metadata",
        "Recipients"
      ]
    },
    {
      "name": "Models",
      "tags": [
        "message_model",
        "message_model_for_creation",
        "message_model_for_update",
        "metadata_model",
        "problem_details_model"
      ]
    }
  ]
}