Skip to main content

Overview

Tenants represent clients or customers in the Invernaderos system. Each tenant can have multiple greenhouses, users, and alerts associated with them.

Get All Tenants

curl -X GET "https://api.invernaderos.com/api/v1/tenants?search=Sara&province=Almería&isActive=true" \
  -H "Authorization: Bearer YOUR_TOKEN"
Retrieve all tenants with optional filtering.

Query Parameters

Search term to filter tenants by name, email, or company name
province
string
Filter by province (e.g., “Almería”, “Granada”)
isActive
boolean
Filter by active status (true/false)

Response

id
long
Unique identifier of the tenant
code
string
Unique readable code (e.g., “TNT-00001”)
name
string
Tenant name or company name
email
string
Contact email address
phone
string
Contact phone number
province
string
Province where the tenant is located
country
string
Country where the tenant is located
location
object
Geographic coordinates
lat
double
Latitude (e.g., 36.8381)
lon
double
Longitude (e.g., -2.4597)
isActive
boolean
Whether the tenant is active
status
string
Status for UI display (“Activo”, “Pendiente”, “Inactivo”)
[
  {
    "id": 1,
    "code": "TNT-00001",
    "name": "Vivero Sara",
    "email": "[email protected]",
    "phone": "+34 612 345 678",
    "province": "Almería",
    "country": "España",
    "location": {
      "lat": 36.8381,
      "lon": -2.4597
    },
    "isActive": true,
    "status": "Activo"
  }
]

Get Tenant by ID

curl -X GET "https://api.invernaderos.com/api/v1/tenants/1" \
  -H "Authorization: Bearer YOUR_TOKEN"
Retrieve a specific tenant by its ID.

Path Parameters

id
long
required
Unique identifier of the tenant

Response

Returns a single tenant object with the same structure as above.
{
  "id": 1,
  "code": "TNT-00001",
  "name": "Vivero Sara",
  "email": "[email protected]",
  "phone": "+34 612 345 678",
  "province": "Almería",
  "country": "España",
  "location": {
    "lat": 36.8381,
    "lon": -2.4597
  },
  "isActive": true,
  "status": "Activo"
}

Create Tenant

curl -X POST "https://api.invernaderos.com/api/v1/tenants" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Elena Rodriguez",
    "email": "[email protected]",
    "phone": "+34 612 345 678",
    "province": "Almería",
    "country": "España",
    "location": {
      "lat": 36.8381,
      "lon": -2.4597
    },
    "status": "Activo"
  }'
Create a new tenant in the system.

Request Body

name
string
required
Full name of the client or company
email
string
required
Contact email address
phone
string
Contact phone number
province
string
Province (e.g., “Almería”, “Granada”)
country
string
default:"España"
Country name
location
object
Geographic coordinates
lat
double
Latitude
lon
double
Longitude
status
string
default:"Activo"
Initial status (“Activo”, “Pendiente”, “Inactivo”)

Response

{
  "id": 2,
  "code": "TNT-00002",
  "name": "Elena Rodriguez",
  "email": "[email protected]",
  "phone": "+34 612 345 678",
  "province": "Almería",
  "country": "España",
  "location": {
    "lat": 36.8381,
    "lon": -2.4597
  },
  "isActive": true,
  "status": "Activo"
}

Update Tenant

curl -X PUT "https://api.invernaderos.com/api/v1/tenants/1" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Vivero Sara S.L.",
    "phone": "+34 612 999 888"
  }'
Update an existing tenant. All fields are optional.

Path Parameters

id
long
required
Unique identifier of the tenant to update

Request Body

All fields are optional. Only provided fields will be updated.
name
string
Full name of the client or company
email
string
Contact email address
phone
string
Contact phone number
province
string
Province
country
string
Country name
location
object
Geographic coordinates
status
string
Status (“Activo”, “Pendiente”, “Inactivo”)

Response

{
  "id": 1,
  "code": "TNT-00001",
  "name": "Vivero Sara S.L.",
  "email": "[email protected]",
  "phone": "+34 612 999 888",
  "province": "Almería",
  "country": "España",
  "location": {
    "lat": 36.8381,
    "lon": -2.4597
  },
  "isActive": true,
  "status": "Activo"
}

Delete Tenant

curl -X DELETE "https://api.invernaderos.com/api/v1/tenants/1" \
  -H "Authorization: Bearer YOUR_TOKEN"
Delete a tenant from the system.

Path Parameters

id
long
required
Unique identifier of the tenant to delete

Response

# Successfully deleted

Tenant Configuration

Each tenant in the system can be configured with:
  • Company details: Name, email, phone, location
  • Geographic data: Province, country, GPS coordinates
  • Status management: Active, Pending, or Inactive states
  • Multi-tenant isolation: All data (greenhouses, users, alerts) is isolated per tenant

Build docs developers (and LLMs) love