Page tree
Skip to end of metadata
Go to start of metadata

 

This function unlinks a service account from a subaccount.


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/UserManager/unlink_service_account?username=example1&domain=example.com&service=ftp

Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Unlink the service account from the subaccount.
$Usermanager = $cpanel->uapi(
    'UserManager', 'unlink_service_account',
   array(
        'username'        => 'example1',
        'domain'          => 'example.com',
        'service'         => 'ftp',
        )
);

Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Unlink the service account from the subaccount.
my $Usermanager = $cpliveapi->uapi(
    'UserManager', 'unlink_service_account',
   {
        'username'        => 'example1',
        'domain'          => 'example.com',
        'service'         => 'ftp',
   }
);

Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Template Toolkit
<!-- Unlink the service account from the subaccount. -->
[% execute('UserManager', 'unlink_service_account', {'username' => 'example1', 'domain' => 'example.com', 'service' => 'ftp',} ) %]

Note:

For more information, read our Guide to Template Toolkit documentation. 

 

 Command Line
uapi --user=username UserManager unlink_service_account username=example1 domain=example.com service=ftp

Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

 Output (JSON)
{
    "messages": null,
    "errors": null,
    "status": 1,
    "metadata": {},
    "data": null
}

Note:

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

ParameterTypeDescriptionPossible valuesExample
username
string

Required

The subaccount's username.

 

A username that meets the account name limitations.
  • Length — 64 characters
  • Characters — a-zA-Z0-9, dot (.), hyphen (-), underscore (_)

Note:

This value does not include the domain name.

example
domainstring

Required

The subaccount's associated domain.

A domain that the cPanel account owns.example.com
servicestring

Required

The service to unlink.

  • email
  • ftp
  • webdisk
ftp
dismissBoolean

Whether to dismiss the service account as a merge candidate.

Note:

If any email, FTP, or Web Disk accounts use the same username, cPanel's User Manager interface (Home >> Preferences >> User Manager) allows you to merge those accounts into a subaccount. 

This parameter defaults to 0.

  • 1 — Dismiss as merge candidate.
  • 0 — Display as merge candidate.
0

This function only returns metadata.