# Profile

## CreateMessagingProfile

<mark style="color:green;">`POST`</mark> `https://api.opentact.org/rest/profile/messaging`

This will create a new messaging profile<br>

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| X-Auth-Token | string | JWT\_TOKEN       |
| Content-Type | string | application/json |

#### Request Body

| Name                 | Type    | Description                                                                                                    |
| -------------------- | ------- | -------------------------------------------------------------------------------------------------------------- |
| name                 | string  | <p><code>\[ 1 .. 255 ] characters</code><br><br>A user-assigned name to help manage the messaging profile.</p> |
| callback\_url        | string  | <p><code>\[ 10 .. 255 ] characters</code><br>Primary webhook callback url</p>                                  |
| number\_pool\_enable | string  | <p><code>\[ 10 .. 255 ] characters</code><br>Secondary webhook url (if primary can't be reached)</p>           |
| long\_code\_weight   | integer | `[ 0 .. 9 ] characters`                                                                                        |
| toll\_free\_weight   | integer | `[ 0 .. 9 ] characters`                                                                                        |
| skip\_unhealthy\_tns | boolean |                                                                                                                |
| sticky\_sender       | boolean |                                                                                                                |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "success": true,
  "payload": [
    {
      "created_on": "2019-08-24T14:15:22Z",
      "modified_on": "2019-08-24T14:15:22Z",
      "uuid": "string",
      "tn": {
        "tn": 0,
        "class4_did_id": 0,
        "registered": true,
        "tnlease": {},
        "profile": {},
        "deleted_on": "2019-08-24T14:15:22Z"
      },
      "account": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "email": "string",
        "level": "ServiceAccount",
        "balance": 0,
        "class4_id": 0,
        "deleted_on": "2019-08-24T14:15:22Z",
        "time_zone": {},
        "users": [],
        "admin": {},
        "messaging_profile_default": {},
        "messaging_profiles": [],
        "addresses": []
      },
      "tnorder": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "state": "created",
        "tns": [],
        "account": {},
        "profile": {},
        "sip_connection": {},
        "sip_control_app": {},
        "created_by": {},
        "modified_by": {},
        "request": {},
        "price": {},
        "autorenew": true,
        "tnleases": []
      },
      "expired_on": "2019-08-24T14:15:22Z",
      "autorenew": true,
      "messaging_profile": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "callback_url": "string",
        "callback_url2": "string",
        "number_pool_enable": true,
        "long_code_weight": 0,
        "tollfree_weight": 0,
        "skip_unhealthy_tns": true,
        "sticky_sender": true,
        "account": {},
        "created_by": {},
        "modified_by": {},
        "leases": []
      },
      "class4_product_item_id": 0,
      "sip_connection": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "is_active": true,
        "tech_prefix": 0,
        "product": {},
        "subdomain": "string",
        "ip": "string",
        "port": 0,
        "class4_ingress_trunk_id": 0,
        "class4_ingress_trunk_settings": {},
        "class4_ingress_resource_ip_id": 0,
        "class4_egress_trunk_id": 0,
        "class4_egress_trunk_settings": {},
        "class4_egress_resource_ip_id": 0,
        "class4_trunk_prefix_id": 0,
        "tnleases": [],
        "sipusers": [],
        "sip_user_invites": [],
        "account": {},
        "created_by": {},
        "modified_by": {},
        "outbound_voice_profile": {}
      },
      "sip_control_app": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "is_active": true,
        "subdomain": "string",
        "tnleases": [],
        "class4_egress_trunk_id": 0,
        "class4_egress_trunk_settings": {},
        "class4_egress_resource_ip_id": 0,
        "account": {},
        "created_by": {},
        "modified_by": {},
        "outbound_voice_profile": {}
      },
      "created_by": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "email": "string",
        "password": "string",
        "phone_number": "string",
        "first_name": "string",
        "last_name": "string",
        "avatar": "string",
        "gender": "Agender",
        "dob": "2019-08-24T14:15:22Z",
        "role": "Admin",
        "gmail_user_id": "string",
        "facebook_user_id": "string",
        "apple_user_id": "string",
        "wechat_user_id": "string",
        "deleted_on": "2019-08-24T14:15:22Z",
        "token": "string",
        "account": {}
      },
      "modified_by": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "email": "string",
        "password": "string",
        "phone_number": "string",
        "first_name": "string",
        "last_name": "string",
        "avatar": "string",
        "gender": "Agender",
        "dob": "2019-08-24T14:15:22Z",
        "role": "Admin",
        "gmail_user_id": "string",
        "facebook_user_id": "string",
        "apple_user_id": "string",
        "wechat_user_id": "string",
        "deleted_on": "2019-08-24T14:15:22Z",
        "token": "string",
        "account": {}
      }
    }
  ]
}
```

{% endtab %}

{% tab title="401 Forbidden" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 401
}
```

