Skip to main content

API reference

Look up every client, method, function and record of the SDK bindings, with its parameters and what it returns.

This page covers the FFI bindings (Python, Java, Android/Kotlin, .NET, Go, Ruby, Swift), built from crates/passbolt-ffi/src. Every binding has these clients, methods, functions and records, under the names of its language: see Names in each language. The JavaScript API is close, with its own shape: see JavaScript.

Read this reference​

The names are the Rust ones, in snake_case. The examples are in Python, whose passbolt package keeps those names; client is a logged-in passbolt.Client.

The types are written this way:

NotationMeaning
string, boolA string, a boolean
u16, u32, u64, i32, f64Unsigned, signed and floating-point numbers, of 16, 32 or 64 bits
T?Optional: None, null, nil or the value
[T]A list
bytesA byte array
nothingNo value
= valueThe default, in the languages that have default arguments
  • Every method of the clients can fail with a PassboltError, and so can the functions, except default_password_policies, generate_pin_code, secret_entropy and secret_strength.
  • Dates are RFC 3339 strings.

Clients​

PassboltClient blocks on each call. AsyncPassboltClient has the same constructors and methods, awaited: see The async client.

login​

Authenticate against a Passbolt server and return a client session. A constructor.

ParameterTypeRequiredDescription
server_urlstringYesAddress of the Passbolt server.
private_key_armoredstringYesThe armored OpenPGP private key of the account.
passphrasestringYesThe passphrase of the private key.

Returns the client.

login is login_with_config with the default LoginOptions. A request waits 60 seconds by default (timeout_seconds).

Log in and log out​

with passbolt.Client.login("https://passbolt.example.com", private_key, passphrase) as client:
print(client.user_id())

login_with_config​

Authenticate with options, the pinned server and metadata keys among them. A constructor.

ParameterTypeRequiredDescription
server_urlstringYesAddress of the Passbolt server.
private_key_armoredstringYesThe armored OpenPGP private key of the account.
passphrasestringYesThe passphrase of the private key.
optionsLoginOptionsYesPinned keys, MFA, timeout, proxy, TLS and client certificate.

Returns the client.

Log in with a pinned server key​

options = passbolt.LoginOptions(server_public_key=server_key.armored_key)
client = passbolt.Client.login_with_config(
"https://passbolt.example.com", private_key, passphrase, options
)

user_id​

Get the current user's ID. Does not fail, and is not awaited on the async client.

No parameters.

Returns string.

print(client.user_id())

base_url​

Get the server base URL. Does not fail, and is not awaited on the async client.

No parameters.

Returns string.

print(client.base_url())

Methods​

The methods of both clients, from the client_methods! list of crates/passbolt-ffi/src/lib.rs, grouped by area:

Permission types are Passbolt's: 1 read, 7 update, 15 owner, -1 to revoke.

Session​

logout​

Terminate the server-side session.

No parameters.

Returns nothing.

Log out​

client.logout()

check_auth​

Check if the session is still valid.

No parameters.

Returns bool.

Log in again when the session ended​

if not client.check_auth():
client = passbolt.Client.login("https://passbolt.example.com", private_key, passphrase)

keep_alive​

Keep the session alive, as the browser extension does every few minutes.

No parameters.

Returns nothing.

Keep the session open​

client.keep_alive()

Resources​

list_resources​

List resources with optional search and filters.

ParameterTypeRequiredDescription
searchstring?NoA search term. Default: none.
favorites_onlyboolNoOnly your favorites. Default: false.
owned_by_meboolNoOnly the resources you own. Default: false.

Returns [Resource].

List your favorites​

favorites = client.list_resources(favorites_only=True)

list_resource_views​

Resources with their v5 metadata decrypted, searched by their decrypted name; their secrets too with with_secrets. One that does not decrypt has an error.

ParameterTypeRequiredDescription
searchstring?NoA search term, matched on the decrypted name. Default: none.
with_secretsboolNoAlso decrypt the secrets. Default: false.

Returns [ResourceView].

Search by name​

for view in client.list_resource_views("github"):
print(view.id, view.name, view.username)

get_resource_view​

A resource with its v5 metadata and its secret decrypted, for every resource type.

ParameterTypeRequiredDescription
idstringYesID of the resource.

Returns ResourceView.

Read a password​

view = client.get_resource_view("<RESOURCE_UUID>")
print(view.password)

get_resource​

Get a single resource by ID.

ParameterTypeRequiredDescription
idstringYesID of the resource.

Returns Resource.

Get a resource​

resource = client.get_resource("<RESOURCE_UUID>")

get_resources_by_ids​

Get multiple resources by IDs.

ParameterTypeRequiredDescription
ids[string]YesIDs of the resources.

Returns [Resource].

Get two resources​

resources = client.get_resources_by_ids(["<RESOURCE_UUID>", "<OTHER_RESOURCE_UUID>"])

decrypt_resource_secret​

Decrypt a resource's secret. The method fetches the resource by its ID, then decrypts its secret.

ParameterTypeRequiredDescription
resource_idstringYesID of the resource.

Returns SecretData.

Decrypt a secret​

secret = client.decrypt_resource_secret("<RESOURCE_UUID>")
print(secret.password)

create_resource​

Create a resource of any type. Returns the created resource.

ParameterTypeRequiredDescription
resourceNewResourceYesThe resource to create.

Returns Resource.

Create a password​

created = client.create_resource(
passbolt.NewResource(name="GitHub", username="ada", password="…")
)

