Attach a User to an Account

This method is used to attach a User to the selected Account. As a consequence, the User gets access to the Customer Control Panel.

POST /api/v2/vendor/account_accesses.json?api_token={api_token}&account_id={account_id}&user_id={user_id}&role=not_required[user, admin, owner]

Arguments

Name

Parameter Type

Data type

Required/Optional

Description

tokenquerystringRequiredAPI token of the manager who perform the operation (see API Token Authentication).
account_idqueryintegerRequiredAn ID of the Account, to which the User will be attached.
user_idqueryintegerRequired

An ID of the User, which will be attached to the Account.

role

querystringOptional

Users can have following roles:

  • The Owner has maximum privileges. An Account can have only one user with Owner access level.
  • The Administrator has administrator privileges. Admin can create, delete, modify other users and assign the access right to them.
  • The User has a minimum set of privileges, with access only to the services that have been assigned by Admin or Owner.

By default, the User gets the User role if the role parameter is empty.

Request example

POST http://billing.activeplatform.com:80/api/v2/vendor/account_accesses?api_token=654321&account_id=2000532&user_id=2000188

Response example

  • If the operation has been successfully completed, the method returns the following status code: HTTP 201 Created.

  • If you try to attach a nonexistent User, the method returns:

    {
      "error": "Couldn't find User with 'id'=2006106 "
    }
  • If you try to attach a User to a nonexistent Account, the method returns:

    {
      "error": "Couldn't find Account with 'id'=2000533 "
    }