# Creating Apps

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /be/v1/apps:
    post:
      summary: Creating Apps
      deprecated: false
      description: >-
        This endpoint allows you to register a new app to the ROCKIT Edge.


        The following minimal parameter set is required:


        - `name`
            
        - `label`   


        ### Game Build Rotation


        When registering a new app the maximum number of game builds `maxBuilds`
        to be stored can be provided. It controls how many game builds
        (`maxBuilds`) and how many patches (`maxBuilds-1`) are stored. The
        default value is 5.


        When uploading the `maxBuilds+1` 'th game build the oldest one will be
        removed from the storage. A larger value may result in higher costs:


        - object storage for `maxBuilds` game builds,
            
        - object storage for `maxBuilds-1` patches, and
            
        - compute costs for generating `maxBuilds-1` patches.



        ### Required Permissions


        `apps.create`


        See [Roles](https://edge.api.cloud.rockitplay.com/roles-3618377f0.md)
        for more details.
      tags:
        - ROCKIT Edge - Backend API/Apps
      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. <br>Mutually excluded with `x-rockit-api-key`.
          required: true
          example: Bearer {{_edge_org_admin_access_token}}
          schema:
            type: string
        - name: x-rockit-tenant
          in: header
          description: >
            Unique and immutable tenancy identifier obtained from the ROCKIT
            Edge administrator. <br>Requires `x-rockit-username`,
            `x-rockit-orgname` and `x-rockit-api-key`.
          required: true
          example: '{{EDGE_TENANT_NAME}}'
          schema:
            type: string
        - name: x-rockit-orgname
          in: header
          description: >
            Unique and immutable organization identifier obtained from the
            ROCKIT Edge administrator. <br>Requires `x-rockit-tenant`,
            `x-rockit-username` and `x-rockit-api-key`.
          required: true
          example: '{{EDGE_ORG_NAME}}'
          schema:
            type: string
        - name: x-rockit-username
          in: header
          description: >
            Unique and immutable username which is associated with the apikey.
            <br>Requires `x-rockit-tenant`, `x-rockit-orgname` and
            `x-rockit-api-key`.
          required: true
          example: adminPrincipal
          schema:
            type: string
        - name: x-rockit-api-key
          in: header
          description: >-
            Unique and immutable apikey which is associated with an machine
            user. <br>Mutually excluded with `Authorization` header. Requires
            `x-rockit-tenant`, `x-rockit-username` and `x-rockit-orgname`.
          required: true
          example: '{{_adminPrincipal_apiKey}}'
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: Unique and immutable identifier of the app.
                  pattern: /^[A-Za-z0-9_]{2,50}$/
                label:
                  type: string
                  description: Human readable string of the app.
                deployments:
                  type: array
                  items:
                    type: string
                  description: Array of registered deployments.
                class:
                  type: string
                  description: >-
                    Compute class to be used for task resources. Allowed values
                    are 'low', 'medium', 'high', 'critical', 'ramdisk'. If
                    unsure, use 'medium'.
                  enum:
                    - low
                    - medium
                    - high
                    - critical
                    - ramdisk
                  x-apidog-enum:
                    - value: low
                      name: ''
                      description: ''
                    - value: medium
                      name: ''
                      description: ''
                    - value: high
                      name: ''
                      description: ''
                    - value: critical
                      name: ''
                      description: ''
                    - value: ramdisk
                      name: ''
                      description: ''
                maxBuilds:
                  type: integer
                  description: >-
                    Default: 5

                    Maximum number of game builds to be kept on storage. This
                    value determines how many patches are computed.
                  minimum: 2
                  default: 5
                  maximum: 10
                gog:
                  type: object
                  properties:
                    gameId:
                      type: string
                    sourceName:
                      type: string
                  x-apidog-orders:
                    - gameId
                    - sourceName
                  required:
                    - gameId
                    - sourceName
                  x-apidog-ignore-properties: []
                egs:
                  type: object
                  properties:
                    gameId:
                      type: string
                    sourceName:
                      type: string
                  x-apidog-orders:
                    - gameId
                    - sourceName
                  required:
                    - gameId
                    - sourceName
                  x-apidog-ignore-properties: []
                steam:
                  type: object
                  properties:
                    gameId:
                      type: string
                    sourceName:
                      type: string
                  x-apidog-orders:
                    - gameId
                    - sourceName
                  required:
                    - gameId
                    - sourceName
                  x-apidog-ignore-properties: []
                minCoverage:
                  type: number
                  description: Coverage required to initiate DxF creation.
                  default: 0.3
                  minimum: 0.01
                  maximum: 1
                maxCoverage:
                  type: number
                  description: Coverage required to disable trace collection.
                  default: 1
                  minimum: 0.01
                  maximum: 1
                minTraceTimeSec:
                  type: number
                  description: Minimal time covered by Traces to enable DxF creation.
                  default: 600
                  minimum: 300
                nProcessTracesMin:
                  type: integer
                  description: >-
                    Number of Traces required to trigger the creation of a new
                    dxf image. This parameter is deprecate. Please use
                    `sessionQueueSize` now.
                  default: 30
                  minimum: 1
                  maximum: 1000
                  deprecated: true
                nTracesReliable:
                  type: number
                  description: >-
                    Number of Traces required to consider data from statistics
                    reliable. This parameter is deprecate. Please use
                    `minTraces` now.
                  default: 30
                  minimum: 1
                  deprecated: true
                sessionQueueSize:
                  type: integer
                  minimum: 1
                  maximum: 1000
                  default: 30
                  description: >-
                    Number of Traces required to consider data from statistics
                    reliable.
                minTraces:
                  type: integer
                  description: >-
                    Number of Traces required to trigger the creation of a new
                    dxf image.
                  minimum: 1
                  maximum: 1000
                  default: 30
                uploadTraces:
                  type: boolean
                artworks:
                  type: object
                  properties:
                    icon:
                      type: string
                      description: Path to app image
                  x-apidog-orders:
                    - icon
                  description: App artworks
                  x-apidog-ignore-properties: []
              x-apidog-orders:
                - name
                - label
                - deployments
                - class
                - maxBuilds
                - gog
                - egs
                - steam
                - minCoverage
                - maxCoverage
                - minTraceTimeSec
                - nProcessTracesMin
                - nTracesReliable
                - sessionQueueSize
                - minTraces
                - uploadTraces
                - artworks
              required:
                - name
                - label
              x-apidog-ignore-properties: []
            example:
              name: '{{appName}}'
              label: '{{appLabel}}'
              maxBuilds: 3
              class: medium
              deployments:
                - Deployment1
                - Deployment2
              nTracesReliable: 30
              minCoverage: 0.2
              maxCoverage: 0.6
              minTraceTimeSec: 1800
              nProcessTracesMin: 30
              uploadTrace: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    description: Indicates that the app creation operation was successful.
                  message:
                    type: string
                    description: >-
                      A confirmation message (e.g., "app created") confirming
                      that the new app has been registered.
                required:
                  - status
                  - message
                x-apidog-orders:
                  - status
                  - message
                x-apidog-ignore-properties: []
              examples:
                '1':
                  summary: '200: success'
                  value:
                    status: success
                    message: app created
                '2':
                  summary: '400: missing-param'
                  value:
                    status: failed
                    error: missing-param
                    message: x-rockit-beauth-token missing
                    detail: header parameter x-rockit-beauth-token is required
                '3':
                  summary: '401: token-expired'
                  value:
                    status: failed
                    error: token-expired
                    message: expired token
                '4':
                  summary: '409: item-exists'
                  value:
                    status: failed
                    error: item-exists
                    message: cannot create app
                    detail: app with name 'sushi' 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)
                x-apidog-orders:
                  - 01JQNHCK7PQHGVBC9MTBHYNN1B
                required:
                  - status
                  - error
                  - message
                  - detail
                x-apidog-refs:
                  01JQNHCK7PQHGVBC9MTBHYNN1B:
                    $ref: '#/components/schemas/Invalid%20Param'
                x-apidog-ignore-properties:
                  - status
                  - error
                  - message
                  - detail
          headers: {}
          x-apidog-name: '400: missing-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:
                  - 01JQNHCZ8E3JRQ2PAD8MFXTDRV
                required:
                  - status
                  - error
                  - message
                x-apidog-refs:
                  01JQNHCZ8E3JRQ2PAD8MFXTDRV:
                    $ref: '#/components/schemas/unauthorized'
                x-apidog-ignore-properties:
                  - status
                  - error
                  - message
          headers: {}
          x-apidog-name: '401: token-expired'
        '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:
                  - 01JQNHDC3R8Z6A1EJ3FHHCQGJZ
                required:
                  - status
                  - error
                  - message
                  - detail
                x-apidog-refs:
                  01JQNHDC3R8Z6A1EJ3FHHCQGJZ:
                    $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/Apps
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/732774/apis/api-11634354-run
components:
  schemas:
    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: ''
    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: []

```
