openapi: 3.1.0
info:
  title: GameAnalytics Organization API
  description: >-
    REST API for managing organizations resources. Base URL:
    https://organization.gameanalytics.com.
  version: v1
  x-logo:
    url: https://docs.gameanalytics.com/img/ga-logo.png
paths:
  /api/v1/games:
    get:
      tags:
        - Games
      summary: List all games
      description: >-
        Returns all games in an organization.


        - **sort**: Property to sort games by. It should have the format
        `[property]:[order]`,

        where `[property]` is one of:
          - id
          - title
          - created_at
          - archived_at
          - dau
          - wau
          - mau

        And `[order]` is either `asc` (for sorting in ascending order) or `desc`
        (for

        descending).
      operationId: games_api_v1_games_get
      security:
        - APIKeyHeader: []
      parameters:
        - name: page[size]
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Maximum number of games to be returned.
            default: 10
            title: Page[Size]
          description: Maximum number of games to be returned.
        - name: page[offset]
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 1000000
                minimum: 1
              - type: 'null'
            description: Starting index of games to be returned.
            title: Page[Offset]
          description: Starting index of games to be returned.
        - name: sort
          in: query
          required: false
          schema:
            enum:
              - id:asc
              - id:desc
              - title:asc
              - title:desc
              - created_at:asc
              - created_at:desc
              - archived_at:asc
              - archived_at:desc
              - dau:asc
              - dau:desc
              - mau:asc
              - mau:desc
              - wau:asc
              - wau:desc
            type: string
            description: Property to sort games by.
            default: id:asc
            title: Sort
          description: Property to sort games by.
        - name: filter[studio.id]
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: Only return games from studio with the given id.
            title: Filter[Studio.Id]
          description: Only return games from studio with the given id.
        - name: filter[title]
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Only return games matching title.
            title: Filter[Title]
          description: Only return games matching title.
        - name: expand[]
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  enum:
                    - organization
                    - studio
                  type: string
              - type: 'null'
            description: >-
              Expand related object in response. Allowed values: `organization`,
              `studio`.
            title: Expand[]
          description: >-
            Expand related object in response. Allowed values: `organization`,
            `studio`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GamesResponse'
        '422':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                title: Response 422 Games Api V1 Games Get
          description: Unprocessable Entity
    post:
      tags:
        - Games
      summary: Create a game
      description: >-
        Create a game in the studio identified by `studio_id`. The studio must
        not be archived.
      operationId: create_game_api_v1_games_post
      security:
        - APIKeyHeader: []
      parameters:
        - name: expand[]
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  enum:
                    - organization
                    - studio
                  type: string
              - type: 'null'
            description: >-
              Expand related object in response. Allowed values: `organization`,
              `studio`.
            title: Expand[]
          description: >-
            Expand related object in response. Allowed values: `organization`,
            `studio`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGameRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GameResponse'
        '404':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                title: Response 404 Create Game Api V1 Games Post
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                title: Response 422 Create Game Api V1 Games Post
          description: Unprocessable Entity
  /api/v1/games/{game_id}:
    get:
      tags:
        - Games
      summary: Get single game
      description: Get game identified by `game_id`.
      operationId: game_api_v1_games__game_id__get
      security:
        - APIKeyHeader: []
      parameters:
        - name: game_id
          in: path
          required: true
          schema:
            type: integer
            title: Game Id
        - name: expand[]
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  enum:
                    - organization
                    - studio
                  type: string
              - type: 'null'
            description: >-
              Expand related object in response. Allowed values: `organization`,
              `studio`.
            title: Expand[]
          description: >-
            Expand related object in response. Allowed values: `organization`,
            `studio`.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GameResponse'
        '404':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                title: Response 404 Game Api V1 Games  Game Id  Get
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                title: Response 422 Game Api V1 Games  Game Id  Get
          description: Unprocessable Entity
  /api/v1/studios:
    get:
      tags:
        - Studios
      summary: List all studios
      description: >-
        Returns all studios in an organization.


        - **sort**: Property to sort studios by. It should have the format
        `[property]:[order]`,

        where `[property]` is one of:
          - id
          - name
          - created_at
          - archived_at

        And `[order]` is either `asc` (for sorting in ascending order) or `desc`
        (for

        descending).
      operationId: studios_api_v1_studios_get
      security:
        - APIKeyHeader: []
      parameters:
        - name: page[size]
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Maximum number of studios to be returned.
            default: 10
            title: Page[Size]
          description: Maximum number of studios to be returned.
        - name: page[offset]
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 1000000
                minimum: 1
              - type: 'null'
            description: Starting index of studios to be returned.
            title: Page[Offset]
          description: Starting index of studios to be returned.
        - name: sort
          in: query
          required: false
          schema:
            enum:
              - id:asc
              - id:desc
              - name:asc
              - name:desc
              - created_at:asc
              - created_at:desc
              - archived_at:asc
              - archived_at:desc
            type: string
            description: Property to sort studios by.
            default: id:asc
            title: Sort
          description: Property to sort studios by.
        - name: filter[name]
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Only return studios matching name.
            title: Filter[Name]
          description: Only return studios matching name.
        - name: expand[]
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  enum:
                    - organization
                  const: organization
                  type: string
              - type: 'null'
            description: 'Expand related object in response. Allowed values: `organization`.'
            title: Expand[]
          description: 'Expand related object in response. Allowed values: `organization`.'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StudiosResponse'
        '422':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                title: Response 422 Studios Api V1 Studios Get
          description: Unprocessable Entity
    post:
      tags:
        - Studios
      summary: Create a studio
      description: Create a studio with the given name.
      operationId: create_studio_api_v1_studios_post
      security:
        - APIKeyHeader: []
      parameters:
        - name: expand[]
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  enum:
                    - organization
                  const: organization
                  type: string
              - type: 'null'
            description: 'Expand related object in response. Allowed values: `organization`.'
            title: Expand[]
          description: 'Expand related object in response. Allowed values: `organization`.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateStudioRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StudioResponse'
        '422':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                title: Response 422 Create Studio Api V1 Studios Post
          description: Unprocessable Entity
  /api/v1/studios/{studio_id}:
    get:
      tags:
        - Studios
      summary: Get single studio
      operationId: studio_api_v1_studios__studio_id__get
      security:
        - APIKeyHeader: []
      parameters:
        - name: studio_id
          in: path
          required: true
          schema:
            type: integer
            title: Studio Id
        - name: expand[]
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  enum:
                    - organization
                  const: organization
                  type: string
              - type: 'null'
            description: 'Expand related object in response. Allowed values: `organization`.'
            title: Expand[]
          description: 'Expand related object in response. Allowed values: `organization`.'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StudioResponse'
        '404':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                title: Response 404 Studio Api V1 Studios  Studio Id  Get
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                title: Response 422 Studio Api V1 Studios  Studio Id  Get
          description: Unprocessable Entity
  /api/v1/users:
    get:
      tags:
        - Users
      summary: List all users
      description: >-
        Lists all users with access to the organization, either directly or
        through a studio or game

        in the organization. Also returns the users' highest level of access.


        - **sort**: Property to sort users by. It should have the format
        `[property]:[order]`,

        where `[property]` is one of:
          - id
          - full_name
          - access_level
          - last_logged_in_at

        And `[order]` is either `asc` (for sorting in ascending order) or `desc`
        (for

        descending).
      operationId: get_organization_users_api_v1_users_get
      security:
        - APIKeyHeader: []
      parameters:
        - name: page[size]
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Maximum number of users to be returned.
            default: 10
            title: Page[Size]
          description: Maximum number of users to be returned.
        - name: page[offset]
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 1000000
                minimum: 1
              - type: 'null'
            description: Starting index of users to be returned.
            title: Page[Offset]
          description: Starting index of users to be returned.
        - name: sort
          in: query
          required: false
          schema:
            enum:
              - id:asc
              - id:desc
              - full_name:asc
              - full_name:desc
              - access_level:asc
              - access_level:desc
              - last_logged_in_at:asc
              - last_logged_in_at:desc
            type: string
            description: Property to sort users by.
            default: id:asc
            title: Sort
          description: Property to sort users by.
        - name: filter_studio_id
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: Only return users with access to studio matching id.
            title: Filter Studio Id
          description: Only return users with access to studio matching id.
        - name: filter_access_resource
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - game
                  - studio
                  - organization
                type: string
              - type: 'null'
            description: Only return users whose access matches the given resource.
            title: Filter Access Resource
          description: Only return users whose access matches the given resource.
        - name: filter_access_level
          in: query
          required: false
          schema:
            anyOf:
              - enum:
                  - viewer
                  - admin
                  - owner
                  - primary owner
                type: string
              - type: 'null'
            description: Only return users whose access matches the given level.
            title: Filter Access Level
          description: Only return users whose access matches the given level.
        - name: filter_name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Only return users matching the given name.
            title: Filter Name
          description: Only return users matching the given name.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsersResponse'
        '422':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                title: Response 422 Get Organization Users Api V1 Users Get
          description: Unprocessable Entity
  /api/v1/users/{user_id}:
    get:
      tags:
        - Users
      summary: Get single user
      description: >-
        Retrieve a single user, identified by `user_id`. Also return the user's
        highest level

        of access in the organization.
      operationId: get_user_api_v1_users__user_id__get
      security:
        - APIKeyHeader: []
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: integer
            title: User Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserResponse'
        '404':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                title: Response 404 Get User Api V1 Users  User Id  Get
          description: Not Found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
  /api/v1/users/invite:
    post:
      tags:
        - Users
      summary: Invite users
      description: >-
        Invite users to a game, studio or organization. Up to 20 invites can be
        sent per request.


        For each invite, if a user is already associated with the given email,
        the invite will give

        access to the game/studio/organization to that user. If the user does
        not exist, a new user

        will be created once the invite is accepted.


        If one of the invites is to be sent to a user who already has a higher
        access

        than the one requested, a 409 Conflict response is returned.


        If an invite that gives higher access has already been sent, a 409
        Conflict response is

        returned. This behavior can be overriden by setting the `override` flag
        to `true`. This will

        send an invite regardless of already existing invites. However, the
        restriction on not allowing

        sending an invite if the user already has higher access cannot be
        overriden.
      operationId: invite_users_api_v1_users_invite_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/InviteUsersRequest'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InviteUsersResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                type: array
                title: Response 404 Invite Users Api V1 Users Invite Post
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                anyOf:
                  - items:
                      $ref: '#/components/schemas/JSONAPIErrorPayload'
                    type: array
                  - $ref: '#/components/schemas/InviteUsersResponse'
                title: Response 409 Invite Users Api V1 Users Invite Post
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                type: array
                title: Response 422 Invite Users Api V1 Users Invite Post
      security:
        - APIKeyHeader: []
  /api/v1/users/{user_id}/replace_acl:
    post:
      tags:
        - Users
      summary: Replace ACL
      description: >-
        Replace a user's accesses in an organization.


        Multiple accesses can be given at once. Note that not all access
        combinations are possible;

        for example, a user can't have both organization access and studio
        access at the same time.

        Updating a primary owner's access is also not possible. If any
        incompatible combinations

        are found, no accesses are replaced and a 409 Conflict response is
        returned.
      operationId: replace_acl_api_v1_users__user_id__replace_acl_post
      security:
        - APIKeyHeader: []
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: integer
            title: User Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateUserACLRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateUserACLResponse'
        '404':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                title: >-
                  Response 404 Replace Acl Api V1 Users  User Id  Replace Acl
                  Post
          description: Not Found
        '409':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                title: >-
                  Response 409 Replace Acl Api V1 Users  User Id  Replace Acl
                  Post
          description: Conflict
        '422':
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                title: >-
                  Response 422 Replace Acl Api V1 Users  User Id  Replace Acl
                  Post
          description: Unprocessable Entity
  /api/v1/images:
    post:
      tags:
        - Images
      summary: Upload icon
      description: Upload an icon for a game, studio or organization.
      operationId: upload_image_file_api_v1_images_post
      requestBody:
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Body_upload_image_file_api_v1_images_post'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadIconResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                type: array
                title: Response 404 Upload Image File Api V1 Images Post
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/JSONAPIErrorPayload'
                type: array
                title: Response 422 Upload Image File Api V1 Images Post
      security:
        - APIKeyHeader: []
