Skip to content

Latest commit

 

History

History
254 lines (176 loc) · 11.1 KB

ConsoleUserApi.md

File metadata and controls

254 lines (176 loc) · 11.1 KB

fireblocks.ConsoleUserApi

All URIs are relative to https://api.fireblocks.io/v1

Method HTTP request Description
create_console_user POST /management/users Create console user
delete_console_user DELETE /management/users/{id} Request deletion of a console user
get_console_users GET /management/users Get console users

create_console_user

create_console_user(idempotency_key=idempotency_key, create_console_user=create_console_user)

Create console user

Create console users in your workspace

  • Please note that this endpoint is available only for API keys with Admin/Non Signing Admin permissions. Learn more about Fireblocks Users management in the following guide. Endpoint Permission: Admin, Non-Signing Admin.

Example

from fireblocks.models.create_console_user import CreateConsoleUser
from fireblocks.client import Fireblocks
from fireblocks.client_configuration import ClientConfiguration
from fireblocks.exceptions import ApiException
from fireblocks.base_path import BasePath

# load the secret key content from a file
with open('your_secret_key_file_path', 'r') as file:
    secret_key_value = file.read()

# build the configuration
configuration = ClientConfiguration(
        api_key="your_api_key",
        secret_key=secret_key_value,
        base_path=BasePath.Sandbox, # or set it directly to a string "https://sandbox-api.fireblocks.io/v1"
)


# Enter a context with an instance of the API client
with Fireblocks(configuration) as fireblocks:
    idempotency_key = 'idempotency_key_example' # str | A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. (optional)
    create_console_user = fireblocks.CreateConsoleUser() # CreateConsoleUser |  (optional)

    try:
        # Create console user
        fireblocks.console_user.create_console_user(idempotency_key=idempotency_key, create_console_user=create_console_user).result()
    except Exception as e:
        print("Exception when calling ConsoleUserApi->create_console_user: %s\n" % e)

Parameters

