Wazo Phonebook API

The phonebook API from Wazo — 11 operation(s) for phonebook.

Operations 23

GET /phonebooks List all phonebooks for a given tenant
POST /phonebooks Create a new phonebook #
GET /phonebooks/{phonebook_uuid} Get the attributes of a phonebook
PUT /phonebooks/{phonebook_uuid} Modify an existing phonebook
DELETE /phonebooks/{phonebook_uuid} Delete an existing phonebook
GET /phonebooks/{phonebook_uuid}/contacts List all contacts for a given phonebook
POST /phonebooks/{phonebook_uuid}/contacts Create a new contact #
POST /phonebooks/{phonebook_uuid}/contacts/import Import multiple contacts at once #
GET /phonebooks/{phonebook_uuid}/contacts/{contact_id} Get the attributes of a contact
PUT /phonebooks/{phonebook_uuid}/contacts/{contact_id} Modify an existing contact
DELETE /phonebooks/{phonebook_uuid}/contacts/{contact_id} Delete an existing contact
GET /backends/phonebook/sources/{source_uuid}/contacts Get contacts from a `phonebook` source #
GET /tenants/{tenant}/phonebooks List all phonebooks for a given tenant
POST /tenants/{tenant}/phonebooks Create a new phonebook #
GET /tenants/{tenant}/phonebooks/{phonebook_id} Get the attributes of a phonebook
PUT /tenants/{tenant}/phonebooks/{phonebook_id} Modify an existing phonebook
DELETE /tenants/{tenant}/phonebooks/{phonebook_id} Delete an existing phonebook
GET /tenants/{tenant}/phonebooks/{phonebook_id}/contacts List all contacts for a given phonebook
POST /tenants/{tenant}/phonebooks/{phonebook_id}/contacts Create a new contact #
POST /tenants/{tenant}/phonebooks/{phonebook_id}/contacts/import Import multiple contacts at once #
GET /tenants/{tenant}/phonebooks/{phonebook_id}/contacts/{contact_id} Get the attributes of a contact
PUT /tenants/{tenant}/phonebooks/{phonebook_id}/contacts/{contact_id} Modify an existing contact
DELETE /tenants/{tenant}/phonebooks/{phonebook_id}/contacts/{contact_id} Delete an existing contact

Documentation

Specifications

Other Resources

🔗
Console
https://api.wazo.io/documentation/console/authentication/
🔗
SourceCode
https://github.com/wazo-platform/wazo-auth
🔗
ChangeLog
https://github.com/wazo-platform/wazo-auth/blob/master/CHANGELOG.md
🔗
Conventions
https://raw.githubusercontent.com/api-evangelist/wazo/refs/heads/main/conventions/wazo-conventions.yml
🔗
ErrorCatalog
https://raw.githubusercontent.com/api-evangelist/wazo/refs/heads/main/errors/wazo-problem-types.yml
🔗
Console
https://api.wazo.io/documentation/console/configuration/
🔗
SourceCode
https://github.com/wazo-platform/wazo-confd
🔗
ChangeLog
https://github.com/wazo-platform/wazo-confd/blob/master/CHANGELOG.md
🔗
Console
https://api.wazo.io/documentation/console/application/
🔗
SourceCode
https://github.com/wazo-platform/wazo-calld
🔗
ChangeLog
https://github.com/wazo-platform/wazo-calld/blob/master/CHANGELOG.md
🔗
Console
https://api.wazo.io/documentation/console/cdr/
🔗
SourceCode
https://github.com/wazo-platform/wazo-call-logd
🔗
ChangeLog
https://github.com/wazo-platform/wazo-call-logd/blob/master/CHANGELOG.md
🔗
Console
https://api.wazo.io/documentation/console/contact/
🔗
SourceCode
https://github.com/wazo-platform/wazo-dird
🔗
ChangeLog
https://github.com/wazo-platform/wazo-dird/blob/master/CHANGELOG.md
🔗
Console
https://api.wazo.io/documentation/console/webhook/
🔗
SourceCode
https://github.com/wazo-platform/wazo-webhookd
🔗
ChangeLog
https://github.com/wazo-platform/wazo-webhookd/blob/master/CHANGELOG.md
🔗
Webhooks
https://raw.githubusercontent.com/api-evangelist/wazo/refs/heads/main/asyncapi/wazo-events-webhooks.yml
🔗
Console
https://api.wazo.io/documentation/console/plugins/
🔗
SourceCode
https://github.com/wazo-platform/wazo-plugind
🔗
ChangeLog
https://github.com/wazo-platform/wazo-plugind/blob/master/CHANGELOG.md
🔗
Console
https://api.wazo.io/documentation/console/agent/
🔗
SourceCode
https://github.com/wazo-platform/wazo-agentd
🔗
ChangeLog
https://github.com/wazo-platform/wazo-agentd/blob/master/CHANGELOG.md
🔗
Console
https://api.wazo.io/documentation/console/chat/
🔗
SourceCode
https://github.com/wazo-platform/wazo-chatd
🔗
ChangeLog
https://github.com/wazo-platform/wazo-chatd/blob/master/CHANGELOG.md
🔗
SourceCode
https://github.com/wazo-platform/wazo-phoned
🔗
ChangeLog
https://github.com/wazo-platform/wazo-phoned/blob/master/CHANGELOG.md
🔗
Console
https://api.wazo.io/documentation/console/setup/
🔗
SourceCode
https://github.com/wazo-platform/wazo-setupd
🔗
ChangeLog
https://github.com/wazo-platform/wazo-setupd/blob/master/CHANGELOG.md
🔗
Console
https://api.wazo.io/documentation/console/amid/
🔗
SourceCode
https://github.com/wazo-platform/wazo-amid
🔗
ChangeLog
https://github.com/wazo-platform/wazo-amid/blob/master/CHANGELOG.md

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/wazo-phonebook-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

