---
title: "POST /mr-api/initialize"
method: POST
path: "/mr-api/initialize"
tags: ["SetupService"]
---

# POST /mr-api/initialize

`POST /mr-api/initialize`

Setup site admin

## Request body

- SetupSiteAdmin
  - `portfolio` string, required
  - `organizationName` string, required
  - `emailAddress` string, email — User's email or blank if using oauth/saml
  - `password` string — User's password or blank if using oauth/saml
  - `name` string — user's name. Will be take from external provider if using oauth/saml
  - `authProvider` string — If the site is using external providers, this is the key of the provider chosen. If there is only one, it can be blank.

## Response `200`

Successfully setup site admin

- TokenizedPerson
  - `accessToken` string
  - `refreshToken` string
  - `redirectUrl` string
  - `person` Person
    - `id` PersonId
      - `id` string, uuid, required
    - `name` string
    - `email` string, email
    - `personType` 'person' | 'serviceAccount' | 'sdkServiceAccount'
    - `other` string
    - `source` string
    - `version` integer
    - `passwordRequiresReset` boolean
    - `groups` Group[]
      - `createdBy` Person — recursive
      - `updatedBy` Person — recursive
      - `whenCreated` string, date-time
      - `whenUpdated` string, date-time
      - `id` string, uuid
      - `admin` boolean — is this an admin group?
      - `portfolioId` string, uuid
      - `organizationId` string, uuid — this will be the organisation this group belongs to at the top level, or if a portfolio group, the organisation of the portfolio
      - `version` integer
      - `name` string, required
      - `members` Person[]
      - `applicationRoles` ApplicationGroupRole[]
        - `applicationId` string, uuid, required
        - `groupId` string, uuid, required
        - `roles` ApplicationRoleType[], required
      - `environmentRoles` EnvironmentGroupRole[]
        - `environmentId` string, uuid, required
        - `groupId` string, uuid, required
        - `roles` RoleType[], required
      - `whenArchived` string, date-time
    - `whenArchived` string, date-time
    - `whenLastAuthenticated` string, date-time — This is the timestamp in UTC when they last logged into the system
    - `whenLastSeen` string, date-time — This is the timestamp in UTC when they last made a request to the system on their most recent login. If it is null it means they have no current token or have never logged in.
    - `additional` PersonInfo[]
      - `key` string, required — e.g. serviceAccountId
      - `value` string, required

## Other responses

- `400` — Bad Request
- `401` — no permission
- `409` — duplicate

---

[API](https://skmtc.net/featurehub-io/apis/managementresourceapi.md) · [All operations](https://skmtc.net/featurehub-io/apis/managementresourceapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/featurehub-io/managementresourceapi/versions/faed5fd616c3/schema)
