Skip to main content
PUT

Recipes

1

1. Set a name of the dialog

You can set a name field for a group or public dialog only.
2

2. Set the ID of the dialog that should be updated

To get a dialog ID, use a List Dialogs request.
3

3. As a result, the API returns a dialog with an updated name.

1

1. Append participants to the array with participants IDs

Use a push_all operator to append participants to the array with participants IDs.
2

2. Set the participants that should be added to the dialog

Set the participants IDs to an occupants_ids array to add participants to the dialog.
3

3. Set the ID of the dialog that should be updated

To get a dialog ID, use a List Dialogs request.
4

4. As a result, the API returns a dialog with new dialog participants.

1

1. Set a custom object that should be updated

Use a data parameter to refer to a custom object that should be updated. The data stores data as a set of unique keys each having an associated value parameter.See this section to learn how to create a custom object class.
2

2. Set a name of the class

Here, we refer to the CoolDialog custom object class.
3

3. Specify custom object fields and their new values

Here, we refer to custom object fields of the Cooldialog class and set new values to these fields.
4

4. Set the ID of the dialog that should be updated

To get a dialog ID, use a List Dialogs request.
5

5. As a result, the API returns a dialog with updated custom data.

1

1. Specify if you want to remove dialog participants

Use a pull_all operator to remove participants from the array with participants IDs.
2

2. Set the participants that should be removed from the dialog

Set participants IDs to an occupants_ids array to remove the participants from the dialog.
3

3. Set the ID of the dialog that should be updated

To get a dialog ID, use a List Dialogs request.
4

4. As a result, the API returns a dialog with an updated 'occupants_ids' array list.

1

1. Use 'Authorization' header to pass API key

2

2. Use 'On-Behalf-Of' header to pass user_id

To execute a request on behalf of a specific user
3

3. Set a name of the dialog

You can set a name field for a group or public dialog only.
4

4. Set the ID of the dialog that should be updated

To get a dialog ID, use a List Dialogs request.
5

5. As a result, the API returns a dialog with an updated name.

1

1. Set user_id of the dialog

2

2. Set the ID of the dialog that should be updated

3

3. As a result, the API returns a dialog with an updated user_id.

1

1. Append admins to the array with participants IDs

Use a push_all operator to append admins to the array with participants IDs.
2

2. Set the participants that should be added to the dialog

Set the participants IDs to an admin_ids array to add participants to the dialog.
3

3. Set the ID of the dialog that should be updated

To get a dialog ID, use a List Dialogs request.
4

4. As a result, the API returns a dialog with new dialog admins.

1

1. Specify if you want to remove dialog admins

Use a pull_all operator to remove admins from the array with participants IDs.
2

2. Set the admins that should be removed from the dialog

Set participants IDs to an admin_ids array to remove the participants from the dialog.
3

3. Set the ID of the dialog that should be updated

To get a dialog ID, use a List Dialogs request.
4

4. As a result, the API returns a dialog with an updated 'admin_ids' array list.

1

1. Use 'Authorization' header to pass API key

2

2. Use 'On-Behalf-Of' header to pass user_id

To execute a request on behalf of a specific user.
3

3. Append participants to the array with participants IDs

Use a push_all operator to append participants to the array with participants IDs.
4

4. Set the participants that should be added to the dialog

Set the participants IDs to an occupants_ids array to add participants to the dialog.
5

5. Set the ID of the dialog that should be updated

To get a dialog ID, use a List Dialogs request.
6

6. As a result, the API returns a dialog with new dialog participants.

1

1. Use 'Authorization' header to pass API key

2

2. Use 'On-Behalf-Of' header to pass user_id

To execute a request on behalf of a specific user.
3

3. Specify if you want to remove dialog participants

Use a pull_all operator to remove participants from the array with participants IDs.
4

4. Set the participants that should be removed from the dialog

Set participants IDs to an occupants_ids array to remove the participants from the dialog.
5

5. Set the ID of the dialog that should be updated

To get a dialog ID, use a List Dialogs request.
6

6. As a result, the API returns a dialog with an updated 'occupants_ids' array list.

1

1. Use 'Authorization' header to pass API key

2

