All URIs are relative to http://localhost, except if the operation defines another base path.
| Method | HTTP request | Description |
|---|---|---|
| createTenant() | POST /v2/facts/{proj_id}/{env_id}/tenants | Create Tenant |
| deleteTenant() | DELETE /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id} | Delete Tenant |
| deleteTenantUser() | DELETE /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id}/users/{user_id} | Delete Tenant User |
| getTenant() | GET /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id} | Get Tenant |
| listTenantUsers() | GET /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id}/users | List Tenant Users |
| listTenants() | GET /v2/facts/{proj_id}/{env_id}/tenants | List Tenants |
| updateTenant() | PATCH /v2/facts/{proj_id}/{env_id}/tenants/{tenant_id} | Update Tenant |
createTenant($proj_id, $env_id, $tenant_create): \OpenAPI\Client\Model\TenantReadCreate 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.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\TenantsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$tenant_create = new \OpenAPI\Client\Model\TenantCreate(); // \OpenAPI\Client\Model\TenantCreate
try {
$result = $apiInstance->createTenant($proj_id, $env_id, $tenant_create);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TenantsApi->createTenant: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| proj_id | string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
| env_id | string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
| tenant_create | \OpenAPI\Client\Model\TenantCreate |
\OpenAPI\Client\Model\TenantRead
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteTenant($proj_id, $env_id, $tenant_id)Delete Tenant
Deletes the tenant and all its related data.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\TenantsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$tenant_id = 'tenant_id_example'; // string | Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the \"slug\").
try {
$apiInstance->deleteTenant($proj_id, $env_id, $tenant_id);
} catch (Exception $e) {
echo 'Exception when calling TenantsApi->deleteTenant: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| proj_id | string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
| env_id | string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
| tenant_id | string | Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the "slug"). |
void (empty response body)
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteTenantUser($proj_id, $env_id, $tenant_id, $user_id)Delete Tenant User
Deletes a user under a tenant.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\TenantsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$tenant_id = 'tenant_id_example'; // string | Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the \"slug\").
$user_id = 'user_id_example'; // string | Either the unique id of the user, or the URL-friendly key of the user (i.e: the \"slug\").
try {
$apiInstance->deleteTenantUser($proj_id, $env_id, $tenant_id, $user_id);
} catch (Exception $e) {
echo 'Exception when calling TenantsApi->deleteTenantUser: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| proj_id | string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
| env_id | string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
| tenant_id | string | Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the "slug"). | |
| user_id | string | Either the unique id of the user, or the URL-friendly key of the user (i.e: the "slug"). |
void (empty response body)
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getTenant($proj_id, $env_id, $tenant_id): \OpenAPI\Client\Model\TenantReadGet Tenant
Gets a tenant, if such tenant exists. Otherwise returns 404.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\TenantsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$tenant_id = 'tenant_id_example'; // string | Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the \"slug\").
try {
$result = $apiInstance->getTenant($proj_id, $env_id, $tenant_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TenantsApi->getTenant: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| proj_id | string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
| env_id | string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
| tenant_id | string | Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the "slug"). |
\OpenAPI\Client\Model\TenantRead
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listTenantUsers($proj_id, $tenant_id, $env_id, $search, $page, $per_page): \OpenAPI\Client\Model\PaginatedResultUserReadList Tenant Users
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\TenantsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$tenant_id = 'tenant_id_example'; // string | Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$search = 'search_example'; // string | Text search for the email field
$page = 1; // int | Page number of the results to fetch, starting at 1.
$per_page = 30; // int | The number of results per page (max 100).
try {
$result = $apiInstance->listTenantUsers($proj_id, $tenant_id, $env_id, $search, $page, $per_page);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TenantsApi->listTenantUsers: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| proj_id | string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
| tenant_id | string | Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the "slug"). | |
| env_id | string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
| search | string | Text search for the email field | [optional] |
| page | int | Page number of the results to fetch, starting at 1. | [optional] [default to 1] |
| per_page | int | The number of results per page (max 100). | [optional] [default to 30] |
\OpenAPI\Client\Model\PaginatedResultUserRead
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listTenants($proj_id, $env_id, $search, $page, $per_page): \OpenAPI\Client\Model\TenantRead[]List Tenants
Lists all the tenants defined within an environment.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\TenantsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$search = 'search_example'; // string | Text search for the tenant name or key
$page = 1; // int | Page number of the results to fetch, starting at 1.
$per_page = 30; // int | The number of results per page (max 100).
try {
$result = $apiInstance->listTenants($proj_id, $env_id, $search, $page, $per_page);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TenantsApi->listTenants: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| proj_id | string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
| env_id | string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
| search | string | Text search for the tenant name or key | [optional] |
| page | int | Page number of the results to fetch, starting at 1. | [optional] [default to 1] |
| per_page | int | The number of results per page (max 100). | [optional] [default to 30] |
\OpenAPI\Client\Model\TenantRead[]
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateTenant($proj_id, $env_id, $tenant_id, $tenant_update): \OpenAPI\Client\Model\TenantReadUpdate Tenant
Partially updates the tenant definition. Fields that will be provided will be completely overwritten.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: HTTPBearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\Api\TenantsApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$proj_id = 'proj_id_example'; // string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the \"slug\").
$env_id = 'env_id_example'; // string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the \"slug\").
$tenant_id = 'tenant_id_example'; // string | Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the \"slug\").
$tenant_update = new \OpenAPI\Client\Model\TenantUpdate(); // \OpenAPI\Client\Model\TenantUpdate
try {
$result = $apiInstance->updateTenant($proj_id, $env_id, $tenant_id, $tenant_update);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TenantsApi->updateTenant: ', $e->getMessage(), PHP_EOL;
}| Name | Type | Description | Notes |
|---|---|---|---|
| proj_id | string | Either the unique id of the project, or the URL-friendly key of the project (i.e: the "slug"). | |
| env_id | string | Either the unique id of the environment, or the URL-friendly key of the environment (i.e: the "slug"). | |
| tenant_id | string | Either the unique id of the tenant, or the URL-friendly key of the tenant (i.e: the "slug"). | |
| tenant_update | \OpenAPI\Client\Model\TenantUpdate |
\OpenAPI\Client\Model\TenantRead
- Content-Type:
application/json - Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]