wazo-phonebook-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: wazo-dird Phonebook API
  description: "Contacts and directories in Wazo are managed by the wazo-dird daemon. This service provides a public API that can be used to query the directories that are configured on a Wazo. \n\n\nA contact can contain various information such as a person's phone number, number, office number, department, office number, etc. The information displayed is selected via a profile. Directories can be aggregated using multiple data sources such as an LDAP server, a CSV file, another Wazo server, etc.\n\n\nPlease refer to [the documentation](https://wazo-platform.org/uc-doc) for further details.\n\n\nNote: The 0.1 API is currently in development. Major changes could still happen and new resources will be added over time."
  version: '0.1'
  license:
    name: GPL v3
    url: http://www.gnu.org/licenses/gpl.txt
  contact:
    name: Wazo Dev Team
    url: https://wazo-platform.org/
    email: dev@wazo.community
  x-logo:
    url: https://wazo-platform.org/images/logo-black.svg
    backgroundColor: '#FAFAFA'
    altText: Wazo Logo
servers:
- url: /0.1
security:
- wazo_auth_token: []
tags:
- name: phonebook
paths:
  /phonebooks:
    get:
      summary: List all phonebooks for a given tenant
      description: '**Required ACL:** `dird.phonebooks.read`'
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/tenantuuid'
      - $ref: '#/components/parameters/order'
      - $ref: '#/components/parameters/direction'
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Offset'
      - $ref: '#/components/parameters/search'
      - $ref: '#/components/parameters/recurse'
      responses:
        '200':
          description: List of phonebooks
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Phonebook'
        '400':
          $ref: '#/components/responses/InvalidParameters'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
    post:
      summary: Create a new phonebook
      description: '**Required ACL:** `dird.phonebooks.create`'
      operationId: create_phonebook
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/tenantuuid'
      responses:
        '201':
          description: The new phonebook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Phonebook'
        '400':
          $ref: '#/components/responses/InvalidParameters'
        '404':
          description: Tenant does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '409':
          $ref: '#/components/responses/DuplicatePhonebook'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhonebookBody'
        description: The attributes of the phonebook
        required: true
  /phonebooks/{phonebook_uuid}:
    get:
      summary: Get the attributes of a phonebook
      description: '**Required ACL:** `dird.phonebooks.{phonebook_uuid}.read`'
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/tenantuuid'
      - $ref: '#/components/parameters/PhonebookUUID'
      responses:
        '200':
          description: The phonebook attributes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Phonebook'
        '400':
          $ref: '#/components/responses/InvalidTenant'
        '404':
          description: Phonebook or Tenant does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
    put:
      summary: Modify an existing phonebook
      description: '**Required ACL:** `dird.phonebooks.{phonebook_uuid}.update`'
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/tenantuuid'
      - $ref: '#/components/parameters/PhonebookUUID'
      responses:
        '204':
          description: Phonebook updated
        '400':
          $ref: '#/components/responses/InvalidParameters'
        '404':
          description: Phonebook does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '409':
          $ref: '#/components/responses/DuplicatePhonebook'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhonebookBody'
        description: The modified attributes of the phonebook
        required: true
    delete:
      summary: Delete an existing phonebook
      description: '**Required ACL:** `dird.phonebooks.{phonebook_uuid}.delete`'
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/tenantuuid'
      - $ref: '#/components/parameters/PhonebookUUID'
      responses:
        '204':
          description: Phonebook deleted
        '400':
          $ref: '#/components/responses/InvalidTenant'
        '404':
          description: Phonebook does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
  /phonebooks/{phonebook_uuid}/contacts:
    get:
      summary: List all contacts for a given phonebook
      description: '**Required ACL:** `dird.phonebooks.{phonebook_uuid}.contacts.read`'
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/tenantuuid'
      - $ref: '#/components/parameters/order'
      - $ref: '#/components/parameters/direction'
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Offset'
      - $ref: '#/components/parameters/search'
      - $ref: '#/components/parameters/PhonebookUUID'
      responses:
        '200':
          description: A list of contacts
          content:
            application/json:
              schema:
                $ref: '#/components/responses/PhonebookContactListResponse'
        '400':
          $ref: '#/components/responses/InvalidParameters'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
    post:
      summary: Create a new contact
      description: '**Required ACL:** `dird.phonebooks.{phonebook_uuid}.contacts.create`'
      operationId: create_phonebook_contact
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/tenantuuid'
      - $ref: '#/components/parameters/PhonebookUUID'
      responses:
        '201':
          description: The new contact
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhonebookContact'
        '400':
          $ref: '#/components/responses/InvalidParameters'
        '409':
          $ref: '#/components/responses/DuplicateContact'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhonebookContact'
        description: The attributes of the contact
        required: true
  /phonebooks/{phonebook_uuid}/contacts/import:
    post:
      summary: Import multiple contacts at once
      description: '**Required ACL:** `dird.phonebooks.{phonebook_uuid}.contacts.create`'
      operationId: import_phonebook
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/tenantuuid'
      - $ref: '#/components/parameters/PhonebookUUID'
      responses:
        '201':
          description: Contacts were imported.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhonebookContactImportResponse'
        '400':
          description: Bad input, no contacts were created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhonebookContactImportError'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
      requestBody:
        content:
          text/csv; charset=utf-8:
            schema:
              type: string
              example: 'firstname,lastname,phone_number,extension

                John,Doe,+33 6 00 00 00 00,5001

                Jane,Doe,+33 6 00 00 00 01,5002

                '
          text/csv; charset=iso8859-15:
            schema:
              type: string
              example: 'firstname,lastname,phone_number,extension

                John,Doe,+33 6 00 00 00 00,5001

                Jane,Doe,+33 6 00 00 00 01,5002

                '
          text/csv; charset=cp1252:
            schema:
              type: string
              example: 'firstname,lastname,phone_number,extension

                John,Doe,+33 6 00 00 00 00,5001

                Jane,Doe,+33 6 00 00 00 01,5002

                '
        description: 'The attributes of the contacts in CSV format.

          * The encoding\

          \ must be set in the Content-Type header, via the `charset=` option.\

          * Field delimiter: `,`.

          * Quoting character: `\"`.

          * Line delimiter: `\\r\\n`.

          '
        required: true
  /phonebooks/{phonebook_uuid}/contacts/{contact_id}:
    get:
      summary: Get the attributes of a contact
      description: '**Required ACL:** `dird.phonebooks.{phonebook_uuid}.contacts.{contact_id}.read`'
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/tenantuuid'
      - $ref: '#/components/parameters/PhonebookUUID'
      - $ref: '#/components/parameters/ContactID'
      responses:
        '200':
          description: The contact attributes
        '400':
          $ref: '#/components/responses/InvalidTenant'
        '404':
          description: The contact or the phonebook does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
    put:
      summary: Modify an existing contact
      description: '**Required ACL:** `dird.phonebooks.{phonebook_uuid}.contacts.{contact_id}.update`'
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/tenantuuid'
      - $ref: '#/components/parameters/PhonebookUUID'
      - $ref: '#/components/parameters/ContactID'
      responses:
        '204':
          description: Contact updated
        '400':
          $ref: '#/components/responses/InvalidParameters'
        '404':
          description: The contact or the phonebook does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '409':
          $ref: '#/components/responses/DuplicateContact'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactBodySample'
        description: The modified attributes of the contact
        required: true
    delete:
      summary: Delete an existing contact
      description: '**Required ACL:** `dird.phonebooks.{phonebook_uuid}.contacts.{contact_id}.delete`'
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/tenantuuid'
      - $ref: '#/components/parameters/PhonebookUUID'
      - $ref: '#/components/parameters/ContactID'
      responses:
        '204':
          description: Contact deleted
        '400':
          $ref: '#/components/responses/InvalidTenant'
        '404':
          description: The contact or the phonebook does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
  /backends/phonebook/sources/{source_uuid}/contacts:
    get:
      operationId: list_phonebook_source_contacts
      summary: Get contacts from a `phonebook` source
      description: '**Required ACL:** `dird.backends.phonebook.sources.{source_uuid}.contacts.read`'
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/tenantuuid'
      - in: path
        name: source_uuid
        required: true
        description: Source uuid
        schema:
          type: string
      - $ref: '#/components/parameters/order'
      - $ref: '#/components/parameters/direction'
      - $ref: '#/components/parameters/limit'
      - $ref: '#/components/parameters/offset'
      - $ref: '#/components/parameters/search'
      responses:
        '200':
          description: A list of contacts from this phonebook source
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhonebookContactList'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '404':
          description: No such source
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '503':
          description: Another service is unavailable (e.g. wazo-auth, ...)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
  /tenants/{tenant}/phonebooks:
    get:
      summary: List all phonebooks for a given tenant
      description: '**Required ACL:** `dird.tenants.{tenant}.phonebooks.read`'
      deprecated: true
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/order'
      - $ref: '#/components/parameters/direction'
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Offset'
      - $ref: '#/components/parameters/search'
      - $ref: '#/components/parameters/Tenant'
      responses:
        '200':
          description: List of phonebooks
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Phonebook'
        '400':
          $ref: '#/components/responses/InvalidParameters'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
    post:
      summary: Create a new phonebook
      description: '**Required ACL:** `dird.tenants.{tenant}.phonebooks.create`'
      deprecated: true
      operationId: create_phonebook_deprecated
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/Tenant'
      responses:
        '201':
          description: The new phonebook
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Phonebook'
        '400':
          $ref: '#/components/responses/InvalidParameters'
        '404':
          description: Tenant does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '409':
          $ref: '#/components/responses/DuplicatePhonebook'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhonebookBody'
        description: The attributes of the phonebook
        required: true
  /tenants/{tenant}/phonebooks/{phonebook_id}:
    get:
      summary: Get the attributes of a phonebook
      description: '**Required ACL:** `dird.tenants.{tenant}.phonebooks.{phonebook_id}.read`'
      deprecated: true
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/Tenant'
      - $ref: '#/components/parameters/PhonebookID'
      responses:
        '200':
          description: The phonebook attributes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Phonebook'
        '400':
          $ref: '#/components/responses/InvalidTenant'
        '404':
          description: Phonebook or Tenant does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
    put:
      summary: Modify an existing phonebook
      description: '**Required ACL:** `dird.tenants.{tenant}.phonebooks.{phonebook_id}.update`'
      deprecated: true
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/Tenant'
      - $ref: '#/components/parameters/PhonebookID'
      responses:
        '204':
          description: Phonebook updated
        '400':
          $ref: '#/components/responses/InvalidParameters'
        '404':
          description: Phonebook does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '409':
          $ref: '#/components/responses/DuplicatePhonebook'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhonebookBody'
        description: The modified attributes of the phonebook
        required: true
    delete:
      summary: Delete an existing phonebook
      description: '**Required ACL:** `dird.tenants.{tenant}.phonebooks.{phonebook_id}.delete`'
      deprecated: true
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/Tenant'
      - $ref: '#/components/parameters/PhonebookID'
      responses:
        '204':
          description: Phonebook deleted
        '400':
          $ref: '#/components/responses/InvalidTenant'
        '404':
          description: Phonebook does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
  /tenants/{tenant}/phonebooks/{phonebook_id}/contacts:
    get:
      summary: List all contacts for a given phonebook
      description: '**Required ACL:** `dird.tenants.{tenant}.phonebooks.{phonebook_id}.contacts.read`'
      deprecated: true
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/order'
      - $ref: '#/components/parameters/direction'
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/Offset'
      - $ref: '#/components/parameters/search'
      - $ref: '#/components/parameters/Tenant'
      - $ref: '#/components/parameters/PhonebookID'
      responses:
        '200':
          description: A list of contacts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhonebookContactList'
        '400':
          $ref: '#/components/responses/InvalidParameters'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
    post:
      summary: Create a new contact
      description: '**Required ACL:** `dird.tenants.{tenant}.phonebooks.{phonebook_id}.contacts.create`'
      deprecated: true
      operationId: create_phonebook_contact_deprecated
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/Tenant'
      - $ref: '#/components/parameters/PhonebookID'
      responses:
        '201':
          description: The new contact
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhonebookContact'
        '400':
          $ref: '#/components/responses/InvalidParameters'
        '409':
          $ref: '#/components/responses/DuplicateContact'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PhonebookContact'
        description: The attributes of the contact
        required: true
  /tenants/{tenant}/phonebooks/{phonebook_id}/contacts/import:
    post:
      summary: Import multiple contacts at once
      description: '**Required ACL:** `dird.tenants.{tenant}.phonebooks.{phonebook_id}.contacts.create`'
      deprecated: true
      operationId: import_phonebook_deprecated
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/Tenant'
      - $ref: '#/components/parameters/PhonebookID'
      responses:
        '201':
          description: At least one contact has been created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhonebookContactImportResponse'
        '400':
          description: Input could not be decoded, and no contacts were created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
      requestBody:
        content:
          text/csv; charset=utf-8:
            schema:
              type: string
          text/csv; charset=iso8859-15:
            schema:
              type: string
          text/csv; charset=cp1252:
            schema:
              type: string
        description: 'The attributes of the contacts in CSV format.

          * The encoding must be set in the Content-Type header, via the `charset=` option.

          * Field delimiter: `,`.

          * Quoting character: `"`.

          * Line delimiter: `\r\n`.'
        required: true
  /tenants/{tenant}/phonebooks/{phonebook_id}/contacts/{contact_id}:
    get:
      summary: Get the attributes of a contact
      description: '**Required ACL:** `dird.tenants.{tenant}.phonebooks.{phonebook_id}.contacts.{contact_id}.read`'
      deprecated: true
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/Tenant'
      - $ref: '#/components/parameters/PhonebookID'
      - $ref: '#/components/parameters/ContactID'
      responses:
        '200':
          description: The contact attributes
        '400':
          $ref: '#/components/responses/InvalidTenant'
        '404':
          description: The contact or the phonebook does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
    put:
      summary: Modify an existing contact
      description: '**Required ACL:** `dird.tenants.{tenant}.phonebooks.{phonebook_id}.contacts.{contact_id}.update`'
      deprecated: true
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/Tenant'
      - $ref: '#/components/parameters/PhonebookID'
      - $ref: '#/components/parameters/ContactID'
      responses:
        '204':
          description: Contact updated
        '400':
          $ref: '#/components/responses/InvalidParameters'
        '404':
          description: The contact or the phonebook does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '409':
          $ref: '#/components/responses/DuplicateContact'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactBodySample'
        description: The modified attributes of the contact
        required: true
    delete:
      summary: Delete an existing contact
      description: '**Required ACL:** `dird.tenants.{tenant}.phonebooks.{phonebook_id}.contacts.{contact_id}.delete`'
      deprecated: true
      tags:
      - phonebook
      parameters:
      - $ref: '#/components/parameters/Tenant'
      - $ref: '#/components/parameters/PhonebookID'
      - $ref: '#/components/parameters/ContactID'
      responses:
        '204':
          description: Contact deleted
        '400':
          $ref: '#/components/responses/InvalidTenant'
        '404':
          description: The contact or the phonebook does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LegacyError'
        '503':
          $ref: '#/components/responses/AnotherServiceUnavailable'