update_resource​

Update a resource; the fields left out keep their value.

ParameterTypeRequiredDescription
idstringYesID of the resource.
changesResourceChangesYesThe fields to change.

Returns Resource.

Change a password and clear its expiry​

client.update_resource(
"<RESOURCE_UUID>", passbolt.ResourceChanges(password="new", clear_expiry=True)
)

move_resource​

Move a resource into a folder, or to the root without one.

ParameterTypeRequiredDescription
idstringYesID of the resource.
folder_idstring?NoThe destination folder. Default: none, the root.

Returns nothing.

Move a resource into a folder​

client.move_resource("<RESOURCE_UUID>", "<FOLDER_UUID>")

delete_resource​

Delete a resource.

ParameterTypeRequiredDescription
idstringYesID of the resource.

Returns nothing.

Delete a resource​

client.delete_resource("<RESOURCE_UUID>")

delete_resources​

Bulk delete resources.

ParameterTypeRequiredDescription
ids[string]YesIDs of the resources.

Returns nothing.

Delete several resources​

client.delete_resources(["<RESOURCE_UUID>", "<OTHER_RESOURCE_UUID>"])

get_resource_permissions​

Get permissions for a resource.

ParameterTypeRequiredDescription
idstringYesID of the resource.

Returns [Permission].

List who can read a resource​

for permission in client.get_resource_permissions("<RESOURCE_UUID>"):
print(permission.aro, permission.aro_foreign_key, permission.permission_type)

Folders​

list_folders​

List all folders.

ParameterTypeRequiredDescription
searchstring?NoA search term. Default: none.

Returns [Folder].

List every folder​

folders = client.list_folders()

get_folder​

Get a single folder by ID.

ParameterTypeRequiredDescription
idstringYesID of the folder.

Returns Folder.

Get a folder​

folder = client.get_folder("<FOLDER_UUID>")

get_folder_tree​

Build a folder tree from the flat folder list.

No parameters.

Returns [FolderTreeNode].

def show(nodes, depth=0):
for node in nodes:
print(" " * depth + node.folder.name)
show(node.children, depth + 1)

show(client.get_folder_tree())

create_folder​

Create a folder, at the root or in folder_parent_id; in a parent folder it gets the parent's permissions.

ParameterTypeRequiredDescription
namestringYesName of the folder.
folder_parent_idstring?NoThe parent folder. Default: none, the root.

Returns Folder.

Create a sub-folder​

folder = client.create_folder("Ops", "<FOLDER_UUID>")

rename_folder​

Rename a folder.

ParameterTypeRequiredDescription
idstringYesID of the folder.
namestringYesThe new name.

Returns Folder.

Rename a folder​

client.rename_folder("<FOLDER_UUID>", "Operations")

move_folder​

Move a folder into another one, or to the root without one.

ParameterTypeRequiredDescription
idstringYesID of the folder.
folder_idstring?NoThe destination folder. Default: none, the root.

Returns nothing.

Move a folder to the root​

client.move_folder("<FOLDER_UUID>")

delete_folder​

Delete a folder; its content moves to the root.

ParameterTypeRequiredDescription
idstringYesID of the folder.

Returns nothing.

Delete a folder and keep its content​

client.delete_folder("<FOLDER_UUID>")

delete_folder_with_content​

Delete a folder with its sub-folders and the resources the user may delete in them.

ParameterTypeRequiredDescription
idstringYesID of the folder.

Returns nothing.

Delete a folder and its content​

client.delete_folder_with_content("<FOLDER_UUID>")

get_folder_permissions​

Get permissions for a folder.

ParameterTypeRequiredDescription
idstringYesID of the folder.

Returns [Permission].

List the permissions of a folder​

permissions = client.get_folder_permissions("<FOLDER_UUID>")

Sharing​

share_resource​

Share a resource with users and groups (permission_type 1, 7 or 15), or revoke with -1.

ParameterTypeRequiredDescription
idstringYesID of the resource.
permission_typei32Yes1 read, 7 update, 15 owner, -1 to revoke.
user_ids[string]NoThe users. Default: [].
group_ids[string]NoThe groups. Default: [].

Returns nothing.

Give a user the update permission​

client.share_resource("<RESOURCE_UUID>", passbolt.PermissionType.UPDATE, user_ids=["<USER_UUID>"])

Revoke a group's access​

client.share_resource("<RESOURCE_UUID>", passbolt.PermissionType.REVOKE, group_ids=["<GROUP_UUID>"])

share_folder​

Share a folder, and with with_content the sub-folders and resources the user owns.

ParameterTypeRequiredDescription
idstringYesID of the folder.
permission_typei32Yes1 read, 7 update, 15 owner, -1 to revoke.
user_ids[string]NoThe users. Default: [].
group_ids[string]NoThe groups. Default: [].
with_contentboolNoAlso share the sub-folders and resources the user owns. Default: false.

Returns nothing.

Share a folder and its content with a group​

client.share_folder(
"<FOLDER_UUID>", passbolt.PermissionType.READ, group_ids=["<GROUP_UUID>"], with_content=True
)

search_aros​

Search for users and groups (AROs) for sharing.

ParameterTypeRequiredDescription
searchstringYesA search term.

Returns [Aro].

Find whom to share with​

for aro in client.search_aros("ada"):
print(aro.id, aro.aro_type, aro.username or aro.name)

Users​

list_users​

List all users.

