The expiration date of your token
Used in practically all requests, those are all the headers the package uses excluding Authorization, the one with the token
If the User-Agent is not liked by https://isbot.js.org/, Umami might give responses akin to {beep: "boop"}
The password of the account
In seconds, how long should it wait after a request failed before retrying? (defaults to 2)
How many retries maximum before throwing an APIError (defaults to 4)
Should it retry a request upon successfully setting a new token due to API.set_token_on_401 being true? (defaults to true)
Upon failing a request and receiving a response, because of which received status code should the request be retried? (defaults to [429])
Should it retry a request if that request failed because it has been aborted by the API.timeout? (defaults to false)
The base URL where requests should land, should include the /api portion if applicable
If true, upon failing a request due to a 401, it will call API.setNewToken (defaults to true)
If true, when creating your API object, a call to API.setNewToken will be automatically made (defaults to true)
If true, the application will silently call API.setNewToken when the API.token is set to expire, as determined by API.expires (defaults to false)
The AbortSignal used in every request
The key that allows you to talk with the API
Should always be "Bearer"
The username of the account
Which events should be logged (defaults to none)
The function that directly communicates with the API! Almost all functions of the API object uses this function!
The type of request, each endpoint uses a specific one (if it uses multiple, the intent and parameters become different)
What comes in the URL after api/, DO NOT USE TEMPLATE LITERALS (`) OR THE ADDITION OPERATOR (+), put everything separately for type safety
The things to specify in the request, such as the beatmap_id when looking for a beatmap
A Promise with the API's response
This contacts the server in order to get and set a new API.token!
Whether or not the token has changed (should be true as otherwise the server would complain and an APIError would be thrown to give you some details)
The API object requires a API.username and a API.password to successfully get any token
StaticcreateThe alternative way of creating an API instance, awaiting this method waits for the server's authorization and allows you to catch errors if the authorization fails
The base URL where requests should land, should include the /api portion if applicable (e.g. https://my-instance.com/api)
The username of the user you're logging in as
The password of the user you're logging in as
Optionalsettings: Partial<API>Additional settings you'd like to specify now rather than later, check out the Accessors at https://umami-api-js.taevas.xyz/classes/API.html
ReadonlygetReturns all teams: https://umami.is/docs/api/admin#get-apiadminteams
Optionalparameters: GenericRequestParametersReadonlygetReturns all users: https://umami.is/docs/api/admin#get-apiadminusers
Optionalparameters: GenericRequestParametersReadonlygetReturns all websites: https://umami.is/docs/api/admin#get-apiadminwebsites
Optionalparameters: GenericRequestParametersReadonlygetGets event-data for a individual event: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-dataeventid
ReadonlygetGets website event details within a given time range: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevents
Optionalfilters?: FiltersCan accept filter parameters
ReadonlygetGets event data names, properties, and counts: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-dataevents
Optionalevent?: stringEvent name filter
Optionalfilters?: FiltersCan accept filter parameters
At least on Umami v3.0.3 and likely prior versions, this will not work if not using the optional event name filter https://github.com/umami-software/umami/issues/3837
ReadonlygetGets event data property and value counts within a given time range: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-datafields
Optionalfilters?: FiltersCan accept filter parameters
ReadonlygetGets event name and property counts for a website: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-dataproperties
Optionalfilters?: FiltersCan accept filter parameters
ReadonlygetGets aggregated website events, properties, and records within a given time range: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-datastats
Optionalfilters?: FiltersCan accept filter parameters
ReadonlygetGets event data counts for a given event and property: https://umami.is/docs/api/events#get-apiwebsiteswebsiteidevent-datavalues
Event name filter
Optionalfilters?: FiltersCan accept filter parameters
Property name
ReadonlydeleteDeletes a link: https://umami.is/docs/api/links#delete-apilinkslinkid
ReadonlydeleteDeletes a pixel: https://umami.is/docs/api/pixels#delete-apipixelspixelid
ReadonlygetGets a link by ID: https://umami.is/docs/api/links#get-apilinkslinkid
ReadonlygetReturns all user links: https://umami.is/docs/api/links#get-apilinks
Optionalparameters: GenericRequestParametersReadonlygetGets a pixel by ID: https://umami.is/docs/api/pixels#get-apipixelspixelid
ReadonlygetReturns all user pixels: https://umami.is/docs/api/pixels#get-apipixels
Optionalparameters: GenericRequestParametersReadonlyupdateUpdates a link: https://umami.is/docs/api/links#post-apilinkslinkid
Optionalname?: stringThe link's name
Optionalslug?: stringThe link's URL slug, with a minimum of 8 characters
Optionalurl?: stringThe link's destination URL
ReadonlyupdateUpdates a pixel: https://umami.is/docs/api/pixels#post-apipixelspixelid
Optionalname?: stringThe pixel's name
Optionalslug?: stringThe pixel's URL slug, with a minimum of 8 characters
ReadonlygetGet information based on your auth token: https://umami.is/docs/api/me#get-apime
ReadonlygetGet all your teams: https://umami.is/docs/api/me#get-apimeteams
ReadonlygetGet all your websites: https://umami.is/docs/api/me#get-apimeteams
ReadonlycreateCreates a report: https://umami.is/docs/api/reports#post-apireports
Optionaldescription?: stringDescription of report
Name of report
Parameters for report
Report type
ReadonlydeleteDeletes a report: https://umami.is/docs/api/reports#delete-apireportsreportid
ReadonlygetGets a report by ID: https://umami.is/docs/api/reports#get-apireportsreportid
ReadonlygetGet all reports by website ID: https://umami.is/docs/api/reports#get-apireports
ReadonlygetSee how users engage with your marketing and what drives conversions: https://umami.is/docs/api/reports#post-apireportsattribution
Optionalfilters?: FiltersCan accept filter parameters
Attribution model
Conversion step
Conversion type
ReadonlygetDive deeper into your data by using segments and filters: https://umami.is/docs/api/reports#post-apireportsbreakdown
List of column fields
Optionalfilters?: FiltersCan accept filter parameters
ReadonlygetUnderstand the conversion and drop-off rate of users: https://umami.is/docs/api/reports#post-apireportsfunnel
Optionalfilters?: FiltersCan accept filter parameters
Type of event and conversion step
Window of days between funnel steps to be considered a conversion
ReadonlygetTrack your goals for pageviews and events: https://umami.is/docs/api/reports#post-apireportsgoals
Optionalfilters?: FiltersCan accept filter parameters
Optionalname?: stringUndocumented
Optionaloperator?: "count" | "sum" | "average"Undocumented
Optionalproperty?: stringUndocumented
Conversion type
Conversion step value
ReadonlygetUnderstand how users nagivate [sic] through your website: https://umami.is/docs/api/reports#post-apireportsjourney
OptionalendStep?: stringEnding step URL or event name
Optionalfilters?: FiltersCan accept filter parameters
Starting step URL or event name
Number of steps from 3 to 7
ReadonlygetMeasure your website stickiness by tracking how often users return: https://umami.is/docs/api/reports#post-apireportsretention
Optionalfilters?: FiltersCan accept filter parameters
Timezone (ex. America/Los_Angeles)
ReadonlygetGet currency for given range. Needed for Revenue and optional in Attribution reports: https://umami.is/docs/api/reports#post-apireportsrevenue
Currency code (ISO 4217)
Optionalfilters?: FiltersCan accept filter parameters
Timezone (ex. America/Los_Angeles)
ReadonlygetTrack your campaigns through UTM parameters: https://umami.is/docs/api/reports#post-apireportsutm
Optionalfilters?: FiltersCan accept filter parameters
ReadonlyupdateUpdates a report: https://umami.is/docs/api/reports#post-apireportsreportid
Optionalparameters: {Optionaldescription?: stringDescription of report
Optionalname?: stringName of report
Parameters for report
Report type
Your website id
To register an event
Optionalpayload: {Optionaldata?: { [k: string]: any }Additional data for the event
Optionalhostname?: stringName of host
Optionalid?: stringSession identifier
Optionallanguage?: stringLanguage of visitor (ex. "en-US")
Optionalname?: stringName of the event
Optionalreferrer?: stringReferrer URL
Optionalscreen?: stringScreen resolution (ex. "1920x1080")
Optionaltag?: stringAdditional tag description
Optionaltitle?: stringPage title
Optionalurl?: stringPage URL
ReadonlygetGets session details for a individual session: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessionssessionid
ReadonlygetGets session activity for a individual session: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessionssessionidactivity
ReadonlygetGets session data counts by property name: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsession-dataproperties
Optionalfilters?: FiltersCan accept filter parameters
ReadonlygetGets session data counts for a given property: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsession-datavalues
Optionalfilters?: FiltersCan accept filter parameters
Property name
ReadonlygetGets session properties for a individual session: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessionssessionidproperties
ReadonlygetGets website session details within a given time range: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessions
Optionalfilters?: FiltersCan accept filter parameters
ReadonlygetGets summarized website session statistics: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessionsstats
Optionalfilters?: FiltersCan accept filter parameters
ReadonlygetGet collected count of sessions by hour of weekday: https://umami.is/docs/api/sessions#get-apiwebsiteswebsiteidsessionsweekly
Optionalfilters?: FiltersCan accept filter parameters
Timezone (ex. America/Los_Angeles)
ReadonlyaddAdd a user to a team: https://umami.is/docs/api/teams#post-apiteamsteamidusers
Team role for user
ID of user to be added
ReadonlycreateCreates a team: https://umami.is/docs/api/teams#post-apiteams
An Array where its first element is the created team, and its second element is its owner
ReadonlydeleteDelete a team: https://umami.is/docs/api/teams#delete-apiteamsteamid
ReadonlygetReadonlygetReturns all teams: https://umami.is/docs/api/teams#get-apiteams
Optionalparameters: Omit<GenericRequestParameters, "search">ReadonlygetGet a user belonging to a team: https://umami.is/docs/api/teams#get-apiteamsteamidusersuserid
ReadonlygetGet all users that belong to a team: https://umami.is/docs/api/teams#get-apiteamsteamidusers
Optionalparameters: GenericRequestParametersReadonlygetGet all websites that belong to a team: https://umami.is/docs/api/teams#get-apiteamsteamidwebsites
Optionalparameters: GenericRequestParametersReadonlyjoinJoin a team: https://umami.is/docs/api/teams#post-apiteamsjoin
ReadonlyremoveRemove a user from a team: https://umami.is/docs/api/teams#delete-apiteamsteamidusersuserid
ReadonlyupdateUpdate a team: https://umami.is/docs/api/teams#post-apiteamsteamid
OptionalaccessCode?: stringThe team's access code
Optionalname?: stringThe team's name
ReadonlyupdateUpdate a user's role on a team: https://umami.is/docs/api/teams#post-apiteamsteamidusersuserid
ReadonlycreateCreates a user: https://umami.is/docs/api/users#post-apiusers
ReadonlydeleteDeletes a user: https://umami.is/docs/api/users#delete-apiusersuserid
ReadonlygetGets a user by ID: https://umami.is/docs/api/users#get-apiusersuserid
ReadonlygetGets all teams that belong to a user: https://umami.is/docs/api/users#get-apiusersuseridteams
Optionalparameters: Omit<GenericRequestParameters, "search">ReadonlygetGets all websites that belong to a user: https://umami.is/docs/api/users#get-apiusersuseridwebsites
Optionalparameters: GenericRequestParameters & { includeTeams?: boolean }ReadonlyupdateUpdates a user: https://umami.is/docs/api/users#post-apiusersuserid
ReadonlygetGets the number of active users on a website: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteidactive
ReadonlygetGets events within a given time range: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteideventsseries
Optionalfilters?: FiltersCan accept filter parameters
Timezone (ex. America/Los_Angeles)
ReadonlygetGets metrics for a given time range: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteidmetrics
Optionalfilters?: FiltersCan accept filter parameters
Optionallimit?: number(optional, default 500) Number of rows returned
Optionaloffset?: number(optional, default 0) Number of ows to skip
Timezone (ex. America/Los_Angeles)
Metrics type
ReadonlygetGets expanded metrics for a given time range: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteidmetricsexpanded
ReadonlygetGets pageviews within a given time range: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteidpageviews
Optionalcompare?: stringComparison value prev | yoy
Optionalfilters?: FiltersCan accept filter parameters
Timezone (ex. America/Los_Angeles)
ReadonlygetGets summarized website statistics: https://umami.is/docs/api/website-stats#get-apiwebsiteswebsiteidstats
Optionalfilters?: FiltersCan accept filter parameters
ReadonlycreateCreates a website: https://umami.is/docs/api/websites#post-apiwebsites
The full domain of the tracked website
Optionalid?: stringForce a UUID assignment to the website
The name of the website in Umami
OptionalshareId?: string | nullA unique string to enable a share url. Set null to unshare
OptionalteamId?: string | nullThe ID of the team the website will be created under
ReadonlydeleteDeletes a website: https://umami.is/docs/api/websites#delete-apiwebsiteswebsiteid
ReadonlygetGets a website by ID: https://umami.is/docs/api/websites#get-apiwebsiteswebsiteid
ReadonlygetReturns all user websites: https://umami.is/docs/api/websites#get-apiwebsites
Optionalparameters: GenericRequestParameters & { includeTeams?: boolean }OptionalincludeTeams?: booleanSet to true if you want to include websites where you are the team owner
ReadonlyresetResets a website by removing all data related to the website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteidreset
ReadonlyupdateUpdates a website: https://umami.is/docs/api/websites#post-apiwebsiteswebsiteid
Optionaldomain?: stringThe full domain of the tracked website
Optionalname?: stringThe name of the website in Umami
OptionalshareId?: string | nullA unique string to enable a share url. Set null to unshare
An API instance is needed to make requests to the server!