2. Use 'On-Behalf-Of' header to pass user_id

To execute a request on behalf of a specific user.
3

3. Set a custom object that should be updated

Use a data parameter to refer to a custom object that should be updated. The data stores data as a set of unique keys each having an associated value parameter.See this section to learn how to create a custom object class.
4

4. Set a name of the class

Here, we refer to the CoolDialog custom object class.
5

5. Specify custom object fields and their new values

Here, we refer to custom object fields of the Cooldialog class and set new values to these fields.
6

6. Set the ID of the dialog that should be updated

To get a dialog ID, use a List Dialogs request.
7

7. As a result, the API returns a dialog with updated custom data.

1

1. Set is_join_required value

You can update the is_join_required field for GROUP dialogs only (type=2).Possible values:
  • 0 — join not required
  • 1 — join required
2

2. Set the ID of the dialog that should be updated

To get a dialog ID, use a List Dialogs request.
3

3. Result

The API returns the updated dialog with the modified is_join_required value.
1

1. Set user_id of the dialog

2

2. Set the ID of the dialog that should be updated

3

3. As a result, the API returns a dialog with an updated user_id.

1

1. Use 'Authorization' header to pass API key

2

2. Use 'On-Behalf-Of' header to pass user_id

To execute a request on behalf of a specific user.
3

3. Append admins to the array with participants IDs

Use a push_all operator to append admins to the array with participants IDs.
4

4. Set the admins that should be added to the dialog

Set the admins IDs to an admin_ids array to add participants to the dialog.
5

5. Set the ID of the dialog that should be updated

To get a dialog ID, use a List Dialogs request.
6

6. As a result, the API returns a dialog with new dialog admins.

1

1. Use 'Authorization' header to pass API key

2

2. Use 'On-Behalf-Of' header to pass user_id

To execute a request on behalf of a specific user.
3

3. Specify if you want to remove dialog admins

Use a pull_all operator to remove admins from the array with participants IDs.
4

4. Set the admins that should be removed from the dialog

Set admins IDs to an admin_ids array to remove the participants from the dialog.
5

5. Set the ID of the dialog that should be updated

To get a dialog ID, use a List Dialogs request.
6

6. As a result, the API returns a dialog with an updated 'admin_ids' array list.

The following rules are applied if dialog’s type=3 (PRIVATE):
  • Any user from occupants_ids can update custom parameters.
The following rules are applied if dialog’s type=2 (GROUP):
Admin Support (introduced in v2.52.0)
  • Any user from occupants_ids can add other users.
  • Any user from occupants_ids can remove only himself.
  • Any user from occupants_ids can update custom parameters.
  • Dialog’s owner (creator) and admin can remove any users from occupants_ids.
  • Only dialog’s owner (creator) can add other users to admin_ids.
  • Only dialog’s owner (creator) can remove any users from admin_ids.
  • Admins can remove themselves from admin_ids.
The following rules are applied if dialog’s type=1 (PUBLIC_GROUP):
  • Dialog’s owner (creator) and admin can update it.
  • Only dialog’s owner (creator) can add other users to admin_ids.
  • Only dialog’s owner (creator) can remove any users from admin_ids.
  • Admins can remove themselves from admin_ids.

Path Parameters

string
required
ID of the dialog to which a current message is connected. Generated automatically by the server after message creation

Body Parameters

string
Name of a dialog. The maximum length is 200 symbols.
string
Photo of the dialog.
integer
Defines whether a user must perform a join operation before sending and receiving messages via XMPP. Applies only to type=2 (GROUP).Possible values:
0 — join not required,
1 — join required.
(added in v2.34.0).
object
object
object

Headers

string
required
A user or application session token. See Authentication page to learn more about session tokens. Must be used either QB-Token or Authorization.
string
default:"ApiKey {your_api_key}"
API key from Dashboard. Expected format: ApiKey {your_api_key}. Must be used either QB-Token or Authorization.
string
User ID. The user ID of the user on whose behalf the request is being made.

Responses

A successful response
string
string
string
integer
string
integer
string
array of integers
array of integers (added in v2.52.0)
string
integer
string
integer
string
string
integer
An error response
array of strings
An error response
array of strings