ParameterTypeRequiredDescription
searchstring?NoA search term. Default: none.
group_idstring?NoOnly the members of this group. Default: none.
admin_onlyboolNoOnly the administrators. Default: false.

Returns [User].

List the members of a group​

members = client.list_users(group_id="<GROUP_UUID>")

get_me​

Get the currently logged-in user.

No parameters.

Returns User.

Get your profile​

me = client.get_me()
print(me.username)

get_user​

Get a user by ID.

ParameterTypeRequiredDescription
idstringYesID of the user.

Returns User.

Get a user​

user = client.get_user("<USER_UUID>")

create_user​

Create a user with the role named role (user or admin).

ParameterTypeRequiredDescription
usernamestringYesThe username, an email address.
first_namestringYesFirst name.
last_namestringYesLast name.
rolestringYesuser or admin.

Returns User.

Create a user​

user = client.create_user("ada@example.com", "Ada", "Lovelace", "user")

update_user​

Update a user's names or role; None keeps the value.

ParameterTypeRequiredDescription
idstringYesID of the user.
first_namestring?NoThe new first name. Default: none.
last_namestring?NoThe new last name. Default: none.
rolestring?NoThe new role. Default: none.

Returns User.

Make a user an administrator​

client.update_user("<USER_UUID>", role="admin")

delete_user​

Delete a user.

ParameterTypeRequiredDescription
idstringYesID of the user.

Returns nothing.

Delete a user​

client.delete_user("<USER_UUID>")

delete_user_dry_run​

Preview the impact of deleting a user.

ParameterTypeRequiredDescription
idstringYesID of the user.

Returns UserDeleteDryRun.

Count what the user alone owns​

impact = client.delete_user_dry_run("<USER_UUID>")
print(impact.resources_sole_owner_count, impact.groups_sole_manager_count)

user_delete_blockers​

What blocks deleting the user: what they alone own or manage.

ParameterTypeRequiredDescription
idstringYesID of the user.

Returns DeleteBlockers.

List what needs a new owner​

blockers = client.user_delete_blockers("<USER_UUID>")
print([item.id for item in blockers.resources], [group.name for group in blockers.groups])

delete_user_with_transfer​

Delete a user, giving what they alone own or manage to successor_id, a user or a group that already has access to it.

ParameterTypeRequiredDescription
idstringYesID of the user.
successor_idstringYesThe user or group that gets what the deleted user alone owns or manages.

Returns nothing.

Hand over and delete​

client.delete_user_with_transfer("<USER_UUID>", "<OTHER_USER_UUID>")

Groups​

list_groups​

List all groups.

No parameters.

Returns [Group].

List the groups​

for group in client.list_groups():
print(group.id, group.name)

get_group​

Get a group by ID.

ParameterTypeRequiredDescription
idstringYesID of the group.

Returns Group.

Get a group​

group = client.get_group("<GROUP_UUID>")

create_group​

Create a group; a manager is also a member.

ParameterTypeRequiredDescription
namestringYesName of the group.
member_ids[string]NoThe members. Default: [].
manager_ids[string]NoThe managers. Default: [].

Returns Group.

Create a group with a manager​

group = client.create_group("DevOps", manager_ids=["<USER_UUID>"])

update_group​

Rename a group and change its members: the removed ones first, then the added ones, who get the secrets of the group's resources. Giving a user the role they have, or removing a non-member, is an error.

ParameterTypeRequiredDescription
idstringYesID of the group.
namestring?NoThe new name. Default: none.
add_member_ids[string]NoUsers to add as members. Default: [].
add_manager_ids[string]NoUsers to add as managers. Default: [].
remove_member_ids[string]NoUsers to remove. Default: [].

Returns Group.

Add a member​

client.update_group("<GROUP_UUID>", add_member_ids=["<USER_UUID>"])

delete_group​

Delete a group.

ParameterTypeRequiredDescription
idstringYesID of the group.

Returns nothing.

Delete a group​

client.delete_group("<GROUP_UUID>")

delete_group_dry_run​

Preview the impact of deleting a group.

ParameterTypeRequiredDescription
idstringYesID of the group.

Returns GroupDeleteDryRun.

Count what the group alone owns​

impact = client.delete_group_dry_run("<GROUP_UUID>")
print(impact.resources_sole_group_count, impact.folders_sole_group_count)

group_delete_blockers​

What blocks deleting the group: what it alone owns.

ParameterTypeRequiredDescription
idstringYesID of the group.

Returns DeleteBlockers.

List what needs a new owner​

blockers = client.group_delete_blockers("<GROUP_UUID>")

delete_group_with_transfer​

Delete a group, giving what it alone owns to successor_id, a user or a group that already has access to it.

ParameterTypeRequiredDescription
idstringYesID of the group.
successor_idstringYesThe user or group that gets what the deleted group alone owns.

Returns nothing.

Hand over and delete​

client.delete_group_with_transfer("<GROUP_UUID>", "<USER_UUID>")

Tags​

get_tags​

List all tags.

No parameters.

Returns [Tag].

List the tags​

slugs = [tag.slug for tag in client.get_tags()]

add_tag_to_resource​

Add a tag to a resource, keeping its other tags; returns the resource's tags.

ParameterTypeRequiredDescription
resource_idstringYesID of the resource.
slugstringYesThe tag.

Returns [Tag].

Tag a resource​

client.add_tag_to_resource("<RESOURCE_UUID>", "production")

set_resource_tags​

Replace all the tags of a resource; returns its tags.

