# Tenants

# Get Tenant List

By using this API endpoint, it is possible to get the list of tenants.

Please note that you cannot get more than 100 records per request. In case you need to get more than 100 records, then you should make more than one request.

# Endpoint

GET /tenants

# Parameters

Name Type Description
name string Full name of the tenant
description string Description of tenant. It performs a text search.
page integer Page number to be returned.
per_page integer The number of records returned. Default is 10, maximum is 100

# Response

TIP

HTTP/1.1 200 OK

{
  "data": [
    {
      "id": "QZOpo3GoB8X",
      "name": "Company",
      "address": "115 East 23rd Street 5th Floor",
      "city": "New York",
      "country_code": "US",
      "country_name": "United States",
      "description": "New York",
      "is_trashed": false
    },
    ...
  ],
  "links": {
    "first": "https://api.iperawifi.com/api/v1/tenants?page=1",
    "last": null,
    "prev": null,
    "next": "https://api.iperawifi.com/api/v1/tenants?page=2"
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "path": "https://api.iperawifi.com/api/v1/tenants",
    "per_page": 10,
    "to": 10
  }
}

# Get Tenant Count

By using this API endpoint, it is possible to get the count of the tenants.

# Endpoint

GET /tenants/count

# Parameters

Name Type Description
name string Full name of the tenant
description string Description of tenant. It performs a text search.
page integer Page number to be returned.
per_page integer The number of records returned. Default is 10, maximum is 100

# Response

TIP

HTTP/1.1 200 OK

{
  "count": 1000
}

# Create Tenant

Create a new tenant with given attributes. After creating, following are done automatically.

  • API user is moved to the new tenant. See Switch Tenant.
  • A default location is created.

# Endpoint

POST /tenants

# Parameters

Name Type Required Description
name string Name of the tenant. Min. 5 characters.
country_code string Country code. ISO 3166-1 alpha-2 country code.
city string City of the tenant.
address string Address of the tenant.
post_code string Post code of the tenant.
description string Description.

# Response

TIP

HTTP/1.1 200 OK

{
  "data": {
    "id": "QZOpo3GoB8X",
    "name": "Company",
    "address": "115 East 23rd Street 5th Floor",
    "city": "New York",
    "country_code": "US",
    "country_name": "United States",
    "description": "New York",
    "is_trashed": false
  }
}

Unprocessable Entity

HTTP/1.1 422 Unprocessable Entity

{
  "message": "The given data was invalid.",
  "errors": {
    "name": [
      "The name field is required."
    ],
    "country_code": [
      "The country code field is invalid. It must be ISO 3166-1 alpha-2 country code."
    ]
  }
}

# Update Tenant

Update tenant information.

# Endpoint

PUT /tenants/:id

# Parameters

Name Type Required Description
name string Name of the tenant. Min. 5 characters.
country_code string Country code. ISO 3166-1 alpha-2 country code.
city string City of the tenant.
address string Address of the tenant.
post_code string Post code of the tenant.
description string Description.

# Response

TIP

HTTP/1.1 200 OK

{
  "data": {
    "id": "QZOpo3GoB8X",
    "name": "Company",
    "address": "115 East 23rd Street 5th Floor",
    "city": "New York",
    "country_code": "US",
    "country_name": "United States",
    "description": "New York",
    "is_trashed": false
  }
}

Unprocessable Entity

HTTP/1.1 422 Unprocessable Entity

{
  "message": "The given data was invalid.",
  "errors": {
    "name": [
      "The name field is required."
    ],
    "country_code": [
      "The country code field is invalid. It must be ISO 3166-1 alpha-2 country code."
    ]
  }
}

# Deactivate Tenant

Deactivate given tenant.

# Endpoint

PUT /tenants/:id/deactivate

# Parameters

Name Type Required Description
user_status int Set status of the users belong to the tenant to this value after deactivation. 0: Passive, 1: Active, 2: Banned.
Note: This does not affect support users.

# Response

TIP

HTTP/1.1 200 OK

{
  "is_trashed": true
}

# Activate Tenant

Activate given tenant.

# Endpoint

PUT /tenants/:id/activate

# Parameters

Name Type Required Description
user_status int Set status of the users belong to the tenant to this value after activation. 0: Passive, 1: Active, 2: Banned.
Note: This does not affect support users.

# Response

TIP

HTTP/1.1 200 OK

{
  "is_trashed": false
}

# Switch Tenant

Switches tenant of the API user.

# Endpoint

PUT /tenants/:id/switch

# Parameters

None

# Response

TIP

HTTP/1.1 200 OK

{
  "success": true
}
Last Updated: 4/16/2025, 8:01:29 AM