# Attaching Wazo lines with Pjsip endpoints via API

**URL:** https://wazo-platform.discourse.group/t/attaching-wazo-lines-with-pjsip-endpoints-via-api/1065
**Category:** Development: API/Events
**Created:** [May 18, 2022, 10:42pm UTC](https://wazo-platform.discourse.group/t/attaching-wazo-lines-with-pjsip-endpoints-via-api/1065 "2022-05-18T22:42:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Kelvin](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@Kelvin](https://wazo-platform.discourse.group/u/Kelvin)
#### Post date: [May 18, 2022, 10:42pm UTC](https://wazo-platform.discourse.group/t/attaching-wazo-lines-with-pjsip-endpoints-via-api/1065/1 "2022-05-18T22:42:31Z")

</div>

Hello,

I’m currently having issues with setting up a Tenant on Wazo via the API endpoints,  
When we create the tenant along with its internal context(sip extension defined in it),  
and then the users accounts attached with lines. We discovered the API wasnt creating the  
corresponding asterisk pjsip endpoints for the lines attached to the user account under the  
new tenant.

But when we try to create them manually on Wazo, everything works fine. Please can anyone point  
me towards the API endpoints responsible for generating the corresponding pjsip endpoint  
for users on wazo.

Thanks in advance.

---

<div class="post-metadata">

### Author: ![Miker](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Miker](https://wazo-platform.discourse.group/u/Miker)
#### Post date: [May 19, 2022, 5:07am UTC](https://wazo-platform.discourse.group/t/attaching-wazo-lines-with-pjsip-endpoints-via-api/1065/2 "2022-05-19T05:07:53Z")

</div>

Hi @Kelvin

In order to create a user via APIs properly you must make sure you follow the following steps:

> **[Documentation: Configuration - Wazo Platform](https://wazo-platform.org/documentation/overview/configuration.html#second-example--create-a-user-with-a-phone-and-a-voicemail)**

Note: Device and Voicemail steps are optionals, the rest is a must.

---

<div class="post-metadata">

### Author: ![Kelvin](https://avatars.discourse-cdn.com/v4/letter/k/7ba0ec/32.png) [@Kelvin](https://wazo-platform.discourse.group/u/Kelvin)
#### Post date: [May 19, 2022, 12:54pm UTC](https://wazo-platform.discourse.group/t/attaching-wazo-lines-with-pjsip-endpoints-via-api/1065/3 "2022-05-19T12:54:15Z")

</div>

1. We create the tenant using auth/0.1/tenant with the payload  
payload = {  
“name”: “name”,  
“phone”: XXXXXXXXXXXX  
}

2. We create the internal context with the below payload  
payload = {  
“name”: “name”,  
“label”: “label”,  
“type”: “internal”,  
“tenant\_uuid”: “UUID”,  
“user\_ranges”: [{“end”: “139”, “start”: “100”}],  
“group\_ranges”: [{“end”: “149”, “start”: “140”}],  
}

The created context appears on the wazo-ui, but extensions and lines created for subsequent users are unusable because wazo does not create the necessary asterisk pjsip endpoint. This happens if we create the user + extension + line through the API or from the wazo-ui. What could possibly be wrong?

---

<div class="post-metadata">

### Author: ![Miker](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Miker](https://wazo-platform.discourse.group/u/Miker)
#### Post date: [May 19, 2022, 10:11pm UTC](https://wazo-platform.discourse.group/t/attaching-wazo-lines-with-pjsip-endpoints-via-api/1065/4 "2022-05-19T22:11:43Z")

</div>

![Screen Shot 2022-05-19 at 6.06.28 PM](https://global.discourse-cdn.com/free1/uploads/wazo_platform/original/1X/ab71a971aaaa000bf17cc048432be2fe52e2926c.png)

Wazo-Tenant uuid is a HEADER PARAMETERS.

[https://wazo-platform.org/documentation/api/configuration.html#operation/create\_context](https://wazo-platform.org/documentation/api/configuration.html#operation/create_context)

Like I said before, follow these steps mentioned below and your SIP endpoint should work just fine.

 ![Screen Shot 2022-05-19 at 6.14.34 PM](https://global.discourse-cdn.com/free1/uploads/wazo_platform/original/1X/7ba65b7e41b09045f60f6219d0e0112c1bcfc7c4.png)