ParameterTypeRequiredDescription
resource_idstringYesID of the resource.
slugs[string]YesThe tags the resource keeps.

Returns [Tag].

Replace the tags of a resource​

client.set_resource_tags("<RESOURCE_UUID>", ["production", "database"])

rename_tag​

Rename a tag.

ParameterTypeRequiredDescription
idstringYesID of the tag.
slugstringYesThe new name.

Returns Tag.

Rename a tag​

client.rename_tag("<TAG_UUID>", "prod")

delete_tag​

Delete a tag.

ParameterTypeRequiredDescription
idstringYesID of the tag.

Returns nothing.

Delete a tag​

client.delete_tag("<TAG_UUID>")

Comments​

get_comments​

Get comments for a resource.

ParameterTypeRequiredDescription
resource_idstringYesID of the resource.

Returns [Comment].

Read the comments of a resource​

for comment in client.get_comments("<RESOURCE_UUID>"):
print(comment.created, comment.content)

create_comment​

Create a comment on a resource.

ParameterTypeRequiredDescription
resource_idstringYesID of the resource.
contentstringYesThe text of the comment.
parent_idstring?NoThe comment this one answers. Default: none.

Returns Comment.

Answer a comment​

client.create_comment("<RESOURCE_UUID>", "Rotated today.", parent_id="<COMMENT_UUID>")

delete_comment​

Delete a comment.

ParameterTypeRequiredDescription
idstringYesID of the comment.

Returns nothing.

Delete a comment​

client.delete_comment("<COMMENT_UUID>")

Favorites​

add_favorite​

Add a resource to favorites.

ParameterTypeRequiredDescription
resource_idstringYesID of the resource.

Returns Favorite.

Mark a resource as favorite​

favorite = client.add_favorite("<RESOURCE_UUID>")

remove_favorite​

Remove a favorite.

ParameterTypeRequiredDescription
favorite_idstringYesID of the favorite, not of the resource.

Returns nothing.

Remove a favorite​

client.remove_favorite(favorite.id)

Password expiry​

get_password_expiry_settings​

Get password expiry settings.

No parameters.

Returns PasswordExpirySettings.

Read the expiry period​

settings = client.get_password_expiry_settings()
print(settings.default_expiry_period_days)

save_password_expiry_settings​

Create or update the password expiry settings (admin).

ParameterTypeRequiredDescription
settingsPasswordExpirySettingsYesThe settings to save.

Returns PasswordExpirySettings.

Expire passwords after 90 days​

settings = client.get_password_expiry_settings()
settings.default_expiry_period_days = 90
client.save_password_expiry_settings(settings)

delete_password_expiry_settings​

Delete the password expiry settings (admin): the defaults apply again.

ParameterTypeRequiredDescription
idstringYesID of the settings.

Returns nothing.

Go back to the defaults​

client.delete_password_expiry_settings(client.get_password_expiry_settings().id)

Password policies​

get_password_policies​

The password policies of the organization, for generate_secret.

No parameters.

Returns PasswordPolicies.

Generate a secret the organization's way​

secret = passbolt.generate_secret(client.get_password_policies())

save_password_policies​

Save the password policies of the organization (administrator, Passbolt Pro).

ParameterTypeRequiredDescription
policiesPasswordPoliciesYesThe policies to save.

Returns PasswordPolicies.

Generate passphrases by default​

policies = client.get_password_policies()
policies.default_generator = passbolt.GeneratorType.PASSPHRASE
client.save_password_policies(policies)

Metadata and resource types​

metadata_key_fingerprint​

The fingerprint of the active shared metadata key, to pin in LoginOptions.metadata_key_fingerprint; None without one.

No parameters.

Returns string?.

Pin the metadata key​

fingerprint = client.metadata_key_fingerprint()
# Save it, then at each login:
client = passbolt.Client.login(
"https://passbolt.example.com", private_key, passphrase, metadata_key_fingerprint=fingerprint
)

list_resource_types​

The resource types of the server.

No parameters.

Returns [ResourceType].

List the type slugs​

slugs = [resource_type.slug for resource_type in client.list_resource_types()]

get_metadata_types_settings​

Which metadata versions the organization creates and allows.

No parameters.

Returns MetadataTypesSettings.

Check whether v5 resources are allowed​

print(client.get_metadata_types_settings().allow_creation_of_v5_resources)

save_metadata_types_settings​

Save the metadata types settings (admin).

ParameterTypeRequiredDescription
settingsMetadataTypesSettingsYesThe settings to save.

Returns MetadataTypesSettings.

Allow v5 resources​

settings = client.get_metadata_types_settings()
settings.allow_creation_of_v5_resources = True
client.save_metadata_types_settings(settings)

get_metadata_keys_settings​

How metadata keys are used in the organization.

No parameters.

Returns MetadataKeysSettings.

Check whether personal keys are allowed​

print(client.get_metadata_keys_settings().allow_usage_of_personal_keys)

save_metadata_keys_settings​

Save the metadata keys settings (admin).

ParameterTypeRequiredDescription
settingsMetadataKeysSettingsYesThe settings to save.

Returns MetadataKeysSettings.

Allow personal keys​

settings = client.get_metadata_keys_settings()
settings.allow_usage_of_personal_keys = True
client.save_metadata_keys_settings(settings)

Have I Been Pwned​

check_password_pwned​

Check if a password has been exposed in data breaches. Returns the number of times found (0 = not breached).

ParameterTypeRequiredDescription
passwordstringYesThe password to check.

Returns u64.

