🚧 We’re still putting the finishing touches on our platform
Tenant API Documentation
This document describes the tenant management API endpoints. All endpoints are protected with bearer token authentication.
Overview
The Tenant API allows you to programmatically create and retrieve tenant (organization/website) information in the system. Each tenant has its own isolated database and domain configuration.
Authentication
All API requests must include a bearer token in the Authorization
header.
Required Header
Authorization: Bearer YOUR_API_TOKEN
Security Notes:
- The API token is configured in the
.env
file asAPI_TOKEN
- Keep your token secure and never commit it to version control
- Contact your system administrator to obtain the token
Endpoints
1. Create Tenant
Create a new tenant in the system.
Endpoint: POST /api/tenant
Authentication: Required (Bearer Token)
Request Headers:
Content-Type: application/json
Accept: application/json
Authorization: Bearer YOUR_API_TOKEN
Request Body: Currently no parameters required
Success Response (200 OK):
{
"tenant_id": "860f5708-21eb-44bf-bb4f-ce1dbed2ede1"
}
Error Response (401 Unauthorized):
{
"message": "Unauthorized"
}
2. Get Tenant Details
Retrieve detailed information about a specific tenant.
Endpoint: GET /api/tenant/{tenantUuid}
Authentication: Required (Bearer Token)
URL Parameters:
tenantUuid
(string, UUID): The unique identifier of the tenant
Request Headers:
Content-Type: application/json
Accept: application/json
Authorization: Bearer YOUR_API_TOKEN
Success Response (200 OK):
{
"tenant_id": "860f5708-21eb-44bf-bb4f-ce1dbed2ede1",
"organization_name": "Agile Harbor",
"domains": {
"base": "dmz-tey-k83.webfluss.com",
"custom": null,
"subdomain": null
}
}
Response Fields:
tenant_id
(string, UUID): The unique identifier for the tenantorganization_name
(string): The name of the organization/websitedomains
(object): Domain configuration for the tenantbase
(string|null): The base domain assigned to the tenantcustom
(string|null): Custom domain if configuredsubdomain
(string|null): Subdomain if configured
Error Responses:
401 Unauthorized:
{
"message": "Unauthorized"
}
404 Not Found:
{
"message": "No query results for model [App\\Models\\Tenant] {tenant_uuid}"
}
Usage Examples
cURL
Create a Tenant
curl -X POST https://webfluss.com/api/tenant \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Example Response:
{
"tenant_id": "860f5708-21eb-44bf-bb4f-ce1dbed2ede1"
}
Get Tenant Details
curl -X GET https://webfluss.com/api/tenant/860f5708-21eb-44bf-bb4f-ce1dbed2ede1 \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Example Response:
{
"tenant_id": "860f5708-21eb-44bf-bb4f-ce1dbed2ede1",
"organization_name": "Agile Harbor",
"domains": {
"base": "dmz-tey-k83.webfluss.com",
"custom": null,
"subdomain": null
}
}
Postman
Environment Setup
Create a Postman environment with these variables:
base_url
:https://webfluss.com
api_token
:YOUR_API_TOKEN
1. Create Tenant Request
-
Create a new request
- Method:
POST
- URL:
{{base_url}}/api/tenant
- Method:
-
Headers Tab
Key Value Content-Type application/json Accept application/json Authorization Bearer {{api_token}} -
Body Tab
- Select:
raw
- Type:
JSON
- Content:
{}
(empty object) or leave empty
- Select:
2. Get Tenant Details Request
-
Create a new request
- Method:
GET
- URL:
{{base_url}}/api/tenant/:tenantUuid
- Method:
-
Params Tab
- Add path variable:
tenantUuid
=860f5708-21eb-44bf-bb4f-ce1dbed2ede1
- Add path variable:
-
Headers Tab
Key Value Content-Type application/json Accept application/json Authorization Bearer {{api_token}}
Save as Collection
- Click "Save" to add to a collection
- Collection name: "Tenant API"
- Organize requests: "Create Tenant", "Get Tenant Details"
Domain Information
Domain Types
- Base Domain: The primary domain automatically assigned to the tenant (e.g.,
dmz-tey-k83.webfluss.com
) - Custom Domain: A custom domain configured by the user (e.g.,
example.com
) - Subdomain: A subdomain under the main domain (e.g.,
mysite.webfluss.com
)
Domain States
null
: No domain of this type is configuredstring
: The configured domain value