Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.
GuideBeta

Enabling and disabling a product

Read the products of your workspace, enable one that your plan covers, follow the change until it's done, and disable a product again through the Console API.

This guide shows how to turn a product on or off for your workspace through the Console API. You will read the products of the workspace with the state of each one, check what you may do with a product, enable it, follow the change until Console reports that it's done, and disable a product again.

Every operation on this page names the workspace by its ID. Navixy Console decides whether you may read or change that workspace, and the API relays its decision.

Prerequisites

You need an access token that names the organization and the workspace you work in. Without it, every console operation is refused with PERMISSION_DENIED. See Authentication to learn what the token contains.

You also need a role in your organization with the Console administration feature and the attach_product and detach_product actions on the workspace. The Owner role has both. Roles are set up in Navixy Console.

To find the ID of your workspace and check that your token reaches it, list the workspaces you can reach:

query MyWorkspaces {
  console {
    accessibleWorkspaces(first: 10) {
      nodes {
        id
        workspaceName
        organizationDisplayName
        status
      }
    }
  }
}

Response:

The id of the workspace is the workspaceId that the product operations take. A PERMISSION_DENIED error instead means that the token doesn't name an organization and a workspace. See Error handling below.

How products and coverage work

A product, such as Business Data Repository or Tracking, runs in your workspace once it's enabled there. Console names a product by its code and by its product ID, the same value as in Billing. Products documents every field. The products that this API serves have the following codes:

Product
Code

Your workspace can also have products that this API doesn't serve, such as Reports. Their codes are in the list that workspaceProducts returns.

Whether you may enable a product depends on coverage. A product is covered when an active subscription of your workspace includes it. Console reads your subscriptions from Billing every time you ask, so a new subscription counts at once. Only a covered product can be enabled. A product that your plan requires is enabled by the plan and can't be disabled.

The state of a product says where it stands:

State
Meaning

AVAILABLE_ON_OTHER_PLANS

No active subscription of your workspace covers the product. Enabling it is refused.

NOT_ENABLED

Covered, but not enabled.

ENABLING

You asked to enable it, and Navixy is setting it up.

ENABLED

Enabled and ready.

DISABLING

You asked to disable it, and Navixy is suspending it.

FAILED

The last change didn't go through. lastFailureCode says why. Enabling or disabling again retries it.

Not covered wins over every other state: a product that was enabled and then lost coverage shows AVAILABLE_ON_OTHER_PLANS, with coverageLostAt set, and Navixy suspends it. When coverage returns, Navixy enables it again without a request from you.

Each product also lists allowedActions: whether you may enable it (attach_product) or disable it (detach_product) right now, and a reason when you can't. An action that your role doesn't grant is absent from the list. Read this list before you call a mutation, because Console refuses a mutation for the same reasons.

Example scenario: A fleet operator adds Tracking to a workspace

TransLog GmbH runs delivery trucks out of Hamburg. Their workspace is on a plan that requires Business Data Repository and covers Tracking, and the administrator wants Tracking enabled. Later, the operator stops using Tracking in that workspace and disables it again.

1

Read the products of the workspace

workspaceProducts returns every product the workspace has or may have. The list isn't paginated, because a workspace sees a small catalog.

Run this query:

Response:

The workspace sees three products. Business Data Repository is enabled and required by the plan, so neither action is allowed. Tracking is covered by the Fleet Pro plan but not enabled, and attach_product is allowed. Reports isn't covered, so it shows AVAILABLE_ON_OTHER_PLANS and can't be enabled from here.

Both actions appear on every product because the role of the administrator grants both. A role that grants neither sees an empty allowedActions list on every product.

2

Check what you may do with the product

Before you call a mutation, read the allowedActions entry of the action you intend to take. The reason values are:

  • not_covered: No active subscription of your workspace covers the product. Subscribe the workspace to a plan that includes it: see Choosing a plan and subscribing.

  • already_enabled: The product is ENABLED or ENABLING. Console accepts a second request and starts one more operation, so don't send it.

  • not_enabled: The product was never enabled, or disabling was the last request. There is nothing to disable.

  • managed_by_plan: The plan requires the product, and it has isRequired: true. Console refuses to enable or to disable it, with one exception: enabling it again after FAILED retries the setup.

In the example, Tracking has attach_product allowed with no reason, so the mutation will be accepted.

