Latest Legacy

Create a profile

This API lets you create a business profile for your end customers.

API Endpoint

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

Arguments

profile_aliasstringrequired

A friendly name for your profile.

customer_typestringrequired

Indicates the nature of your operations.

Allowed values: DIRECT, RESELLER.

Select RESELLER if your business provides communication services such as messaging and voice calling to other businesses.

entity_typestringrequired

Indicates ownership of the company.

Allowed values: PRIVATE, PUBLIC, NON_PROFIT, GOVERNMENT, INDIVIDUAL.

company_namestringrequired

Legal name of the company.

vertical stringrequired

Indicates industry.

Allowed values: PROFESSIONAL, REAL_ESTATE, HEALTHCARE, HUMAN_RESOURCES, ENERGY,ENTERTAINMENT, RETAIL, TRANSPORTATION,AGRICULTURE,INSURANCE,POSTAL,EDUCATION,HOSPITALITY, FINANCIAL, POLITICAL, GAMBLING, LEGAL, CONSTRUCTION, NGO, MANUFACTURING, GOVERNMENT, TECHNOLOGY, COMMUNICATION

ein integer

Employer Identification Number.

Plivo strongly recommends providing your EIN if your company is registered to unlock premium features like high throughput for Plivo products.

ein_issuing_countrystring

The ISO country code of the country that issued the EIN.

address objectrequired

Valid postal address of the company.

{
"street": "",
"city": "",
"state": "",
"postal_code": "",
"country": ""

}

state: A valid state code, e.g. TX for Texas.
postal_code: ZIP code.
country: ISO alpha-2 country code (US).

authorized_contact objectrequired

Authorized contact person at the company.

"first_name": "John",
"last_name": "Doe",
"email": "john@example.com",
"title": "Mr",
"seniority": "admin",
"phone": ""

Fields first_name and last_name are free-form.

email: Email address.
title: Salutation of the contact at the given company.
seniority: Allowed values: DIRECTOR, GM, VP, CEO, CFO, GENERAL_COUNSEL, OTHER.
phone: Company phone number in E.164 format.
stock_symbol string

Stock symbol of the company.

stock_exchange enum

Stock exchange where your company is listed.

Allowed values: NASDAQ, NYSE, AMEX, AMX, ASX, B3, BME, BSE, FRA, ICEX ,JPX, JSE, KRX ,LON, NSE, OMX, SEHK, SGX, SSE, STO, SWX, SZSE, TSX ,TWSE, VSE, OTHER

alt_business_id string

Alternate business identification number.

alt_business_id_type enum

Alternate business ID type.

Allowed values: DUNS, LEI, GIIN, NONE

website string

Website of the business.

plivo_subaccount string

Subaccount mapped to the profile.

Create a profile — individuals

If you use the Create a Profile API and specify entity_type=INDIVIDUAL you can skip fields like ein, ein_issuing_country, stock_symbol, stock_exchange, alt_business_id, and alt_business_id_type.

Returns

api_id for the request, unique profile_uuid, and success message

Response

HTTP Status Code: 200

{
    "api_id": "4e1f954c-baf3-11ec-bafe-0242ac110003",
    "message": "Profile created successfully.",
    "profile_uuid": "f19c4773-4ae6-4b75-92ea-9cf3ea4227d6"
}

Example Request

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import sys
sys.path.append("../plivo-python")
import plivo

