JSON API » people » people/create
Creates a new person.
Input parameters
Requires authentication and the administrator or wholesale role privileges.
| Name | Type | Description | Required | Default value | 
|---|---|---|---|---|
| auth_username | String | Authentication username. | Yes | |
| auth_password | String | Authentication password. | Yes | |
| username | String | User name. | Yes | |
| String | Email address(es). | Yes | ||
| password | String | Password. | Yes, unless copy_password is specified. | |
| role | Integer | ID of role. | Yes | |
| company | String | Company name. | No | Empty string. | 
| customer | String | ID of customer to create in. | No | Customer of authentication user. | 
| copy_password | Integer | ID of another person in the same customer to copy the password from. 0 to use the password parameter instead. | No | 0 | 
| country | String | Two letter country code. | No | Country of customer. | 
| date_format | String | Date format. "DD/MM/YYYY", "MM/DD/YYYY", or "YYYY-MM-DD". | No | "YYYY-MM-DD" | 
| description | String | Description. | No | Empty string. | 
| extension | String | Number for forward to in dial by name. Empty string for none. | No | Empty string. | 
| fax | String | Fax number. | No | Empty string. | 
| forename | String | First name. | No | Empty string. | 
| language | String | Language code. Empty string for default. | No | Empty string. | 
| mobile | String | Mobile (cellular) number. | No | Empty string. | 
| public_key | String | GPG public key. | No | Empty string. | 
| source | String | Source IP address(es). Empty string for any. | No | Empty string. | 
| surname | String | Last name. | No | Empty string. | 
| telephone | String | Telephone number. | No | Empty string. | 
| time_format | String | Time format. "12" or "24". | No | "24" | 
| timezone | String | Time zone. Empty string for default. | No | Time zone of customer. | 
| title | String | Title. | No | Empty string. | 
| validation | Integer | 1 to validate input then return, 0 for full action. | No | 0 | 
The email address is not required if the system is configured not to require it.
Responses
| Code | Description | 
|---|---|
| 200 | Success. | 
| 201 | Input passed validation. Only returned if validation=1. | 
| 400 | Invalid input parameters specified. Check the key and message fields for more details. | 
| 401 | The authentication details provided are invalid. | 
| 402 | Your role does not allow this. | 
| 403 | Your rate plan does not allow this. | 
Data returned
The ID of the created person.
Example: With required parameters
http://enswitch.example.com/api/json/people/create/?auth_username=user;auth_password=password;username=user@example.com;email=user@example.com;password=secret;role=1{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "id":123 } }
Change history
| Version | Changes | 
|---|---|
| 3.13 | Function added. | 
