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: true in: path description: The phonebook's UUID 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 securitySchemes: wazo_auth_token: type: apiKey name: X-Auth-Token in: header x-xivo-port: 9489 x-xivo-name: dird x-apievangelist-source: harvested_from: https://github.com/wazo-platform/wazo-dird assembly: base plugin api.yml deep-merged with all plugin api.yml fragments, reproducing what the running service serves at /api/dird/0.1/api/api.yml (see wazo_dird/plugins/api/http.py — xivo.chain_map.ChainMap) spec_version: Swagger 2.0 (as published by Wazo) harvested: '2026-08-17'