import plivo

client = plivo.RestClient('<auth_id>','<auth_token>')
response = client.endpoints.create(
    username='testusername',
    password='testpassword',
    alias='Test Account', )
print(response)
{
"username": "zumba131031145958",
"alias": "zumba",
"message": "created",
"endpoint_id": "37371860103666",
"api_id": "1c13de4c-423d-11e3-9899-22000abfa5d5"
}

Create a new endpoint

API Endpoint
POST
https://api.plivo.com/v1/Account/{auth_id}/Endpoint/

Arguments

ArgumentsDescription
username (required, string)Username for the endpoint. Only alphanumeric characters are accepted, and the username must start with an alphabetic character.
password (required, string)Password for the endpoint username. It should be at least five characters long.
alias (required, string)Alias for the endpoint.
Allowed Values:
  • Alphabets (uppercase and lowercase)
  • Numbers (0–9)
  • Hyphen - and underscore _ only
app_id (string)ID of the application attached to the endpoint.

Returns

If successful, returns “created” in the “message” field along with an updated username of the endpoint, which has a 12-digit number appended to the username provided in the request. It also returns endpoint_id, which is a unique ID for the endpoint that’s used with other endpoint APIs.

import plivo

client = plivo.RestClient('<auth_id>','<auth_token>')
response = client.endpoints.create(
    username='testusername',
    password='testpassword',
    alias='Test Account', )
print(response)
{
"username": "zumba131031145958",
"alias": "zumba",
"message": "created",
"endpoint_id": "37371860103666",
"api_id": "1c13de4c-423d-11e3-9899-22000abfa5d5"
}