{% endtab %}

{% tab title="404 Not found" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 404
}
```

{% endtab %}
{% endtabs %}

### Code Example

{% tabs %}
{% tab title="cURL" %}

```bash
```

{% endtab %}

{% tab title="PHP" %}

```php
```

{% endtab %}

{% tab title="Python" %}

```python
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
```

{% endtab %}
{% endtabs %}

## ModifyMessagingProfile

<mark style="color:purple;">`PATCH`</mark> `https://api.opentact.org/rest/profile/messaging/{uuid}`

This will update a messaging profile<br>

#### Path Parameters

| Name | Type   | Description                                                      |
| ---- | ------ | ---------------------------------------------------------------- |
| uuid | string | `^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$` |

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| X-Auth-Token | string | JWT\_TOKEN       |
| Content-Type | string | application/json |

#### Request Body

| Name                 | Type    | Description                                                                                                    |
| -------------------- | ------- | -------------------------------------------------------------------------------------------------------------- |
| name                 | string  | <p><code>\[ 1 .. 255 ] characters</code><br><br>A user-assigned name to help manage the messaging profile.</p> |
| callback\_url        | string  | <p><code>\[ 10 .. 255 ] characters</code><br>Primary webhook callback url</p>                                  |
| number\_pool\_enable | string  | <p><code>\[ 10 .. 255 ] characters</code><br>Secondary webhook url (if primary can't be reached)</p>           |
| long\_code\_weight   | integer | `[ 0 .. 9 ] characters`                                                                                        |
| toll\_free\_weight   | integer | `[ 0 .. 9 ] characters`                                                                                        |
| skip\_unhealthy\_tns | boolean |                                                                                                                |
| sticky\_sender       | boolean |                                                                                                                |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "success": true,
  "payload": [
    {
      "created_on": "2019-08-24T14:15:22Z",
      "modified_on": "2019-08-24T14:15:22Z",
      "uuid": "string",
      "tn": {
        "tn": 0,
        "class4_did_id": 0,
        "registered": true,
        "tnlease": {},
        "profile": {},
        "deleted_on": "2019-08-24T14:15:22Z"
      },
      "account": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "email": "string",
        "level": "ServiceAccount",
        "balance": 0,
        "class4_id": 0,
        "deleted_on": "2019-08-24T14:15:22Z",
        "time_zone": {},
        "users": [],
        "admin": {},
        "messaging_profile_default": {},
        "messaging_profiles": [],
        "addresses": []
      },
      "tnorder": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "state": "created",
        "tns": [],
        "account": {},
        "profile": {},
        "sip_connection": {},
        "sip_control_app": {},
        "created_by": {},
        "modified_by": {},
        "request": {},
        "price": {},
        "autorenew": true,
        "tnleases": []
      },
      "expired_on": "2019-08-24T14:15:22Z",
      "autorenew": true,
      "messaging_profile": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "callback_url": "string",
        "callback_url2": "string",
        "number_pool_enable": true,
        "long_code_weight": 0,
        "tollfree_weight": 0,
        "skip_unhealthy_tns": true,
        "sticky_sender": true,
        "account": {},
        "created_by": {},
        "modified_by": {},
        "leases": []
      },
      "class4_product_item_id": 0,
      "sip_connection": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "is_active": true,
        "tech_prefix": 0,
        "product": {},
        "subdomain": "string",
        "ip": "string",
        "port": 0,
        "class4_ingress_trunk_id": 0,
        "class4_ingress_trunk_settings": {},
        "class4_ingress_resource_ip_id": 0,
        "class4_egress_trunk_id": 0,
        "class4_egress_trunk_settings": {},
        "class4_egress_resource_ip_id": 0,
        "class4_trunk_prefix_id": 0,
        "tnleases": [],
        "sipusers": [],
        "sip_user_invites": [],
        "account": {},
        "created_by": {},
        "modified_by": {},
        "outbound_voice_profile": {}
      },
      "sip_control_app": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "is_active": true,
        "subdomain": "string",
        "tnleases": [],
        "class4_egress_trunk_id": 0,
        "class4_egress_trunk_settings": {},
        "class4_egress_resource_ip_id": 0,
        "account": {},
        "created_by": {},
        "modified_by": {},
        "outbound_voice_profile": {}
      },
      "created_by": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "email": "string",
        "password": "string",
        "phone_number": "string",
        "first_name": "string",
        "last_name": "string",
        "avatar": "string",
        "gender": "Agender",
        "dob": "2019-08-24T14:15:22Z",
        "role": "Admin",
        "gmail_user_id": "string",
        "facebook_user_id": "string",
        "apple_user_id": "string",
        "wechat_user_id": "string",
        "deleted_on": "2019-08-24T14:15:22Z",
        "token": "string",
        "account": {}
      },
      "modified_by": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "email": "string",
        "password": "string",
        "phone_number": "string",
        "first_name": "string",
        "last_name": "string",
        "avatar": "string",
        "gender": "Agender",
        "dob": "2019-08-24T14:15:22Z",
        "role": "Admin",
        "gmail_user_id": "string",
        "facebook_user_id": "string",
        "apple_user_id": "string",
        "wechat_user_id": "string",
        "deleted_on": "2019-08-24T14:15:22Z",
        "token": "string",
        "account": {}
      }
    }
  ]
}
```

{% endtab %}

{% tab title="401 Forbidden" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 401
}
```

