Phone Book Entry
The Phone Book Entry object is supported by the MiRTA PBX OpenAPI endpoint. This object is tenant-scoped. Tenant API keys must include tenant=CANISTRACCI; writes require a writable API key.
Object Summary
| Property | Value |
|---|---|
| Object | phonebookentry |
| Primary path | /phonebookentries |
| ID field | pe_id |
| Label field | pe_id |
| Primary source table | pe_phonebookentries |
| Required on create | phonebook_id, at least one value |
| Path aliases | /phonebookentry, /phonebookentries, /phonebook_entry, /phonebook_entries, /phonebookcontact, /phonebookcontacts, /phonebook_contact, /phonebook_contacts |
Endpoint Patterns
| Action | Example pattern |
|---|---|
| List | GET https://pbx.example.com/pbx/openapi.php/phonebookentries?tenant=CANISTRACCI |
| Get by ID | GET https://pbx.example.com/pbx/openapi.php/phonebookentries/OBJECT_ID?tenant=CANISTRACCI |
| Create | POST https://pbx.example.com/pbx/openapi.php/phonebookentries?tenant=CANISTRACCI |
| Update | PATCH https://pbx.example.com/pbx/openapi.php/phonebookentries/OBJECT_ID?tenant=CANISTRACCI |
| Delete | DELETE https://pbx.example.com/pbx/openapi.php/phonebookentries/OBJECT_ID?tenant=CANISTRACCI |
Accepted Field Aliases
| Request field | Source field |
|---|---|
phonebook_id | pe_pb_id |
pbid | pe_pb_id |
values | pd_phonebookdetails keyed by pi_code |
fields | pd_phonebookdetails keyed by pi_code |
details | pd_phonebookdetails rows |
NAME | phone book item code |
PHONE1 | phone book item code |
PHONE2 | phone book item code |
EMAIL | phone book item code |
ROUTING | phone book item code |
Important Notes
- Entry values are stored in pd_phonebookdetails and are keyed by pi_phonebookitems.pi_code.
- Send values as a values or fields object, as top-level item codes, or as detail rows containing pi_id or pi_code and a value.
- Sending an empty string or null for a value clears that field from the entry.
Examples
List Phone Book Entries
Returns the phone book entries visible to the key and scope.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/phonebookentries?tenant=CANISTRACCI"
Get Phone Book Entry
Reads one object by its internal ID.
curl -H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/phonebookentries/OBJECT_ID?tenant=CANISTRACCI"
Create Phone Book Entry
Creates a new object. Use the short aliases shown above or the source field names.
curl -X POST \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phonebook_id": 12,
"values": {
"NAME": "Ada Rivera",
"PHONE1": "+15551230001",
"EMAIL": "ada.rivera@example.com",
"ROUTING": "EXT-100"
}
}' \
"https://pbx.example.com/pbx/openapi.php/phonebookentries?tenant=CANISTRACCI"
Edit Phone Book Entry
Updates only the supplied fields.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"values": {
"PHONE1": "+15551230002",
"EMAIL": "ada.updated@example.com"
}
}' \
"https://pbx.example.com/pbx/openapi.php/phonebookentries/OBJECT_ID?tenant=CANISTRACCI"
Delete Phone Book Entry
Deletes the object. Check references before deleting configuration used by routing or reporting.
curl -X DELETE \
-H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/phonebookentries/OBJECT_ID?tenant=CANISTRACCI"
List Entries for One Phone Book
Filters the phone book entry list by parent phonebook_id. The aliases pbid and pe_pb_id are also accepted.
curl -X GET \
-H "X-API-Key: TENANT_API_KEY" \
"https://pbx.example.com/pbx/openapi.php/phonebookentries?tenant=CANISTRACCI&phonebook_id=12"
Clear Phone Book Entry Value
Removes the EMAIL detail row for the selected entry while leaving other values unchanged.
curl -X PATCH \
-H "X-API-Key: TENANT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"values": {
"EMAIL": ""
}
}' \
"https://pbx.example.com/pbx/openapi.php/phonebookentries/OBJECT_ID?tenant=CANISTRACCI"
Search and Pagination
GET /phonebookentries accepts search filters, with full or read-only keys. Add phonebook_id (aliases pbid and pe_pb_id) to search one phone book.
| Parameter | Meaning |
|---|
nameExact match on a saved NAME, FIRSTNAME, LASTNAME or COMPANY value.
numberExact match on PHONE1–PHONE7 or FAX. Leading zeros and + are kept; formatting is not normalized.
searchLiteral substring of those name and number fields. % and _ are ordinary characters.
limit, offsetOptional pagination: limit 1–1000 (default 100 when offset is given), offset from 0.
Filters are combined with AND and follow the database collation, as in the web interface (normally case and accent insensitive). Each contact is returned once, in phone book and entry ID order; no match returns []. Without limit and offset the complete list is returned, as before. To page, increase offset by limit until a page has fewer rows; there is no total count, and concurrent changes can move contacts between pages.
curl -G -H "X-API-Key: TENANT_API_KEY" \
--data-urlencode "tenant=CANISTRACCI" --data-urlencode "phonebook_id=8" \
--data-urlencode "search=Alice" --data-urlencode "limit=100" \
"https://pbx.example.com/pbx/openapi.php/phonebookentries"
curl -G -H "X-API-Key: TENANT_API_KEY" \
--data-urlencode "tenant=CANISTRACCI" --data-urlencode "number=00123456789" \
"https://pbx.example.com/pbx/openapi.php/phonebookentries"
Values must be UTF-8 strings of at most 255 characters without control characters (400 invalid_phonebook_filter); invalid pagination returns 400 invalid_phonebook_pagination. URL-encode the values: a plus sign is %2B.
Common Errors
| Error | Meaning |
|---|---|
missing_api_key | No API key was supplied in the query string, X-API-Key, or bearer token. |
invalid_api_key | The supplied key does not match the tenant or global API key. |
tenant_required | A tenant code is required for tenant-scoped writes or tenant-key reads. |
read_only_api_key | The key can read data but cannot create, update, or delete objects. |
missing_required_field | A required create field is missing. |
All entries of one phone book
Use GET /phonebooks/{id}/entries to download all stored contacts, POST /phonebooks/{id}/entries to append up to 500 contacts atomically, and DELETE /phonebooks/{id}/entries to clear only the selected phone book. These operations require a selected tenant; writes require a full API key.
For request bodies, responses, and rollback behavior, see the Phone Book page.