openapi: 3.0.1 info: title: Purplebricks.Messaging.Api 1.0 - Backend description: '### Purplebricks Messaging API ### [Purplebricks.Messaging.Api Git Repository](https://dev.azure.com/purplebricks/BackEnd/_git/messaging-api)' version: '1.0' servers: - url: https://api.purplebricks.co.uk/messaging-api paths: /v1/messages: get: tags: - Messages parameters: - name: propertyId in: query schema: type: integer format: int32 - name: threadId in: query schema: type: string format: uuid - name: isRead in: query schema: type: boolean - name: includeSystemMessages in: query schema: type: boolean - name: limit in: query schema: type: integer format: int32 default: 50 - name: cursor in: query schema: type: string - name: page in: query schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.CursorPaginationType' - name: ascending in: query schema: type: boolean default: true - name: userId in: query schema: type: integer format: int32 responses: '200': description: Success content: text/plain: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.MessagesListResponseModel' application/json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.MessagesListResponseModel' text/json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.MessagesListResponseModel' '400': description: Bad Request content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '401': description: Unauthorized content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' post: tags: - Messages requestBody: content: application/json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.MessageRequestModel' text/json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.MessageRequestModel' application/*+json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.MessageRequestModel' responses: '201': description: Created '400': description: Bad Request content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '401': description: Unauthorized content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '404': description: Not Found content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '409': description: Conflict content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' /v1/messages/{messageId}: get: tags: - Messages parameters: - name: messageId in: path required: true schema: type: integer format: int32 responses: '200': description: Success '400': description: Bad Request content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '404': description: Not Found content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '401': description: Unauthorized content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' put: tags: - Messages parameters: - name: messageId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.MessageUpdateRequestModel' text/json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.MessageUpdateRequestModel' application/*+json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.MessageUpdateRequestModel' responses: '201': description: Created '400': description: Bad Request content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '401': description: Unauthorized content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '404': description: Not Found content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '409': description: Conflict content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' /v1/messages/{messageId}/notes: get: tags: - Messages parameters: - name: messageId in: path required: true schema: type: integer format: int32 - name: userId in: query schema: type: integer format: int32 responses: '200': description: Success '400': description: Bad Request content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '404': description: Not Found content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '401': description: Unauthorized content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' post: tags: - Messages parameters: - name: messageId in: path required: true schema: type: integer format: int32 requestBody: content: application/json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.NoteRequestModel' text/json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.NoteRequestModel' application/*+json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.NoteRequestModel' responses: '201': description: Created '400': description: Bad Request content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '401': description: Unauthorized content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '404': description: Not Found content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' /v1/messages/count: get: tags: - Messages parameters: - name: type in: query schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.MessageStatusType' - name: includeSystemMessages in: query schema: type: boolean default: false responses: '200': description: Success '400': description: Bad Request content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' /v1/threads: get: tags: - Threads parameters: - name: propertyId in: query schema: type: integer format: int32 - name: fromDate in: query schema: type: string format: date-time - name: includeSystemMessages in: query schema: type: boolean default: false - name: limit in: query schema: type: integer format: int32 default: 50 - name: cursor in: query schema: type: string - name: page in: query schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.CursorPaginationType' - name: userId in: query schema: type: integer format: int32 responses: '200': description: Success content: text/plain: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.ThreadListResponseModel' application/json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.ThreadListResponseModel' text/json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.ThreadListResponseModel' '403': description: Forbidden content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '400': description: Bad Request content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '401': description: Unauthorized content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' /v1/threads/{threadId}: get: tags: - Threads parameters: - name: threadId in: path required: true schema: type: string format: uuid responses: '200': description: Success content: text/plain: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.ThreadResponseModel' application/json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.ThreadResponseModel' text/json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.ThreadResponseModel' '400': description: Bad Request content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '401': description: Unauthorized content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' /v1/threads/{threadId}/messages: get: tags: - Threads parameters: - name: threadId in: path required: true schema: type: string format: uuid - name: propertyId in: query schema: type: integer format: int32 - name: isRead in: query schema: type: boolean - name: includeSystemMessages in: query schema: type: boolean - name: limit in: query schema: type: integer format: int32 default: 50 - name: cursor in: query schema: type: string - name: page in: query schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.CursorPaginationType' - name: ascending in: query schema: type: boolean default: true - name: userId in: query schema: type: integer format: int32 responses: '200': description: Success content: text/plain: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.MessagesListResponseModel' application/json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.MessagesListResponseModel' text/json: schema: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.MessagesListResponseModel' '400': description: Bad Request content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '401': description: Unauthorized content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' /v1/threads/{threadId}/messages/count: get: tags: - Threads parameters: - name: threadId in: path required: true schema: type: string format: uuid - name: propertyId in: query schema: type: integer format: int32 - name: isRead in: query schema: type: boolean - name: includeSystemMessages in: query schema: type: boolean - name: userId in: query schema: type: integer format: int32 responses: '200': description: Success content: text/plain: schema: type: string application/json: schema: type: string text/json: schema: type: string '400': description: Bad Request content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '401': description: Unauthorized content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' /v1/threads/{threadId}/read: patch: tags: - Threads parameters: - name: threadId in: path required: true schema: type: string format: uuid responses: '204': description: No Content '400': description: Bad Request content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' '401': description: Unauthorized content: text/plain: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' application/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' text/json: schema: $ref: '#/components/schemas/Microsoft.AspNetCore.Mvc.ProblemDetails' components: schemas: Microsoft.AspNetCore.Mvc.ProblemDetails: type: object properties: type: type: string nullable: true title: type: string nullable: true status: type: integer format: int32 nullable: true detail: type: string nullable: true instance: type: string nullable: true additionalProperties: {} Purplebricks.Messaging.Business.Messages.MessageStatusType: enum: - All - Read - Unread type: string Purplebricks.Messaging.Business.Messages.Models.AddressDetail: type: object properties: line1: type: string nullable: true line2: type: string nullable: true town: type: string nullable: true county: type: string nullable: true postcode: type: string nullable: true additionalProperties: false Purplebricks.Messaging.Business.Messages.Models.CursorPaginationType: enum: - Previous - Next type: string Purplebricks.Messaging.Business.Messages.Models.MessageRequestModel: type: object properties: threadId: type: string format: uuid nullable: true senderId: type: integer format: int32 recipientId: type: integer format: int32 propertyId: type: integer format: int32 nullable: true subject: type: string nullable: true body: type: string nullable: true address: type: string nullable: true additionalProperties: false Purplebricks.Messaging.Business.Messages.Models.MessageResponseModel: type: object properties: id: type: integer format: int32 threadId: type: string format: uuid senderId: type: integer format: int32 nullable: true recipientId: type: integer format: int32 propertyId: type: integer format: int32 nullable: true subject: type: string nullable: true body: type: string nullable: true read: type: boolean date: type: string format: date-time cursor: type: string nullable: true isSystemMessage: type: boolean readOnly: true additionalProperties: false Purplebricks.Messaging.Business.Messages.Models.MessageUpdateRequestModel: type: object properties: subject: type: string nullable: true body: type: string nullable: true read: type: boolean nullable: true additionalProperties: false Purplebricks.Messaging.Business.Messages.Models.MessagesListResponseModel: type: object properties: messages: type: array items: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.MessageResponseModel' nullable: true pageInfo: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.PageInfoResponseModel' additionalProperties: false Purplebricks.Messaging.Business.Messages.Models.NoteRequestModel: type: object properties: userId: type: integer format: int32 propertyId: type: integer format: int32 subject: type: string nullable: true body: type: string nullable: true additionalProperties: false Purplebricks.Messaging.Business.Messages.Models.PageInfoResponseModel: type: object properties: requestedPageSize: type: integer format: int32 totalItemCount: type: integer format: int32 hasNextPage: type: boolean hasPreviousPage: type: boolean additionalProperties: false Purplebricks.Messaging.Business.Messages.Models.ParticipantDetail: type: object properties: userId: type: integer format: int32 title: type: string nullable: true forename: type: string nullable: true surname: type: string nullable: true additionalProperties: false Purplebricks.Messaging.Business.Messages.Models.ThreadListResponseModel: type: object properties: threads: type: array items: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.ThreadResponseModel' nullable: true pageInfo: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.PageInfoResponseModel' additionalProperties: false Purplebricks.Messaging.Business.Messages.Models.ThreadResponseModel: type: object properties: id: type: string format: uuid propertyId: type: integer format: int32 nullable: true address: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.AddressDetail' participants: type: array items: type: integer format: int32 nullable: true participantsDetails: type: array items: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.ParticipantDetail' nullable: true date: type: string format: date-time lastMessage: $ref: '#/components/schemas/Purplebricks.Messaging.Business.Messages.Models.MessageResponseModel' cursor: type: string nullable: true additionalProperties: false securitySchemes: Bearer: type: apiKey description: Authorization header using Bearer scheme name: Authorization in: header security: - Bearer: []