{% endtab %}

{% tab title="404 Not found" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 404
}
```

{% endtab %}
{% endtabs %}

### Code Example

{% tabs %}
{% tab title="cURL" %}

```bash
curl -X POST "https://api.opentact.org/rest/sip/app/{uuid}/tnlease" \
-H  "accept: application/json" -H  "X-Auth-Token: JWT_TOKEN" \
-H  "Content-Type: application/json" \
-d "{\"add\":[\"string\"],\"remove\":[\"string\"]}"
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array(
    'accept' => 'application/json',
    'X-Auth-Token' => 'JWT_TOKEN',
    'Content-Type' => 'application/json'
);
$data = '{"add":["string"],"remove":["string"]}';
$response = Requests::post('https://api.opentact.org/rest/sip/app/{uuid}/tnlease', $headers, $data);

```

{% endtab %}

{% tab title="Python" %}

```python
import requests

headers = {
    'accept': 'application/json',
    'X-Auth-Token': 'JWT_TOKEN',
    'Content-Type': 'application/json',
}

data = '{"add":["string"],"remove":["string"]}'

response = requests.post('https://api.opentact.org/rest/sip/app/%7Buuid%7D/tnlease', headers=headers, data=data)

```

{% endtab %}

{% tab title="Javascript" %}

```javascript
var fetch = require('node-fetch');

