# Create Organization

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /be/v1/orgs:
    post:
      summary: Create Organization
      deprecated: false
      description: >-
        This endpoint enables the creation of a new organization in the ROCKIT
        Backend Edge, including a default 'Administrators' role and an
        associated primary administrator user. Upon successful creation, the
        response includes the initial password for the administrator user. 


        Authentication is required via the Authorization header, which must
        contain a valid Bearer access token for the ROCKIT Backend 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 - Backend API/Backend Edge Organizations
      parameters:
        - name: Authorization
          in: header
          description: >-
            Use the access token obtained from [`POST
            /be/v1/login`](https://edge.api.cloud.rockitplay.com/user-login-org-11611254e0.md)
            or [`POST
            /be/v1/refresh`](https://edge.api.cloud.rockitplay.com/refresh-11630082e0.md)
            as Bearer token.
          required: true
          example: Bearer {{_edge_org_admin_access_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.
              required:
                - name
                - label
                - username
                - email
                - firstname
                - surname
                - dxorglnk
              x-apidog-orders:
                - name
                - label
                - username
                - email
                - title
                - firstname
                - surname
                - dxorglnk
                - orgPrivPemB64
                - orgPrivPW
              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: []
          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)
                x-apidog-orders:
                  - 01JQMASM9Y1EJHD07NXC8SV03D
                required:
                  - status
                  - error
                  - message
                  - detail
                x-apidog-refs:
                  01JQMASM9Y1EJHD07NXC8SV03D:
                    $ref: '#/components/schemas/Invalid%20Param'
                x-apidog-ignore-properties:
                  - status
                  - error
                  - message
                  - detail
          headers: {}
          x-apidog-name: '400: invalid-param'
        '401':
          description: ''
          content:
            application/json:
              schema:
                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.
                x-apidog-orders:
                  - 01JQMARV27VWDXYF9XAKQQ5TW7
                required:
                  - status
                  - error
                  - message
                x-apidog-refs:
                  01JQMARV27VWDXYF9XAKQQ5TW7:
                    $ref: '#/components/schemas/unauthorized'
                x-apidog-ignore-properties:
                  - status
                  - error
                  - message
          headers: {}
          x-apidog-name: '401: unauthorized'
        '409':
          description: ''
          content:
            application/json:
              schema:
                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.
                x-apidog-orders:
                  - 01JQMAT9H5KMM1KFMEJWCCNCZW
                required:
                  - status
                  - error
                  - message
                  - detail
                x-apidog-refs:
                  01JQMAT9H5KMM1KFMEJWCCNCZW:
                    $ref: '#/components/schemas/Item-exists'
                x-apidog-ignore-properties:
                  - status
                  - error
                  - message
                  - detail
          headers: {}
          x-apidog-name: '409: item-exists'
      security: []
      x-apidog-folder: ROCKIT Edge - Backend API/Backend Edge Organizations
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/732774/apis/api-11591049-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: ''
    Invalid Param:
      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: []
      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: []

```
