GuidesShare and revoke access

Share and revoke access

Grant a role on an address or folder, change or revoke a grant, and check who has access and where it comes from.

Address access is granted either selectively, on a single address, or broadly, on an entire folder, with the viewer or contributor role. The subject can be a user or a group, and a folder grant also covers future addresses. This guide shows how to grant, change, and revoke access and how to check who has it. For the underlying model, see Addresses, folders, and access.

Where address access comes from and how it shows up in participants:

Prerequisites

  • The Vault's code and the id of the address or folder.
  • A subject: a userId or a group id.
  • An access token (see Authentication).

Access roles:

RoleWhat it roughly grants
viewerviewing the address, or the folder and its addresses
contributorextended permissions (see Addresses, folders, and access for the exact set)

The canCreateAddress permission isn't part of any role and is granted separately.

Step 1. Grant access to an address

POST /api/v1/vaults/{code}/addresses/{id}/shares issues a grant on a specific address. The subject is polymorphic (subjectType: user|group), and permissions are set by the role.

curl -X POST "[BASE_URL]/api/v1/vaults/acme-otc/addresses/ADDRESS_ID/shares" \
  -H "Authorization: Bearer $V3_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "subjectType": "user", "subjectId": "USER_ID", "role": "viewer" }'

An address grant is idempotent: granting again to the same subject updates the permissions and reactivates a revoked grant, so there's no separate "update" call. For the batch form, use subjects[]. The canCreateAddress permission isn't part of any role and is granted separately. See the API Reference for the exact schema.

Step 2. Grant access to a folder

A folder grant gives permissions on all of the folder's addresses, including ones added later:

curl -X POST "[BASE_URL]/api/v1/vaults/acme-otc/address-folders/FOLDER_ID/grants" \
  -H "Authorization: Bearer $V3_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "subjectType": "group", "subjectId": "USER_GROUP_ID", "role": "contributor" }'

Step 3. Change or revoke a grant

Which request to use for each action:

ActionRequest
grant on an addressPOST .../addresses/{id}/shares
grant on a folderPOST .../address-folders/{id}/grants
change a folder grantPATCH .../address-folders/{id}/grants/{grantId}
revoke a folder grantDELETE .../address-folders/{id}/grants/{grantId}
change an address grantrepeat POST .../shares (idempotent)
revoke an address grantDELETE on the share
curl -X PATCH "[BASE_URL]/api/v1/vaults/acme-otc/address-folders/FOLDER_ID/grants/GRANT_ID" \
  -H "Authorization: Bearer $V3_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "role": "viewer" }'

Revoking a group grant removes access for all of the group's members; a personal grant is revoked individually.

Step 4. Check who has access and where it comes from

curl "[BASE_URL]/api/v1/vaults/acme-otc/addresses/ADDRESS_ID/participants" \
  -H "Authorization: Bearer $V3_TOKEN"

participants lists people (the owner is returned separately, and groups are expanded), and the via field shows the source of access and therefore how to remove it:

viaSourceHow to remove
directpersonal grant on the addressDELETE the share
user_groupgroup grantremove from the group or revoke the group grant
folderfolder grantchange or revoke the folder grant

Related lists:

ListRequest
shared with me (direct only)GET .../shared-with-me
shared by meGET .../shared-by-me
everything accessible to meGET .../addresses?access=shared
address participantsGET .../addresses/{id}/participants

Common mistakes

SymptomCause
grant "duplicated"a repeated POST /shares doesn't create a second grant; it updates idempotently
access wasn't removedthe personal grant was revoked, but access remains via a group or folder; check via
no permission to create addressescanCreateAddress isn't part of any role and is granted separately
group revocation affected too many peopleDELETE on a group grant removes access for all of its members
a future address isn't accessiblethe grant was issued on an address, not a folder

You're done when

  • POST on a share or grant has created access with the right role;
  • PATCH changes a folder grant's role, and DELETE revokes it;
  • participants.via shows the source of access;
  • revoking through the right source actually removes access.

Next steps