Skip to main content

Tenant Members

Tenant Members enable user management operations within the context of a Tenant. New members can be invited via e-mail to join an existing tenant. Upon accepting a Tenant Invitation, a new Tenant Member will be created.

List Tenant Members

Get a list of Tenant Members for the Tenant.

GET https://api.basistheory.com/tenants/self/members
Copy

Permissions

tenant:member:read

Request

curl "https://api.basistheory.com/tenants/self/members" \
-H "BT-API-KEY: key_N88mVGsp3sCXkykyN2EFED"

Query Parameters

ParameterRequiredTypeDefaultDescription
user_idfalseuuidnullOne to many User IDs to query for. Multiple IDs can be passed in the form ?user_id=<value1>&user_id=<value2>.
pagefalseinteger1Page number of the results to return.
sizefalseinteger20Number of the results to return per page. Maximum size of 50 results.

Response

Returns a paginated object with the data property containing an array of Tenant Members. Providing any query parameters will filter the results. Returns an error if Tenant Members could not be retrieved.

{
"pagination": {...},
"data": [
{
"id": "5540a02f-99e7-46de-8f41-1b3cf7b2a3d2",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"role": "ADMIN",
"user": {
"id": "dc5fca8c-dd54-41df-98fc-50d7a1e7fb4d",
"email": "jane@doe.com",
"first_name": "Jane",
"last_name": "Doe",
"picture": ""
},
"created_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"created_at": "2020-09-15T15:53:00+00:00",
"modified_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"modified_at": "2021-03-01T08:23:14+00:00"
},
{...},
{...}
]
}

Delete Tenant Member

Delete a Tenant Member by ID from the Tenant. Deleting a Tenant Member will revoke all access from the Tenant.

DELETE https://api.basistheory.com/tenants/self/members/{id}
Copy

Permissions

tenant:member:delete

Request

curl "https://api.basistheory.com/tenants/self/members/5540a02f-99e7-46de-8f41-1b3cf7b2a3d2" \
-H "BT-API-KEY: key_N88mVGsp3sCXkykyN2EFED" \
-X "DELETE"

URI Parameters

ParameterRequiredTypeDefaultDescription
idtrueuuidnullThe ID of the Tenant Member

Response

Returns an error if the Tenant Member could not be deleted.

Create Tenant Invitation

Invite a new member to join this Tenant. Creating a Tenant Invitation will send an e-mail to the recipient containing a link to accept the invitation.

POST https://api.basistheory.com/tenants/self/invitations
Copy

Permissions

tenant:invitation:create

Request

curl "https://api.basistheory.com/tenants/self/invitations" \
-H "BT-API-KEY: key_N88mVGsp3sCXkykyN2EFED" \
-H "Content-Type: application/json" \
-X "POST" \
-d '{
"email": "jane@doe.com",
}'

Request Parameters

AttributeRequiredTypeDefaultDescription
emailtruestringnullThe invitee's e-mail address. Has to be a well-formed e-mail address (RFC 5322).

Response

Returns a Tenant Invitation if the Tenant Invitation was created. Returns an error if there were validation errors, or the Tenant Invitation failed to create.

{
"id": "fb32ea26-2185-4ad2-a7bf-2fe69c00ae13",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"email": "jane@doe.com",
"status": "PENDING",
"expires_at": "2020-09-18T15:53:00+00:00",
"created_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"created_at": "2020-09-15T15:53:00+00:00"
}

Resend Tenant Invitation

Resend a pending or expired Tenant Invitation. Resending the invitation will extend the expiration by 72 hours and invalidate any previous invitation link(s) sent to the recipient.

POST https://api.basistheory.com/tenants/self/invitations/{id}/resend
Copy

Permissions

tenant:invitation:createtenant:invitation:update

Request

curl "https://api.basistheory.com/tenants/self/invitations/fb32ea26-2185-4ad2-a7bf-2fe69c00ae13/resend" \
-H "BT-API-KEY: key_N88mVGsp3sCXkykyN2EFED" \
-H "Content-Type: application/json" \
-X "POST"

URI Parameters

ParameterRequiredTypeDefaultDescription
idtrueuuidnullThe ID of the Tenant Invitation

Response

Returns a Tenant Invitation if the Tenant Invitation was resent. Returns an error if there were validation errors, or the Tenant Invitation failed to resend.

{
"id": "fb32ea26-2185-4ad2-a7bf-2fe69c00ae13",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"email": "jane@doe.com",
"status": "PENDING",
"expires_at": "2020-09-18T15:53:00+00:00",
"created_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"created_at": "2020-09-15T15:53:00+00:00"
}

List Tenant Invitations

Get a list of Tenant Invitations for the Tenant.

GET https://api.basistheory.com/tenants/self/invitations
Copy

Permissions

