Skip to main content
POST
/
complaints
/
Create complaint
curl --request POST \
  --url http:localhost:3000/v2/complaints/ \
  --header 'Content-Type: application/json' \
  --header 'x-API-Key: <api-key>' \
  --data '{
  "_id": "<string>",
  "number": 123,
  "companyId": "<string>",
  "status": {
    "status": 123,
    "createdAt": "2023-11-07T05:31:56Z",
    "createdBy": "<string>",
    "lastModifiedAt": "2023-11-07T05:31:56Z",
    "lastModifiedBy": "<string>"
  },
  "chatId": "<string>",
  "objectId": "507f1f77bcf86cd799439012",
  "desc": "The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture.",
  "roomDescription": "Bathroom on 2nd floor, next to the elevator",
  "contactName": "John Smith",
  "contact": {
    "email": "john.smith@example.com",
    "telephone": "+41 44 123 45 67"
  },
  "priority": 2,
  "images": [
    "https://example.com/complaint-image1.jpg"
  ],
  "userId": "507f1f77bcf86cd799439014",
  "customFields": {}
}'
{
  "_id": "<string>",
  "number": 123,
  "companyId": "<string>",
  "status": {
    "status": 123,
    "createdAt": "2023-11-07T05:31:56Z",
    "createdBy": "<string>",
    "lastModifiedAt": "2023-11-07T05:31:56Z",
    "lastModifiedBy": "<string>"
  },
  "chatId": "<string>",
  "desc": "Updated complaint description with additional details",
  "roomDescription": "Updated room location information",
  "contactName": "John Smith Jr.",
  "contact": {
    "email": "jsmith@example.com",
    "telephone": "<string>"
  },
  "priority": 3,
  "images": [
    "<string>"
  ],
  "userId": "507f1f77bcf86cd799439014",
  "comment": "Additional notes about the complaint resolution",
  "response": "Thank you for your patience. The issue has been resolved.",
  "customFields": {}
}

Authorizations

x-API-Key
string
header
required

Body

application/json

Complaint creation data

Data required to create a new complaint Base class for all entities that can have a chat associated with them. Base class for all entities in the system, providing common properties and methods.

objectId
string<objectid>
required

ID of the customer object this complaint relates to

Example:

"507f1f77bcf86cd799439012"

desc
string
required

Detailed description of the complaint or issue

Example:

"The cleaning was not satisfactory. There were stains on the carpet and dust on the furniture."

roomDescription
string

Description of the specific room or area where the issue occurred

Example:

"Bathroom on 2nd floor, next to the elevator"

contactName
string

Name of the person submitting the complaint

Example:

"John Smith"

contact
object

Contact information for the complaint reporter

priority
integer
default:1

Priority level of the complaint (1=Low, 2=Medium, 3=High, 4=Critical)

Required range: 1 <= x <= 4
Example:

2

images
string<uri>[]

Images related to the complaint (evidence, before photos, etc.)

Example:
["https://example.com/complaint-image1.jpg"]
userId
string<objectid> | null

ID of the user to assign this complaint to (optional)

Example:

"507f1f77bcf86cd799439014"

customFields
object | null

Custom field values for this complaint

_id
string<objectid>

Unique identifier of the entity

number
integer

Unique number of the entity, used for identification

companyId
string<objectid>

The ID of the company this entity belongs to

status
object

Entity Status information

chatId
string<objectid> | null

ID of the chat associated with this entity

Response

Complaint created successfully

Data that can be updated for an existing complaint Base class for all entities that can have a chat associated with them. Base class for all entities in the system, providing common properties and methods.

desc
string

Updated description of the complaint

Example:

"Updated complaint description with additional details"

roomDescription
string

Updated room description

Example:

"Updated room location information"

contactName
string

Updated contact name

Example:

"John Smith Jr."

contact
object

Updated contact information

priority
integer

Updated priority level (1=Low, 2=Medium, 3=High, 4=Critical)

Required range: 1 <= x <= 4
Example:

3

images
string<uri>[]

Updated images for the complaint

userId
string<objectid> | null

ID of the user to assign/reassign this complaint to

Example:

"507f1f77bcf86cd799439014"

comment
string

Internal comment about the complaint

Example:

"Additional notes about the complaint resolution"

response
string

Customer response message

Example:

"Thank you for your patience. The issue has been resolved."

customFields
object | null

Updated custom field values

_id
string<objectid>

Unique identifier of the entity

number
integer

Unique number of the entity, used for identification

companyId
string<objectid>

The ID of the company this entity belongs to

status
object

Entity Status information

chatId
string<objectid> | null

ID of the chat associated with this entity