Refuse a breached password​

if client.check_password_pwned(password) > 0:
print("This password appeared in a data breach.")

Functions​

Exported functions, outside any client: they need no session. In Java and C# they are static methods of PassboltFfi.

Server key and OpenPGP​

fetch_server_key​

The server public key, to pin in LoginOptions.server_public_key once the user confirmed its fingerprint.

ParameterTypeRequiredDescription
server_urlstringYesAddress of the Passbolt server.
tls_skip_verifyboolNoSkip the check of the TLS certificate. Default: false.

Returns ServerKey.

Fetch the key to pin​

server_key = passbolt.fetch_server_key("https://passbolt.example.com")
print("Check this fingerprint with your administrator:", server_key.fingerprint)

decrypt_message​

Decrypt a PGP-armored message with a private key.

ParameterTypeRequiredDescription
armored_messagestringYesThe PGP-armored message.
private_key_armoredstringYesThe armored private key.
passphrasestringYesThe passphrase of the private key.

Returns bytes.

Decrypt a message​

plaintext = passbolt.decrypt_message(armored_message, private_key, passphrase)

encrypt_message​

Encrypt a plaintext message for one or more PGP public keys. Returns the PGP-armored ciphertext.

ParameterTypeRequiredDescription
plaintextbytesYesThe message.
public_keys_armored[string]YesThe armored public keys to encrypt for.

Returns string.

Encrypt for two keys​

armored = passbolt.encrypt_message(b"hello", [public_key, other_public_key])

get_key_fingerprint​

Parse a PGP private key and return its fingerprint (hex uppercase).

ParameterTypeRequiredDescription
private_key_armoredstringYesThe armored private key.

Returns string.

print(passbolt.get_key_fingerprint(private_key))

openpgp_engine​

The name of the OpenPGP engine the native library runs: gopenpgp in the released packages, openpgpjs in the Go module. See OpenPGP engines. Does not fail.

No parameters.

Returns string.

print(passbolt.openpgp_engine())

Password generator​

default_password_policies​

The policies of a server without settings: passwords of 18 characters by default. Does not fail.

No parameters.

Returns PasswordPolicies.

Generate a secret without a server​

secret = passbolt.generate_secret(passbolt.default_password_policies())

generate_password​

A password following settings, as the extension generates it.

ParameterTypeRequiredDescription
settingsPasswordGeneratorSettingsYesLength and character sets.

Returns string.

Generate a 24-character password​

password = passbolt.generate_password(passbolt.PasswordGeneratorSettings(length=24))

generate_passphrase​

A passphrase of words of the EFF list following settings.

ParameterTypeRequiredDescription
settingsPassphraseGeneratorSettingsYesWords, separator and case.

Returns string.

Generate a passphrase of six words​

passphrase = passbolt.generate_passphrase(
passbolt.PassphraseGeneratorSettings(words=6, word_case=passbolt.WordCase.CAMELCASE)
)

generate_secret​

A secret from the default generator of policies, those of PassboltClient.get_password_policies for instance.

ParameterTypeRequiredDescription
policiesPasswordPoliciesYesThe generator to use and its settings.

Returns string.

Generate a secret from the organization's policies​

secret = passbolt.generate_secret(client.get_password_policies())

generate_pin_code​

A PIN code of length digits, brought within 4 to 12. Does not fail.

ParameterTypeRequiredDescription
lengthu32NoNumber of digits. Default: 4.

Returns string.

Generate a 6-digit PIN code​

pin_code = passbolt.generate_pin_code(6)

secret_entropy​

The entropy of secret in bits, measured as the extension does: as a passphrase when it is words of the list joined by one separator. Does not fail.

ParameterTypeRequiredDescription
secretstringYesThe secret to measure.

Returns f64.

Measure a password​

print(passbolt.secret_entropy(password))

secret_strength​

The strength the extension shows for secret. Does not fail.

ParameterTypeRequiredDescription
secretstringYesThe secret to rate.

Returns Strength.

Rate a password​

print(passbolt.secret_strength(password))

Records and enums​

Records are plain values. A field with a default can be left out where the language has default arguments; Java builds the records it writes with builders.

Login records​

LoginOptions​

How to log in, beyond the credentials.

FieldTypeDefaultDescription
tls_skip_verifyboolfalse
proxystring?none
mfa_totp_tokenstring?noneThe base32 TOTP secret answering the MFA challenge without prompting.
server_public_keystring?noneThe armored server public key pinned with fetch_server_key: each login then checks the server holds its private key.
metadata_key_fingerprintstring?noneThe shared metadata key fingerprint pinned with PassboltClient.metadata_key_fingerprint: shared metadata is then only encrypted for that key.
timeout_secondsu64?noneSeconds a request may take; None is 60, 0 waits forever.
client_certificate_pemstring?nonePEM certificate and private key, for a server asking for a client certificate (mTLS).
client_key_pemstring?none

ServerKey​

The server public key, to pin.

FieldTypeDescription
fingerprintstringComputed from the key, checked against the one the server announces.
armored_keystring

Resource records​

ResourceView​

A resource with its v5 metadata decrypted, and its secret when it was asked for.

