> For the complete documentation index, see [llms.txt](https://dantonia.gitbook.io/test/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dantonia.gitbook.io/test/account/leases.md).

# Leases

## ListTNLeases

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

#### Headers

| Name          | Type   | Description |
| ------------- | ------ | ----------- |
| Authorization | string | JWT\_TOKEN  |

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

```
```

{% endtab %}
{% endtabs %}

### Code Example

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

```bash
```

{% endtab %}
{% endtabs %}

## GetTNLeaseByUUID

<mark style="color:blue;">`GET`</mark> `https://api.opentact.org/rest/lease/tn/{uuid}`

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| uuid | string |             |

#### Headers

| Name          | Type   | Description      |
| ------------- | ------ | ---------------- |
| Content-Type  | string | application/json |
| Authorization | string | JWT\_TOKEN       |

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

```
```

{% endtab %}

{% tab title="404 " %}

```
```

{% endtab %}
{% endtabs %}

### Code Example

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

```bash
```

{% endtab %}
{% endtabs %}

## ModifyTNLease

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

Update a TN Lease

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| uuid | string |             |

#### Headers

| Name          | Type   | Description      |
| ------------- | ------ | ---------------- |
| Authorization | string | JWT\_TOKEN       |
| Content-Type  | string | application/json |

#### Request Body

| Name                     | Type    | Description                                                                                                         |
| ------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------- |
| autorenew                | boolean | Default: `"true"`                                                                                                   |
| voice                    | string  | <p>Default:<code>"true"</code><br>Voice feature</p>                                                                 |
| fax                      | string  | Fax feature                                                                                                         |
| sms                      | boolean | <p>SMS feature<br>Default: <code>"true"</code></p>                                                                  |
| mms                      | boolean | MMS feature                                                                                                         |
| emergency                | boolean | Emergency feature                                                                                                   |
| tns                      | string  | <p>Array of numbers \<double> <code>non-empty</code><br>Array of numbers to order</p>                               |
| messaging\_profile\_uuid | string  | <p><code>^\[0-9a-f]{8}-\[0-9a-f]{4}-\[0-9a-f]{4}-\[0-9a-f]{4}-\[0-9a-f]{12}$</code> <br>Messaging profile uuid</p>  |
| sip\_connection          | string  | <p><code>^\[0-9a-f]{8}-\[0-9a-f]{4}-\[0-9a-f]{4}-\[0-9a-f]{4}-\[0-9a-f]{12}$</code><br>SIP Connection uuid</p>      |
| sip\_control\_app        | string  | <p><code>^\[0-9a-f]{8}-\[0-9a-f]{4}-\[0-9a-f]{4}-\[0-9a-f]{4}-\[0-9a-f]{12}$</code><br>SIP Control app uuid<br></p> |

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

```
```

{% endtab %}

{% tab title="401 " %}

```
```

{% endtab %}

{% tab title="404 " %}

```
```

{% endtab %}
{% endtabs %}

### Code Example

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

```bash
```

{% endtab %}
{% endtabs %}

## RemoveTNLeaseByUUID

<mark style="color:red;">`DELETE`</mark> `https://api.opentact.org/rest/lease/tn/{uuid}`

#### Path Parameters

| Name | Type   | Description |
| ---- | ------ | ----------- |
| uuid | string |             |

#### Headers

| Name          | Type   | Description      |
| ------------- | ------ | ---------------- |
| Content-Type  | string | application/json |
| Authorization | string | JWT\_TOKEN       |

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

```
```

{% endtab %}

{% tab title="404 " %}

```
```

{% endtab %}
{% endtabs %}

### Code Example

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

```bash
```

{% endtab %}
{% endtabs %}

## GetTNLeaseRouteByTN

<mark style="color:blue;">`GET`</mark> `https://api.opentact.org/rest/lease/tn/{tn}/route`

Get lease route info by TN

#### Path Parameters

| Name | Type    | Description |
| ---- | ------- | ----------- |
| tn   | integer | \<int32>    |

#### Headers

| Name          | Type   | Description                                   |
| ------------- | ------ | --------------------------------------------- |
| Authorization | string | <p>BEARER\_TOKEN<br><code>Provider</code></p> |

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

```
```

{% endtab %}

{% tab title="404 " %}

```
```

{% endtab %}
{% endtabs %}

### Code Example

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

```bash
```

{% endtab %}
{% endtabs %}

## Search

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

Advanced TN Search

#### Query Parameters

| Name | Type    | Description                                                                                           |
| ---- | ------- | ----------------------------------------------------------------------------------------------------- |
| page | integer | <p>\<int32> <code>>= 1</code><br>Default: <code>1</code><br>Page number</p>                           |
| size | integer | <p>\<int32> <code>\[ 1 .. 100 ]</code><br>Default: <code>10</code><br>How many items per page<br></p> |

#### Headers

| Name          | Type   | Description      |
| ------------- | ------ | ---------------- |
| Content-Type  | string | application/json |
| Authorization | string | JWT\_TOKEN       |

#### Request Body

| Name       | Type    | Description                                                                                                                                                                                                                                                                                                                                                                                 |
| ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| pattern    | string  | <p><code>non-empty</code><br>Default: <code>"\*"</code><br>Ten digit telephone number; end <em>and % as wildcards. () implies match everything and % implies match that specific digit position. For Example:</em> 233 will match all tns that have 233 in them such as 2345672334 as well as 2331231234. Another example would be 233%55 would match 2342337556 as well as 7892334559.</p> |
| rateCenter | string  | Rate center abbreviation ( e.g. WSHNGTNZN1)                                                                                                                                                                                                                                                                                                                                                 |
| city       | string  | Location Full Name filter for telephone number                                                                                                                                                                                                                                                                                                                                              |
| province   | string  | Two-letter state or province abbreviation (e.g. IL, CA)                                                                                                                                                                                                                                                                                                                                     |
| postalCode | string  | Zip code filter for telephone numbers                                                                                                                                                                                                                                                                                                                                                       |
| abcSearch  | boolean | <p>Default: <code>"false"</code><br>If true, it will do search based on alphabates as well. If false, it will do numeric & X based search.</p>                                                                                                                                                                                                                                              |
| profile    | string  | <p>Default: <code>"US"</code><br>TN Profile name</p>                                                                                                                                                                                                                                                                                                                                        |

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

```
```

{% endtab %}

{% tab title="404 " %}

```
```

{% endtab %}
{% endtabs %}

### Code Example

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

```bash
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://dantonia.gitbook.io/test/account/leases.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