components:
  responses:
    InvalidParameters:
      description: Invalid parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LegacyError'
    AnotherServiceUnavailable:
      description: Another service is unavailable (e.g. wazo-auth, postgresql, ...)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LegacyError'
    PhonebookContactListResponse:
      description: A list of contacts
      content:
        application/json:
          schema:
            type: object
            properties:
              total:
                type: integer
                description: The total number of contacts
              items:
                $ref: '#/components/schemas/PhonebookContactList'
    InvalidTenant:
      description: The tenant is not a valid ascii alphanumeric string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LegacyError'
    DuplicateContact:
      description: This contact already exists
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LegacyError'
    DuplicatePhonebook:
      description: This phonebook already exists
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LegacyError'
  schemas:
    LegacyError:
      title: LegacyError
      description: Error message for the client
      properties:
        timestamp:
          description: Time at which the error occured
          type: array
          items:
            type: number
            format: timestamp
        reason:
          description: Human readable explanation of the error
          type: array
          items:
            type: string
        status_code:
          description: HTTP status code
          type: integer
    PhonebookContact:
      properties:
        id:
          type: string
          readOnly: true
        firstname:
          type: string
        lastname:
          type: string
      additionalProperties:
        type: string
    PhonebookContactImportError:
      description: Error(s) during contact import
      allOf:
      - $ref: '#/components/schemas/Error'
      - type: object
        properties:
          details:
            type: object
            properties:
              errors:
                description: A list of errors concerning separate contact entries
                type: array
                items:
                  type: object
                  properties:
                    contact:
                      description: The contact entry as parsed from the request csv input
                      type: object
                      additionalProperties:
                        type: string
                    message:
                      type: string
                      description: Human readable description of the error
                    index:
                      type: integer
                      description: the zero-based index of the contact entry in the request csv input(excluding the header)
    PhonebookContactList:
      type: array
      items:
        $ref: '#/components/schemas/PhonebookContact'
    ContactImportResponse:
      properties:
        created:
          type: array
          items:
            type: object
        failed:
          type: array
          items:
            $ref: '#/components/schemas/ContactImportFailure'
    ContactImportFailure:
      properties:
        line:
          type: integer
        errors:
          type: array
          items:
            type: string
    PhonebookBody:
      properties:
        name:
          type: string
        description:
          type: string
      required:
      - name
    PhonebookContactImportResponse:
      $ref: '#/components/schemas/ContactImportResponse'
      properties:
        created:
          $ref: '#/components/schemas/PhonebookContactList'
    Phonebook:
      properties:
        id:
          type: integer
        uuid:
          type: string
        name:
          type: string
        description:
          type: string
    Error:
      title: Error
      description: Error message for the client
      properties:
        timestamp:
          description: Time at which the error occured, as a unix timestamp
          type: number
          format: timestamp
        message:
          description: Human readable explanation of the error
          type: string
        error_id:
          description: a identifier for the type of error
          type: string
        details:
          description: additional attributes specific to the error type and instance
          type: object
          additionalProperties:
            type:
            - string
            - boolean
            - number
            - object
            - array
        resource:
          description: an identifier for the resource type concerned by the error
          type: string
    ContactBodySample:
      description: Those are only example attributes. The API accepts any arbitrary attributes.
      properties:
        firstname:
          type: string
        lastname:
          type: string
  parameters:
    tenantuuid:
      name: Wazo-Tenant
      in: header
      description: The tenant's UUID, defining the ownership of a given resource.
      required: false
      schema:
        type: string
    Offset:
      name: offset
      in: query
      description: The offset defines the number of items of the collection to skip
      required: false
      schema:
        type: integer
        default: 0
    PhonebookID:
      name: phonebook_id
      required: true
      in: path
      description: The phonebook's ID
      schema:
        type: integer
    offset:
      name: offset
      in: query
      description: The offset defines the offsets the start by the number specified
      required: false
      schema:
        type: integer
        default: 0
    order:
      required: false
      name: order
      in: query
      description: Name of the field to use for sorting the list of items returned.
      schema:
        type: string
    Tenant:
      name: tenant
      in: path
      description: The tenant defines the ownership of a given resource.
      required: true
      schema:
        type: string
    ContactID:
      name: contact_id
      in: path
      required: true
      description: The ID of contact.
      schema:
        type: string
    Limit:
      name: limit
      in: query
      description: The limit defines the number of individual objects that are returned
      required: false
      schema:
        type: integer
    recurse:
      name: recurse
      in: query
      description: Should the query include sub-tenants
      required: false
      schema:
        type: boolean
        default: false
    direction:
      required: false
      name: direction
      in: query
      description: Sort list of items in 'asc' (ascending) or 'desc' (descending) order
      schema:
        type: string
        enum:
        - asc
        - desc
    search:
      required: false
      name: search
      in: query
      description: Search term for filtering a list of items. Only items with a field containing the search term will be returned.
      schema:
        type: string
    PhonebookUUID:
      name: phonebook_uuid
      required

# --- truncated at 32 KB (32 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/wazo/refs/heads/main/openapi/wazo-phonebook-api-openapi.yml