# Search phonebook contacts (CTI + centralized) **GET /phonebook/search/{term}** Legacy-compatible union search across the authenticated user's CTI phonebook and the centralized phonebook. Requires the `phonebook` capability. Results are returned in a `{count, rows, last_sync_at}` envelope. Ordering (issue #7124): with no `sort` (the current default for nethvoice-cti and phone-island) the legacy order "company ASC, name ASC" is preserved so existing callers are not affected. ## Servers - Local development server: http://localhost:8080 (Local development server) - Production server: https://middleware.example.com/api (Production server) ## Authentication methods - Bearer auth ## Parameters ### Path parameters - **term** (string) Free-text search term. May be empty to match all visible contacts. ### Query parameters - **view** (string) Result shape. Omit for a flat person+company list; `person` returns only real-name contacts; `company` groups results by company. - **sort** (string) Sort key (issue #7124). `surname` is an alias of `lastname`; `name` an alias of `displayname`. Any other/absent value keeps the legacy default ordering. - **visibility** (string) Visibility filter. Alias: `sharing`. - **sharing** (string) Alias of `visibility`. - **limit** (integer) Page size. When provided, pagination is applied. Providing `offset` without `limit` is a 400 error. - **offset** (integer) Row offset for pagination (default 0). Requires `limit`. ## Responses ### 200 Search results #### Body: application/json (object) - **count** (integer) Total number of matching rows (ignores pagination). - **rows** (array[object]) A phonebook contact from either the per-user CTI phonebook (source "cti") or the centralized phonebook (source "centralized"). Fields firstname..otheremail were added by issue #7124 and exist only on CTI contacts; centralized contacts always return them empty. - **last_sync_at** (string(date-time) | null) Last centralized-phonebook sync timestamp (RFC3339), or null. ### 400 Invalid pagination parameters #### Body: application/json (object) - **code** (integer) - **message** (string) - **data** () - **error** (string) ### 401 Unauthorized #### Body: application/json (object) - **code** (integer) - **message** (string) - **data** () - **error** (string) [Powered by Bump.sh](https://bump.sh)