Create Chat
Creates a new chat, or optionally opens an existing one.
Creates a new chat, or optionally opens an existing one.
Authorization
auth-token
All the DevRev APIs require a token to authenticate the user. Provide Authorization: Bearer <TOKEN> as a header to every API request.
How do I find my token?
In: header
Request Body
application/json
Application-defined custom fields.
Custom schemas described using identifiers. Each custom field in the request must have the corresponding schema specified; omission results in a Bad Request error. If a custom schema is not included in the specifier, it remains unchanged. For surfaces with human interactors, it is recommended to provide tenant_fragment: true and validate_required_fields: true.
If true and a chat already exists with unique properties that conflict with the chat creation, then the existing chat is returned without error, otherwise if false, a conflict error is returned.
The title for the chat.
textWhether this is the default DM for messaging the constituent users. If true, then this DM is always returned when opening a DM for the users. Note only one DM may be the default for a given set of users. By Default, this is true.
The associated records for this DM.
items <= 16The users to send direct messages to. The authenticated user must be included in this list.
1 <= items <= 16Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api.devrev.ai/chats.create" \ -H "Content-Type: application/json" \ -d '{ "type": "string", "users": [ "DEVU-12345" ] }'{
"chat": {
"type": "string"
}
}{
"detail": "string",
"message": "string",
"type": "artifact_already_attached_to_a_parent",
"existing_parent": "string",
"is_same": true
}{
"detail": "string",
"message": "string",
"type": "unauthenticated"
}{
"detail": "string",
"message": "string",
"type": "forbidden"
}{
"detail": "string",
"message": "string",
"type": "too_many_requests",
"retry_after": 0
}{
"detail": "string",
"message": "string",
"type": "internal_error",
"reference_id": "string"
}{
"detail": "string",
"message": "string",
"type": "service_unavailable"
}