fetch('https://api.opentact.org/rest/sip/app/{uuid}/tnlease', {
    method: 'POST',
    headers: {
        'accept': 'application/json',
        'X-Auth-Token': 'JWT_TOKEN',
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({"add":["string"],"remove":["string"]})
});

```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
	"strings"
)

func main() {
	client := &http.Client{}
	var data = strings.NewReader(`{"add":["string"],"remove":["string"]}`)
	req, err := http.NewRequest("POST", "https://api.opentact.org/rest/sip/app/{uuid}/tnlease", data)
	if err != nil {
		log.Fatal(err)
	}
	req.Header.Set("accept", "application/json")
	req.Header.Set("X-Auth-Token", "JWT_TOKEN")
	req.Header.Set("Content-Type", "application/json")
	resp, err := client.Do(req)
	if err != nil {
		log.Fatal(err)
	}
	bodyText, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%s\n", bodyText)
}

```

{% endtab %}
{% endtabs %}

## RemoveMessagingProfileByUUID

<mark style="color:red;">`DELETE`</mark> `https://api.opentact.org/rest/profile/messaging`

Get extended messaging profile info

#### Path Parameters

| Name | Type   | Description                                                      |
| ---- | ------ | ---------------------------------------------------------------- |
| uuid | string | `^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$` |

#### Headers

| Name         | Type   | Description |
| ------------ | ------ | ----------- |
| X-Auth-Token | string | JWT\_TOKEN  |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "success": true,
  "payload": [
    {
      "created_on": "2019-08-24T14:15:22Z",
      "modified_on": "2019-08-24T14:15:22Z",
      "uuid": "string",
      "tn": {
        "tn": 0,
        "class4_did_id": 0,
        "registered": true,
        "tnlease": {},
        "profile": {},
        "deleted_on": "2019-08-24T14:15:22Z"
      },
      "account": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "email": "string",
        "level": "ServiceAccount",
        "balance": 0,
        "class4_id": 0,
        "deleted_on": "2019-08-24T14:15:22Z",
        "time_zone": {},
        "users": [],
        "admin": {},
        "messaging_profile_default": {},
        "messaging_profiles": [],
        "addresses": []
      },
      "tnorder": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "state": "created",
        "tns": [],
        "account": {},
        "profile": {},
        "sip_connection": {},
        "sip_control_app": {},
        "created_by": {},
        "modified_by": {},
        "request": {},
        "price": {},
        "autorenew": true,
        "tnleases": []
      },
      "expired_on": "2019-08-24T14:15:22Z",
      "autorenew": true,
      "messaging_profile": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "callback_url": "string",
        "callback_url2": "string",
        "number_pool_enable": true,
        "long_code_weight": 0,
        "tollfree_weight": 0,
        "skip_unhealthy_tns": true,
        "sticky_sender": true,
        "account": {},
        "created_by": {},
        "modified_by": {},
        "leases": []
      },
      "class4_product_item_id": 0,
      "sip_connection": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "is_active": true,
        "tech_prefix": 0,
        "product": {},
        "subdomain": "string",
        "ip": "string",
        "port": 0,
        "class4_ingress_trunk_id": 0,
        "class4_ingress_trunk_settings": {},
        "class4_ingress_resource_ip_id": 0,
        "class4_egress_trunk_id": 0,
        "class4_egress_trunk_settings": {},
        "class4_egress_resource_ip_id": 0,
        "class4_trunk_prefix_id": 0,
        "tnleases": [],
        "sipusers": [],
        "sip_user_invites": [],
        "account": {},
        "created_by": {},
        "modified_by": {},
        "outbound_voice_profile": {}
      },
      "sip_control_app": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "is_active": true,
        "subdomain": "string",
        "tnleases": [],
        "class4_egress_trunk_id": 0,
        "class4_egress_trunk_settings": {},
        "class4_egress_resource_ip_id": 0,
        "account": {},
        "created_by": {},
        "modified_by": {},
        "outbound_voice_profile": {}
      },
      "created_by": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "email": "string",
        "password": "string",
        "phone_number": "string",
        "first_name": "string",
        "last_name": "string",
        "avatar": "string",
        "gender": "Agender",
        "dob": "2019-08-24T14:15:22Z",
        "role": "Admin",
        "gmail_user_id": "string",
        "facebook_user_id": "string",
        "apple_user_id": "string",
        "wechat_user_id": "string",
        "deleted_on": "2019-08-24T14:15:22Z",
        "token": "string",
        "account": {}
      },
      "modified_by": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "email": "string",
        "password": "string",
        "phone_number": "string",
        "first_name": "string",
        "last_name": "string",
        "avatar": "string",
        "gender": "Agender",
        "dob": "2019-08-24T14:15:22Z",
        "role": "Admin",
        "gmail_user_id": "string",
        "facebook_user_id": "string",
        "apple_user_id": "string",
        "wechat_user_id": "string",
        "deleted_on": "2019-08-24T14:15:22Z",
        "token": "string",
        "account": {}
      }
    }
  ]
}
```

{% endtab %}

{% tab title="401 Forbidden" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 401
}
```

{% endtab %}

{% tab title="404 Not found" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 404
}
```

{% endtab %}
{% endtabs %}

### Code Example

{% tabs %}
{% tab title="cURL" %}

```bash
```

{% endtab %}

{% tab title="PHP" %}

```php
```

{% endtab %}

{% tab title="Python" %}

```python
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
```

{% endtab %}

{% tab title="Go" %}

```go
```

{% endtab %}
{% endtabs %}

###

###

## ListMessagingProfiles

<mark style="color:blue;">`GET`</mark> `https://api.opentact.org/rest/profile/messaging`

This will return a list of all messaging profiles<br>

#### Headers

