umami-api-js
    Preparing search index...

    Class API

    An API instance is needed to make requests to the server!

    Index

    Constructors

    Accessors

    Methods

    Admin endpoints

    Events endpoints

    Links endpoints

    Me endpoints

    Realtime endpoints

    Reports endpoints

    Sending stats

    Sessions endpoints

    Teams endpoints

    Users endpoints

    Website stats endpoints

    Websites endpoints

    Constructors

    • If you have account credentials, you might want to use this constructor

      Parameters

      • server: string
      • username: string
      • password: string
      • Optionalsettings: Partial<API>

      Returns API

    • You might want to use this constructor if you'd like the freedom to set whatever you like, for example a API.token without setting account credentials

      Parameters

      • settings: Partial<API>

      Returns API

    Accessors

    • get expires(): Date

      The expiration date of your token

      Returns Date

    • set expires(date: Date): void

      Parameters

      • date: Date

      Returns void

    • get headers(): { [key: string]: any }

      Used in practically all requests, those are all the headers the package uses excluding Authorization, the one with the token

      Returns { [key: string]: any }

      If the User-Agent is not liked by https://isbot.js.org/, Umami might give responses akin to {beep: "boop"}

    • set headers(headers: { [key: string]: any }): void

      Parameters

      • headers: { [key: string]: any }

      Returns void

    • get password(): string

      The password of the account

      Returns string

    • set password(password: string): void

      Parameters

      • password: string

      Returns void

    • get retry_delay(): number

      In seconds, how long should it wait after a request failed before retrying? (defaults to 2)

      Returns number

    • set retry_delay(retry_delay: number): void

      Parameters

      • retry_delay: number

      Returns void

    • get retry_maximum_amount(): number

      How many retries maximum before throwing an APIError (defaults to 4)

      Returns number

      Pro tip: Set that to 0 to completely disable retries!

    • set retry_maximum_amount(retry_maximum_amount: number): void

      Parameters

      • retry_maximum_amount: number

      Returns void

    • get retry_on_new_token(): boolean

      Should it retry a request upon successfully setting a new token due to API.set_token_on_401 being true? (defaults to true)

      Returns boolean

    • set retry_on_new_token(retry_on_new_token: boolean): void

      Parameters

      • retry_on_new_token: boolean

      Returns void

    • get retry_on_status_codes(): number[]

      Upon failing a request and receiving a response, because of which received status code should the request be retried? (defaults to [429])

      Returns number[]

    • set retry_on_status_codes(retry_on_status_codes: number[]): void

      Parameters

      • retry_on_status_codes: number[]

      Returns void

    • get retry_on_timeout(): boolean

      Should it retry a request if that request failed because it has been aborted by the API.timeout? (defaults to false)

      Returns boolean

    • set retry_on_timeout(retry_on_timeout: boolean): void

      Parameters

      • retry_on_timeout: boolean

      Returns void

    • get server(): string

      The base URL where requests should land, should include the /api portion if applicable

      Returns string

    • set server(server: string): void

      Parameters

      • server: string

      Returns void

    • get set_token_on_401(): boolean

      If true, upon failing a request due to a 401, it will call API.setNewToken (defaults to true)

      Returns boolean

    • set set_token_on_401(bool: boolean): void

      Parameters

      • bool: boolean

      Returns void

    • get set_token_on_creation(): boolean

      If true, when creating your API object, a call to API.setNewToken will be automatically made (defaults to true)

      Returns boolean

    • set set_token_on_creation(bool: boolean): void

      Parameters

      • bool: boolean

      Returns void

    • get set_token_on_expires(): boolean

      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)

      Returns boolean

    • set set_token_on_expires(enabled: boolean): void

      Parameters

      • enabled: boolean

      Returns void

    • get signal(): AbortSignal | undefined

      The AbortSignal used in every request

      Returns AbortSignal | undefined

    • set signal(signal: AbortSignal | undefined): void

      Parameters

      • signal: AbortSignal | undefined

      Returns void

    • get timeout(): number

      The maximum amount of seconds requests should take before returning an answer (defaults to 20)

      Returns number

      0 means no maximum, no timeout

    • set timeout(timeout: number): void

      Parameters

      • timeout: number

      Returns void

    • get token(): string

      The key that allows you to talk with the API

      Returns string

    • set token(token: string): void

      Parameters

      • token: string

      Returns void

    • get token_timer(): Timeout | undefined

      Returns Timeout | undefined

    • set token_timer(timer: Timeout): void

      Parameters

      • timer: Timeout

      Returns void

    • get token_type(): string

      Should always be "Bearer"

      Returns string

    • set token_type(token: string): void

      Parameters

      • token: string

      Returns void

    • get user(): User

      Information about the account that has been used to log in

      Returns User

    • set user(user: User): void

      Parameters

      Returns void

    • get username(): string

      The username of the account

      Returns string

    • set username(username: string): void

      Parameters

      • username: string

      Returns void

    • get verbose(): "none" | "errors" | "all" | undefined

      Which events should be logged (defaults to none)

      Returns "none" | "errors" | "all" | undefined

    • set verbose(verbose: "none" | "errors" | "all" | undefined): void

      Parameters

      • verbose: "none" | "errors" | "all" | undefined

      Returns void

    Methods

    • The function that directly communicates with the API! Almost all functions of the API object uses this function!

      Parameters

      • method: "get" | "post" | "put" | "delete"

        The type of request, each endpoint uses a specific one (if it uses multiple, the intent and parameters become different)

      • endpoint: (string | number)[]

        What comes in the URL after api/, DO NOT USE TEMPLATE LITERALS (`) OR THE ADDITION OPERATOR (+), put everything separately for type safety

      • parameters: { [k: string]: any } = {}

        The things to specify in the request, such as the beatmap_id when looking for a beatmap

      Returns Promise<any>

      A Promise with the API's response

    • This contacts the server in order to get and set a new API.token!

      Returns Promise<boolean>

      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

    • The 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

      Parameters

      • server: string

        The base URL where requests should land, should include the /api portion if applicable (e.g. https://my-instance.com/api)

      • username: string

        The username of the user you're logging in as

      • password: string

        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

      Returns Promise<API>

    Admin endpoints

    getTeamsAsAdmin: (
        this: API,
        parameters?: GenericRequestParameters,
    ) => Promise<TeamWithMembersCount[]> = Admin.getTeams

    Type Declaration

    getUsersAsAdmin: (
        this: API,
        parameters?: GenericRequestParameters,
    ) => Promise<DetailedUser[]> = Admin.getUsers

    Type Declaration

    getWebsitesAsAdmin: (
        this: API,
        parameters?: GenericRequestParameters,
    ) => Promise<WebsiteWithUserTeam[]> = Admin.getWebsites

    Type Declaration

    Events endpoints

    getWebsiteEventData: (
        this: API,
        websiteId: string,
        eventId: string,
    ) => Promise<Data[]> = Events.get_WEBSITEID_Eventdata_EVENTID

    Type Declaration

    getWebsiteEvents: (
        this: API,
        websiteId: string,
        parameters: Timestamps & GenericRequestParameters & { filters?: Filters },
    ) => Promise<Event[]> = Events.get_WEBSITEID_Events

    Type Declaration

    getWebsiteEventsData: (
        this: API,
        websiteId: string,
        parameters: Timestamps & { event?: string; filters?: Filters },
    ) => Promise<DataMultiple[]> = Events.get_WEBSITEID_EventdataEvents

    Type Declaration

    getWebsiteEventsDataFields: (
        this: API,
        websiteId: string,
        parameters: Timestamps & { filters?: Filters },
    ) => Promise<DataFields[]> = Events.get_WEBSITEID_EventdataFields

    Type Declaration

    getWebsiteEventsDataProperties: (
        this: API,
        websiteId: string,
        parameters: Timestamps & { filters?: Filters },
    ) => Promise<Events.DataProperties[]> = Events.get_WEBSITEID_EventdataProperties

    Type Declaration

    getWebsiteEventsDataStats: (
        this: API,
        websiteId: string,
        parameters: Timestamps & { filters?: Filters },
    ) => Promise<DataStats> = Events.get_WEBSITEID_EventdataStats

    Type Declaration

    getWebsiteEventsDataValues: (
        this: API,
        websiteId: string,
        parameters: Timestamps & {
            event: string;
            filters?: Filters;
            propertyName: string;
        },
    ) => Promise<Events.DataValues[]> = Events.get_WEBSITEID_EventdataValues

    Type Declaration

    Links endpoints

    deleteLink: (this: API, linkId: string) => Promise<DeletionResult> = Links.delete_LINKID

    Type Declaration

    deletePixel: (this: API, pixelId: string) => Promise<DeletionResult> = Pixels.delete_PIXELID

    Type Declaration

    getLink: (this: API, linkId: string) => Promise<Link> = Links.get_LINKID

    Type Declaration

    getLinks: (this: API, parameters?: GenericRequestParameters) => Promise<Link[]> = Links.get

    Type Declaration

    getPixel: (this: API, pixelId: string) => Promise<Pixel> = Pixels.get_PIXELID

    Type Declaration

    getPixels: (
        this: API,
        parameters?: GenericRequestParameters,
    ) => Promise<Pixel[]> = Pixels.get

    Type Declaration

    updateLink: (
        this: API,
        linkId: string,
        parameters: { name?: string; slug?: string; url?: string },
    ) => Promise<Link> = Links.post_LINKID

    Type Declaration

      • (
            this: API,
            linkId: string,
            parameters: { name?: string; slug?: string; url?: string },
        ): Promise<Link>
      • Parameters

        • this: API
        • linkId: string
        • parameters: { name?: string; slug?: string; url?: string }
          • Optionalname?: string

            The link's name

          • Optionalslug?: string

            The link's URL slug, with a minimum of 8 characters

          • Optionalurl?: string

            The link's destination URL

        Returns Promise<Link>

    updatePixel: (
        this: API,
        pixelId: string,
        parameters: { name?: string; slug?: string },
    ) => Promise<Pixel> = Pixels.post_PIXELID

    Type Declaration

      • (
            this: API,
            pixelId: string,
            parameters: { name?: string; slug?: string },
        ): Promise<Pixel>
      • Parameters

        • this: API
        • pixelId: string
        • parameters: { name?: string; slug?: string }
          • Optionalname?: string

            The pixel's name

          • Optionalslug?: string

            The pixel's URL slug, with a minimum of 8 characters

        Returns Promise<Pixel>

    Me endpoints

    getMyself: (this: API) => Promise<TokenInformation> = Me.get

    Type Declaration

    getMyTeams: (this: API) => Promise<TeamWithMembersCount[]> = Me.getTeams

    Type Declaration

    getMyWebsites: (this: API) => Promise<WebsiteWithUser[]> = Me.getWebsites

    Type Declaration

    Realtime endpoints

    getRealtime: (this: API, websiteId: string) => Promise<Realtime.Stats> = Realtime.get_WEBSITEID

    Type Declaration

    Reports endpoints

    createReport: (
        this: API,
        websiteId: string,
        parameters: {
            description?: string;
            name: string;
            parameters: { type: string; value: string };
            type: ReportType;
        },
    ) => Promise<Report> = Reports.post

    Type Declaration

      • (
            this: API,
            websiteId: string,
            parameters: {
                description?: string;
                name: string;
                parameters: { type: string; value: string };
                type: ReportType;
            },
        ): Promise<Report>
      • Parameters

        • this: API
        • websiteId: string
        • parameters: {
              description?: string;
              name: string;
              parameters: { type: string; value: string };
              type: ReportType;
          }
          • Optionaldescription?: string

            Description of report

          • name: string

            Name of report

          • parameters: { type: string; value: string }

            Parameters for report

          • type: ReportType

            Report type

        Returns Promise<Report>

    deleteReport: (this: API, reportId: string) => Promise<DeletionResult> = Reports.delete_REPORTID

    Type Declaration

    getReport: (this: API, reportId: string) => Promise<Report> = Reports.get_REPORTID

    Type Declaration

    getReports: (
        this: API,
        websiteId: string,
        parameters: { type: ReportType } & Omit<GenericRequestParameters, "search">,
    ) => Promise<Report[]> = Reports.get

    Type Declaration

    getReportsAttribution: (
        this: API,
        websiteId: string,
        parameters: Reports.Timestamps & {
            filters?: Filters;
            model: "first-click" | "last-click";
            step: string;
            type: "path" | "event";
        },
    ) => Promise<Attribution> = Reports.postAttribution

    Type Declaration

      • (
            this: API,
            websiteId: string,
            parameters: Reports.Timestamps & {
                filters?: Filters;
                model: "first-click" | "last-click";
                step: string;
                type: "path" | "event";
            },
        ): Promise<Attribution>
      • See how users engage with your marketing and what drives conversions: https://umami.is/docs/api/reports#post-apireportsattribution

        Parameters

        • this: API
        • websiteId: string
        • parameters: Reports.Timestamps & {
              filters?: Filters;
              model: "first-click" | "last-click";
              step: string;
              type: "path" | "event";
          }
          • Optionalfilters?: Filters

            Can accept filter parameters

          • model: "first-click" | "last-click"

            Attribution model

          • step: string

            Conversion step

          • type: "path" | "event"

            Conversion type

        Returns Promise<Attribution>

    getReportsBreakdown: (
        this: API,
        websiteId: string,
        parameters: Reports.Timestamps & {
            fields: (
                | "region"
                | "path"
                | "event"
                | "title"
                | "query"
                | "referrer"
                | "browser"
                | "os"
                | "device"
                | "country"
                | "city"
                | "hostname"
                | "tag"
            )[];
            filters?: Filters;
        },
    ) => Promise<Breakdown[]> = Reports.postBreakdown

    Type Declaration

      • (
            this: API,
            websiteId: string,
            parameters: Reports.Timestamps & {
                fields: (
                    | "region"
                    | "path"
                    | "event"
                    | "title"
                    | "query"
                    | "referrer"
                    | "browser"
                    | "os"
                    | "device"
                    | "country"
                    | "city"
                    | "hostname"
                    | "tag"
                )[];
                filters?: Filters;
            },
        ): Promise<Breakdown[]>
      • Dive deeper into your data by using segments and filters: https://umami.is/docs/api/reports#post-apireportsbreakdown

        Parameters

        • this: API
        • websiteId: string
        • parameters: Reports.Timestamps & {
              fields: (
                  | "region"
                  | "path"
                  | "event"
                  | "title"
                  | "query"
                  | "referrer"
                  | "browser"
                  | "os"
                  | "device"
                  | "country"
                  | "city"
                  | "hostname"
                  | "tag"
              )[];
              filters?: Filters;
          }
          • fields: (
                | "region"
                | "path"
                | "event"
                | "title"
                | "query"
                | "referrer"
                | "browser"
                | "os"
                | "device"
                | "country"
                | "city"
                | "hostname"
                | "tag"
            )[]

            List of column fields

          • Optionalfilters?: Filters

            Can accept filter parameters

        Returns Promise<Breakdown[]>

    getReportsFunnel: (
        this: API,
        websiteId: string,
        parameters: Reports.Timestamps & {
            filters?: Filters;
            steps: { type: "path" | "event"; value: string }[];
            window: number;
        },
    ) => Promise<Funnel[]> = Reports.postFunnel

    Type Declaration

      • (
            this: API,
            websiteId: string,
            parameters: Reports.Timestamps & {
                filters?: Filters;
                steps: { type: "path" | "event"; value: string }[];
                window: number;
            },
        ): Promise<Funnel[]>
      • Understand the conversion and drop-off rate of users: https://umami.is/docs/api/reports#post-apireportsfunnel

        Parameters

        • this: API
        • websiteId: string
        • parameters: Reports.Timestamps & {
              filters?: Filters;
              steps: { type: "path" | "event"; value: string }[];
              window: number;
          }
          • Optionalfilters?: Filters

            Can accept filter parameters

          • steps: { type: "path" | "event"; value: string }[]

            Type of event and conversion step

          • window: number

            Window of days between funnel steps to be considered a conversion

        Returns Promise<Funnel[]>

    getReportsGoals: (
        this: API,
        websiteId: string,
        parameters: Reports.Timestamps & {
            filters?: Filters;
            name?: string;
            operator?: "count" | "sum" | "average";
            property?: string;
            type: "path" | "event";
            value: string;
        },
    ) => Promise<Goals> = Reports.postGoals

    Type Declaration

      • (
            this: API,
            websiteId: string,
            parameters: Reports.Timestamps & {
                filters?: Filters;
                name?: string;
                operator?: "count" | "sum" | "average";
                property?: string;
                type: "path" | "event";
                value: string;
            },
        ): Promise<Goals>
      • Track your goals for pageviews and events: https://umami.is/docs/api/reports#post-apireportsgoals

        Parameters

        • this: API
        • websiteId: string
        • parameters: Reports.Timestamps & {
              filters?: Filters;
              name?: string;
              operator?: "count" | "sum" | "average";
              property?: string;
              type: "path" | "event";
              value: string;
          }
          • Optionalfilters?: Filters

            Can accept filter parameters

          • Optionalname?: string

            Undocumented

          • Optionaloperator?: "count" | "sum" | "average"

            Undocumented

          • Optionalproperty?: string

            Undocumented

          • type: "path" | "event"

            Conversion type

          • value: string

            Conversion step value

        Returns Promise<Goals>

        Here be dragons: I have no idea how to use this endpoint without it returning a client/server error, my apologies - The package developer

    getReportsJourney: (
        this: API,
        websiteId: string,
        parameters: Reports.Timestamps & {
            endStep?: string;
            filters?: Filters;
            startStep: string;
            steps: number;
        },
    ) => Promise<Journey[]> = Reports.postJourney

    Type Declaration

      • (
            this: API,
            websiteId: string,
            parameters: Reports.Timestamps & {
                endStep?: string;
                filters?: Filters;
                startStep: string;
                steps: number;
            },
        ): Promise<Journey[]>
      • Understand how users nagivate [sic] through your website: https://umami.is/docs/api/reports#post-apireportsjourney

        Parameters

        • this: API
        • websiteId: string
        • parameters: Reports.Timestamps & {
              endStep?: string;
              filters?: Filters;
              startStep: string;
              steps: number;
          }
          • OptionalendStep?: string

            Ending step URL or event name

          • Optionalfilters?: Filters

            Can accept filter parameters

          • startStep: string

            Starting step URL or event name

          • steps: number

            Number of steps from 3 to 7

        Returns Promise<Journey[]>

    getReportsRetention: (
        this: API,
        websiteId: string,
        parameters: Reports.Timestamps & { filters?: Filters; timezone: string },
    ) => Promise<Retention[]> = Reports.postRetention

    Type Declaration

    getReportsRevenue: (
        this: API,
        websiteId: string,
        parameters: Reports.Timestamps & {
            currency: string;
            filters?: Filters;
            timezone: string;
        },
    ) => Promise<Revenue> = Reports.postRevenue

    Type Declaration

      • (
            this: API,
            websiteId: string,
            parameters: Reports.Timestamps & {
                currency: string;
                filters?: Filters;
                timezone: string;
            },
        ): Promise<Revenue>
      • Get currency for given range. Needed for Revenue and optional in Attribution reports: https://umami.is/docs/api/reports#post-apireportsrevenue

        Parameters

        • this: API
        • websiteId: string
        • parameters: Reports.Timestamps & { currency: string; filters?: Filters; timezone: string }
          • currency: string

            Currency code (ISO 4217)

          • Optionalfilters?: Filters

            Can accept filter parameters

          • timezone: string

            Timezone (ex. America/Los_Angeles)

        Returns Promise<Revenue>

    getReportsUTM: (
        this: API,
        websiteId: string,
        parameters: Reports.Timestamps & { filters?: Filters },
    ) => Promise<UTM> = Reports.postUTM

    Type Declaration

    updateReport: (
        this: API,
        reportId: string,
        parameters?: {
            description?: string;
            name?: string;
            parameters: { type: string; value: string };
            type: ReportType;
            websiteId: string;
        },
    ) => Promise<Report> = Reports.post_REPORTID

    Type Declaration

      • (
            this: API,
            reportId: string,
            parameters?: {
                description?: string;
                name?: string;
                parameters: { type: string; value: string };
                type: ReportType;
                websiteId: string;
            },
        ): Promise<Report>
      • Parameters

        • this: API
        • reportId: string
        • Optionalparameters: {
              description?: string;
              name?: string;
              parameters: { type: string; value: string };
              type: ReportType;
              websiteId: string;
          }
          • Optionaldescription?: string

            Description of report

          • Optionalname?: string

            Name of report

          • parameters: { type: string; value: string }

            Parameters for report

          • type: ReportType

            Report type

          • websiteId: string

            Your website id

        Returns Promise<Report>

    Sending stats

    • To register an event

      Parameters

      • websiteId: string
      • Optionalpayload: {
            data?: { [k: string]: any };
            hostname?: string;
            id?: string;
            language?: string;
            name?: string;
            referrer?: string;
            screen?: string;
            tag?: string;
            title?: string;
            url?: string;
        }
        • Optionaldata?: { [k: string]: any }

          Additional data for the event

        • Optionalhostname?: string

          Name of host

        • Optionalid?: string

          Session identifier

        • Optionallanguage?: string

          Language of visitor (ex. "en-US")

        • Optionalname?: string

          Name of the event

        • Optionalreferrer?: string

          Referrer URL

        • Optionalscreen?: string

          Screen resolution (ex. "1920x1080")

        • Optionaltag?: string

          Additional tag description

        • Optionaltitle?: string

          Page title

        • Optionalurl?: string

          Page URL

      • type: "event" | "identify" = "event"

      Returns Promise<{ cache: string; sessionId: string; visitId: string }>

    Sessions endpoints

    getWebsiteSession: (
        this: API,
        websiteId: string,
        sessionId: string,
    ) => Promise<SessionWithDistinctidEventsTotaltime> = Sessions.get_WEBSITEID_Sessions_SESSIONID

    Type Declaration

    getWebsiteSessionActivity: (
        this: API,
        websiteId: string,
        sessionId: string,
        parameters: Timestamps,
    ) => Promise<Activity[]> = Sessions.get_WEBSITEID_Sessions_SESSIONID_Activity

    Type Declaration

    getWebsiteSessionDataProperties: (
        this: API,
        websiteId: string,
        parameters: Timestamps & { filters?: Filters },
    ) => Promise<Sessions.DataProperties[]> = Sessions.get_WEBSITEID_SessiondataProperties

    Type Declaration

    getWebsiteSessionDataValues: (
        this: API,
        websiteId: string,
        parameters: Timestamps & { filters?: Filters; propertyName: string },
    ) => Promise<Sessions.DataValues[]> = Sessions.get_WEBSITEID_SessiondataValues

    Type Declaration

    getWebsiteSessionProperties: (
        this: API,
        websiteId: string,
        sessionId: string,
    ) => Promise<Properties[]> = Sessions.get_WEBSITEID_Sessions_SESSIONID_Properties

    Type Declaration

    getWebsiteSessions: (
        this: API,
        websiteId: string,
        parameters: Timestamps & GenericRequestParameters & { filters?: Filters },
    ) => Promise<SessionWithHostnameCreatedate[]> = Sessions.get_WEBSITEID_Sessions

    Type Declaration

    getWebsiteSessionsStats: (
        this: API,
        websiteId: string,
        parameters: Timestamps & { filters?: Filters },
    ) => Promise<Sessions.Stats> = Sessions.get_WEBSITEID_SessionsStats

    Type Declaration

    getWebsiteSessionsWeekly: (
        this: API,
        websiteId: string,
        parameters: Timestamps & { filters?: Filters; timezone: string },
    ) => Promise<number[][]> = Sessions.get_WEBSITEID_SessionsWeekly

    Type Declaration

    Teams endpoints

    addTeamUser: (
        this: API,
        teamId: string,
        parameters: {
            role: "team-manager" | "team-member" | "team-view-only";
            userId: string;
        },
    ) => Promise<TeamMember> = Teams.post_TEAMID_Users

    Type Declaration

      • (
            this: API,
            teamId: string,
            parameters: {
                role: "team-manager" | "team-member" | "team-view-only";
                userId: string;
            },
        ): Promise<TeamMember>
      • Parameters

        • this: API
        • teamId: string
        • parameters: { role: "team-manager" | "team-member" | "team-view-only"; userId: string }
          • role: "team-manager" | "team-member" | "team-view-only"

            Team role for user

          • userId: string

            ID of user to be added

        Returns Promise<TeamMember>

    createTeam: (this: API, name: string) => Promise<[Team, TeamMember]> = Teams.post

    Type Declaration

    deleteTeam: (this: API, teamId: string) => Promise<DeletionResult> = Teams.delete_TEAMID

    Type Declaration

    getTeam: (this: API, teamId: string) => Promise<TeamWithMembers> = Teams.get_TEAMID

    Type Declaration

    getTeams: (
        this: API,
        parameters?: Omit<GenericRequestParameters, "search">,
    ) => Promise<TeamWithMembersCount[]> = Teams.get

    Type Declaration

    getTeamUser: (this: API, teamId: string, userId: string) => Promise<TeamMember> = Teams.get_TEAMID_Users_USERID

    Type Declaration

    getTeamUsers: (
        this: API,
        teamId: string,
        parameters?: GenericRequestParameters,
    ) => Promise<TeamMemberWithUser[]> = Teams.get_TEAMID_Users

    Type Declaration

    getTeamWebsites: (
        this: API,
        teamId: string,
        parameters?: GenericRequestParameters,
    ) => Promise<WebsiteWithCreateuser[]> = Teams.get_TEAMID_Websites

    Type Declaration

    joinTeam: (this: API, accessCode: string) => Promise<TeamMember> = Teams.postJoin

    Type Declaration

    removeTeamUser: (
        this: API,
        teamId: string,
        userId: string,
    ) => Promise<DeletionResult> = Teams.delete_TEAMID_Users_USERID

    Type Declaration

    updateTeam: (
        this: API,
        teamId: string,
        parameters: { accessCode?: string; name?: string },
    ) => Promise<Team> = Teams.post_TEAMID

    Type Declaration

      • (
            this: API,
            teamId: string,
            parameters: { accessCode?: string; name?: string },
        ): Promise<Team>
      • Parameters

        • this: API
        • teamId: string
        • parameters: { accessCode?: string; name?: string }
          • OptionalaccessCode?: string

            The team's access code

          • Optionalname?: string

            The team's name

        Returns Promise<Team>

    updateTeamUser: (
        this: API,
        teamId: string,
        userId: string,
        role: "team-manager" | "team-member" | "team-view-only",
    ) => Promise<TeamMember> = Teams.post_TEAMID_Users_USERID

    Type Declaration

    Users endpoints

    createUser: (
        this: API,
        parameters: { id?: string; password: string; role: Role; username: string },
    ) => Promise<MinimalUserWithRole> = Users.post

    Type Declaration

    deleteUser: (this: API, userId: string) => Promise<DeletionResult> = Users.delete_USERID

    Type Declaration

    getUser: (this: API, userId: string) => Promise<MinimalUserWithRoleCreatedAt> = Users.get_USERID

    Type Declaration

    getUserTeams: (
        this: API,
        userId: string,
        parameters?: Omit<GenericRequestParameters, "search">,
    ) => Promise<TeamWithMembersCount[]> = Users.get_USERID_Teams

    Type Declaration

    getUserWebsites: (
        this: API,
        userId: string,
        parameters?: GenericRequestParameters & { includeTeams?: boolean },
    ) => Promise<WebsiteWithUser[]> = Users.get_USERID_Websites

    Type Declaration

    updateUser: (
        this: API,
        userId: string,
        parameters?: { password?: string; role?: Role; username?: string },
    ) => Promise<MinimalUserWithRoleCreatedAt> = Users.post_USERID

    Type Declaration

    Website stats endpoints

    getWebsiteActiveVisitors: (this: API, websiteId: string) => Promise<Active> = WebsiteStats.get_WEBSITEID_Active

    Type Declaration

    getWebsiteEventsStats: (
        this: API,
        websiteId: string,
        parameters: Timestamps & Units & { filters?: Filters; timezone: string },
    ) => Promise<XTY[]> = WebsiteStats.get_WEBSITEID_EventsSeries

    Type Declaration

    getWebsiteMetrics: (
        this: API,
        websiteId: string,
        parameters: Timestamps & Units & {
            filters?: Filters;
            limit?: number;
            offset?: number;
            timezone: string;
            type: MetricsTypes;
        },
    ) => Promise<Metrics[]> = WebsiteStats.get_WEBSITEID_Metrics

    Type Declaration

    getWebsiteMetricsExpanded: (
        this: API,
        ...args: [
            websiteId: string,
            parameters: Timestamps & Units & {
                filters?: Filters;
                limit?: number;
                offset?: number;
                timezone: string;
                type: MetricsTypes;
            },
        ],
    ) => Promise<ExpandedMetrics[]> = WebsiteStats.get_WEBSITEID_MetricsExpanded

    Type Declaration

    getWebsitePageviews: (
        this: API,
        websiteId: string,
        parameters: Timestamps & Units & {
            compare?: string;
            filters?: Filters;
            timezone: string;
        },
    ) => Promise<Pageviews> = WebsiteStats.get_WEBSITEID_Pageviews

    Type Declaration

    getWebsiteStats: (
        this: API,
        websiteId: string,
        parameters: Timestamps & { filters?: Filters },
    ) => Promise<StatsWithComparison> = WebsiteStats.get_WEBSITEID_Stats

    Type Declaration

    Websites endpoints

    createWebsite: (
        this: API,
        parameters: {
            domain: string;
            id?: string;
            name: string;
            shareId?: string | null;
            teamId?: string | null;
        },
    ) => Promise<Website> = Websites.post

    Type Declaration

      • (
            this: API,
            parameters: {
                domain: string;
                id?: string;
                name: string;
                shareId?: string | null;
                teamId?: string | null;
            },
        ): Promise<Website>
      • Parameters

        • this: API
        • parameters: {
              domain: string;
              id?: string;
              name: string;
              shareId?: string | null;
              teamId?: string | null;
          }
          • domain: string

            The full domain of the tracked website

          • Optionalid?: string

            Force a UUID assignment to the website

          • name: string

            The name of the website in Umami

          • OptionalshareId?: string | null

            A unique string to enable a share url. Set null to unshare

          • OptionalteamId?: string | null

            The ID of the team the website will be created under

        Returns Promise<Website>

    deleteWebsite: (this: API, websiteId: string) => Promise<DeletionResult> = Websites.delete_WEBSITEID

    Type Declaration

    getWebsite: (this: API, websiteId: string) => Promise<Website> = Websites.get_WEBSITEID

    Type Declaration

    getWebsites: (
        this: API,
        parameters?: GenericRequestParameters & { includeTeams?: boolean },
    ) => Promise<WebsiteWithUser[]> = Websites.get

    Type Declaration

    resetWebsite: (this: API, websiteId: string) => Promise<DeletionResult> = Websites.post_WEBSITEID_Reset

    Type Declaration

    updateWebsite: (
        this: API,
        websiteId: string,
        parameters: { domain?: string; name?: string; shareId?: string | null },
    ) => Promise<Website> = Websites.post_WEBSITEID

    Type Declaration

      • (
            this: API,
            websiteId: string,
            parameters: { domain?: string; name?: string; shareId?: string | null },
        ): Promise<Website>
      • Parameters

        • this: API
        • websiteId: string
        • parameters: { domain?: string; name?: string; shareId?: string | null }
          • Optionaldomain?: string

            The full domain of the tracked website

          • Optionalname?: string

            The name of the website in Umami

          • OptionalshareId?: string | null

            A unique string to enable a share url. Set null to unshare

        Returns Promise<Website>