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.
Permissions
tenant:member:read
Request
- cURL
- JavaScript
- C#
- Java
- Python
- Go
curl "https://api.basistheory.com/tenants/self/members" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>"
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("<MANAGEMENT_API_KEY>");
const tenantMembers = await bt.tenants.listMembers();
using BasisTheory.net.Tenants;
var client = new TenantClient("<MANAGEMENT_API_KEY>");
var tenantMembers = await client.GetMembersAsync();
import com.basistheory.*;
import com.basistheory.auth.*;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
public class Example {
public static void main(String[] args) throws Exception {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.basistheory.com");
ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
ApiKey.setApiKey("<MANAGEMENT_API_KEY>");
TenantsApi apiInstance = new TenantsApi(defaultClient);
List<UUID> userId = Arrays.asList();
Integer page = 1;
Integer size = 50;
TenantMemberResponsePaginatedList result = apiInstance.getMembers(userId, page, size);
}
}
import basistheory
from basistheory.api import tenants_api
with basistheory.ApiClient(configuration=basistheory.Configuration(api_key="<MANAGEMENT_API_KEY>")) as api_client:
tenant_client = tenants_api.TenantsApi(api_client)
tenant_members = tenant_client.get_members()
package main
import (
"context"
"github.com/Basis-Theory/basistheory-go/v3"
)
func main() {
configuration := basistheory.NewConfiguration()
apiClient := basistheory.NewAPIClient(configuration)
contextWithAPIKey := context.WithValue(context.Background(), basistheory.ContextAPIKeys, map[string]basistheory.APIKey{
"ApiKey": {Key: "<MANAGEMENT_API_KEY>"},
})
tenantMembers, httpResponse, err := apiClient.TenantsApi.GetMembers(contextWithAPIKey).Execute()
}
Query Parameters
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
user_id | false | uuid | null | One to many User IDs to query for. Multiple IDs can be passed in the form ?user_id=<value1>&user_id=<value2> . |
page | false | integer | 1 | Page number of the results to return. |
size | false | integer | 20 | Number 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.
Permissions
tenant:member:delete
Request
- cURL
- JavaScript
- C#
- Java
- Python
- Go
curl "https://api.basistheory.com/tenants/self/members/5540a02f-99e7-46de-8f41-1b3cf7b2a3d2" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>" \
-X "DELETE"
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("<MANAGEMENT_API_KEY>");
await bt.tenants.deleteMember("5540a02f-99e7-46de-8f41-1b3cf7b2a3d2");
using BasisTheory.net.Tenants;
var client = new TenantClient("<MANAGEMENT_API_KEY>");
await client.DeleteMemberAsync("5540a02f-99e7-46de-8f41-1b3cf7b2a3d2");
import com.basistheory.*;
import com.basistheory.auth.*;
import java.util.UUID;
public class Example {
public static void main(String[] args) throws Exception {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.basistheory.com");
ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
ApiKey.setApiKey("<MANAGEMENT_API_KEY>");
TenantsApi apiInstance = new TenantsApi(defaultClient);
apiInstance.deleteMember(UUID.fromString("5540a02f-99e7-46de-8f41-1b3cf7b2a3d2"));
}
}
import basistheory
from basistheory.api import tenants_api
with basistheory.ApiClient(configuration=basistheory.Configuration(api_key="<MANAGEMENT_API_KEY>")) as api_client:
tenant_client = tenants_api.TenantsApi(api_client)
tenant_client.delete_member(member_id="5540a02f-99e7-46de-8f41-1b3cf7b2a3d2")
package main
import (
"context"
"github.com/Basis-Theory/basistheory-go/v3"
)
func main() {
configuration := basistheory.NewConfiguration()
apiClient := basistheory.NewAPIClient(configuration)
contextWithAPIKey := context.WithValue(context.Background(), basistheory.ContextAPIKeys, map[string]basistheory.APIKey{
"ApiKey": {Key: "<MANAGEMENT_API_KEY>"},
})
httpResponse, err := apiClient.TenantsApi.DeleteMember(contextWithAPIKey, "5540a02f-99e7-46de-8f41-1b3cf7b2a3d2").Execute()
}
URI Parameters
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
id | true | uuid | null | The 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.
Permissions
tenant:invitation:create
Request
- cURL
- JavaScript
- C#
- Java
- Python
- Go
curl "https://api.basistheory.com/tenants/self/invitations" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>" \
-H "Content-Type: application/json" \
-X "POST" \
-d '{
"email": "jane@doe.com",
}'
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("<MANAGEMENT_API_KEY>");
const createdInvitation = await bt.tenants.createInvitations({
email: "jane@doe.com",
});
using BasisTheory.net.Tenants;
var client = new TenantClient("<MANAGEMENT_API_KEY>");
var createdInvitation = await client.CreateInvitationAsync(new TenantInvitation
{
Email = "jane@doe.com"
});
import com.basistheory.*;
import com.basistheory.auth.*;
public class Example {
public static void main(String[] args) throws Exception {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.basistheory.com");
ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
ApiKey.setApiKey("<MANAGEMENT_API_KEY>");
TenantsApi apiInstance = new TenantsApi(defaultClient);
CreateTenantInvitationRequest createTenantInvitationRequest = new CreateTenantInvitationRequest(); // CreateTenantInvitationRequest |
TenantInvitationResponse result = apiInstance.createInvitation(createTenantInvitationRequest.email("jane@doe.com"));
}
}
import basistheory
from basistheory.api import tenants_api
from basistheory.model.create_tenant_invitation_request import CreateTenantInvitationRequest
with basistheory.ApiClient(configuration=basistheory.Configuration(api_key="<MANAGEMENT_API_KEY>")) as api_client:
tenant_client = tenants_api.TenantsApi(api_client)
created_invitation = tenant_client.create_invitation(create_tenant_invitation_request=CreateTenantInvitationRequest(
email="jane@doe.com"
))
package main
import (
"context"
"github.com/Basis-Theory/basistheory-go/v3"
)
func main() {
configuration := basistheory.NewConfiguration()
apiClient := basistheory.NewAPIClient(configuration)
contextWithAPIKey := context.WithValue(context.Background(), basistheory.ContextAPIKeys, map[string]basistheory.APIKey{
"ApiKey": {Key: "<MANAGEMENT_API_KEY>"},
})
createTenantInvitationRequest := *basistheory.NewCreateTenantInvitationRequest("jane@doe.com")
createdInvitation, httpResponse, err := apiClient.TenantsApi.CreateInvitation(contextWithAPIKey).CreateTenantInvitationRequest(createTenantInvitationRequest).Execute()
}
Request Parameters
Attribute | Required | Type | Default | Description |
---|---|---|---|---|
email | true | string | null | The 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.
Permissions
tenant:invitation:create
tenant:invitation:update
Request
- cURL
- JavaScript
- C#
- Java
- Python
- Go
curl "https://api.basistheory.com/tenants/self/invitations/fb32ea26-2185-4ad2-a7bf-2fe69c00ae13/resend" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>" \
-H "Content-Type: application/json" \
-X "POST"
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("<MANAGEMENT_API_KEY>");
const resentInvitation = await bt.tenants.resendInvitation(
"fb32ea26-2185-4ad2-a7bf-2fe69c00ae13"
);
using BasisTheory.net.Tenants;
var client = new TenantClient("<MANAGEMENT_API_KEY>");
var resentInvitation = await client.ResendInvitationAsync("fb32ea26-2185-4ad2-a7bf-2fe69c00ae13");
import com.basistheory.*;
import com.basistheory.auth.*;
import java.util.UUID;
public class Example {
public static void main(String[] args) throws Exception {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.basistheory.com");
ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
ApiKey.setApiKey("<MANAGEMENT_API_KEY>");
TenantsApi apiInstance = new TenantsApi(defaultClient);
TenantInvitationResponse result = apiInstance.resendInvitation(UUID.fromString("fb32ea26-2185-4ad2-a7bf-2fe69c00ae13"));
}
}
import basistheory
from basistheory.api import tenants_api
with basistheory.ApiClient(configuration=basistheory.Configuration(api_key="<MANAGEMENT_API_KEY>")) as api_client:
tenant_client = tenants_api.TenantsApi(api_client)
resent_invitation = tenant_client.resend_invitation(invitation_id="dfd0319e-e978-4d2a-9109-f8a9048088bd")
package main
import (
"context"
"github.com/Basis-Theory/basistheory-go/v3"
)
func main() {
configuration := basistheory.NewConfiguration()
apiClient := basistheory.NewAPIClient(configuration)
contextWithAPIKey := context.WithValue(context.Background(), basistheory.ContextAPIKeys, map[string]basistheory.APIKey{
"ApiKey": {Key: "<MANAGEMENT_API_KEY>"},
})
resentInvitation, httpResponse, err := apiClient.TenantsApi.ResendInvitation(contextWithAPIKey, "dfd0319e-e978-4d2a-9109-f8a9048088bd").Execute()
}
URI Parameters
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
id | true | uuid | null | The 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.
Permissions
tenant:invitation:read
Request
- cURL
- JavaScript
- C#
- Java
- Python
- Go
curl "https://api.basistheory.com/tenants/self/invitations" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>"
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("<MANAGEMENT_API_KEY>");
const invitations = await bt.tenants.listInvitations();
using BasisTheory.net.Tenants;
var client = new TenantClient("<MANAGEMENT_API_KEY>");
var invitations = await client.GetInvitationsAsync();
import com.basistheory.*;
import com.basistheory.auth.*;
public class Example {
public static void main(String[] args) throws Exception {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.basistheory.com");
ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
ApiKey.setApiKey("<MANAGEMENT_API_KEY>");
TenantsApi apiInstance = new TenantsApi(defaultClient);
TenantInvitationStatus status = TenantInvitationStatus.fromValue("PENDING");
Integer page = 1;
Integer size = 56;
TenantInvitationResponsePaginatedList result = apiInstance.getInvitations(status, page, size);
}
}
import basistheory
from basistheory.api import tenants_api
with basistheory.ApiClient(configuration=basistheory.Configuration(api_key="<MANAGEMENT_API_KEY>")) as api_client:
tenant_client = tenants_api.TenantsApi(api_client)
invitations = tenant_client.get_invitations()
package main
import (
"context"
"github.com/Basis-Theory/basistheory-go/v3"
)
func main() {
configuration := basistheory.NewConfiguration()
apiClient := basistheory.NewAPIClient(configuration)
contextWithAPIKey := context.WithValue(context.Background(), basistheory.ContextAPIKeys, map[string]basistheory.APIKey{
"ApiKey": {Key: "<MANAGEMENT_API_KEY>"},
})
invitations, httpResponse, err := apiClient.TenantsApi.GetInvitations(contextWithAPIKey).Execute()
}
Query Parameters
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
page | false | integer | 1 | Page number of the results to return. |
size | false | integer | 20 | Number 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.
Permissions
tenant:invitation:read
Request
- cURL
- JavaScript
- C#
- Java
- Python
- Go
curl "https://api.basistheory.com/tenants/self/invitations/fb32ea26-2185-4ad2-a7bf-2fe69c00ae13" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>"
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("<MANAGEMENT_API_KEY>");
const invitation = await bt.tenants.retrieveInvitation(
"fb32ea26-2185-4ad2-a7bf-2fe69c00ae13"
);
using BasisTheory.net.Tenants;
var client = new TenantClient("<MANAGEMENT_API_KEY>");
var invitation = await client.GetInvitationByIdAsync("fb32ea26-2185-4ad2-a7bf-2fe69c00ae13");
Not Available.
import basistheory
from basistheory.api import tenants_api
with basistheory.ApiClient(configuration=basistheory.Configuration(api_key="<MANAGEMENT_API_KEY>")) as api_client:
tenant_client = tenants_api.TenantsApi(api_client)
invitation = tenant_client.get_invitation_by_id(invitation_id="fb32ea26-2185-4ad2-a7bf-2fe69c00ae13")
package main
import (
"context"
"github.com/Basis-Theory/basistheory-go/v3"
)
func main() {
configuration := basistheory.NewConfiguration()
apiClient := basistheory.NewAPIClient(configuration)
contextWithAPIKey := context.WithValue(context.Background(), basistheory.ContextAPIKeys, map[string]basistheory.APIKey{
"ApiKey": {Key: "<MANAGEMENT_API_KEY>"},
})
invitation, httpResponse, err := apiClient.TenantsApi.GetInvitationById(contextWithAPIKey, "fb32ea26-2185-4ad2-a7bf-2fe69c00ae13").Execute()
}
URI Parameters
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
id | true | uuid | null | The 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.
Permissions
tenant:invitation:delete
Request
- cURL
- JavaScript
- C#
- Java
- Python
- Go
curl "https://api.basistheory.com/tenants/self/invitations/fb32ea26-2185-4ad2-a7bf-2fe69c00ae13" \
-H "BT-API-KEY: <MANAGEMENT_API_KEY>" \
-X "DELETE"
import { BasisTheory } from "@basis-theory/basis-theory-js";
const bt = await new BasisTheory().init("<MANAGEMENT_API_KEY>");
await bt.tenants.deleteInvitation("fb32ea26-2185-4ad2-a7bf-2fe69c00ae13");
using BasisTheory.net.Tenants;
var client = new TenantClient("<MANAGEMENT_API_KEY>");
await client.DeleteInvitationAsync("fb32ea26-2185-4ad2-a7bf-2fe69c00ae13");
import com.basistheory.*;
import com.basistheory.auth.*;
import java.util.UUID;
public class Example {
public static void main(String[] args) throws Exception {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.basistheory.com");
ApiKeyAuth ApiKey = (ApiKeyAuth) defaultClient.getAuthentication("ApiKey");
ApiKey.setApiKey("<MANAGEMENT_API_KEY>");
TenantsApi apiInstance = new TenantsApi(defaultClient);
apiInstance.deleteInvitation(UUID.fromString("fb32ea26-2185-4ad2-a7bf-2fe69c00ae13"));
}
}
import basistheory
from basistheory.api import tenants_api
with basistheory.ApiClient(configuration=basistheory.Configuration(api_key="<MANAGEMENT_API_KEY>")) as api_client:
tenant_client = tenants_api.TenantsApi(api_client)
tenant_client.delete_invitation(invitation_id="fb32ea26-2185-4ad2-a7bf-2fe69c00ae13")
package main
import (
"context"
"github.com/Basis-Theory/basistheory-go/v3"
)
func main() {
configuration := basistheory.NewConfiguration()
apiClient := basistheory.NewAPIClient(configuration)
contextWithAPIKey := context.WithValue(context.Background(), basistheory.ContextAPIKeys, map[string]basistheory.APIKey{
"ApiKey": {Key: "<MANAGEMENT_API_KEY>"},
})
httpResponse, err := apiClient.TenantsApi.DeleteInvitation(contextWithAPIKey, "fb32ea26-2185-4ad2-a7bf-2fe69c00ae13").Execute()
}
URI Parameters
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
id | true | uuid | null | The ID of the Tenant Invitation |
Response
Returns an error if the Tenant Invitation could not be deleted.
Tenant Member Object
Attribute | Type | Description |
---|---|---|
id | uuid | Unique identifier of the Tenant Member |
tenant_id | uuid | The Tenant ID that the membership is attached |
role | string | The Role assigned to the Tenant Member |
user | user object | The User which this membership is attached to |
created_by | uuid | (Optional) The ID of the User or Application that created the Tenant Member |
created_at | date | (Optional) Created date of the Tenant Member in ISO 8601 format |
modified_by | uuid | (Optional) The ID of the User or Application that last modified the Tenant Member |
modified_at | date | (Optional) Last modified date of the Tenant Member in ISO 8601 format |
Roles
Role | Description |
---|---|
OWNER | The OWNER role is automatically assigned to the Tenant Owner and grants full access to all features. The Tenant OWNER cannot be deleted. |
ADMIN | The ADMIN role is assigned by default to all members and grants full access to all features. |
User Object
Attribute | Type | Description |
---|---|---|
id | uuid | Unique identifier of the User |
email | string | (Optional) The e-mail address of the User |
first_name | string | (Optional) The User's first name |
last_name | string | (Optional) The User's last name |
picture | string | (Optional) A URI pointing to the User's picture |
Tenant Invitation Object
Attribute | Type | Description |
---|---|---|
id | uuid | Unique identifier of the Tenant Invitation |
tenant_id | uuid | The Tenant ID that the invitation is tied to. When the invitation is accepted, a new Tenant Member will be created in this Tenant. |
email | string | The invitee's e-mail address |
status | string | The status of the invitation (i.e. PENDING or EXPIRED ) |
expires_at | date | The 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_by | uuid | (Optional) The ID of the User or Application that created the Tenant Invitation |
created_at | date | (Optional) Created date of the Tenant Invitation in ISO 8601 format |
modified_by | uuid | (Optional) The ID of the User or Application that last modified the Tenant Invitation |
modified_at | date | (Optional) Last modified date of the Tenant Invitation in ISO 8601 format |