Websites

Operations around Website management and statistics.

Endpoints

GET /api/websites
POST /api/websites
GET /api/websites/:websiteId
POST /api/websites/:websiteId
DELETE /api/websites/:websiteId
POST /api/websites/:websiteId/reset

GET /api/websites

Returns all tracked websites.

Parameters

  • query: (optional string) Search text.
  • page: (optional number, default 1) Determines page.
  • pageSize: (optional string) Determines how many results to return.
  • orderBy: (optional string, default name) Order by column name.

Sample response

{
    "data": [
        {
            "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "name": "Example",
            "domain": "example.com",
            "shareId": null,
            "resetAt": null,
            "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "teamId": null,
            "createdBy": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
            "createdAt": "0000-00-00T00:00:00.000Z",
            "updatedAt": "0000-00-00T00:00:00.000Z",
            "deletedAt": null,
            "user": {
                "username": "[email protected]",
                "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
            }
        }
    ],
    "count": 2,
    "page": 1,
    "pageSize": 10,
    "orderBy": "name"
}

POST /api/websites

Creates a website.

Parameters

  • domain: (string) The full domain of the tracked website.
  • name: (string) The name of the website in Umami.
  • shareId: (string | optional) A unique string to enable a share url. Set null to unshare.
  • teamId: (string | optional) The ID of the team the website will be created under.

Request body

{
    "name": "Test",
    "domain": "example.com"
}

Sample response

{
    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "name": "Test",
    "domain": "example.com",
    "shareId": null,
    "resetAt": null,
    "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "teamId": null,
    "createdBy": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "createdAt": "0000-00-00T00:00:00.000Z",
    "updatedAt": "0000-00-00T00:00:00.000Z",
    "deletedAt": null
}

GET /api/websites/:websiteId

Gets a website by ID.

Sample response

{
  "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "name": "Example",
  "domain": "example.com",
  "shareId": null,
  "resetAt": null,
  "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
  "createdAt": "0000-00-00T00:00:00.000Z",
  "updatedAt": null,
  "deletedAt": null
}

POST /api/websites/:websiteId

Updates a website.

Parameters

  • name: (string) The name of the website in Umami.
  • domain: (string) The full domain of the tracked website.
  • shareId: (string | optional) A unique string to enable a share url. Set null to unshare.

Request body

{
    "name": "Test",
    "domain": "domain.com"
}

Sample response

{
    "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "name": "Test",
    "domain": "domain.com",
    "shareId": null,
    "resetAt": null,
    "userId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "teamId": null,
    "createdBy": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "createdAt": "0000-00-00T00:00:00.000Z",
    "updatedAt": "0000-00-00T00:00:00.000Z",
    "deletedAt": null
}

DELETE /api/websites/:websiteId

Deletes a website.

Sample response

ok

POST /api/websites/:websiteId/reset

Resets a website by removing all data related to the website.

Sample response

ok