Skip to content

Latest commit

 

History

History
247 lines (146 loc) · 9.71 KB

TenantsApi.md

File metadata and controls

247 lines (146 loc) · 9.71 KB

\TenantsApi

All URIs are relative to http://localhost

Method HTTP request Description
create_tenant POST /v2/facts/{proj_id}/{env_id}/tenants Create Tenant
delete_tenant DELETE /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id} Delete Tenant
delete_tenant_user DELETE /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id}/users/{user_id} Delete Tenant User
get_tenant GET /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id} Get Tenant
list_tenant_users GET /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id}/users List Tenant Users
list_tenants GET /v2/facts/{proj_id}/{env_id}/tenants List Tenants
update_tenant PATCH /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id} Update Tenant

create_tenant

models::TenantRead create_tenant(proj_id, env_id, tenant_create) Create Tenant

Creates a new tenant inside the Permit.io system. If the tenant is already created: will return 200 instead of 201, and will return the existing tenant object in the response body.

Parameters

Name Type Description Required Notes
proj_id String Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). [required]
env_id String Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). [required]
tenant_create TenantCreate [required]

Return type

models::TenantRead

Authorization

HTTPBearer

HTTP request headers

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

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

delete_tenant

delete_tenant(tenant_id, proj_id, env_id) Delete Tenant

Deletes the tenant and all its related data.

Parameters

Name Type Description Required Notes
tenant_id String Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the "slug"). [required]
proj_id String Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). [required]
env_id String Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). [required]

Return type

(empty response body)

Authorization

HTTPBearer

HTTP request headers

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

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

delete_tenant_user

delete_tenant_user(tenant_id, user_id, proj_id, env_id) Delete Tenant User

Deletes a user under a tenant.

Parameters

Name Type Description Required Notes
tenant_id String Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the "slug"). [required]
user_id String Either the unique id of the user, or the URL-friendly key of the user (i.e: the "slug"). [required]
proj_id String Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). [required]
env_id String Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). [required]

Return type

(empty response body)

Authorization

HTTPBearer

HTTP request headers

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

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

get_tenant

models::TenantRead get_tenant(proj_id, env_id, tenant_id) Get Tenant

Gets a tenant, if such tenant exists. Otherwise returns 404.

Parameters

Name Type Description Required Notes
proj_id String Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). [required]
env_id String Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). [required]
tenant_id String Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the "slug"). [required]

Return type

models::TenantRead

Authorization

HTTPBearer

HTTP request headers

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

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

list_tenant_users

models::PaginatedResultUserRead list_tenant_users(tenant_id, proj_id, env_id, search, role, include_resource_instance_roles, page, per_page) List Tenant Users

Parameters

Name Type Description Required Notes
tenant_id String Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the "slug"). [required]
proj_id String Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). [required]
env_id String Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). [required]
search Option<String> Text search for the email field
role Option<String> Match users with a specific role
include_resource_instance_roles Option<bool> Should add resource instance roles [default to false]
page Option<i32> Page number of the results to fetch, starting at 1. [default to 1]
per_page Option<i32> The number of results per page (max 100). [default to 30]

Return type

models::PaginatedResultUserRead

Authorization

HTTPBearer

HTTP request headers

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

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

list_tenants

models::ResponseListTenantsV2FactsProjIdEnvIdTenantsGet list_tenants(proj_id, env_id, search, include_total_count, page, per_page) List Tenants

Lists all the tenants defined within an environment.

Parameters

Name Type Description Required Notes
proj_id String Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). [required]
env_id String Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). [required]
search Option<String> Text search for the tenant name or key
include_total_count Option<bool> Include total count in response [default to false]
page Option<i32> Page number of the results to fetch, starting at 1. [default to 1]
per_page Option<i32> The number of results per page (max 100). [default to 30]

Return type

models::ResponseListTenantsV2FactsProjIdEnvIdTenantsGet

Authorization

HTTPBearer

HTTP request headers

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

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

update_tenant

models::TenantRead update_tenant(tenant_id, proj_id, env_id, tenant_update) Update Tenant

Partially updates the tenant definition. Fields that will be provided will be completely overwritten.

Parameters

Name Type Description Required Notes
tenant_id String Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the "slug"). [required]
proj_id String Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). [required]
env_id String Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). [required]
tenant_update TenantUpdate [required]

Return type

models::TenantRead

Authorization

HTTPBearer

HTTP request headers

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

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