Workflow Create Chat Membership Actions
Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
List of valid attributes:
| Attribute | Description | Specifics |
|---|---|---|
| chat_id | ID of the chat for which a membership will be created | Optional - if not specified/null, the chat will be taken as a dynamic action input instead (i.e. it has to be provided by a preceding trigger or action) |
| role_id | ID of the role to give the user in the chat | Required |
| user_id | ID of the user for whom to create the chat membership | Optional - if not specified/null, the user will be taken as a dynamic action input instead (i.e. it has to be provided by a preceding trigger or action) |
Use Cases:
You’re most likely to use “create chat membership” workflow actions to add a
user to a chat as part of a workflow. For example, you could build a workflow
that adds every new user you create to a specific chat. To achieve that, you
would create a workflow with an event trigger for the create event and
item_type user. Next, you would add a “create chat membership” action to the
workflow that takes the user as dynamic input from the trigger (i.e. you pass no
user_id) and you would “hardcode” the chat and role (i.e. you pass the ID of
the chat they’re supposed to be added to as the chat_id, and the ID of the
role they’re supposed to have in that chat as the role_id).
In case the user is part of the chat already, this action type can also be used to give the user additional roles in the chat.
Create
Example request:
{ "data": { "id": "85579c3b-22ea-43b8-ab79-d60d05680be5", "type": "workflow_create_chat_membership_action", "attributes": { "chat_id": "6d9b9b37-c047-4bc9-a2ed-e22d1a443fe6", "role_id": "ad77f0e7-8d29-4475-a654-83bb579d666d", "user_id": null } }}Example response:
{ "data": { "id": "85579c3b-22ea-43b8-ab79-d60d05680be5", "type": "workflow_create_chat_membership_action", "attributes": { ... } }}This endpoint adds a new create chat membership action to a workflow.
HTTP Request
POST /api/v1/workflows/:workflow_id/create_chat_membership_actions
URL Parameters
| Parameter | Description |
|---|---|
| workflow_id | The ID of the workflow that the action will be added to |