# GraphQL API support add/remove participant member list

**URL:** <https://discuss.workflowgen.com/t/graphql-api-support-add-remove-participant-member-list/1649>\
**Category:** GraphQL\
**Created:** [June 25, 2020, 6:04am UTC](https://discuss.workflowgen.com/t/graphql-api-support-add-remove-participant-member-list/1649 "2020-06-25T06:04:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aud888](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@Aud888](https://discuss.workflowgen.com/u/Aud888)\
**Post date:** [June 25, 2020, 6:04am UTC](https://discuss.workflowgen.com/t/graphql-api-support-add-remove-participant-member-list/1649/1 "2020-06-25T06:04:22Z")

</div>

Is GraphQL support the add/removal of a member/members in participant ? ( I looked in GraphQL api documentation of workflowgen but cannot find )  
If possible, what is the GraphQL api ?

Regards,  
Audrey

---

<div class="post-metadata">

**Author:** ![lyelle](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/lyelle/32/455_2.png) [@lyelle](https://discuss.workflowgen.com/u/lyelle)\
**Post date:** [December 21, 2020, 2:36pm UTC](https://discuss.workflowgen.com/t/graphql-api-support-add-remove-participant-member-list/1649/2 "2020-12-21T14:36:46Z")

</div>

Hello Audrey,

GraphQL does support the addition and removal of participant members. These actions can be performed with a mutation.

Here is a simplified update mutation:

```auto
mutation {
  updateLocalProcessParticipant(input: {
    id: "TG9jYWxQcm9jZXNzUGFydGljaXBhbnQ6MTI=",
    userIds: ["VXNlcjox", "VXNlcjoy"],
    groupIds: ["R3JvdXA6MQ=="],
    directoryIds: ["RGlyZWN0b3J5OjE="],
    coordinatorIds: ["VXNlcjoy"]
  }) {
    localProcessParticipant {
      id
      name
    }
  }
}

```

Be careful, since `updateLocalProcessParticpant` will change all current members to the one specified in the mutation. So if there are current members that you want to keep, you need to specify them in the mutation query.

To retrieve a `localProcessParticipant` ID, you can run the following GraphQL query:

```auto
query localProcessParticipant{
  localProcessParticipant(
    name:"participantName",
    processName:"Simple_approval",
    processVersion:1
  ){
    id
  }
}

```

The documentation for the `updateLocalProcessParticipant` mutation is available [here](https://docs.advantys.com/workflowgen-integration-guide/graphql#update-a-local-process-participant).

A small explanation of the update mutation:

> userIds: [“VXNlcjox”, “VXNlcjoy”]  
> This represents the users in participant: ![image](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/df7f2ff3544abefbd89c9fc99d5c9b8c6447aa16.png)

> groupIds: [“R3JvdXA6MQ==”]  
> This represents the groups in participant: ![image](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/fd85397178a4915431fc863d6bff3170b3601ba1.png)

> directoryIds: [“RGlyZWN0b3J5OjE=”]  
> This represents the directory in participant: ![image](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/c42440335db953c6b73ad459e6a6b22e3337298d.png)

> coordinatorIds: [“VXNlcjoy”]  
> This represents the coordinator in participant: ![image](https://canada1.discourse-cdn.com/flex030/uploads/workflowgen/original/1X/e66c8151171caf44e174f26278ef8fb04493192b.png)

By using the update mutation in the documentation you will be able to add and remove members. To do this, you will need to know the ID of the user, group, directory, or coordinator you want to add. To retrieve that ID, you can make a GraphQL query.

Here is a GraphQL example to retrieve a user ID:

```auto
query user{
  user(userName:"user1") {
    id
  }
}

```

Regards,  
Lynn