client = plivo.RestClient("<auth_id>", "<auth_token>")
response = client.profile.create(
    profile_alias="profile name sample",
    customer_type="DIRECT",
    entity_type="PRIVATE",
    company_name="ABC Inc.",
    ein="123456789",
    ein_issuing_country="US",
    stock_symbol="ABC",
    stock_exchange="NSE",
    website="www.example.com",
    vertical="REAL_ESTATE",
    alt_business_id="",
    alt_business_id_type="NONE",
    plivo_subaccount="",
    address={
        "street": "123",
        "city": "New York",
        "state": "NY",
         "postal_code": "10001",
        "country": "US"
    },
    authorized_contact={
        "first_name": "john",
        "last_name": "con",
        "phone": "1876865565",
        "email": "xyz@plivo.com",
        "title": "Mr",
        "seniority": "admin"
    },
)
print(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
require "rubygems"
require "/etc/plivo-ruby/lib/plivo.rb"
include Plivo

api = RestClient.new("<auth_id>", "<auth_token>")

begin
        # Create Profile
        puts('Create Profile')

        authorized_contact_data = {
                "first_name" => "ruby",
                "last_name" => "test-1",
                "email" => "vlc@gmail.com",
                "title" => "Mr.",
                "seniority" => "admin",
                "phone" => "919539113734",
        }
    address_data = {
                "street" => "Street Name",
                "city" => "City Name",
                "state" => "NY",
                "postal_code" => "10001",
                "country" => "US"
        }

        response = api.profile.create(  profile_alias: "pa1", 
                customer_type: "DIRECT",
                entity_type: "PRIVATE",
                company_name: "vlc",
                vertical: "ENERGY",
                stock_symbol: "NSE",
                stock_exchange: "NASDAQ",
                alt_business_id: "NONE",
                alt_business_id_type: "NONE",
                ein: "123456789",
                ein_issuing_country: "IN",
                website: "www.vlc.com",
                address: address_data,
                authorized_contact: authorized_contact_data
        )
    puts response
rescue PlivoRESTError => e
        puts 'Exception: ' + e.message
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
let plivo = require('plivo');

var authorized_contact = {
    "first_name": "John",
    "last_name": "Doe",
    "email": "john@example.com",
    "title": "manager",
    "seniority": "admin",
    "phone": "+12125551234"
}
var address = {
    "street": "660 Broadway",
    "city": "New York City",
    "state": "NY",
    "postal_code": "10001",
    "country": "US"
}
var client = new plivo.Client("<auth_id>", "<auth_token>");
client.profile.create(
    "my_profile", // profile_alias
    "SA2025RK4E639VJFZAMS", // plivo_subaccount 
    "DIRECT", // customer_type
    "GOVERNMENT", // entity_type
    "ABC Inc", // compnay_name
    "111111111", // ein
    "PROFESSIONAL", // vertical
    "US", // ein_issuing_country
    "ABC", // stock_symbol
    "NASDAQ", // stock exchange
    "NONE", // alt_business_id_type
    "google.com", // website
    address,
    authorized_contact)
    .then(function (response) {
        console.log(response);
    })
    .catch(function (error) {
        console.log(error);
    });
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php

require '/etc/plivo-php/vendor/autoload.php';
use Plivo\RestClient;

$client = new RestClient("<auth_id>", "<auth_token>");

$client
    ->client
    ->setTimeout(60);
try
{
    $authorized_contact = array(
        "first_name" => "John",
        "last_name" => "Doe",
        "email" => "john@example.com",
        "title" => "Mr",
        "seniority" => "admin",
        "phone" => "9381590950"
    );
    $address = array(
        "street" => "660 Broadway",
        "city" => "New York City",
        "state" => "NY",
        "postal_code" => "10001",
        "country" => "US"
    );
    $res = $client
        ->profile
        ->create("vishnu104", "", "DIRECT", "GOVERNMENT", "ABC Inc", "111111111", "PROFESSIONAL", "US", "ABC", "NASDAQ", "NONE", "google.com", $address, $authorized_contact);
    print_r($res);
}
catch(PlivoRestException $ex)
{
    print_r($ex);
}

?>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.plivo.examples;
import com.plivo.api.Plivo;
import com.plivo.api.models.profile.Profile;
import com.plivo.api.models.profile.ProfileAddResponse;
import com.plivo.api.models.profile.ProfileAddress;
import com.plivo.api.models.profile.ProfileAuthorizedContact;


public class PlivoTest  {


   public static void main(String[] args) {


       Plivo.init("<auth_id>","<auth_token>");


       // Create Profile


       ProfileAddress address = new ProfileAddress("street name", "New York", "NY", "123456", "US");
       ProfileAuthorizedContact authorizedContact = new ProfileAuthorizedContact("firstname",
               "lastname",
               "12017135399",
               "test@plivo.com",
               "Mr.",
               "admin");


       try {
           ProfileAddResponse response = Profile.creator("profile_alias-1", "DIRECT", "PRIVATE", "Plivo Inc",
                   "12345678", "IN", address, "ABC",
                   "NSE", "www.javasdk.com",
                   "ENERGY", "", "", "",
                   authorizedContact).create();
           System.out.println(response);
       } catch (Exception e) {
           e.printStackTrace();
       }
   }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Available in versions >= 5.9.0 (https://github.com/plivo/plivo-dotnet/releases/tag/v5.9.0)

using System;
using System.Collections.Generic;
using Plivo;
using Plivo.Exception;
using Plivo.Resource.Profile;

namespace dotnet_project
{
    class Ten_dlc
    {
        static void Main(string[] args)
        {

            var api = new PlivoApi("<auth_id>", "<auth_token>");

            // Create a Profile
            try
            {
                AuthorizedContact contact = new AuthorizedContact();
                contact.Email = "john@example.com";
                contact.Phone = "12025551234";
                contact.FirstName = "John";
                contact.LastName = "Doe";
                contact.Seniority = "none";
                contact.Title = "Mr";
                Address address = new Address();
                address.Street = "660 Broadway";
                address.City = "New York";
                address.PostalCode = "10001";
                address.Country = "US";
                var response = api.Profile.Create("john_profile_1", "", "RESELLER", "PUBLIC", "Company Name Inc",
                "111111111", "PROFESSIONAL", "US", "ABC", "NASDAQ", "www.webistename.com", "NONE", contact, address);
                Console.WriteLine(response);
            }
            catch (PlivoRestException e)
            {
                Console.WriteLine("Exception: " + e.Message);
            }

        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
curl -i --user auth_id:auth_token \
    -H 'Content-Type: application/json' \
    -d '{
        "profile_alias": "john_new",
        "customer_type": "reseller",
        "entity_type": "public",
        "company_name": "ABC Inc.",
        "vertical": "Entertainment",
        "plivo_subaccount" :"SA2025RK4E639VJFZAMM",
        "ein": "122321231",
        "ein_issuing_country":"US", 
        "address": {
            "street": "660 Broadway",
            "city": "New York City",
            "state": "NY",
            "postal_code": "10001",
            "country": "US"
        },
        "stock_symbol": "TESLA",
        "stock_exchange": "NYSE",
        "alt_business_id_type": "DUNS",
        "alt_business_id": "ABC",
        "website": "hibye.com",
        "authorized_contact": {
            "first_name": "John",
            "last_name": "Doe",
            "email": "john@example.com",
            "title": "manager",
            "seniority": "admin",
            "phone": "12125551234"
        }
    
    }' \
    https://api.plivo.com/v1/Account/{auth_id}/Profile/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package main

import (
        "fmt"
        "os"

        plivo "github.com/plivo/plivo-go/v7"
)

var client *plivo.Client

func initClient(authID, authToken string) {
        var er error
        copts := &plivo.ClientOptions{}
        client, er = plivo.NewClient(authID, authToken, copts)
        if er != nil {
                panic(er)
        }
}
func main() {
        initClient("<auth_id>", "<auth_token>")
        //Profile create
        input := plivo.CreateProfileRequestParams{
                ProfileAlias:         "api_reference_go",
                CustomerType:        "DIRECT",
                EntityType:          "PRIVATE",
                CompanyName:         "golang",
                Vertical:             "ENERGY",
                StockSymbol:         "NSE",
                StockExchange:       "NASDAQ",
                AltBusinessidType: "NONE",
                Ein:                  "123456789",
                EinIssuingCountry:  "IN",
                Website:              "www.google.com",
                Address: &plivo.Address{
                        Street:      "Street Name",
                        City:        "City Name",
                        State:       "NY",
                        PostalCode: "10001",
                        Country:     "US",
                },
                AuthorizedContact: &plivo.AuthorizedContact{
                        FirstName: "goes",
                        LastName:  "lang",
                        Email:      "vlc@gmail.com",
                        Title:      "Mr.",
                        Seniority:  "admin",
                        Phone:      "919381590950",
                },
        }
        response, err := client.Profile.Create(input)
        if err != nil {
                fmt.Printf("Error occurred while creating profile. error:%+v\n", err)
                os.Exit(1)
        } else {
                fmt.Printf("%+v\n", response)
        }
}