openapi: 3.0.3 info: title: Agents cube 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: Cube API Production URL tags: - name: cube paths: /cube: get: operationId: cube_list description: 'This is a shortcut class that will include all 6 resourceful actions part of the DRF ViewSets: - list() - retrieve() - create() - update() - partial_update() - destroy() If you do not want to expose all 6 of these in your ViewSet, then use the CubeAuthenticatedViewSet and add the appropriate mixins to it (see rest_framework.mixins). This will allow the api to behave appropriately and block requests to unprocessable endpoints. Furthermore, it will make the drf_spectacular documentation be generated more easily.' tags: - cube security: - OAuth2: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/CubeDataRequest' description: '' post: operationId: cube_create description: 'This is a shortcut class that will include all 6 resourceful actions part of the DRF ViewSets: - list() - retrieve() - create() - update() - partial_update() - destroy() If you do not want to expose all 6 of these in your ViewSet, then use the CubeAuthenticatedViewSet and add the appropriate mixins to it (see rest_framework.mixins). This will allow the api to behave appropriately and block requests to unprocessable endpoints. Furthermore, it will make the drf_spectacular documentation be generated more easily.' tags: - cube requestBody: content: application/json: schema: $ref: '#/components/schemas/CubeDataRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/CubeDataRequest' multipart/form-data: schema: $ref: '#/components/schemas/CubeDataRequest' required: true security: - OAuth2: [] responses: '201': content: application/json: schema: $ref: '#/components/schemas/CubeDataRequest' description: '' /cube/{id}: get: operationId: cube_retrieve description: 'This is a shortcut class that will include all 6 resourceful actions part of the DRF ViewSets: - list() - retrieve() - create() - update() - partial_update() - destroy() If you do not want to expose all 6 of these in your ViewSet, then use the CubeAuthenticatedViewSet and add the appropriate mixins to it (see rest_framework.mixins). This will allow the api to behave appropriately and block requests to unprocessable endpoints. Furthermore, it will make the drf_spectacular documentation be generated more easily.' parameters: - in: path name: id schema: type: string format: uuid description: A UUID string identifying this cube value. required: true tags: - cube security: - OAuth2: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/CubeDataRequest' description: '' put: operationId: cube_update description: 'This is a shortcut class that will include all 6 resourceful actions part of the DRF ViewSets: - list() - retrieve() - create() - update() - partial_update() - destroy() If you do not want to expose all 6 of these in your ViewSet, then use the CubeAuthenticatedViewSet and add the appropriate mixins to it (see rest_framework.mixins). This will allow the api to behave appropriately and block requests to unprocessable endpoints. Furthermore, it will make the drf_spectacular documentation be generated more easily.' parameters: - in: path name: id schema: type: string format: uuid description: A UUID string identifying this cube value. required: true tags: - cube requestBody: content: application/json: schema: $ref: '#/components/schemas/CubeDataRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/CubeDataRequest' multipart/form-data: schema: $ref: '#/components/schemas/CubeDataRequest' required: true security: - OAuth2: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/CubeDataRequest' description: '' patch: operationId: cube_partial_update description: 'This is a shortcut class that will include all 6 resourceful actions part of the DRF ViewSets: - list() - retrieve() - create() - update() - partial_update() - destroy() If you do not want to expose all 6 of these in your ViewSet, then use the CubeAuthenticatedViewSet and add the appropriate mixins to it (see rest_framework.mixins). This will allow the api to behave appropriately and block requests to unprocessable endpoints. Furthermore, it will make the drf_spectacular documentation be generated more easily.' parameters: - in: path name: id schema: type: string format: uuid description: A UUID string identifying this cube value. required: true tags: - cube requestBody: content: application/json: schema: $ref: '#/components/schemas/PatchedCubeDataRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/PatchedCubeDataRequest' multipart/form-data: schema: $ref: '#/components/schemas/PatchedCubeDataRequest' security: - OAuth2: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/CubeDataRequest' description: '' delete: operationId: cube_destroy description: 'This is a shortcut class that will include all 6 resourceful actions part of the DRF ViewSets: - list() - retrieve() - create() - update() - partial_update() - destroy() If you do not want to expose all 6 of these in your ViewSet, then use the CubeAuthenticatedViewSet and add the appropriate mixins to it (see rest_framework.mixins). This will allow the api to behave appropriately and block requests to unprocessable endpoints. Furthermore, it will make the drf_spectacular documentation be generated more easily.' parameters: - in: path name: id schema: type: string format: uuid description: A UUID string identifying this cube value. required: true tags: - cube security: - OAuth2: [] responses: '204': description: No response body components: schemas: Matrix: type: object properties: attribute_columns: type: array items: type: integer minimum: 0 attribute_row: type: integer minimum: 0 filters: type: object additionalProperties: type: string data: type: array items: type: array items: nullable: true required: - data - filters Currency: type: object description: "Allows selectively disabling DRF uniqueness validation for ModelSerializers.\n\nModelSerializer runs unique field validation during `is_valid()`, even when the\nserializer is used only to deserialize or reference existing model data (i.e. with\nno intent to create or update an instance). This mixin enables callers to explicitly\nskip uniqueness checks for specific fields in those cases.\n\nUsage:\n serializer = MySerializer(\n data=payload,\n skip_unique_validation_fields=('code',),\n )" properties: code: type: string maxLength: 10 required: - code CubeDataRequest: type: object description: Mixin to delegate create and update operations to a service class. properties: matrix: $ref: '#/components/schemas/Matrix' message: type: string metadata: type: object additionalProperties: {} default: {} currency: $ref: '#/components/schemas/Currency' background: type: boolean default: false addon: type: string readOnly: true required: - addon - matrix PatchedCubeDataRequest: type: object description: Mixin to delegate create and update operations to a service class. properties: matrix: $ref: '#/components/schemas/Matrix' message: type: string metadata: type: object additionalProperties: {} default: {} currency: $ref: '#/components/schemas/Currency' background: type: boolean default: false addon: type: string readOnly: true 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