Skip to main content

API reference

Version
since 1.x, describes 2.52.14
Feature flag
none
For
Workspace user, Workspace administrator

The REST API lets programs read the catalogue, list, reboot and terminate instances, and manage projects in a workspace with an access token. Ordering instances is done in the web app; the public API has no purchase route. The command-line interface uses the same API for the capabilities it covers.

Host and authentication​

  • Host. On the on-demand service the API host is https://api.cerebro.cloud. On a licensed on-prem deployment it is the API host of your deployment; your administrator has it.
  • Token. Every request carries a workspace access token: Authorization: Bearer <token>. Tokens are created in the web app under Workspace settings, Access tokens; the token value is shown once, at creation. See Access tokens.
  • Workspace. Routes are scoped by workspace_id, shown on the same page as the token.

Token permissions​

A token always carries view-projects and view-instances. The other permissions are chosen when the token is created. Each route below names the permission it needs.

PermissionRoutes using it
any active token7
view-instances6
manage-instances1
destroy-instances1
view-projects3
manage-projects3

Route groups​

Errors​

Error responses share one JSON shape:

FieldTypeRequiredNotes
messagestring
codestring
causestring nullableone of 46 cause codes (see the API overview)
payloadobject nullable
payload.{some_key}string

Status codes used: 200, 204, 400, 401, 403, 404, 422, 429, 500.

All 67 cause codes defined by the API
CauseMeaning
no_email_fieldRequest was received without email field that was expected, validation will probably throw error before we get here
no_password_fieldsame as the above
no_email_attributesame as the above
no_password_attributesame as the above
registration_invalid_emailemail provided for registration is invalid
registration_invalid_passwordPassword provided for registration is invalid
registration_invalid_otp_tokenOTP Token provided for registration is invalid
registration_email_already_in_useEmail taht user tries to register with is already in use
token_action_executedany kind of verification process (email, reset password, freeze account) will get its actionable token, you'll get this error when token was already executed
token_action_expiredfor the above mentioned token, this will be error when user tries using it after it has expired
active_user_cannot_be_deleted_permanentlyError that will be displayed in rare cases when super-admin tries to delete forever active user
input is out of rangeInput is out of range
no possible date and time matching inputNo possible date and time matching input
input is not enough for unique date and timeInput is not enough for unique date and time
input_contains_invalid_charactersinput_contains_invalid_characters
premature_end_of_inputpremature_end_of_input
trailing_inputtrailing_input
bad_or_unsupported_format_stringbad_or_unsupported_format_string
invalid_number_of_answers:{}Error that will be returned when on any question based request you send invalid number of answers
invalid_otp_tokenInvalid OTP Token
cannot_reassign_only_ownerError that is returned when the request would leave a company without any administrator users
cannot_expire_only_ownerError that is returned when the request would leave a company without any administrator users
content_dispositionError that is returned when the Content-Disposition header is not set
filenameError that is returned when the File name is not sent in upload request
file_type_not_allowedInvalid File type
maximum_file_size_exceededMaximum File size exceeded
cannot_delete_defaultWhen user tries to delete company_pipeline if it is the default one, he will get this error and will need to assign different one as default
uploader:content_disposition:unknownSomething is wrong with the upload data or its type
uploader:filename:unknownSomething is wrong with the upload data or its type
one_time_password_expiredOne time password that is sent to users with disabled 2fa after first step of login has expired
bare_metal_product_item_already_assigned_to_bare_metal_productWhen user tries to add bare metal product item that already exists on bare metal product
cannot_delete_workspace_owner_accountWhen admin tries to delete a user that is an owner of a workspace
user_already_deactivatedWhen admin tries to deactivate a user that is already deactivated
workspace_already_deactivatedWhen trying to deactivate a workspace that was already deactivated
all_workspace_instances_must_be_terminated_before_deactivationWhen trying to deactivate a workspace with active workspace instances
bare_metal_product_active_cannot_updateWhen trying to update a product that is currently active
bare_metal_product_already_deletedWhen trying to delete a product that has already been deleted
active_bare_metal_product_cannot_be_deletedWhen trying to delete a currently active product
deleted_bare_metal_product_cannot_be_activatedWhen trying to activate a deleted product
bare_metal_product_already_inactiveWhen trying to deactivate a product that is already inactive
cannot_restore_deleted_userWhen trying to restore a user that was deleted forever
cannot_restore_active_userWhen trying to restore a user that is currently active
cannot_reset_password_of_deleted_userWhen trying to reset password of deleted user
cannot_freeze_deleted_userWhen trying to freeze deleted user
user_already_deletedWhen trying to delete a user that was already deleted
cannot_impersonate_deleted_userWhen trying to impersonate a deleted user
account_decativatedaccount has been soft deleted/user is banned
email_not_verifiedemail of the account has not been verified
invalid_credentialsuser or password not ok
no_sessionno session found and it was expected to be there
authentication_failed_no_session_found_chno session found in cache
oauth_google_invalid_authorization_codecode given from the oauth provider is invalid
oauth_github_invalid_authorization_codecode given from the oauth provider is invalid
oauth_gitlab_invalid_authorization_codecode given from the oauth is invalid
oauth_microsoft_invalid_authorization_codecode given from the oauth provider is invalid
authentication_failed_no_intermediate_sessionno intermediate session found and it was expected to be there (first step of login skipped)
invalid_one_time_passwordone time password is invalid (token sent to user after login if 2fa is enabled)
no_access_for_jwterror that will be thrown on routes where no JWT access is allowed and JWT was used
no_tfa_code_param_providedroutes that require authenticating with tfa will return this error if no code is provided
no_session_on_tfa_checkthis error is thrown near the above mentioned error, but is almost impossible to get it
no_tfa_secret_set_for_userthis error comes from the middleware that checks two factor for some routes and is a result when user trying the route does not have the tfa set
invalid_otp_code_providedthis error comes from the middleware that checks two factor for some routes and is thrown when the code does not match the secret
permission_denied_missing_rolethis error means that the user does not have role with permissions
permission_denied_missing_permission:{}this error will show you that user does not have valid permission to access the route and will give you the name of missing permission
permission_denied_cannot_do_on_selfthis is error that user will get if he tries doing some protected action on himself, his session or his role
bare_metal_operating_system_is_activethis error means that user is trying to delete a bare metal operating system that is active
bare_metal_product_already_activethis error means that user is trying to add bare metal product item to bare metal product that is already active

Public API that enables you to manage your workspace and its resources.