# Create Organization

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /adm/v1/orgs:
    post:
      summary: Create Organization
      deprecated: false
      description: >-
        This endpoint allows you to create a new organization in ROCKIT Edge,
        along with a default role 'Administrators' and its primary administrator
        user account. By calling this endpoint ROCKITPLAY sends an invitation
        email to the specified address. By confirming the email address the
        account will be enabled.


        Authentication is required via the x-rockit-admin-token header, which
        must contain a valid administrator token for ROCKIT Edge.



        ### Generating a public/private keypair


        1. `ssh-keygen -t rsa -b 4096 -m PEM -f <customer>.rockitplay.priv.pem`

        2. `rm <customer>.rockitplay.priv.pem.pub` (optional)

        3. `openssl rsa -in <customer>.rockitplay.priv.pem -pubout -outform PEM
        -out <customer>.rockitplay.pub.pem`
      tags:
        - ROCKIT Edge - Admin API/Admin Edge Organizations
      parameters:
        - name: x-rockit-admin-token
          in: header
          description: >-
            ROCKIT Edge administrator token generated by `gen-admin-token.sh`-
            https://github.com/DACSLABS/rockitplay/blob/master/edge/gen-admin-token.sh
          required: true
          example: '{{EDGE_ADMIN_TOKEN}}'
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: >-
                    Unique and immutable identifier of the organization, which
                    is to be created. Typically the name of the organization.
                  pattern: /^[A-Za-z0-9_]{2,50}$/
                label:
                  type: string
                  description: >-
                    Human readable label for the organisation. Typically the
                    name of the organization.
                username:
                  type: string
                  description: >-
                    Unique and immutable identifier of the admin user. Typically
                    the name of the admin user.
                email:
                  type: string
                  description: Email adress of the user.
                title:
                  type: string
                  description: Title of the user. Optional parameter.
                firstname:
                  type: string
                  description: Firstname of the user.
                surname:
                  type: string
                  description: Surname of the user.
                dxorglnk:
                  type: string
                orgPrivPemB64:
                  type: string
                  description: >-
                    64 bit encoded private key. Optional parameter to create an
                    organization, but mandatory if th org need to be able to
                    start game session.
                orgPrivPW:
                  type: string
                  description: >-
                    PrivateKey Password. Optional parameter to create an
                    organization, but mandatory if th org need to be able to
                    start game session.
                gog:
                  type: boolean
                  description: >-
                    _Experimental feature:_ If enabled the GoG downloader
                    feature is available
                egs:
                  type: boolean
                  description: >-
                    _Experimental feature:_ If enabled the Epic Games Store
                    downloader feature is available
                steam:
                  type: boolean
                  description: >-
                    _Experimental feature:_ If enabled the Steam downloader
                    feature is available
              required:
                - name
                - label
                - username
                - email
                - firstname
                - surname
                - dxorglnk
              x-apidog-orders:
                - name
                - label
                - username
                - email
                - title
                - firstname
                - surname
                - dxorglnk
                - orgPrivPemB64
                - orgPrivPW
                - gog
                - egs
                - steam
              x-apidog-ignore-properties: []
            example:
              name: '{{EDGE_ORG_NAME}}'
              label: '{{EDGE_ORG_LABEL}}'
              username: '{{EDGE_ORG_ADMIN_USERNAME}}'
              email: '{{EDGE_ORG_ADMIN_EMAIL}}'
              firstname: '{{EDGE_ORG_ADMIN_FIRSTNAME}}'
              surname: '{{EDGE_ORG_ADMIN_SURNAME}}'
              dxorglnk: '{{EDGE_DXORGLNK}}'
              orgPrivPemB64: '{{EDGE_ORG_PRIV_PEM_B64}}'
              orgPrivPW: '{{EDGE_ORG_PRIV_PW}}'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Indicating that the organization was created successfully.
                  message:
                    type: string
                    description: >-
                      A confirmation message such as "organization created"
                      confirming the successful creation.
                  adminPW:
                    type: string
                    description: >-
                      Returns the initial password for the organization's
                      primary administrator user, which is necessary for the
                      login.
                required:
                  - status
                  - message
                  - adminPW
                x-apidog-orders:
                  - status
                  - message
                  - adminPW
                x-apidog-ignore-properties: []
              examples:
                '1':
                  summary: '200: success'
                  value:
                    status: success
                    message: organization created
                    adminPW: ':0-)IrG:kLDvr2'
                '2':
                  summary: '401: unauthorized'
                  value:
                    status: failed
                    error: unauthorized
                    message: invalid token
                '3':
                  summary: '400: invalid-param'
                  value:
                    status: failed
                    error: invalid-param
                    message: name invalid
                    detail: >-
                      body parameter name does not match pattern
                      "/^([A-Za-z][A-Za-z0-9]{3,19})$/"
                '4':
                  summary: '409: item-exists'
                  value:
                    status: failed
                    error: item-exists
                    message: cannot create organization
                    detail: organization with name 'edgeOrgA' exists already
          headers: {}
          x-apidog-name: '200: success'
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: >-
                      Reflects that the creation failed due to one or more
                      invalid or missing parameters in the request.
                  error:
                    type: string
                    description: Contains an error identifier.  (e.g., "invalid-param")
                  message:
                    type: string
                    description: >-
                      Explains the nature of the invalid input (for example,
                      "name invalid").
                  detail:
                    type: string
                    description: >-
                      Offers further context on the error. (e.g., expected
                      pattern for the organization name)
                required:
                  - status
                  - error
                  - message
                  - detail
                x-apidog-orders:
                  - status
                  - error
                  - message
                  - detail
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: '400: invalid-param'
        '401':
          description: ''
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    description: >-
                      Indicates that the organization creation request was
                      rejected because of authentication problems.
                  error:
                    type: string
                    description: Contains an error identifier. (e.g."unauthorized")
                  message:
                    type: string
                    description: >-
                      Provides details such as "invalid token" to help diagnose
                      the failure.
                required:
                  - status
                  - error
                  - message
                x-apidog-orders:
                  - status
                  - error
                  - message
                $ref: '#/components/schemas/unauthorized'
          headers: {}
          x-apidog-name: '401: unauthorized'
        '409':
          description: ''
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    description: >-
                      Indicates that the request failed because an organization
                      with the same identifier already exists.
                  error:
                    type: string
                    description: Contains an error identifier.  (e.g., "item exists")
                  message:
                    type: string
                    description: >-
                      States that the organization cannot be created due to a
                      conflict.
                  detail:
                    type: string
                    description: Provides additional context.
                required:
                  - status
                  - error
                  - message
                  - detail
                x-apidog-orders:
                  - status
                  - error
                  - message
                  - detail
                $ref: '#/components/schemas/Item-exists'
          headers: {}
          x-apidog-name: '409: item-exists'
      security: []
      x-apidog-folder: ROCKIT Edge - Admin API/Admin Edge Organizations
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/732774/apis/api-14082424-run
components:
  schemas:
    unauthorized:
      type: object
      properties:
        status:
          type: string
          description: >-
            Indicates that the organization creation request was rejected
            because of authentication problems.
        error:
          type: string
          description: Contains an error identifier. (e.g."unauthorized")
        message:
          type: string
          description: >-
            Provides details such as "invalid token" to help diagnose the
            failure.
      required:
        - status
        - error
        - message
      x-apidog-orders:
        - status
        - error
        - message
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    Item-exists:
      type: object
      properties:
        status:
          type: string
          description: >-
            Indicates that the request failed because an organization with the
            same identifier already exists or is protected.
        error:
          type: string
          description: Contains an error identifier.  (e.g., "item exists")
        message:
          type: string
          description: States that the organization cannot be created due to a conflict.
        detail:
          type: string
          description: Provides additional context.
      required:
        - status
        - error
        - message
        - detail
      x-apidog-orders:
        - status
        - error
        - message
        - detail
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  securitySchemes:
    Bearer token:
      type: bearer
      scheme: bearer
      description: >-
        Enter your Access Token. You can obtain this by calling the /be/v1/login
        endpoint. Use the Refresh token to get a new Access token when it
        expires.
servers:
  - url: https://Example-Server.com
    description: Default
security: []

```
