openapi: 3.2.0 info: version: v2.222.1 title: Corva App Purchases API description: 'The Corva API is a powerful interface providing great flexibility and extensibility with Corva. Whether your needs are simple UI visualizations, data entry, replication/sync tasks, real-time stream processing, or complex machine learning CPU-intensive apps, the Corva API is the way to make it happen. Our concepts are split into three distinct silos: data apps, visualization apps, and a REST API' termsOfService: https://www.corva.ai/terms-and-conditions/ contact: name: Corva API Team email: support@corva.ai security: - api_key: [] tags: - name: AppPurchases paths: /v2/app_purchases: get: summary: List of app purchases tags: - AppPurchases responses: '401': description: Authentication error content: application/json: schema: $ref: '#/components/schemas/AuthenticationError' '403': description: Authorization error content: application/json: schema: $ref: '#/components/schemas/AuthorizationError' '404': description: Not found error content: application/json: schema: $ref: '#/components/schemas/NotFoundError' '200': type: object description: Successful response with all required relationships content: application/json: schema: $ref: '#/components/schemas/AppPurchaseList' parameters: - in: query name: status description: 'Filter app purchases by status. Valid statuses: pending, approved, denied' schema: type: string - in: query name: search description: Search app purchases by app name schema: type: string - in: query name: app_id description: Filter app purchases by app_id schema: type: integer - in: query name: purchased description: Filter app purchases if they are purchased or provided schema: type: boolean - in: query name: page description: Number of page schema: type: integer - in: query name: per_page description: Number of items to list per page schema: type: integer operationId: getV2AppPurchases x-operation-id-source: derived post: summary: Create a App Purchase tags: - AppPurchases responses: '401': description: Authentication error content: application/json: schema: $ref: '#/components/schemas/AuthenticationError' '403': description: Authorization error content: application/json: schema: $ref: '#/components/schemas/AuthorizationError' '404': description: Not found error content: application/json: schema: $ref: '#/components/schemas/NotFoundError' '200': description: Created App Purchase Payload without apps/assets relationships content: application/json: schema: $ref: '#/components/schemas/AppPurchase' requestBody: content: application/json: schema: $ref: '#/components/schemas/AppPurchasePayload' description: App Purchase Payload required: true operationId: postV2AppPurchases x-operation-id-source: derived /v2/app_purchases/{id}: get: summary: Show app purchase tags: - AppPurchases responses: '401': description: Authentication error content: application/json: schema: $ref: '#/components/schemas/AuthenticationError' '403': description: Authorization error content: application/json: schema: $ref: '#/components/schemas/AuthorizationError' '404': description: Not found error content: application/json: schema: $ref: '#/components/schemas/NotFoundError' '200': type: object description: Successful response with all required relationships content: application/json: schema: properties: data: type: object $ref: '#/components/schemas/AppPurchase' parameters: - in: path name: id description: App Purchase ID required: true schema: type: integer format: int64 operationId: getV2AppPurchasesById x-operation-id-source: derived /v2/app_purchases/{id}/approve: post: summary: Approve app purchase tags: - AppPurchases responses: '401': description: Authentication error content: application/json: schema: $ref: '#/components/schemas/AuthenticationError' '403': description: Authorization error content: application/json: schema: $ref: '#/components/schemas/AuthorizationError' '404': description: Not found error content: application/json: schema: $ref: '#/components/schemas/NotFoundError' '200': type: object description: Successful response without apps/assets relationships content: application/json: schema: properties: data: type: object $ref: '#/components/schemas/AppPurchase' parameters: - in: path name: id description: App Purchase ID required: true schema: type: integer format: int64 operationId: postV2AppPurchasesByIdApprove x-operation-id-source: derived /v2/app_purchases/{id}/deny: post: summary: Deny app purchase tags: - AppPurchases responses: '401': description: Authentication error content: application/json: schema: $ref: '#/components/schemas/AuthenticationError' '403': description: Authorization error content: application/json: schema: $ref: '#/components/schemas/AuthorizationError' '404': description: Not found error content: application/json: schema: $ref: '#/components/schemas/NotFoundError' '200': type: object description: Successful response without apps/assets relationships content: application/json: schema: properties: data: type: object $ref: '#/components/schemas/AppPurchase' parameters: - in: path name: id description: App Purchase ID required: true schema: type: integer format: int64 operationId: postV2AppPurchasesByIdDeny x-operation-id-source: derived /v2/app_purchases/{id}/resume: post: summary: Resume a App Purchase Subscription tags: - AppPurchases responses: '401': description: Authentication error content: application/json: schema: $ref: '#/components/schemas/AuthenticationError' '403': description: Authorization error content: application/json: schema: $ref: '#/components/schemas/AuthorizationError' '404': description: Not found error content: application/json: schema: $ref: '#/components/schemas/NotFoundError' '200': type: object description: App Purchase response content: application/json: schema: $ref: '#/components/schemas/AppPurchase' '400': type: object description: Error on resuming content: application/json: schema: message: string example: message: App Purchase subscriptions are not cancelled parameters: - in: path name: id description: App Purchases ID required: true schema: type: integer operationId: postV2AppPurchasesByIdResume x-operation-id-source: derived components: schemas: AppPurchase: properties: id: type: integer format: int64 type: type: string attributes: type: object properties: id: type: integer format: int64 status: type: string purchased_by_id: type: integer format: int64 purchased_by_name: type: string denied_at: type: string format: date-time approved_at: type: string format: date-time deny_reason: type: string included: type: array items: $ref: '#/components/schemas/PurchaseSubscription' example: id: 12345 type: app_purchase attributes: id: 12345 status: - pending - approved - denied purchased_by_id: 111 purchased_by_name: Derek denied_at: '2021-10-27T17:05:32.860Z' approved_at: '2021-10-31T17:05:32.860Z' deny_reason: Some comment relationships: purchase_subscriptions: data: - id: 15124 type: purchase_subscription AppPurchasePayload: properties: app_purchase: type: array items: $ref: '#/components/schemas/PurchaseSubscriptionPayload' AuthorizationError: required: - code - message properties: code: type: integer format: int32 message: type: string example: code: 403 message: Access denied AppPurchaseList: properties: data: type: array items: $ref: '#/components/schemas/AppPurchase' AuthenticationError: required: - code - message properties: code: type: integer format: int32 message: type: string example: code: 401 message: Missing authentication. Please try again. PurchaseSubscriptionPayload: properties: name: type: string segment: type: string enum: - drilling - completion asset_type: type: string enum: - company - program - rig - frac_fleet - drillout_unit billing_period: type: string enum: - monthly - daily - annually billing_calc_method: type: string enum: - well_afe_day - well_afe_month - corva_active_day - corva_active_month billing_contact: type: string billing_email: type: string billing_phone: type: string account_manager: type: string price: type: float asset_ids: type: array items: type: integer app_ids: type: array items: type: integer example: price: 19.95 name: Product Name segment: drilling asset_type: program billing_period: monthly billing_calc_method: well_afe_day billing_contact: Billing contact billing_email: example@email.com billing_phone: +1-415 652 0000 account_manager: Manager name asset_ids: - 4 app_ids: - 1 NotFoundError: required: - code - message properties: code: type: integer format: int32 message: type: string example: code: 404 message: Not found PurchaseSubscription: properties: id: type: integer format: int64 type: type: string attributes: type: object properties: id: type: integer format: int64 price: type: float company_id: type: integer format: int64 name: type: string segment: type: string enum: - drilling - completion status: type: string enum: - unapproved - active - cancelled - denied asset_type: type: string enum: - company - program - rig - frac_fleet - drillout_unit billing_period: type: string enum: - monthly - daily - annually billing_calc_method: type: string enum: - well_afe_day - well_afe_month - corva_active_day - corva_active_month billing_contact: type: string billing_email: type: string billing_phone: type: string account_manager: type: string provider_company_id: type: integer format: int64 new_subscription_version_id: type: integer format: int64 uuid: type: string activated_at: type: string format: date-time cancelled_at: type: string format: date-time created_at: type: string format: date-time updated_at: type: string format: date-time relationships: type: object properties: apps: type: object properties: data: type: array properties: id: type: integer format: int64 app_key: type: string app_type: type: string category: type: string name: type: string segment: type: string visibility: type: string assets: type: object properties: data: type: array properties: id: type: integer format: int64 asset_id: type: integer format: int64 old_asset_id: type: integer format: int64 asset_type: type: string asset_name: type: string company: type: object properties: data: type: array properties: name: type: string example: id: 12345 type: purchase_subscription attributes: id: 12345 price: 19.95 name: Product Name segment: drilling status: active asset_type: company billing_period: monthly billing_calc_method: well_afe_day billing_contact: Billing contact billing_email: example@email.com billing_phone: +1-415 652 0000 account_manager: Manager name provider_company_id: 10001 company_id: 12345 new_subscription_version_id: 10002 uuid: a628bd6c-2c2c-479f-a38c-48cc47b360f1 activated_at: '2010-01-01T00:00:00.000Z' cancelled_at: '2010-01-02T00:00:00.000Z' created_at: '2010-01-01T00:00:00.000Z' updated_at: '2010-01-01T00:00:00.000Z' relationships: apps: - id: '1' type: app assets: - id: '3' type: product_subscription_asset securitySchemes: api_key: type: apiKey name: authorization in: header