3

Enable the product

workspaceProductEnable takes the workspace ID and the product code from the list. Run this mutation:

Response:

The response confirms that Console accepted the request. It doesn't say whether the product is enabled yet. Console recorded an operation of type product_attach with the status accepted. Navixy sets up the product afterwards, and meanwhile the product state is ENABLING. Keep the operation id to follow the change.

A console block runs one mutation at a time. To enable two products in one request, give each mutation its own aliased console block, such as tracking: console { ... } and reports: console { ... } (see Aliases). The blocks run in the order you write them.

4

Follow the change until it's done

workspaceOperation returns the operation in full. Read it every few seconds until status is no longer accepted:

Response once the product is ready:

The operation ends as completed or failed. When it ends as failed, failureReason is product_failed, and the cause is on the product: read lastFailureCode with workspaceProducts. The value no_response means that nothing answered within about 12 minutes. Other values name what went wrong in the product.

workspaceOperation returns null for an operation ID that Console doesn't know in your organization, with no entry in errors. Nothing notifies you when the change is done, so read the operation, or the products of the workspace, until it is.

5

Confirm the product state

Read the products again. Tracking is now ENABLED, and its actions changed:

Response, showing only the Tracking entry:

Tracking is ready to use in the workspace, and detach_product is now an allowed action.

6

Disable the product

workspaceProductDisable takes the workspace ID and the productId from the list, not the code. Run this mutation:

Response:

The product state is DISABLING until Navixy suspends the product, then NOT_ENABLED. Follow the operation the same way as in Follow the change until it's done. Disabling removes user access to the product and keeps its data. Enabling it again restores access.

Retrying a failed change

When a change ends as failed, the product has the state FAILED. After a failed enable, both actions are allowed again. After a failed disable, only attach_product is allowed, and detach_product shows not_enabled. Read lastFailureCode first. Then call workspaceProductEnable again to retry enabling, or workspaceProductDisable to give up on the product. Each call clears the failure and starts a new operation. A required product allows only the retry.

Error handling

The Console operations return errors in the shared format. See Error handling for the response structure and the general codes, and Console errors for everything specific to Console.

Code
When it occurs
Resolution

PERMISSION_DENIED

The token doesn't name your organization and workspace, or Console refused the request because your roles lack the Console administration feature or the action on the workspace.

Request a token issued for the organization and the workspace. Ask an Owner of your organization for a role with the feature and the action.

NOT_FOUND

The workspace doesn't belong to the organization named by your token.

Read the workspace ID from accessibleWorkspaces with a token issued for its organization.

VALIDATION_ERROR

The workspace ID, the product ID, the operation ID, or the product code is malformed, no product has the code (PRODUCT_UNKNOWN), or the product can't be turned on or off at all (PRODUCT_NOT_TOGGLABLE).

Read field and dependencyCode. Send the code and productId as workspaceProducts returned them, and the operation id as the mutation returned it.

CONFLICT

Console refused the change in the current state of the product or the workspace: PRODUCT_NOT_COVERED, PRODUCT_MANAGED_BY_PLAN, PRODUCT_NOT_ENABLED, or WORKSPACE_TERMINATING.

Read dependencyCode. Sending the same request again fails the same way. Read allowedActions before the next attempt.

SERVICE_UNAVAILABLE

Console, or Billing, didn't respond, or Console returned an operation ID that isn't valid.

Retry a query after a short pause. After a mutation, read workspaceProducts before you send it again, because Console might already have accepted the change. dependency is console.

Enabling a product that no active subscription covers returns this error:

How to handle a product that isn't covered

Read dependencyCode. A CONFLICT from Console is a refusal in the current state, not a concurrent change, so sending the same request again fails the same way. Your workspace needs a subscription to a plan that includes the product: see Choosing a plan and subscribing. Then read workspaceProducts again. The product shows NOT_ENABLED with attach_product allowed, and the mutation goes through. To avoid the error, read allowedActions before you call the mutation.

See also

  • Products: Learn how the products of a workspace, the product catalog, the two mutations, and the operation type work.

  • Console errors: Learn which refusals Console relays and which fields a Console error has.

  • Choosing a plan and subscribing: Subscribe your workspace to a plan that covers the product.

  • Authentication: Learn how the token names the organization and the workspace that the Console operations act in.

Last updated

Was this helpful?