> ## 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.

# Create user invitation

In Opigno Enterprise invitations used to define a user's social network.
It's possible to create only one invitation between two users.

To create an invitation, `createUserInvitation` mutation should be called.
It has one required incoming parameter - `inviteeUserContextUuid` which represents the UUID of the user context that is associated with the invitee user.

<Note>
  The current user context from the request will be used as an invitation initiator.
</Note>

<CodeGroup>
  ```filename GraphQL theme={null}
    mutation createUserInvitation {
      createUserInvitation(inviteeUserContextUuid: "a1b2c3d4-e5f6-7890-abcd-ef1234567890") {
        response {
          id
          initiatorUserContext {
            id
            uuid
          }
          inviteeUserContext {
            id
            uuid
          }
          isAccepted
          created
          status
          cta {
            title
            actionId
            arguments {
              key
              value
            }
            metadata {
              key
              value
            }
          }
        }
        errors
      }
    }
  ```

  ```File Query result [expandable] theme={null}
  {
    "data": {
      "createUserInvitation": {
        "response": {
          "id": "59",
          "initiatorUserContext": {
            "id": "915",
            "uuid": "5acfc440-88e0-4286-b089-c0f03575ed9w"
          },
          "inviteeUserContext": {
            "id": "1818",
            "uuid": "1ccbe3f4-87be-472a-89b2-3875b5bdf121"
          },
          "isAccepted": false,
          "created": 1751626780,
          "status": "ACTIVE",
          "cta": [
            {
              "title": "Cancel",
              "actionId": "CANCEL_USER_INVITATION",
              "arguments": [
                {
                  "key": "invitationId",
                  "value": "59"
                }
              ],
              "metadata": [
                {
                  "key": "type",
                  "value": "button"
                }
              ]
            }
          ]
        },
        "errors": []
      }
    }
  }
  ```
</CodeGroup>

If the mutation executed successfully, a `UserInvitation` object will be returned in the response.