tenant:invitation:read

Request

curl "https://api.basistheory.com/tenants/self/invitations" \
-H "BT-API-KEY: key_N88mVGsp3sCXkykyN2EFED"

Query Parameters

ParameterRequiredTypeDefaultDescription
pagefalseinteger1Page number of the results to return.
sizefalseinteger20Number of the results to return per page. Maximum size of 100 results.

Response

Returns a paginated object with the data property containing an array of Tenant Invitations. Providing any query parameters will filter the results. Returns an error if Tenant Invitations could not be retrieved.

{
"pagination": {...},
"data": [
{
"id": "fb32ea26-2185-4ad2-a7bf-2fe69c00ae13",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"email": "jane@doe.com",
"status": "PENDING",
"expires_at": "2020-09-18T15:53:00+00:00",
"created_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"created_at": "2020-09-15T15:53:00+00:00"
},
{...},
{...}
]
}

Get a Tenant Invitation

Get a Tenant Invitation by ID in the Tenant.

GET https://api.basistheory.com/tenants/self/invitations/{id}
Copy

Permissions

tenant:invitation:read

Request

curl "https://api.basistheory.com/tenants/self/invitations/fb32ea26-2185-4ad2-a7bf-2fe69c00ae13" \
-H "BT-API-KEY: key_N88mVGsp3sCXkykyN2EFED"

URI Parameters

ParameterRequiredTypeDefaultDescription
idtrueuuidnullThe ID of the Tenant Invitation

Response

Returns a Tenant Invitation with the id provided. Returns an error if the Tenant Invitation could not be retrieved.

{
"id": "fb32ea26-2185-4ad2-a7bf-2fe69c00ae13",
"tenant_id": "77cb0024-123e-41a8-8ff8-a3d5a0fa8a08",
"email": "jane@doe.com",
"status": "PENDING",
"expires_at": "2020-09-18T15:53:00+00:00",
"created_by": "fb124bba-f90d-45f0-9a59-5edca27b3b4a",
"created_at": "2020-09-15T15:53:00+00:00"
}

Delete Tenant Invitation

Delete a Tenant Invitation by ID from the Tenant. Deleting a Tenant Invitation will invalidate any outstanding invitation links sent to the recipient.

DELETE https://api.basistheory.com/tenants/self/invitations/{id}
Copy

Permissions

tenant:invitation:delete

Request

curl "https://api.basistheory.com/tenants/self/invitations/fb32ea26-2185-4ad2-a7bf-2fe69c00ae13" \
-H "BT-API-KEY: key_N88mVGsp3sCXkykyN2EFED" \
-X "DELETE"

URI Parameters

ParameterRequiredTypeDefaultDescription
idtrueuuidnullThe ID of the Tenant Invitation

Response

Returns an error if the Tenant Invitation could not be deleted.

Tenant Member Object

AttributeTypeDescription
iduuidUnique identifier of the Tenant Member
tenant_iduuidThe Tenant ID that the membership is attached
rolestringThe Role assigned to the Tenant Member
useruser objectThe User which this membership is attached to
created_byuuid(Optional) The ID of the User or Application that created the Tenant Member
created_atdate(Optional) Created date of the Tenant Member in ISO 8601 format
modified_byuuid(Optional) The ID of the User or Application that last modified the Tenant Member
modified_atdate(Optional) Last modified date of the Tenant Member in ISO 8601 format

Roles

RoleDescription
OWNERThe OWNER role is automatically assigned to the Tenant Owner and grants full access to all features. The Tenant OWNER cannot be deleted.
ADMINThe ADMIN role is assigned by default to all members and grants full access to all features.

User Object

AttributeTypeDescription
iduuidUnique identifier of the User
emailstring(Optional) The e-mail address of the User
first_namestring(Optional) The User's first name
last_namestring(Optional) The User's last name
picturestring(Optional) A URI pointing to the User's picture

Tenant Invitation Object

AttributeTypeDescription
iduuidUnique identifier of the Tenant Invitation
tenant_iduuidThe Tenant ID that the invitation is tied to. When the invitation is accepted, a new Tenant Member will be created in this Tenant.
emailstringThe invitee's e-mail address
statusstringThe status of the invitation (i.e. PENDING or EXPIRED)
expires_atdateThe expiration date of the invitation is ISO 8601 format. By default, the invitation expires 72 hours from the time it was created. Invitations can be resent to extend the expiration, but doing so will invalidate the previous invitation link sent to the invitee.
created_byuuid(Optional) The ID of the User or Application that created the Tenant Invitation
created_atdate(Optional) Created date of the Tenant Invitation in ISO 8601 format
modified_byuuid(Optional) The ID of the User or Application that last modified the Tenant Invitation
modified_atdate(Optional) Last modified date of the Tenant Invitation in ISO 8601 format