---
title: "Completes the invite by creating user/service and invalidating the invite code"
method: POST
path: "/v1/api/invites/{code}/complete"
tags: ["Invites"]
---

# Completes the invite by creating user/service and invalidating the invite code

`POST /v1/api/invites/{code}/complete`

In the case of a user invite, this resource will assign the new service to the existing user and disables the invite. <br>In the case of a service invite, this resource will create a new service, assign gateway account ids (if provided) and also creates a new user and assign to the service<br>The response contains the user and the service id's affected as part of the invite completion in addition to the invite

## Path parameters

- `code` string, required

## Response `200`

OK

- CompleteInviteResponse
  - `invite` Invite
    - `_links` Link[]
      - `href` string
      - `method` string
      - `rel` string
    - `attempt_counter` integer
    - `disabled` boolean
    - `email` string
    - `expired` boolean
    - `inviteLink` string
    - `password_set` boolean
    - `role` string
    - `telephone_number` string
    - `type` string
    - `user_exist` boolean
  - `service_external_id` string
  - `user_external_id` string

## Other responses

- `404` — Not found

## Changes

- **2022-11-21** `e138c649db69` — 1 warning
  - removed the optional property `invite/otp_key` from the response with the `200` status
- **2022-11-21** `c07ac6503216` — 1 info
  - added the optional property `invite/otp_key` to the response with the `200` status
- **2022-11-17** `a80785172230` — 1 warning
  - removed the optional property `invite/otp_key` from the response with the `200` status
- **2022-11-17** `1b5fc1d6d048` — 1 info
  - added the optional property `invite/otp_key` to the response with the `200` status
- **2022-11-14** `5861842b8167` — 2 breaking, 2 info
  - removed the enum value `app` of the request property `second_factor`
  - removed the enum value `sms` of the request property `second_factor`
  - added the new `APP` enum value to the request property `second_factor`
  - added the new `SMS` enum value to the request property `second_factor`

[Full history](https://skmtc.dev/government-digital-service/apis/adminusers-api/changes/v1/api/invites/:code/complete/post.md)

---

[API](https://skmtc.dev/government-digital-service/apis/adminusers-api.md) · [All operations](https://skmtc.dev/government-digital-service/apis/adminusers-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/government-digital-service/adminusers-api/revisions/e138c649db69/schema)
