> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opigno.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Accept/decline/cancel community invitation

Once the community invitation is created, the user associated with the invitee  context can accept or decline it.
Also, the community owner or users associated with the `ADMINISTRATOR` scope can cancel it,
if it is still in the pending state (was not accepted yet).
The list of operations is available under the `cta` parameter in the [`CommuntiyInvitation`](/OpignoEnterpriseAPI/Community/CreateCommunityInvitation/#community-invitation-object) object.

## Accept community invitation

Only pending community invitations can be accepted by the user associated with invitee context.
If invitation is accepted, the invitee user becomes the member of the associated community.

To accept an invitation, `acceptCommunityInvitation` mutation should be executed.
It has one required incoming argument - `invitationId`.

<CodeGroup>
  ```filename GraphQL theme={null}
    mutation acceptCommunityInvitation {
      acceptCommunityInvitation(invitationId: 1) {
        response {
          id
        }
        errors
      }
    }
  ```

  ```File Query result [expandable] theme={null}
  {
    "data": {
      "acceptCommunityInvitation": {
        "response": {
          "id": "2",
        }
        "errors": []
      }
    }
  }
  ```
</CodeGroup>

If the mutation executed successfully, a [`Community`](/OpignoEnterpriseAPI/Community/GetCommunity) object will be returned in the response.

## Decline community invitation

Pending community invitation can be declined by the user associated with the invitee context.
If the invitation is declined, the invitee user does not become the community member, and the new community invitation can be sent to the same user again.

To decline an invitation, use `declineCommuntiyInvitation` mutation. As in the previous example, this mutation accepts only one required incoming argument - `invitationId`.

<CodeGroup>
  ```filename GraphQL theme={null}
    mutation declineCommunityInvitation {
      declineCommunityInvitation(invitationId: 2) {
        response
        errors
      }
    }
  ```

  ```File Query result [expandable] theme={null}
    {
      "data": {
        "declineCommunityInvitation": {
          "response": true,
          "errors": []
        }
      }
    }
  ```
</CodeGroup>

If the mutation is executed without any errors, the boolean value will be returned in the response, indicating the execution status.
If `true` returned, mutation has been executed without any issues, and the community invitation has been declined.

## Cancel community invitation

Pending community invitations can be cancelled by the user associated with the community owner context
or the user associated with the `ASMINISTRATOR` scope.

To cancel the community invitation, use `cancelCommuntiyInvitation` mutation.
This mutation also accepts one required incoming argument - `invitationId`.

<CodeGroup>
  ```filename GraphQL theme={null}
    mutation cancelCommunityInvitation {
      cancelCommunityInvitation(invitationId: 3) {
        response
         errors
      }
    }
  ```

  ```File Query result [expandable] theme={null}
  {
    "data": {
      "cancelCommunityInvitation": {
        "response": true,
        "errors": []
      }
    }
  }
  ```
</CodeGroup>

If the mutation is executed without any errors, the boolean value will be returned in the response, indicating the execution status.