FieldTypeDescription
idstring
namestring
usernamestring
uristringThe first of uris.
uris[string]
descriptionstringThe v5 metadata description, else the v4 one.
folder_parent_idstring?
resource_typestring?The type slug; None for a type the server does not list.
resource_type_idstring?
personalbool?
metadata_key_typestring?user_key (personal) or shared_key for v5 resources.
createdstring?
modifiedstring?
expiredstring?
passwordstring?
totpTotpData?
metadata_jsonstringThe decrypted v5 metadata, or the v4 fields, as a JSON object: the icon and custom fields among them.
secret_jsonstring?The decrypted secret as a JSON object, when it was asked for and decrypted.
errorstring?Why the metadata or the secret could not be decrypted.

NewResource​

A resource to create. Its type comes from the fields set and the server's default version, unless resource_type names it; fields the type does not have are refused.

FieldTypeDefaultDescription
namestringrequired
resource_typestring?noneThe type slug: password-and-description, v5-default, v5-totp-standalone…
usernamestring?none
uris[string][]v4 types have a single URI.
descriptionstring?none
notestring?noneThe secret note of v5 types.
passwordstring?none
totpTotpData?none
pin_codestring?none
folder_parent_idstring?none
expiredstring?noneExpiry date, RFC 3339.
metadata_fields_jsonstring?noneA JSON object of fields set as given, last: the v5 metadata or v4 resource fields.
secret_fields_jsonstring?noneA JSON object of secret fields set as given, last.

ResourceChanges​

Changes to a resource; None keeps the current value.

FieldTypeDefaultDescription
namestring?none
usernamestring?none
uris[string]?nonev4 types have a single URI.
descriptionstring?none
notestring?noneThe secret note of v5 types.
passwordstring?none
pin_codestring?none
totpTotpData?noneThe TOTP fields to change. Adding a TOTP switches to the type with a TOTP.
remove_totpboolfalseSwitches to the type without TOTP.
expiredstring?noneThe new expiry date, RFC 3339.
clear_expiryboolfalseClears the expiry.
metadata_fields_jsonstring?noneA JSON object of fields set as given, last: the v5 metadata or v4 resource fields.
secret_fields_jsonstring?noneA JSON object of secret fields set as given, last.

TotpData​

FieldType
secret_keystring?
algorithmstring?
digitsu32?
periodu64?
issuerstring?

Resource​

FieldTypeDefaultDescription
idstringrequired
namestringrequired
usernamestring?required
uristring?required
descriptionstring?required
folder_parent_idstring?required
resource_type_idstring?required
createdstring?required
modifiedstring?required
created_bystring?required
modified_bystring?required
personalbool?required
favoriteFavorite?required
secrets[Secret]required
permissions[Permission]required
expiredstring?required
metadatastring?nonev5 only: PGP-armored encrypted metadata.
metadata_key_idstring?none
metadata_key_typestring?none

Secret​

FieldType
idstring?
resource_idstring?
user_idstring?
datastring?
createdstring?
modifiedstring?

SecretData​

FieldType
passwordstring?
descriptionstring?
totpTotpData?
rawstring?

Permission​

FieldType
idstring?
acostring?
aco_foreign_keystring?
arostring?
aro_foreign_keystring?
permission_typei32?
createdstring?
modifiedstring?
userUser?
groupGroup?

Favorite​

FieldType
idstring?
foreign_modelstring?
foreign_keystring?
createdstring?

ResourceType​

A resource type of the server; definition is its JSON Schema, as JSON.

FieldType
idstring
slugstring
namestring?
definitionstring?

Folder records​

Folder​

FieldType
idstring
namestring
folder_parent_idstring?
createdstring?
modifiedstring?
created_bystring?
modified_bystring?
personalbool?
permissions[Permission]

FolderTreeNode​

FieldType
folderFolder
children[FolderTreeNode]

User and group records​

User​

FieldType
idstring
usernamestring?
role_idstring?
createdstring?
modifiedstring?
activebool?
deletedbool?
profileUserProfile?
roleRole?
gpg_keyGpgKey?

UserProfile​

FieldType
first_namestring?
last_namestring?

Role​

FieldType
idstring?
namestring?

GpgKey​

FieldType
idstring?
user_idstring?
armored_keystring?
bitsu32?
fingerprintstring?
key_createdstring?

Group​

FieldType
idstring
namestring
createdstring?
modifiedstring?
created_bystring?
modified_bystring?
deletedbool?
groups_users[GroupUser]

GroupUser​

FieldType
idstring?
group_idstring?
user_idstring?
is_adminbool?
createdstring?

Aro​

FieldType
idstring
aro_typestring?
usernamestring?
profileUserProfile?
namestring?

UserDeleteDryRun​

FieldType
resources_sole_owner_countu32
folders_sole_owner_countu32
groups_sole_manager_countu32

GroupDeleteDryRun​

FieldType
resources_sole_group_countu32
folders_sole_group_countu32

DeleteBlockers​

What blocks deleting a user or a group: each item needs a new owner, each group a new manager.

FieldTypeDescription
resources[OwnedItem]
folders[OwnedItem]
groups[ManagedGroup]
groups_to_delete[string]Groups the deleted user is the only member of: deleted with them.

OwnedItem​

A shared resource or folder only the deleted user or group owns, with its permissions.

FieldType
idstring
permissions[Permission]

ManagedGroup​

A group with other members that only the deleted user manages, with its memberships.

FieldType
idstring
namestring
groups_users[GroupUser]

Tag and comment records​

Tag​

FieldType
idstring
slugstring
is_sharedbool?
createdstring?
modifiedstring?

Comment​

FieldType
idstring
parent_idstring?
foreign_keystring?
foreign_modelstring?
contentstring
createdstring?
modifiedstring?
created_bystring?
modified_bystring?
creatorUser?