| Name         | Type   | Description |
| ------------ | ------ | ----------- |
| X-Auth-Token | string | JWT\_TOKEN  |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "success": true,
  "payload": [
    {
      "created_on": "2019-08-24T14:15:22Z",
      "modified_on": "2019-08-24T14:15:22Z",
      "uuid": "string",
      "tn": {
        "tn": 0,
        "class4_did_id": 0,
        "registered": true,
        "tnlease": {},
        "profile": {},
        "deleted_on": "2019-08-24T14:15:22Z"
      },
      "account": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "email": "string",
        "level": "ServiceAccount",
        "balance": 0,
        "class4_id": 0,
        "deleted_on": "2019-08-24T14:15:22Z",
        "time_zone": {},
        "users": [],
        "admin": {},
        "messaging_profile_default": {},
        "messaging_profiles": [],
        "addresses": []
      },
      "tnorder": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "state": "created",
        "tns": [],
        "account": {},
        "profile": {},
        "sip_connection": {},
        "sip_control_app": {},
        "created_by": {},
        "modified_by": {},
        "request": {},
        "price": {},
        "autorenew": true,
        "tnleases": []
      },
      "expired_on": "2019-08-24T14:15:22Z",
      "autorenew": true,
      "messaging_profile": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "callback_url": "string",
        "callback_url2": "string",
        "number_pool_enable": true,
        "long_code_weight": 0,
        "tollfree_weight": 0,
        "skip_unhealthy_tns": true,
        "sticky_sender": true,
        "account": {},
        "created_by": {},
        "modified_by": {},
        "leases": []
      },
      "class4_product_item_id": 0,
      "sip_connection": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "is_active": true,
        "tech_prefix": 0,
        "product": {},
        "subdomain": "string",
        "ip": "string",
        "port": 0,
        "class4_ingress_trunk_id": 0,
        "class4_ingress_trunk_settings": {},
        "class4_ingress_resource_ip_id": 0,
        "class4_egress_trunk_id": 0,
        "class4_egress_trunk_settings": {},
        "class4_egress_resource_ip_id": 0,
        "class4_trunk_prefix_id": 0,
        "tnleases": [],
        "sipusers": [],
        "sip_user_invites": [],
        "account": {},
        "created_by": {},
        "modified_by": {},
        "outbound_voice_profile": {}
      },
      "sip_control_app": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "is_active": true,
        "subdomain": "string",
        "tnleases": [],
        "class4_egress_trunk_id": 0,
        "class4_egress_trunk_settings": {},
        "class4_egress_resource_ip_id": 0,
        "account": {},
        "created_by": {},
        "modified_by": {},
        "outbound_voice_profile": {}
      },
      "created_by": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "email": "string",
        "password": "string",
        "phone_number": "string",
        "first_name": "string",
        "last_name": "string",
        "avatar": "string",
        "gender": "Agender",
        "dob": "2019-08-24T14:15:22Z",
        "role": "Admin",
        "gmail_user_id": "string",
        "facebook_user_id": "string",
        "apple_user_id": "string",
        "wechat_user_id": "string",
        "deleted_on": "2019-08-24T14:15:22Z",
        "token": "string",
        "account": {}
      },
      "modified_by": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "email": "string",
        "password": "string",
        "phone_number": "string",
        "first_name": "string",
        "last_name": "string",
        "avatar": "string",
        "gender": "Agender",
        "dob": "2019-08-24T14:15:22Z",
        "role": "Admin",
        "gmail_user_id": "string",
        "facebook_user_id": "string",
        "apple_user_id": "string",
        "wechat_user_id": "string",
        "deleted_on": "2019-08-24T14:15:22Z",
        "token": "string",
        "account": {}
      }
    }
  ]
}
```

{% endtab %}

{% tab title="401 Forbidden" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 401
}
```

{% endtab %}

{% tab title="404 Not found" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 404
}
```

{% endtab %}
{% endtabs %}

### Code Example

{% tabs %}
{% tab title="cURL" %}

```bash
```

{% endtab %}

{% tab title="PHP" %}

```php
```

{% endtab %}

{% tab title="Python" %}

```python
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
```

{% endtab %}

{% tab title="Go" %}

```go
```

{% endtab %}
{% endtabs %}

## GetMessagingProfileByUUID

<mark style="color:blue;">`GET`</mark> `https://api.opentact.org/rest/profile/messaging`

Get extended messaging profile info

#### Path Parameters

| Name | Type   | Description                                                      |
| ---- | ------ | ---------------------------------------------------------------- |
| uuid | string | `^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$` |

#### Headers