Name Type Description Notes
idempotency_key str A unique identifier for the request. If the request is sent multiple times with the same idempotency key, the server will return the same response as the first request. The idempotency key is valid for 24 hours. [optional]
create_console_user CreateConsoleUser [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 User creation approval request has been sent * X-Request-ID -
400 bad request * X-Request-ID -
401 Unauthorized. Missing / invalid JWT token in Authorization header. * X-Request-ID -
403 Lacking permissions. * X-Request-ID -
5XX Internal error. * X-Request-ID -
0 Error Response * X-Request-ID -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_console_user

ConsoleUser delete_console_user(id, force=force)

Request deletion of a console user

Requests deletion of a console user. The request is asynchronous: it goes through the workspace's configured "Delete users" approval policy (Settings > Quorums), exactly as deleting a user from the console does, and the user is removed only once that approval completes.

  • The workspace must have a "Delete users" approval policy (admin quorum or approval group). If "Delete users" is Owner-only, which is the default, the request is refused with OWNER_ONLY (2760) and the Owner deletes users in the Console. With an admin quorum, the requesting API user's own approval counts toward the quorum.
  • Track progress by polling GET /management/users; deletion is complete when the user is disabled.
  • Please note that this endpoint is available only for API keys with Admin/Non Signing Admin/Security Admin permissions. Endpoint Permission: Admin, Non-Signing Admin, Security Admin. Note: This endpoint is currently in beta and might be subject to changes.

Example

from fireblocks.models.console_user import ConsoleUser
from fireblocks.client import Fireblocks
from fireblocks.client_configuration import ClientConfiguration
from fireblocks.exceptions import ApiException
from fireblocks.base_path import BasePath
from pprint import pprint

# load the secret key content from a file
with open('your_secret_key_file_path', 'r') as file:
    secret_key_value = file.read()

# build the configuration
configuration = ClientConfiguration(
        api_key="your_api_key",
        secret_key=secret_key_value,
        base_path=BasePath.Sandbox, # or set it directly to a string "https://sandbox-api.fireblocks.io/v1"
)


# Enter a context with an instance of the API client
with Fireblocks(configuration) as fireblocks:
    id = 'id_example' # str | The ID of the console user to delete
    force = False # bool | Acknowledges the impact of removing this user and proceeds anyway. Overrides both USER_REFERENCED_IN_TAP and QUORUM_INTEGRITY, the same way the acknowledgement checkbox does in the console. (optional) (default to False)

    try:
        # Request deletion of a console user
        api_response = fireblocks.console_user.delete_console_user(id, force=force).result()
        print("The response of ConsoleUserApi->delete_console_user:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ConsoleUserApi->delete_console_user: %s\n" % e)

Parameters

Name Type Description Notes
id str The ID of the console user to delete
force bool Acknowledges the impact of removing this user and proceeds anyway. Overrides both USER_REFERENCED_IN_TAP and QUORUM_INTEGRITY, the same way the acknowledgement checkbox does in the console. [optional] [default to False]

Return type

ConsoleUser

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
202 Deletion request accepted. Returns the console user that will be removed once the workspace's configured approval completes. * X-Request-ID -
400 Bad request: invalid parameters (for example a non-boolean `force`), or TARGET_IS_API_USER - the ID belongs to an API user in this workspace; this endpoint deletes console users only. * X-Request-ID -
401 Unauthorized. Missing / invalid JWT token in Authorization header. * X-Request-ID -
403 Lacking permissions, or the target cannot be deleted: the user is the workspace Owner, or the caller is the target. Also returned as OWNER_ONLY (2760) when the workspace's "Delete users" approval is Owner-only; set an approval policy in the Console under Settings > Quorums. * X-Request-ID -
404 Console user not found. Also returned for users in other workspaces (so the endpoint does not reveal whether an ID exists there) and for users that were already deleted. * X-Request-ID -
409 PENDING_REQUEST_EXISTS - a deletion request for this user is already awaiting approval; USER_REFERENCED_IN_TAP - the user is referenced by the workspace transaction authorization policy (can be overridden with force=true); or USER_PENDING_ONBOARDING - the user has not completed onboarding, so there is nothing to delete yet. Revoke the invitation from the console instead. * X-Request-ID -
422 QUORUM_INTEGRITY - the user is required to complete the workspace's admin approval quorum. Can be overridden with force=true, matching the console's acknowledgement checkbox. * X-Request-ID -
5XX Internal error. * X-Request-ID -
0 Error Response * X-Request-ID -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_console_users

GetConsoleUsersResponse get_console_users()

Get console users

Get console users for your workspace.

  • Please note that this endpoint is available only for API keys with Admin/Non Signing Admin permissions. Endpoint Permission: Admin, Non-Signing Admin.

Example

from fireblocks.models.get_console_users_response import GetConsoleUsersResponse
from fireblocks.client import Fireblocks
from fireblocks.client_configuration import ClientConfiguration
from fireblocks.exceptions import ApiException
from fireblocks.base_path import BasePath
from pprint import pprint

# load the secret key content from a file
with open('your_secret_key_file_path', 'r') as file:
    secret_key_value = file.read()

# build the configuration
configuration = ClientConfiguration(
        api_key="your_api_key",
        secret_key=secret_key_value,
        base_path=BasePath.Sandbox, # or set it directly to a string "https://sandbox-api.fireblocks.io/v1"
)


# Enter a context with an instance of the API client
with Fireblocks(configuration) as fireblocks:

    try:
        # Get console users
        api_response = fireblocks.console_user.get_console_users().result()
        print("The response of ConsoleUserApi->get_console_users:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ConsoleUserApi->get_console_users: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

GetConsoleUsersResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 got console users * X-Request-ID -
401 Unauthorized. Missing / invalid JWT token in Authorization header. * X-Request-ID -
403 Lacking permissions. * X-Request-ID -
5XX Internal error. * X-Request-ID -
0 Error Response * X-Request-ID -

[Back to top] [Back to API list] [Back to Model list] [Back to README]