Custom domains

API Documentation

Endpoint
GET https://dev.usermetric.io/api/domains/available
Parameters
Parameters Details Description
search
Optional String
The search string.
search_by
Optional String
What field are you searching by. Allowed values are: host.
datetime_field
Optional String
Allowed values: datetime, last_datetime
datetime_start
Optional String
Filter results starting from this datetime. Y-m-d H:i:s format.
datetime_end
Optional String
Filter results up to this datetime. Y-m-d H:i:s format.
order_by
Optional String
What field to order the results by. Allowed values are: domain_id, datetime, last_datetime, host.
order_type
Optional String
The ordering of the results. Allowed values are: ASC for ascending ordering, and DESC for descending ordering.
page
Optional Integer
The page number that you want results from. Defaults to 1.
results_per_page
Optional Integer
How many results you want per page. Allowed values are: 10, 25, 50, 100, 250, 500, 1000. Defaults to 25.
Example
curl --request GET \
  --url 'https://dev.usermetric.io/api/domains/available' \
  --header 'Authorization: Bearer {api_key}' \
Response example
{
    "data": [
        {
            "id": 1,
            "user_id": 1,
            "type": 0,
            "scheme": "https://",
            "host": "example.com",
            "url": "https://example.com/",
            "custom_index_url": "",
            "custom_not_found_url": "",
            "is_enabled": true,
            "last_datetime": null,
            "datetime": "2026-09-22 02:53:49"
        },
        {
            "id": 2,
            "user_id": null,
            "type": 1,
            "scheme": "https://",
            "host": "shared.example.net",
            "url": "https://shared.example.net/",
            "custom_index_url": null,
            "custom_not_found_url": null,
            "is_enabled": true,
            "last_datetime": null,
            "datetime": "2026-09-22 02:53:49"
        }
    ],
    "meta": {
        "page": 1,
        "total_pages": 1,
        "results_per_page": 25,
        "total_results": 2
    },
    "links": {
        "first": "https://dev.usermetric.io/api/domains/available?page=1",
        "last": "https://dev.usermetric.io/api/domains/available?page=1",
        "next": null,
        "prev": null,
        "self": "https://dev.usermetric.io/api/domains/available?page=1"
    }
}

Endpoint
GET https://dev.usermetric.io/api/domains/
Parameters
Parameters Details Description
search
Optional String
The search string.
search_by
Optional String
What field are you searching by. Allowed values are: host.
user_id
Optional Integer
is_enabled
Optional Boolean
datetime_field
Optional String
Allowed values: datetime, last_datetime
datetime_start
Optional String
Filter results starting from this datetime. Y-m-d H:i:s format.
datetime_end
Optional String
Filter results up to this datetime. Y-m-d H:i:s format.
order_by
Optional String
What field to order the results by. Allowed values are: domain_id, datetime, last_datetime, host.
order_type
Optional String
The ordering of the results. Allowed values are: ASC for ascending ordering, and DESC for descending ordering.
page
Optional Integer
The page number that you want results from. Defaults to 1.
results_per_page
Optional Integer
How many results you want per page. Allowed values are: 10, 25, 50, 100, 250, 500, 1000. Defaults to 25.
Example
curl --request GET \
  --url 'https://dev.usermetric.io/api/domains/' \
  --header 'Authorization: Bearer {api_key}' \
Response example
{
    "data": [
        {
            "id": 1,
            "user_id": 1,
            "scheme": "https://",
            "host": "example.com",
            "custom_index_url": "https://example.com/",
            "custom_not_found_url": "https://example.com/404-page",
            "is_enabled": true,
            "last_datetime": "2026-09-22 02:53:49",
            "datetime": "2026-09-22 02:53:49"
        },
        {
            "id": 2,
            "user_id": 1,
            "scheme": "http://",
            "host": "pending.example.com",
            "custom_index_url": null,
            "custom_not_found_url": null,
            "is_enabled": false,
            "last_datetime": null,
            "datetime": "2026-09-22 02:53:49"
        }
    ],
    "meta": {
        "page": 1,
        "total_pages": 1,
        "results_per_page": 25,
        "total_results": 2
    },
    "links": {
        "first": "https://dev.usermetric.io/api/domains?page=1",
        "last": "https://dev.usermetric.io/api/domains?page=1",
        "next": null,
        "prev": null,
        "self": "https://dev.usermetric.io/api/domains?page=1"
    }
}

Endpoint
GET https://dev.usermetric.io/api/domains/{domain_id}
Example
curl --request GET \
  --url 'https://dev.usermetric.io/api/domains/{domain_id}' \
  --header 'Authorization: Bearer {api_key}' \
Response example
{
    "data": {
        "id": 1,
        "user_id": 1,
        "scheme": "https://",
        "host": "example.com",
        "custom_index_url": "",
        "custom_not_found_url": "",
        "is_enabled": true,
        "last_datetime": null,
        "datetime": "2026-09-22 02:53:49"
    }
}

Endpoint
POST https://dev.usermetric.io/api/domains
Parameters
Parameters Details Description
host
Required String
custom_index_url
Optional String
custom_not_found_url
Optional String
Example
curl --request POST \
  --url 'https://dev.usermetric.io/api/domains' \
  --header 'Authorization: Bearer {api_key}' \
  --header 'Content-Type: multipart/form-data' \
  --form 'host=example.com' \
  --form 'custom_index_url=https://example.com/' \
  --form 'custom_not_found_url=https://example.com/404-page' \
Response example
{
    "data": {
        "id": 1,
        "user_id": 1,
        "scheme": "https://",
        "host": "example.com",
        "custom_index_url": "https://example.com/",
        "custom_not_found_url": "https://example.com/404-page",
        "is_enabled": false,
        "last_datetime": null,
        "datetime": "2026-09-22 02:53:49"
    }
}

Endpoint
POST https://dev.usermetric.io/api/domains/{domain_id}
Parameters
Parameters Details Description
host
Optional String
custom_index_url
Optional String
custom_not_found_url
Optional String
Example
curl --request POST \
  --url 'https://dev.usermetric.io/api/domains/{domain_id}' \
  --header 'Authorization: Bearer {api_key}' \
  --header 'Content-Type: multipart/form-data' \
  --form 'host=example.com' \
Response example
{
    "data": {
        "id": 1,
        "user_id": 1,
        "scheme": "https://",
        "host": "example.com",
        "custom_index_url": "https://example.com/",
        "custom_not_found_url": "https://example.com/404-page",
        "is_enabled": false,
        "last_datetime": "2026-09-22 02:53:49",
        "datetime": "2026-09-22 02:53:49"
    }
}

Endpoint
DELETE https://dev.usermetric.io/api/domains/{domain_id}
Example
curl --request DELETE \
  --url 'https://dev.usermetric.io/api/domains/{domain_id}' \
  --header 'Authorization: Bearer {api_key}' \