| Name         | Type   | Description |
| ------------ | ------ | ----------- |
| X-Auth-Token | string | JWT\_TOKEN  |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "success": true,
  "payload": [
    {
      "created_on": "2019-08-24T14:15:22Z",
      "modified_on": "2019-08-24T14:15:22Z",
      "uuid": "string",
      "tn": {
        "tn": 0,
        "class4_did_id": 0,
        "registered": true,
        "tnlease": {},
        "profile": {},
        "deleted_on": "2019-08-24T14:15:22Z"
      },
      "account": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "email": "string",
        "level": "ServiceAccount",
        "balance": 0,
        "class4_id": 0,
        "deleted_on": "2019-08-24T14:15:22Z",
        "time_zone": {},
        "users": [],
        "admin": {},
        "messaging_profile_default": {},
        "messaging_profiles": [],
        "addresses": []
      },
      "tnorder": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "state": "created",
        "tns": [],
        "account": {},
        "profile": {},
        "sip_connection": {},
        "sip_control_app": {},
        "created_by": {},
        "modified_by": {},
        "request": {},
        "price": {},
        "autorenew": true,
        "tnleases": []
      },
      "expired_on": "2019-08-24T14:15:22Z",
      "autorenew": true,
      "messaging_profile": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "callback_url": "string",
        "callback_url2": "string",
        "number_pool_enable": true,
        "long_code_weight": 0,
        "tollfree_weight": 0,
        "skip_unhealthy_tns": true,
        "sticky_sender": true,
        "account": {},
        "created_by": {},
        "modified_by": {},
        "leases": []
      },
      "class4_product_item_id": 0,
      "sip_connection": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "is_active": true,
        "tech_prefix": 0,
        "product": {},
        "subdomain": "string",
        "ip": "string",
        "port": 0,
        "class4_ingress_trunk_id": 0,
        "class4_ingress_trunk_settings": {},
        "class4_ingress_resource_ip_id": 0,
        "class4_egress_trunk_id": 0,
        "class4_egress_trunk_settings": {},
        "class4_egress_resource_ip_id": 0,
        "class4_trunk_prefix_id": 0,
        "tnleases": [],
        "sipusers": [],
        "sip_user_invites": [],
        "account": {},
        "created_by": {},
        "modified_by": {},
        "outbound_voice_profile": {}
      },
      "sip_control_app": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "is_active": true,
        "subdomain": "string",
        "tnleases": [],
        "class4_egress_trunk_id": 0,
        "class4_egress_trunk_settings": {},
        "class4_egress_resource_ip_id": 0,
        "account": {},
        "created_by": {},
        "modified_by": {},
        "outbound_voice_profile": {}
      },
      "created_by": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "email": "string",
        "password": "string",
        "phone_number": "string",
        "first_name": "string",
        "last_name": "string",
        "avatar": "string",
        "gender": "Agender",
        "dob": "2019-08-24T14:15:22Z",
        "role": "Admin",
        "gmail_user_id": "string",
        "facebook_user_id": "string",
        "apple_user_id": "string",
        "wechat_user_id": "string",
        "deleted_on": "2019-08-24T14:15:22Z",
        "token": "string",
        "account": {}
      },
      "modified_by": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "email": "string",
        "password": "string",
        "phone_number": "string",
        "first_name": "string",
        "last_name": "string",
        "avatar": "string",
        "gender": "Agender",
        "dob": "2019-08-24T14:15:22Z",
        "role": "Admin",
        "gmail_user_id": "string",
        "facebook_user_id": "string",
        "apple_user_id": "string",
        "wechat_user_id": "string",
        "deleted_on": "2019-08-24T14:15:22Z",
        "token": "string",
        "account": {}
      }
    }
  ]
}
```

{% endtab %}

{% tab title="401 Forbidden" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 401
}
```

{% endtab %}

{% tab title="404 Not found" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 404
}
```

{% endtab %}
{% endtabs %}

### Code Example

{% tabs %}
{% tab title="cURL" %}

```bash
```

{% endtab %}

{% tab title="PHP" %}

```php
```

{% endtab %}

{% tab title="Python" %}

```python
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
```

{% endtab %}

{% tab title="Go" %}

```go
```

{% endtab %}
{% endtabs %}

###

## CreateOutboundVoiceProfile

<mark style="color:green;">`POST`</mark> `https://api.opentact.org/rest/profile/outbound_voice`

This will create a new outbound voice profile<br>

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| X-Auth-Token | string | JWT\_TOKEN       |
| Content-Type | string | application/json |

#### Request Body

