UAPI Functions - UserManager::lookup_user

Description

This function lists a single subaccount.

Examples 


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/UserManager/lookup_user?guid=EXAMPLE1%3AEXAMPLE.COM%3A564CD663%3AFE50072F2620B50988EA4E5F46022546FBE6BDDE3C36C2F2534F4967C661EC37

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// List a subaccount.
$UserManager $cpanel->uapi(
    'UserManager''lookup_user',
    array(
        'guid'  =>   'EXAMPLE1%3AEXAMPLE.COM%3A564CD663%3AFE50072F2620B50988EA4E5F46022546FBE6BDDE3C36C2F2534F4967C661EC37'
    )
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# List a subaccount.
my $UserManager $cpliveapi->uapi(
    'UserManager''lookup_user',
    {  
    'guid'  =>   'EXAMPLE1%3AEXAMPLE.COM%3A564CD663%3AFE50072F2620B50988EA4E5F46022546FBE6BDDE3C36C2F2534F4967C661EC37'
    }
);

 cPanel Template Toolkit

<!-- List a subaccount. -->
[% execute('UserManager', 'lookup_user', {'guid' => 'EXAMPLE1%3AEXAMPLE.COM%3A564CD663%3AFE50072F2620B50988EA4E5F46022546FBE6BDDE3C36C2F2534F4967C661EC37',} ) %]

 Command Line

uapi --user=username UserManager lookup_user guid=EXAMPLE1%3AEXAMPLE.COM%3A564CD663%3AFE50072F2620B50988EA4E5F46022546FBE6BDDE3C36C2F2534F4967C661EC37

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 Output (JSON)

{
    "messages": null,
    "errors": null,
    "status": 1,
    "metadata": {},
    "data": {
        "issues": [],
        "sub_account_exists": null,
        "can_set_quota": 0,
        "dismissed": null,
        "has_siblings": null,
        "full_username": "example1@example.com",
        "parent_type": null,
        "special": 0,
        "can_set_password": 1,
        "domain": "example.com",
        "merge_candidates": [
            {
                "issues": [],
                "sub_account_exists": 1,
                "can_set_quota": 1,
                "dismissed": null,
                "has_siblings": null,
                "full_username": "example1@example.com",
                "parent_type": "sub",
                "special": 0,
                "can_set_password": 1,
                "domain": "example.com",
                "merge_candidates": [],
                "guid": null,
                "real_name": null,
                "can_delete": 1,
                "services": {
                    "email": {
                        "enabled": 0
                    },
                    "ftp": {
                        "quota": "0.00",
                        "homedir": "public_html/example.com/example1",
                        "enabled": 1
                    },
                    "webdisk": {
                        "enabled": 0
                    }
                },
                "phone_number": null,
                "avatar_url": null,
                "alternate_email": null,
                "username": "example1",
                "type": "service",
                "synced_password": null
            },
            {
                "issues": [],
                "sub_account_exists": 1,
                "can_set_quota": 1,
                "dismissed": null,
                "has_siblings": null,
                "full_username": "example1@example.com",
                "parent_type": "sub",
                "special": 0,
                "can_set_password": 1,
                "domain": "example.com",
                "merge_candidates": [],
                "guid": null,
                "real_name": null,
                "can_delete": 1,
                "services": {
                    "email": {
                        "enabled": 0
                    },
                    "ftp": {
                        "enabled": 0
                    },
                    "webdisk": {
                        "enabledigest": 0,
                        "private": 0,
                        "perms": "rw",
                        "homedir": "public_html/example1",
                        "enabled": 1
                    }
                },
                "phone_number": null,
                "avatar_url": null,
                "alternate_email": null,
                "username": "example1",
                "type": "service",
                "synced_password": null
            }
        ],
        "guid": "EXAMPLE1:EXAMPLE.COM:566099A9:131FDD97D660FA524064A51E7F5DC250EEC70CEFC3C884DCEFAA76A478CB533F",
        "real_name": null,
        "can_delete": 1,
        "services": {
            "email": {
                "enabled": 1
            },
            "ftp": {
                "enabled": 0
            },
            "webdisk": {
                "enabled": 0
            }
        },
        "phone_number": null,
        "avatar_url": null,
        "alternate_email": null,
        "username": "example1",
        "type": "sub",
        "synced_password": 1
    }
}

 

Note:

Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.

 

Parameters

 Parameter 

Type

Description

Possible values

 Example 

guid

 string 

Required

 The subaccount's unique identifier. 

 A system-assigned unique value. 

 

 

 

Returns

 

Return

Type

Description

Possible values

Example

alternate_email

string

An alternate email address for the subaccount's user.

A valid email address.

 user@example.com 

avatar_url

string

 The URL to the user's subaccount profile photo.

Note:

Use the HTTPS protocol to prevent mixed content warnings when users view it from another HTTPS URL.

 A valid HTTPS URL that points to an image file.

 

can_delete

boolean

Whether the cPanel account user can delete the subaccount.

  • 1 — Can delete.
  • 0 — Cannot delete.

0

can_set_password

boolean

Whether the cPanel account user can change the subaccount's password.

 

  • 1 — Can change password.
  • 0 — Cannot change password.

Note:

The function returns a 0 value for subaccounts who inherit their password from the cPanel account.

1

can_set_quota

boolean

Whether the cPanel account user can change the subaccount's disk usage quota.

  • 1 — Can change quota.
  • 0 — Cannot change quota.

0

dismissed

boolean

Whether the cPanel account user dismissed the merge  prompt for the service account.

Note:

 Only service accounts return this value.

  • 1 — Dismissed prompt.
  • 0 — Did not dismiss prompt.

1

domain

string

 The subaccount user's associated domain.

A domain that the cPanel account owns.

example.com

full_username

string

The subaccount's username and domain name.

 A valid username, the @ character, and the associated domain.

user@example.com

guid

string

 The subaccountunique identifier.

Note:

The subaccount's globally unique identifier (GUID) does not change when you adjust its other attributes.

The system assigned unique value.

 

issues

array

This array of hashes contains information about any issues or problems with the subaccount.

This array contains the type, area, service,message, used, and limit values.

 

type

string

The type of issue.

The function returns this value in theissues array.

  • error
  • warning
  • info

info

area

string

The affected section of cPanel & WHM.

quota

quota

service

string

The affected service.

The function returns this value in theissues array.

  • email
  • ftp
  • webdisk

email

message

string

 The description of the issue.

The function returns this value in theissues array.

A message that contains a description of the issue.

Your account is over quota.

used

string

The number of Megabytes (MB) that the account currently uses.

The function returns this value in theissues array.

A positive integer.

2000

limit

string

The set quota Megabyte (MB) limit for the affected subaccount.

The function returns this value in theissues array.

A positive integer.

1500

merge_candidates

array

An array of hashes that represents the service accounts that the system could merge for this subaccount.

This array contains  the alternate_email,avatar_url, can_delete, can_set_password,can_set_quota, dismissed, domain,full_username, guid, has_siblings, issues,merge_candidates, parent_type, phone_number,real_name, services, special,sub_account_exists, synced_password, type,  andusername values.

 

has_siblings

boolean

Whether the service account shares afull_username value with another service account.

  • 1 — Shared.
  • 0 — Not shared.

0

parent_type

string

The type of account that could own the service account.

  • sub — A subaccount.
  • hypothetical — A hypothetical subaccount that does not yet exist, but the user could create as part of a merge.
  • null— Not a merge candidate.

 

 hypothetical

phone_number

string

 The subaccount user's phone number.

A valid phone number that conforms to ITU-T'sE.164 recommended standard for the representation of telephone numbers.

+15551234567

real_name

string

The name of the subaccount's user.

  • A first name, a last name, or a first name and last name.
  • An empty string.

John Doe

services

hash

This hash contains  information about the  subaccount's access to email, FTP, and Web Disk.

This hash contains the email, ftp, and webdiskvalues.

 

email

hash

 This hash contains the information that indicates the subaccount's email status.

This hash contains the enabled and quota values.

 

enabled

boolean

Whether the  subaccount can  access Webmail, POP, and IMAP services.

  • 1 — Can access.
  • 0 — Cannot access.

1

quota

string

The subaccount's email disk space quota.

  • A positive integer between one and 999,999 that represents the maximum disk space that the subaccount may use, in megabytes (MB).
  • 0 — The subaccount's disk space is unlimited.

100

ftp

hash

 This hash contains the information that indicates the subaccount's FTP status.

This hash contains the enabled, quota, and homedirvalues.

 

enabled

boolean

Whether the  subaccount can access FTP.

  • 1 — Can access.
  • 0 — Cannot access.

0

quota

string

The subaccount's FTP disk space quota.

  • An integer that represents the subaccount's maximum FTP disk usage, in Megabytes (MB).
  • A value of 0 grants the subaccount unlimited FTP disk space.

100

homedir

string

The subaccount's FTP home directory.

A relative path from the cPanel account's home directory on the server.

/subaccount

webdisk

hash

 This hash contains the information that indicates the subaccount's Web Disk status.

This hash contains the enabled, homedir, perms, and private values.

 

enabled

boolean

Whether the  subaccount can access Web Disk.

  • 1 — Can access.
  • 0 — Cannot access.

0

homedir

string

The path to the subaccount's directory, relative to the cPanel account's home directory.

A valid path.

/bob

perms

string

Whether to grant write permissions to the subaccount.

  • ro — Read-only permissions.
  • rw — Read and write permissions.

rw

private

boolean

Whether to set the Web Disk directory's permissions to public or private.

Notes:

  • When the directory is public, the home directory's permissions are 0755.
  • When the directory is private, the home directory's permissions are 0700.
  • 1 — Private.
  • 0 — Public.
 

0

special

boolean

Whether the account is a system-created special account that the user cannot remove.

 

  • 1 — A special account.
  • 0 — Not a special account.

1

 sub_account_exists 

 boolean 

Whether a subaccount exists with the same username.

  • 1 — Yes.
  • 0 — No.

Note:

The function returns this attribute as nullvalue if the account type is not a service account.

0

synced_password

boolean

 Whether the user has synchronized the  passwords for each of the subaccount'sservice accounts.

  • 1 — Passwords synchronized.
  • 0 — Passwords not synchronized.

Note:

The function returns this attribute as nullvalue if the account type is not a subaccount.

0

type

 string

The type of account.

  • sub — A subaccount.
  • hypothetical — A hypothetical subaccount that does not exist, but that the user could create as part of a merge.
  • service — A service account.
  • cpanel — The cPanel account.

sub

username

string

 The username for the subaccount.

Notes:

This value does not include the domain name.

A username that meets the subaccount name limitations.

  • Length — 64 characters
  • Characters — a-z, A-Z, 0-9, dot (.), hyphen (-), underscore (_)

example

 

  • 4 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....