Settings records​

PasswordExpirySettings​

FieldType
idstring?
default_expiry_period_daysu32?
policy_overridebool?
automatic_expirybool?
automatic_updatebool?

MetadataTypesSettings​

Which metadata versions the organization creates and allows (admin settings).

FieldType
default_resource_typesstring?
default_folder_typestring?
default_tag_typestring?
default_comment_typestring?
allow_creation_of_v5_resourcesbool?
allow_creation_of_v5_foldersbool?
allow_creation_of_v5_tagsbool?
allow_creation_of_v5_commentsbool?
allow_creation_of_v4_resourcesbool?
allow_creation_of_v4_foldersbool?
allow_creation_of_v4_tagsbool?
allow_creation_of_v4_commentsbool?

MetadataKeysSettings​

How metadata keys are used in the organization (admin settings).

FieldType
allow_usage_of_personal_keysbool?
zero_knowledge_key_sharebool?

Password generator records​

PasswordPolicies​

The password policies of the organization: the generator to use and its settings.

FieldTypeDefaultDescription
default_generatorGeneratorTyperequired
password_generator_settingsPasswordGeneratorSettingsrequired
passphrase_generator_settingsPassphraseGeneratorSettingsrequired
external_dictionary_checkbooltrueCheck new passwords against Have I Been Pwned.
sourcestring?noneWhere the server read them: default, file, env, db…
idstring?noneSet once an administrator saved them (Passbolt Pro).

PasswordGeneratorSettings​

How passwords are generated; the defaults are the server's and the extension's: 18 characters of every set but emoji, without look-alike characters.

FieldTypeDefaultDescription
lengthu3218
min_lengthu328
max_lengthu32128
mask_upperbooltrueA-Z
mask_lowerbooltruea-z
mask_digitbooltrue0-9
mask_parenthesisbooltrue{ [ ( | ) ] }
mask_emojiboolfalseThe emoticons of Unicode 6.
mask_char1booltrue# $ % & @ ^ ~
mask_char2booltrue. , : ;
mask_char3booltrue', " and the backtick
mask_char4booltrue/ \ _ -
mask_char5booltrue< * + ! ? =
exclude_look_alike_charsbooltrueLeaves out O l | I 0 1.

PassphraseGeneratorSettings​

How passphrases are generated; the defaults are the server's and the extension's: 9 lowercase words of the EFF list joined by spaces.

FieldTypeDefaultDescription
wordsu329
word_separatorstring" "
word_caseWordCase?noneNone is lowercase.
min_wordsu324
max_wordsu3240

GeneratorType​

What the generator makes by default.

VariantDescription
Password
Passphrase

WordCase​

The case of the words of a passphrase.

VariantDescription
Lowercase
Uppercase
CamelcaseThe first letter of each word in capital.

Strength​

The strength the extension shows for a secret.

VariantDescription
NotAvailableNo secret.
VeryWeakUnder 60 bits.
WeakFrom 60 bits.
FairFrom 80 bits.
StrongFrom 112 bits.
VeryStrongFrom 128 bits.

Error type​

The error of every call; see Errors for its name in each language.

PassboltError​

FFI-safe error type exposed to all target languages.

VariantFields
Transportreason: string
Authreason: string
Cryptoreason: string
Apistatus: u16, reason: string
NotFoundreason: string
Configreason: string
InvalidArgumentreason: string
Otherreason: string

Records no method takes​

Exported with the records, but no method takes them: the list methods take their fields as arguments.

ResourceQuery​

FieldType
searchstring?
favorites_onlybool
owned_by_mebool

FolderQuery​

FieldType
searchstring?

UserQuery​

FieldType
searchstring?
group_idstring?
admin_onlybool

Names in each language​

The generators of UniFFI name everything after the Rust names, in the case of the language:

LanguageMethods and functionsFieldsEnum casesExample
Pythonsnake_casesnake_caseWordCase.CAMELCASEclient.get_resources_by_ids(ids), server_key.armored_key
Rubysnake_casesnake_casePassbolt::WordCase::CAMELCASEclient.get_resources_by_ids(ids)
KotlincamelCasecamelCaseWordCase.CAMELCASEclient.getResourcesByIds(ids), serverKey.armoredKey
SwiftcamelCase, with argument labelscamelCase.camelcaseclient.getResourcesByIds(ids: ids)
JavacamelCasecamelCase accessorsWordCase.CAMELCASEclient.getResourcesByIds(ids), serverKey.armoredKey()
C#PascalCasecamelCaseWordCase.Camelcaseclient.GetResourcesByIds(ids), serverKey.armoredKey
GoPascalCase, Go initialismsPascalCase, Go initialismsWordCaseCamelcaseclient.GetResourcesByIDs(ids), serverKey.ArmoredKey

Where the constructors and functions live​

LanguageConstructorsFunctions
Pythonpassbolt.Client.login(...), passbolt.Client.login_with_config(...)passbolt.fetch_server_key(...)
RubyPassbolt::Client.login(...)Passbolt.fetch_server_key(...)
KotlinPassboltClient.login(...), PassboltClient.loginWithConfig(...)functions of the package com.passbolt.sdk: fetchServerKey(...)
SwiftPassboltClient.login(serverUrl:privateKeyArmored:passphrase:)global functions: fetchServerKey(serverUrl:)
JavaPassboltClient.login(...), PassboltClient.loginWithConfig(...)static methods of PassboltFfi: PassboltFfi.fetchServerKey(url, false)
C#PassboltClient.Login(...), PassboltClient.LoginWithConfig(...)static methods of PassboltFfi: PassboltFfi.FetchServerKey(url)
Gopassbolt.PassboltClientLogin(...), passbolt.PassboltClientLoginWithConfig(...)passbolt.FetchServerKey(url, false)