| Name                | Type    | Description                                                                                                                       |
| ------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- |
| tech\_prefix        | integer | <p>\<int32> <br><code>\[ 100000 .. 999999 ]</code></p>                                                                            |
| name                | string  | <p><code>\[ 1 .. 255 ] characters</code><br><br>A user-assigned name to help manage the messaging profile.</p>                    |
| channel\_limit      | number  | <p>\<double><br><code>>= 0</code><br>Allows you to set a limit for outbound Concurrent Channels (1 call amounts to 1 channel)</p> |
| max\_rate           | number  | <p>\<double><br><code>>=  0</code></p>                                                                                            |
| record\_calls       | integer | <p>(EVoiceRecordCallType)<br>Enum: <code>0</code> <code>1</code> <code>2</code></p>                                               |
| daily\_spend\_limit | integer | \<float> `>= 0`                                                                                                                   |
| filemat             | boolean | <p>(EVoiceRecordCallFileType)<br>Enum: <code>"wav"</code> <code>"mp3"</code></p>                                                  |
| audio\_track\_type  | boolean | <p>(EVoiceRecordCallAudioTrackType)<br>Enum: <code>0</code> <code>1</code></p>                                                    |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "success": true,
  "payload": [
    {
      "created_on": "2019-08-24T14:15:22Z",
      "modified_on": "2019-08-24T14:15:22Z",
      "uuid": "string",
      "tn": {
        "tn": 0,
        "class4_did_id": 0,
        "registered": true,
        "tnlease": {},
        "profile": {},
        "deleted_on": "2019-08-24T14:15:22Z"
      },
      "account": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "email": "string",
        "level": "ServiceAccount",
        "balance": 0,
        "class4_id": 0,
        "deleted_on": "2019-08-24T14:15:22Z",
        "time_zone": {},
        "users": [],
        "admin": {},
        "messaging_profile_default": {},
        "messaging_profiles": [],
        "addresses": []
      },
      "tnorder": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "state": "created",
        "tns": [],
        "account": {},
        "profile": {},
        "sip_connection": {},
        "sip_control_app": {},
        "created_by": {},
        "modified_by": {},
        "request": {},
        "price": {},
        "autorenew": true,
        "tnleases": []
      },
      "expired_on": "2019-08-24T14:15:22Z",
      "autorenew": true,
      "messaging_profile": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "callback_url": "string",
        "callback_url2": "string",
        "number_pool_enable": true,
        "long_code_weight": 0,
        "tollfree_weight": 0,
        "skip_unhealthy_tns": true,
        "sticky_sender": true,
        "account": {},
        "created_by": {},
        "modified_by": {},
        "leases": []
      },
      "class4_product_item_id": 0,
      "sip_connection": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "is_active": true,
        "tech_prefix": 0,
        "product": {},
        "subdomain": "string",
        "ip": "string",
        "port": 0,
        "class4_ingress_trunk_id": 0,
        "class4_ingress_trunk_settings": {},
        "class4_ingress_resource_ip_id": 0,
        "class4_egress_trunk_id": 0,
        "class4_egress_trunk_settings": {},
        "class4_egress_resource_ip_id": 0,
        "class4_trunk_prefix_id": 0,
        "tnleases": [],
        "sipusers": [],
        "sip_user_invites": [],
        "account": {},
        "created_by": {},
        "modified_by": {},
        "outbound_voice_profile": {}
      },
      "sip_control_app": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "is_active": true,
        "subdomain": "string",
        "tnleases": [],
        "class4_egress_trunk_id": 0,
        "class4_egress_trunk_settings": {},
        "class4_egress_resource_ip_id": 0,
        "account": {},
        "created_by": {},
        "modified_by": {},
        "outbound_voice_profile": {}
      },
      "created_by": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "email": "string",
        "password": "string",
        "phone_number": "string",
        "first_name": "string",
        "last_name": "string",
        "avatar": "string",
        "gender": "Agender",
        "dob": "2019-08-24T14:15:22Z",
        "role": "Admin",
        "gmail_user_id": "string",
        "facebook_user_id": "string",
        "apple_user_id": "string",
        "wechat_user_id": "string",
        "deleted_on": "2019-08-24T14:15:22Z",
        "token": "string",
        "account": {}
      },
      "modified_by": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "email": "string",
        "password": "string",
        "phone_number": "string",
        "first_name": "string",
        "last_name": "string",
        "avatar": "string",
        "gender": "Agender",
        "dob": "2019-08-24T14:15:22Z",
        "role": "Admin",
        "gmail_user_id": "string",
        "facebook_user_id": "string",
        "apple_user_id": "string",
        "wechat_user_id": "string",
        "deleted_on": "2019-08-24T14:15:22Z",
        "token": "string",
        "account": {}
      }
    }
  ]
}
```

{% endtab %}

{% tab title="401 Forbidden" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 401
}
```

{% endtab %}

{% tab title="404 Not found" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 404
}
```

{% endtab %}
{% endtabs %}

### Code Example

{% tabs %}
{% tab title="cURL" %}

```bash
```

{% endtab %}

{% tab title="PHP" %}

```php
```

{% endtab %}

{% tab title="Python" %}

```python
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
```

{% endtab %}

{% tab title="Go" %}

```go
```

{% endtab %}
{% endtabs %}

## ModifyOutboundVoiceProfile

<mark style="color:purple;">`PATCH`</mark> `https://api.opentact.org/rest/profile/outbound_voice`

#### Headers

| Name         | Type   | Description      |
| ------------ | ------ | ---------------- |
| X-Auth-Token | string | JWT\_TOKEN       |
| Content-Type | string | application/json |

#### Request Body

