Cube Tags API

Alternative hierarchies & grouping of dimensions in Cube

OpenAPI Specification

cubesoftware-tags-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Cube Agents Tags API
  version: 1.0.0 (1.0)
  description: "#### General Description\nAn API to access underlying Cube functionality. These endpoints are the same endpoints\nthat support Cube's universal add-ons and a plethora of integrations meaning you'll be able to interact with your\nCube data in many powerful ways. Visit the API section of Cube's [Help Center](https://help.cubesoftware.com/hc/en-us/sections/18205290556180-Custom-Integrations)\nfor more usage guides on how you can use this API to integrate with Cube to accomplish various tasks!\n\n#### Versioning\nAll requests to the API require a version to be configured via an `Accept` Header. The value of this Header should look like this:\n```\nAccept: application/json; version=1.0\n```\nNote that the version number may differ depending on which version of the endpoint is needed.\n\n#### Response Structure\nThe general response structure of Cube's API endpoints will contain a `\"data\"` and `\"metadata\"` root level key:\n```json\n{\n    \"data\": { ... object data or list of objects ... },\n    \"metadata\": {\n        \"status\": 200,\n        \"message\": \"Potential message with additional context\",\n        \"error\": false,\n        \"code\": \"\"\n    }\n}\n```\n\n#### Rate Limiting\nAll endpoints have a rate limit configured, most of them default to 5/s.\nWhen the rate limit is encountered, a 429 HTTP code will be returned.\n\n#### Error Handling\nIn the event an error occurs, the response will typically look like this:\n```json\n{\n    \"data\": {},\n    \"metadata\": {\n        \"status\": 400,\n        \"message\": \"Some error message\",\n        \"error\": true,\n        \"code\": \"SOME_ERROR_CODE\"\n    }\n}\n```\n"
  termsOfService: https://www.cubesoftware.com/terms-of-service
servers:
- url: https://api.cubesoftware.com
  description: Production API URL
tags:
- name: Tags
  description: Alternative hierarchies & grouping of dimensions in Cube
paths:
  /tags:
    get:
      operationId: TagList
      description: "This endpoint retrieves detailed information for all tags that the authenticated\n        user has access to for this company."
      summary: Get All Tags
      parameters:
      - in: header
        name: X-Company-ID
        schema:
          type: string
        description: Associates request with company
        required: true
      tags:
      - Tags
      security:
      - OAuth2: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TagsResponse'
          description: ''
    post:
      operationId: TagCreate
      description: "This endpoint creates a new tag with (optional) member dimensions.\n        Once a tag has been created, you cannot change the tag's top-level dimension."
      summary: Create a New Tag
      parameters:
      - in: header
        name: X-Company-ID
        schema:
          type: string
        description: Associates request with company
        required: true
      tags:
      - Tags
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagCreateRequest'
            examples:
              TagRequest:
                value:
                  name: My New Tag
                  member_ids:
                  - 11
                  - 16
                  top_level_dimension_name: Account
                summary: Tag Request
                description: "| **Parameter** | **Type** | **Description** |\n|---|---|--|\n| name | string | The name of the tag |\n| member_ids | list[int] | A list of integers indicating dimension IDs |\n| top_level_dimension_name | string | The top-level dimension of this tag. Optional if member_ids is specified. |\n        "
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TagCreateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TagCreateRequest'
        required: true
      security:
      - OAuth2: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TagCreateResponse'
          description: ''
  /tags/{tag_id}:
    get:
      operationId: TagRetrieve
      description: This endpoint retrieves detailed information for a tag.
      summary: Get a Specific Tag
      parameters:
      - in: header
        name: X-Company-ID
        schema:
          type: string
        description: Associates request with company
        required: true
      - in: path
        name: tag_id
        schema:
          type: integer
        description: ID of the tag to recalculate.
        required: true
        examples:
          SampleValue:
            value: 3236
            summary: Sample value
      tags:
      - Tags
      security:
      - OAuth2: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TagResponse'
          description: ''
    post:
      operationId: TagUpdate
      description: This endpoint updates detailed information for a tag.
      summary: Update a Specific Tag
      parameters:
      - in: header
        name: X-Company-ID
        schema:
          type: string
        description: Associates request with company
        required: true
      - in: path
        name: tag_id
        schema:
          type: integer
        description: ID of the tag to recalculate.
        required: true
        examples:
          SampleValue:
            value: 3236
            summary: Sample value
      tags:
      - Tags
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagUpdateRequest'
            examples:
              TagRequest:
                value:
                  name: My Updated Tag
                  member_ids:
                  - 22
                  - 28
                summary: Tag Request
                description: "| **Parameter** | **Type** | **Description** |\n|---|---|--|\n| name | string | The name of the tag |\n| member_ids | list[int] | A list of integers indicating dimension IDs |\n        "
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/TagUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/TagUpdateRequest'
        required: true
      security:
      - OAuth2: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TagUpdateResponse'
          description: ''
  /tags/{tag_id}/recalculate:
    post:
      operationId: tags_recalculate_create
      description: This endpoint recalculates a requested tag and updates its formulas.
      summary: Recalculate a Specific Tag
      parameters:
      - in: header
        name: X-Company-ID
        schema:
          type: string
        description: Associates request with company
        required: true
      - in: path
        name: tag_id
        schema:
          type: integer
        description: ID of the tag to recalculate.
        required: true
        examples:
          SampleValue:
            value: 3236
            summary: Sample value
      tags:
      - Tags
      security:
      - OAuth2: []
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TagRecalculateResponse'
          description: ''
components:
  schemas:
    TagCreateRequest:
      type: object
      properties:
        name:
          type: string
        member_ids:
          type: array
          items:
            type: integer
        top_level_dimension_name:
          type: string
      required:
      - member_ids
      - name
      - top_level_dimension_name
    TagResponse:
      type: object
      properties:
        id:
          type: integer
        is_recalculating:
          type: boolean
        name:
          type: string
        members:
          type: array
          items:
            type: object
            additionalProperties: {}
        top_level_dimension_name:
          type: string
      required:
      - id
      - is_recalculating
      - members
      - name
      - top_level_dimension_name
    TagCreateResponse:
      type: object
      properties:
        id:
          type: integer
        is_recalculating:
          type: boolean
        members:
          type: array
          items:
            type: object
            additionalProperties: {}
        name:
          type: string
        top_level_dimension_name:
          type: string
      required:
      - id
      - is_recalculating
      - members
      - name
      - top_level_dimension_name
    TagRecalculateResponse:
      type: object
      properties:
        message:
          type: string
      required:
      - message
    TagsResponse:
      type: object
      properties:
        id:
          type: integer
        is_recalculating:
          type: boolean
        name:
          type: string
        members:
          type: array
          items:
            type: object
            additionalProperties: {}
        top_level_dimension_name:
          type: string
      required:
      - id
      - is_recalculating
      - members
      - name
      - top_level_dimension_name
    TagUpdateResponse:
      type: object
      properties:
        id:
          type: integer
        is_recalculating:
          type: boolean
        members:
          type: array
          items:
            type: object
            additionalProperties: {}
        name:
          type: string
        top_level_dimension_name:
          type: string
      required:
      - id
      - is_recalculating
      - members
      - name
      - top_level_dimension_name
    TagUpdateRequest:
      type: object
      properties:
        name:
          type: string
        member_ids:
          type: array
          items:
            type: integer
      required:
      - member_ids
      - name
  securitySchemes:
    OAuth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://portal.cubesoftware.com/o/authorize/
          tokenUrl: https://api.cubesoftware.com/o/token/
          scopes: {}
      description: Standard Cube OAuth 2.0 flow