What each binding adds or changes​

  • Python. passbolt.Client.login takes the fields of LoginOptions as keywords (server_public_key=, mfa_totp_token=…), and the client is a context manager that logs out. generate_password, generate_passphrase and generate_secret take their settings as an optional argument. passbolt.PermissionType names the permission types (READ, UPDATE, OWNER, REVOKE). See Python.
  • Ruby. Passbolt::Client.login takes the login options as keywords and a block that logs out. Flags and optional arguments are keywords (list_resources(search = nil, favorites_only: false, owned_by_me: false), share_resource(id, permission_type:, user_ids: [], group_ids: [])); Passbolt.generate_password and Passbolt.generate_passphrase take the fields of their settings as keywords. Passbolt::PermissionType names the permission types. See Ruby.
  • Kotlin, Swift, C#. The arguments and record fields with a default can be left out, by name: listResourceViews(search = "github"), NewResource(name: "GitHub"), new ResourceChanges(password: "new"). The numbers are unsigned where Rust's are (UInt, ULong in Kotlin).
  • Java. No default arguments: a method takes all its arguments, null for an optional value, false for a flag, List.of() for no ID. The records you write have builders that start from their defaults: NewResourceBuilder, ResourceChangesBuilder, LoginOptionsBuilder, TotpDataBuilder, PasswordGeneratorSettingsBuilder, PassphraseGeneratorSettingsBuilder. See Java.
  • Go. The initialisms are capitals: ID, URL, URI, JSON, API, TLS, HTTP (GetResourcesByIDs, BaseURL(), MetadataJSON). The methods with optional arguments take an option struct, whose zero value is the default: see the table below. The other methods take every argument, nil for an optional one (CreateFolder(name, nil)). PermissionRead, PermissionUpdate, PermissionOwner and PermissionRevoke name the permission types. Close logs out and releases the client; Call and Run stop waiting on a context.Context. See Go.

Go option structs​

MethodOption struct
ListResources*ResourceListOptions: Search, FavoritesOnly, OwnedByMe
ListResourceViews*ResourceViewListOptions: Search, WithSecrets
ListFolders*FolderListOptions: Search
ListUsers*UserListOptions: Search, GroupID, AdminOnly
UpdateGroupGroupChanges: Name, AddMemberIDs, AddManagerIDs, RemoveMemberIDs
UpdateUserUserChanges: FirstName, LastName, Role
ShareResourceShare: Permission, UserIDs, GroupIDs
ShareFolderFolderShare: Permission, UserIDs, GroupIDs, WithContent

The async client​

AsyncPassboltClient has the constructors and methods of PassboltClient, awaited in the way of each language. The SDK's own threads do the network work: the caller's thread or event loop goes on meanwhile.

LanguageAsync clientA call returns
Pythonpassbolt.AsyncClient (async with)a coroutine
KotlinAsyncPassboltClientsuspend functions
SwiftAsyncPassboltClientasync throws methods
JavaAsyncPassboltClienta CompletableFuture
C#AsyncPassboltClienta Task (the names have no Async suffix)
Gonone: the calls block, use goroutines
Rubynone: the UniFFI generator of Ruby has no async support
note

user_id and base_url are not awaited. The functions (fetch_server_key, the generator, the OpenPGP helpers) block in every language.

Run two calls at once​

import asyncio

import passbolt


async def main(private_key: str, passphrase: str) -> None:
async with await passbolt.AsyncClient.login(
"https://passbolt.example.com", private_key, passphrase
) as client:
views, folders = await asyncio.gather(
client.list_resource_views("github"), client.list_folders()
)

Errors​

Every failure is a PassboltError with one of the variants of PassboltError, each with its reason; Api also has the HTTP status.

LanguageErrorVariants
Pythonpassbolt.PassboltErrorsubclasses TransportError, AuthError, CryptoError, ApiError, NotFoundError, ConfigError, InvalidArgumentError
RubyPassbolt::Error, a module every error includesPassbolt::TransportError, AuthError, CryptoError, ApiError, NotFoundError, ConfigError, InvalidArgumentError
KotlinPassboltException, a sealed classPassboltException.Auth, .Api…
JavaPassboltException, checkednested classes PassboltException.Auth, .Api…
C#PassboltExceptionnested classes PassboltException.Auth, .Api…
SwiftPassboltError, an Error enum.Auth, .Api(status, reason)…
Go*passbolt.PassboltError*PassboltErrorAuth, *PassboltErrorAPI…, matched with errors.As, or errors.Is and ErrPassboltErrorNotFound…

Handle a missing resource​

try:
client.get_resource_view("<RESOURCE_UUID>")
except passbolt.NotFoundError:
print("No such resource")
except passbolt.ApiError as error:
print("The server answered", error.status, error.reason)

JavaScript​

The npm package, built from crates/passbolt-wasm, has the same operations on a PassboltSession whose methods return promises. Its names are camelCase, the methods with optional arguments take an options object (listResourceViews({ search, withSecrets }), shareResource(id, { userIds, permissionType })), the objects keep the field names of the Passbolt API, and its errors have a code. Its methods, options, types and error codes are on the JavaScript page.