components:
  schemas:
    ACL:
      properties:
        resource:
          oneOf:
            - $ref: '#/components/schemas/GameAccessResource'
            - $ref: '#/components/schemas/StudioAccessResource'
            - $ref: '#/components/schemas/OrganizationAccessResource'
          title: Resource
          description: Resource the ACL gives access to
          discriminator:
            propertyName: access_resource
            mapping:
              game: '#/components/schemas/GameAccessResource'
              organization: '#/components/schemas/OrganizationAccessResource'
              studio: '#/components/schemas/StudioAccessResource'
      type: object
      required:
        - resource
      title: ACL
    Body_upload_image_file_api_v1_images_post:
      properties:
        file:
          type: string
          format: binary
          title: File
        entity_type:
          type: string
          enum:
            - organization
            - studio
            - game
          title: Entity Type
        studio_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Studio Id
        game_id:
          anyOf:
            - type: integer
            - type: 'null'
          title: Game Id
      type: object
      required:
        - file
        - entity_type
      title: Body_upload_image_file_api_v1_images_post
    CreateGameRequest:
      properties:
        studio_id:
          type: integer
          title: Studio Id
          description: Id for the studio the game will be created in.
        title:
          type: string
          maxLength: 191
          title: Title
        sdk_used:
          allOf:
            - $ref: '#/components/schemas/SDKUsed'
          description: SDK used for game.
        platform:
          allOf:
            - $ref: '#/components/schemas/Platform'
          description: Platform game is developed for.
        store_platform:
          anyOf:
            - $ref: '#/components/schemas/StorePlatform'
            - type: 'null'
          description: Platform game is developed for.
        bundle_id:
          anyOf:
            - type: string
              maxLength: 255
            - type: 'null'
          title: Bundle Id
          description: >-
            The unique identifier for your game as defined in the App Store or
            Play Store.
        googleplay_key:
          anyOf:
            - type: string
              maxLength: 2048
            - type: 'null'
          title: Googleplay Key
          description: >-
            Play Store licensing key used for validating IAP with Google payment
            servers.
      type: object
      required:
        - studio_id
        - title
        - sdk_used
        - platform
      title: CreateGameRequest
    CreateStudioRequest:
      properties:
        name:
          type: string
          title: Name
          description: Studio name
      type: object
      required:
        - name
      title: CreateStudioRequest
    Game:
      properties:
        id:
          type: integer
          title: Id
          description: Game id
          examples:
            - 1
        title:
          type: string
          title: Title
          description: Game title
          examples:
            - My game
        icon_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Icon Url
          description: URL for game icon
          examples:
            - http://example.com/icon.jpg
        is_disabled:
          type: boolean
          title: Is Disabled
          description: Is the game disabled?
        is_archived:
          type: boolean
          title: Is Archived
          description: Is the game archived?
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Creation time for game
        archived_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Archived At
          description: Archival time for game, if it is archived
        platform:
          anyOf:
            - $ref: '#/components/schemas/Platform'
            - type: 'null'
          description: Platform game is developed for
        store_platform:
          anyOf:
            - $ref: '#/components/schemas/StorePlatform'
            - type: 'null'
          description: Platform game is developed for
        sdk_used:
          anyOf:
            - $ref: '#/components/schemas/SDKUsed'
            - type: 'null'
          description: SDK used for game
        bundle_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Bundle Id
          description: >-
            The unique identifier for your game as defined in the App Store or
            Play Store
        googleplay_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Googleplay Key
          description: >-
            Play Store licensing key used for validating IAP with Google payment
            servers
        key:
          type: string
          title: Key
        secret_key:
          type: string
          title: Secret Key
        studio:
          anyOf:
            - type: integer
            - $ref: '#/components/schemas/Studio'
          title: Studio
          description: Studio the game belongs to
        organization:
          anyOf:
            - type: integer
            - $ref: '#/components/schemas/Organization'
          title: Organization
          description: Organization the game belongs to
        metrics:
          $ref: '#/components/schemas/GameMetrics'
      type: object
      required:
        - id
        - title
        - is_disabled
        - is_archived
        - created_at
        - key
        - secret_key
        - studio
        - organization
        - metrics
      title: Game
    GameAccessResource:
      properties:
        access_level:
          type: string
          enum:
            - viewer
            - admin
          title: Access Level
          description: Access level in game
        access_resource:
          type: string
          enum:
            - game
          const: game
          title: Access Resource
          description: Access resource
        studio_id:
          type: integer
          title: Studio Id
          description: Studio the access is for
          examples:
            - 1
        game_id:
          type: integer
          title: Game Id
          description: Game the access is for
          examples:
            - 2
      type: object
      required:
        - access_level
        - access_resource
        - studio_id
        - game_id
      title: GameAccessResource
    GameMetrics:
      properties:
        DAU:
          anyOf:
            - type: integer
            - type: 'null'
          title: Dau
        WAU:
          anyOf:
            - type: integer
            - type: 'null'
          title: Wau
        MAU:
          anyOf:
            - type: integer
            - type: 'null'
          title: Mau
      type: object
      title: GameMetrics
    GameResponse:
      properties:
        data:
          $ref: '#/components/schemas/Game'
      type: object
      required:
        - data
      title: GameResponse
    GamesResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/Game'
          type: array
          title: Data
        meta:
          $ref: '#/components/schemas/ResponseMeta'
      type: object
      required:
        - data
        - meta
      title: GamesResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Invite:
      properties:
        email:
          type: string
          format: email
          title: Email
        resource:
          oneOf:
            - $ref: '#/components/schemas/GameAccessResource'
            - $ref: '#/components/schemas/StudioAccessResource'
            - $ref: '#/components/schemas/OrganizationAccessResource'
          title: Resource
          description: Resource the invite will give access to
          discriminator:
            propertyName: access_resource
            mapping:
              game: '#/components/schemas/GameAccessResource'
              organization: '#/components/schemas/OrganizationAccessResource'
              studio: '#/components/schemas/StudioAccessResource'
      type: object
      required:
        - email
        - resource
      title: Invite
    InviteUserResponse:
      properties:
        email:
          type: string
          format: email
          title: Email
          description: Email the invite was sent to (if request was successful).
        status:
          type: string
          enum:
            - success
            - higher_invite_exists
          title: Status
          description: >-
            Indicates whether a higher invite exists for the email. If
            `higher_invite_exists` is `true`, the invite will not be sent,
            unless the `override` flag was set to `true` in the request.
      type: object
      required:
        - email
        - status
      title: InviteUserResponse
    InviteUsersRequest:
      properties:
        override:
          type: boolean
          title: Override
          description: >-
            Ignore warnings and send invites even if invites for higher ACLs
            already exist
          default: false
        invites:
          items:
            $ref: '#/components/schemas/Invite'
          type: array
          title: Invites
          description: Invites to send
      type: object
      required:
        - invites
      title: InviteUsersRequest
    InviteUsersResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/InviteUserResponse'
          type: array
          title: Data
          description: List of invites
        meta:
          $ref: '#/components/schemas/ResponseMeta'
      type: object
      required:
        - data
        - meta
      title: InviteUsersResponse
    JSONAPIErrorPayload:
      properties:
        title:
          type: string
          title: Title
        detail:
          anyOf:
            - type: string
            - type: 'null'
          title: Detail
        loc:
          anyOf:
            - type: string
            - type: 'null'
          title: Loc
      type: object
      required:
        - title
      title: JSONAPIErrorPayload
    Organization:
      properties:
        id:
          type: integer
          title: Id
          description: Organization id
          examples:
            - 1
        name:
          type: string
          title: Name
          description: Organization name
          examples:
            - My organization
        name_identifier:
          type: string
          title: Name Identifier
          description: Unique identifier for organization
          examples:
            - my-organization-4dgh5
        icon_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Icon Url
          description: URL for organization icon
          examples:
            - http://example.com/icon.jpg
        website:
          anyOf:
            - type: string
            - type: 'null'
          title: Website
          description: Website for organization
          examples:
            - http://example.com
        targeting_platform:
          anyOf:
            - type: string
            - type: 'null'
          title: Targeting Platform
          description: Platforms the organization is developing for
          examples:
            - Desktop
      type: object
      required:
        - id
        - name
        - name_identifier
      title: Organization
    OrganizationAccessResource:
      properties:
        access_level:
          type: string
          enum:
            - viewer
            - admin
            - owner
          title: Access Level
          description: Access level in organization
        access_resource:
          type: string
          enum:
            - organization
          const: organization
          title: Access Resource
          description: Access resource
      type: object
      required:
        - access_level
        - access_resource
      title: OrganizationAccessResource
    Platform:
      type: string
      enum:
        - android
        - huawei_android
        - amazon_android
        - browser
        - ios
        - tvos
        - playstation
        - xbox
        - nintendo
        - linux
        - windows
        - meta_vr_android
        - macos
        - other
      title: Platform
    ResourceAccess:
      properties:
        resource:
          anyOf:
            - type: string
              enum:
                - game
                - studio
                - organization
            - type: 'null'
          title: Resource
        access_level:
          anyOf:
            - type: string
              enum:
                - viewer
                - admin
                - owner
                - primary owner
            - type: 'null'
          title: Access Level
      type: object
      title: ResourceAccess
    ResponseMeta:
      properties:
        total:
          type: integer
          title: Total
          description: >-
            Total number of resources to be returned. For paginated
            endpointsthis might not equal the number of items returned.
          examples:
            - 1
      type: object
      required:
        - total
      title: ResponseMeta
    SDKUsed:
      type: string
      enum:
        - unity
        - unreal
        - ios_native
        - tvos_native
        - android_native
        - javascript
        - adobe_air
        - cocos2d
        - cordova
        - soldar2d
        - construct
        - defold
        - gamemaker
        - godot
        - roblox
        - stencyl
        - xamarin
        - flutter
        - csharp
        - cpp
        - collection_api
        - other
      title: SDKUsed
    StorePlatform:
      type: string
      enum:
        - amazon_appstore
        - apple
        - apple_ios
        - apple_tv
        - apple_mac
        - google_android
        - google_play
        - google_play_tv
        - huawei_android
        - playstation
        - linux
        - windows10
        - windows_phone
        - other
      title: StorePlatform
    Studio:
      properties:
        id:
          type: integer
          title: Id
          description: Studio id
          examples:
            - 1
        name:
          type: string
          title: Name
          description: Studio name
          examples:
            - My studio
        icon_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Icon Url
          description: URL for studio icon
          examples:
            - http://example.com/icon.jpg
        organization:
          anyOf:
            - type: integer
            - $ref: '#/components/schemas/Organization'
          title: Organization
          description: Organization the studio belongs to
          examples:
            - http://example.com
        is_archived:
          type: boolean
          title: Is Archived
          description: Is the studio archived?
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Creation time for studio
        archived_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Archived At
          description: Archival time for studio, if it is archived
      type: object
      required:
        - id
        - name
        - organization
        - is_archived
        - created_at
      title: Studio
    StudioAccessResource:
      properties:
        access_level:
          type: string
          enum:
            - viewer
            - admin
          title: Access Level
          description: Access level in studio
        access_resource:
          type: string
          enum:
            - studio
          const: studio
          title: Access Resource
          description: Access resource
        studio_id:
          type: integer
          title: Studio Id
          description: Studio the access is for
          examples:
            - 1
      type: object
      required:
        - access_level
        - access_resource
        - studio_id
      title: StudioAccessResource
    StudioResponse:
      properties:
        data:
          $ref: '#/components/schemas/Studio'
      type: object
      required:
        - data
      title: StudioResponse
    StudiosResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/Studio'
          type: array
          title: Data
        meta:
          $ref: '#/components/schemas/ResponseMeta'
      type: object
      required:
        - data
        - meta
      title: StudiosResponse
    UpdateUserACLRequest:
      properties:
        acls:
          items:
            $ref: '#/components/schemas/ACL'
          type: array
          title: Acls
          description: List of ACLs to update
      type: object
      required:
        - acls
      title: UpdateUserACLRequest
    UpdateUserACLResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/ACL'
          type: array
          title: Data
          description: List of ACLs that have been updated
        meta:
          $ref: '#/components/schemas/ResponseMeta'
      type: object
      required:
        - data
        - meta
      title: UpdateUserACLResponse
    UploadIconGameResponse:
      properties:
        entity_type:
          type: string
          enum:
            - game
          const: game
          title: Entity Type
        game:
          $ref: '#/components/schemas/Game'
      type: object
      required:
        - entity_type
        - game
      title: UploadIconGameResponse
    UploadIconOrganizationResponse:
      properties:
        entity_type:
          type: string
          enum:
            - organization
          const: organization
          title: Entity Type
        organization:
          $ref: '#/components/schemas/Organization'
      type: object
      required:
        - entity_type
        - organization
      title: UploadIconOrganizationResponse
    UploadIconResponse:
      properties:
        data:
          oneOf:
            - $ref: '#/components/schemas/UploadIconGameResponse'
            - $ref: '#/components/schemas/UploadIconStudioResponse'
            - $ref: '#/components/schemas/UploadIconOrganizationResponse'
          title: Data
          description: Resource the icon is associated with
          discriminator:
            propertyName: entity_type
            mapping:
              game: '#/components/schemas/UploadIconGameResponse'
              organization: '#/components/schemas/UploadIconOrganizationResponse'
              studio: '#/components/schemas/UploadIconStudioResponse'
      type: object
      required:
        - data
      title: UploadIconResponse
    UploadIconStudioResponse:
      properties:
        entity_type:
          type: string
          enum:
            - studio
          const: studio
          title: Entity Type
        studio:
          $ref: '#/components/schemas/Studio'
      type: object
      required:
        - entity_type
        - studio
      title: UploadIconStudioResponse
    UserResponse:
      properties:
        id:
          type: integer
          title: Id
          description: User id
          examples:
            - 1
        first_name:
          type: string
          title: First Name
          description: User first name
          examples:
            - John
        last_name:
          type: string
          title: Last Name
          description: User last name
          examples:
            - Doe
        full_name:
          type: string
          title: Full Name
          description: User first name + last name
          examples:
            - John Doe
        email:
          type: string
          format: email
          title: Email
          description: User email
          examples:
            - john.doe@example.com
        last_logged_in_at:
          type: string
          format: date-time
          title: Last Logged In At
          description: User's last login date
        access:
          allOf:
            - $ref: '#/components/schemas/ResourceAccess'
          description: access the user has in the organization
      type: object
      required:
        - id
        - first_name
        - last_name
        - full_name
        - email
        - last_logged_in_at
        - access
      title: UserResponse
    UsersResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/UserResponse'
          type: array
          title: Data
        meta:
          $ref: '#/components/schemas/ResponseMeta'
      type: object
      required:
        - data
        - meta
      title: UsersResponse
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      description: API key for the organization.
      in: header
      name: x-api-key
servers:
  - url: https://organization.gameanalytics.com