| Name                | Type    | Description                                                                                                                       |
| ------------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------- |
| tech\_prefix        | integer | <p>\<int32> <br><code>\[ 100000 .. 999999 ]</code></p>                                                                            |
| name                | string  | <p><code>\[ 1 .. 255 ] characters</code><br><br>A user-assigned name to help manage the messaging profile.</p>                    |
| channel\_limit      | number  | <p>\<double><br><code>>= 0</code><br>Allows you to set a limit for outbound Concurrent Channels (1 call amounts to 1 channel)</p> |
| max\_rate           | number  | <p>\<double><br><code>>=  0</code></p>                                                                                            |
| record\_calls       | integer | <p>(EVoiceRecordCallType)<br>Enum: <code>0</code> <code>1</code> <code>2</code></p>                                               |
| daily\_spend\_limit | integer | \<float> `>= 0`                                                                                                                   |
| filemat             | boolean | <p>(EVoiceRecordCallFileType)<br>Enum: <code>"wav"</code> <code>"mp3"</code></p>                                                  |
| audio\_track\_type  | boolean | <p>(EVoiceRecordCallAudioTrackType)<br>Enum: <code>0</code> <code>1</code></p>                                                    |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "success": true,
  "payload": [
    {
      "created_on": "2019-08-24T14:15:22Z",
      "modified_on": "2019-08-24T14:15:22Z",
      "uuid": "string",
      "tn": {
        "tn": 0,
        "class4_did_id": 0,
        "registered": true,
        "tnlease": {},
        "profile": {},
        "deleted_on": "2019-08-24T14:15:22Z"
      },
      "account": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "email": "string",
        "level": "ServiceAccount",
        "balance": 0,
        "class4_id": 0,
        "deleted_on": "2019-08-24T14:15:22Z",
        "time_zone": {},
        "users": [],
        "admin": {},
        "messaging_profile_default": {},
        "messaging_profiles": [],
        "addresses": []
      },
      "tnorder": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "state": "created",
        "tns": [],
        "account": {},
        "profile": {},
        "sip_connection": {},
        "sip_control_app": {},
        "created_by": {},
        "modified_by": {},
        "request": {},
        "price": {},
        "autorenew": true,
        "tnleases": []
      },
      "expired_on": "2019-08-24T14:15:22Z",
      "autorenew": true,
      "messaging_profile": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "callback_url": "string",
        "callback_url2": "string",
        "number_pool_enable": true,
        "long_code_weight": 0,
        "tollfree_weight": 0,
        "skip_unhealthy_tns": true,
        "sticky_sender": true,
        "account": {},
        "created_by": {},
        "modified_by": {},
        "leases": []
      },
      "class4_product_item_id": 0,
      "sip_connection": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "is_active": true,
        "tech_prefix": 0,
        "product": {},
        "subdomain": "string",
        "ip": "string",
        "port": 0,
        "class4_ingress_trunk_id": 0,
        "class4_ingress_trunk_settings": {},
        "class4_ingress_resource_ip_id": 0,
        "class4_egress_trunk_id": 0,
        "class4_egress_trunk_settings": {},
        "class4_egress_resource_ip_id": 0,
        "class4_trunk_prefix_id": 0,
        "tnleases": [],
        "sipusers": [],
        "sip_user_invites": [],
        "account": {},
        "created_by": {},
        "modified_by": {},
        "outbound_voice_profile": {}
      },
      "sip_control_app": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "name": "string",
        "is_active": true,
        "subdomain": "string",
        "tnleases": [],
        "class4_egress_trunk_id": 0,
        "class4_egress_trunk_settings": {},
        "class4_egress_resource_ip_id": 0,
        "account": {},
        "created_by": {},
        "modified_by": {},
        "outbound_voice_profile": {}
      },
      "created_by": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "email": "string",
        "password": "string",
        "phone_number": "string",
        "first_name": "string",
        "last_name": "string",
        "avatar": "string",
        "gender": "Agender",
        "dob": "2019-08-24T14:15:22Z",
        "role": "Admin",
        "gmail_user_id": "string",
        "facebook_user_id": "string",
        "apple_user_id": "string",
        "wechat_user_id": "string",
        "deleted_on": "2019-08-24T14:15:22Z",
        "token": "string",
        "account": {}
      },
      "modified_by": {
        "created_on": "2019-08-24T14:15:22Z",
        "modified_on": "2019-08-24T14:15:22Z",
        "uuid": "string",
        "email": "string",
        "password": "string",
        "phone_number": "string",
        "first_name": "string",
        "last_name": "string",
        "avatar": "string",
        "gender": "Agender",
        "dob": "2019-08-24T14:15:22Z",
        "role": "Admin",
        "gmail_user_id": "string",
        "facebook_user_id": "string",
        "apple_user_id": "string",
        "wechat_user_id": "string",
        "deleted_on": "2019-08-24T14:15:22Z",
        "token": "string",
        "account": {}
      }
    }
  ]
}
```

{% endtab %}

{% tab title="401 Forbidden" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 401
}
```

{% endtab %}

{% tab title="404 Not found" %}

```javascript
{
  "success": false,
  "message": "string",
  "status": 404
}
```

{% endtab %}
{% endtabs %}

### Code Example

{% tabs %}
{% tab title="cURL" %}

```bash
```

{% endtab %}

{% tab title="PHP" %}

```php
```

{% endtab %}

{% tab title="Python" %}

```python
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
```

{% endtab %}

{% tab title="Go" %}

```go
```

{% endtab %}
{% endtabs %}
