Hierarchy

Constructors

Methods

  • Parameters

    • id: string
    • email: string

    Returns Promise<string>

    Description

    Adds a new team member to the profile using their email address.

    See

    https://help.tago.io/portal/en/kb/articles/106-sharing-your-profile Team Management - Sharing your Profile

    Example

    const resources = new Resources({ token: "YOUR-PROFILE-TOKEN" });
    const result = await resources.profiles.addTeamMember("profile-id-123", "user@example.com");
    console.log(result); // User invited
  • Parameters

    • profileID: string
    • addonObj: Partial<AddonInfo>

    Returns Promise<string>

    Description

    Updates the add-on configuration for a profile.

    Deprecated

    This route is deprecated.

  • Parameters

    • profileObj: {
          name: string;
      }
      • name: string
    • Optional options: {
          allocate_free_resources?: boolean;
      }
      • Optional allocate_free_resources?: boolean

    Returns Promise<{
        id: string;
    }>

    Description

    Creates a new profile with the specified name and optional resource allocation settings.

    See

    https://help.tago.io/portal/en/kb/articles/198-profiles#Adding_Profiles Adding Profiles

    Example

    const resources = new Resources({ token: "YOUR-PROFILE-TOKEN" });
    const result = await resources.profiles.create({ name: "New Profile" }, { allocate_free_resources: true });
    console.log(result); // { id: 'profile-id-123' }
  • Parameters

    • profileID: string
    • credentials: {
          password: string;
          pin_code?: string;
      }
      • password: string
      • Optional pin_code?: string

    Returns Promise<string>

    Description

    Permanently removes a profile from the account.

    See

    https://help.tago.io/portal/en/kb/articles/526-two-factor-authentication Two-Factor Authentication (2FA)

    Example

    const resources = new Resources({ token: "YOUR-PROFILE-TOKEN" });
    // The “pin_code” field is required when 2FA is activated
    const result = await resources.profiles.delete("profile-id-123", { password: "your-password", pin_code: "123456" });
    console.log(result); // Successfully Removed
  • Parameters

    • id: string
    • accountId: string

    Returns Promise<string>

    Description

    Removes a team member from the profile.

    See

    https://help.tago.io/portal/en/kb/articles/106-sharing-your-profile Team Management - Sharing your Profile

    Example

    If receive an error "Authorization Denied", check policy in Access Management.

    const resources = new Resources({ token: "YOUR-PROFILE-TOKEN" });
    const result = await resources.profiles.deleteTeamMember("profile-id-123", "account-id-456");
    console.log(result); // Account Successfully Removed
  • Parameters

    • profileID: string

    Returns Promise<ProfileInfo>

    Description

    Retrieves detailed information about a specific profile using its ID or 'current' for the active profile.

    See

    https://help.tago.io/portal/en/kb/articles/198-profiles Profiles

    Example

    If receive an error "Authorization Denied", check policy Account / Access profile in Access Management.

    const profileInfo = await Resources.profiles.info("profile-id-123");
    // Or get current profile
    const currentProfile = await Resources.profiles.info("current");
    console.log(profileInfo); // { info { id: 'profile-id-123', account: 'account-id-123', ...}, ... }
  • Parameters

    Returns Promise<string>

    Description

    Removes an add-on from the profile at the end of the current billing cycle.

    Deprecated

    This route is deprecated.

  • Parameters

    • profileID: string
    • serviceObj: object

    Returns Promise<string>

    Description

    Updates service configuration and resource limits for a profile.

  • Parameters

    • profileID: string
    • Optional options: {
          onlyAmount?: boolean;
      }
      • Optional onlyAmount?: boolean

    Returns Promise<ProfileSummary>

    Description

    Retrieves a summary of the profile's usage and statistics.

    See

    https://help.tago.io/portal/en/kb/articles/198-profiles Profiles

    Example

    If receive an error "Authorization Denied", check policy Account / Access profile in Access Management.

    const result = await Resources.profiles.summary("profile-id-123");
    console.log(result); // { amount: { device: 10, bucket: 10, dashboard: 5, ... }, ... }
  • Parameters

    • profileId: string
    • token: string

    Returns Promise<string>

    Description

    Revokes and removes an authentication token from the profile.

    See

    https://help.tago.io/portal/en/kb/articles/495-account-token Account Token

    Example

    const resources = new Resources({ token: "YOUR-PROFILE-TOKEN" });
    const result = await resources.profiles.tokenDelete("profile-id-123", "token-xyz");
    console.log(result); // Token Successfully Removed
  • Parameters

    Returns Promise<Partial<TokenDataList>[]>

    Description

    Retrieves a list of all tokens associated with a specific profile.

    See

    https://help.tago.io/portal/en/kb/articles/495-account-token Account Token

    Example

    const resources = new Resources({ token: "YOUR-PROFILE-TOKEN" });
    const result = await resources.profiles.tokenList("profile-id-123", {
    page: 1,
    amount: 20,
    fields: ["name", "token", "permission"]
    });
    console.log(result); // [ { name: 'Token #1', token: 'token-value', permission: 'full', ... }, ... ]
  • Parameters

    • targetProfileID: string

    Returns Promise<string>

    Description

    Transfers the current authentication token to another profile.

    Example

    const resources = new Resources({ token: "YOUR-PROFILE-TOKEN" });
    const result = await resources.profiles.transferTokenToAnotherProfile("target-profile-123");
    console.log(result);
  • Parameters

    Returns Promise<UsageStatistic[]>

    Description

    Retrieves usage statistics for a profile within a specified time period.

    Usage statistics are cumulative: if a service was not used in a time period, the statistics for that time period will not be in the object.

    Example

    If receive an error "Authorization Denied", check policy Account / Access profile statistics in Access Management.

    const result = await Resources.profiles.usageStatisticList("profile-id-123", {
    start_date: "2024-09-01",
    end_date: "2024-12-31",
    periodicity: "day"
    });
    console.log(result); // [ { time: '2024-09-02T00:01:29.749Z', analysis: 0.07, data_records: 67254, ... }, ... ]