---
reference:
  curl:
    - key: accept_invitation
      id: accept_invitation
      url: /reference/authkit/invitation/accept
      title: '/user_management/invitations/:id/accept'
      type: POST
      parameters:
        - (invitation.id)
      returns:
        - (invitation)
  js:
    - key: acceptInvitation
      id: accept_invitation
      url: /reference/authkit/invitation/accept
      title: userManagement.acceptInvitation()
      parameters:
        - (Invitation.id)
      returns:
        - (Invitation)
originalPath: >-
  .tmp-workos-clone/packages/docs/content/reference/authkit/invitation/accept.mdx
---

## Accept an invitation

Accepts an invitation and, if linked to an organization, activates the user’s membership in that organization.

In most cases, use existing authentication methods like [`authenticateWithCode`](/reference/authkit/authentication/code), which also accept an invitation token. These methods offer the same functionality (invitation acceptance and membership activation) while also signing the user in.

This method is useful for apps requiring a highly customized invitation flow, as it focuses solely on handling invitations without authentication. It’s also helpful when users can be invited to multiple organizations and need a way to accept invitations after signing in.

Your application should verify that the invitation is intended for the user accepting it. For example, by fetching the invitation using the [find-by-token endpoint](/reference/authkit/invitation/find-by-token) and ensuring the email matches the email address of the accepting user.

<CodeBlock referenceId="accept_invitation">
  <CodeBlockTab title="Request" file="accept-invitation-request" />
  <CodeBlockTab title="Response" file="accept-invitation-response" />
</CodeBlock>
