> ## Documentation Index
> Fetch the complete documentation index at: https://developer.omni.z-api.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get contact

> A contact's data

## Overview

A contact's data.

> [!NOTE]
>
> An id out of format responds `400` `invalid_request`. A number the channel does not recognize responds with the message `The channel did not recognize this contact: ...` — the text `Phone not exists` only appears when Z-API itself returns 4xx.

> [!NOTE]
>
> The detail carries `photoUrl` (valid for \~48h) and does **not** carry `lid`. `phone` is `null` when the contact only has a LID, and then `id` is the LID. Null fields appear in the JSON.


## OpenAPI

````yaml en/contacts/openapi.json GET /v1/channels/{channelId}/contacts/{contact}
openapi: 3.1.0
info:
  title: Omni Z-API - Contacts
  version: 1.0.0
servers:
  - url: https://api.omni.z-api.io
security:
  - bearerAuth: []
paths:
  /v1/channels/{channelId}/contacts/{contact}:
    get:
      tags:
        - Contatos
      summary: Get contact
      description: >-
        Returns a contact's data by phone (digits only, with country and area
        code), by `{phone}@c.us`, or by LID.
      operationId: getContact
      parameters:
        - name: channelId
          in: path
          required: true
          description: Channel id
          schema:
            type: string
            example: 58907809F0964E998D36C87F10EBA60C
        - name: contact
          in: path
          required: true
          description: >-
            Contact phone (digits only, with country and area code),
            `{phone}@c.us`, or LID.
          schema:
            type: string
            example: '554497294996'
      responses:
        '200':
          description: Contact data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactDetail'
              example:
                id: '554497294996'
                phone: '554497294996'
                name: Contato de teste
                shortName: Contato
                profileName: Contato de teste
                vcardName: Contato de teste
                about: Disponível
                photoUrl: https://pps.whatsapp.net/v/t61.24694-24/...
        '400':
          description: Parameter out of format
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalid:
                  summary: Id inválido
                  value:
                    error: invalid_request
                    field: contact
                    message: >-
                      contact is not valid: send the phone number with country
                      code and area code, digits only (8 to 15 digits, for
                      example 5511999999999), or the contact LID (for example
                      999999999999999@lid)
                notFound:
                  summary: Number not recognized by the channel
                  value:
                    error: provider_error
                    message: >-
                      The channel did not recognize this contact: check the
                      phone number (country code and area code, digits only) or
                      the LID.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/InstanceNotFound'
        '422':
          description: >-
            Instance not provisioned, subscription inactive, workspace blocked,
            or operation not supported on the channel, checked in this order
            (the `404` for a missing channel comes before all of them). Only the
            operation-not-supported 422 carries `message`, and it is for
            reading: handle it by `error`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                instanceNotProvisioned:
                  summary: Instance not provisioned
                  value:
                    error: instance is not provisioned
                subscriptionInactive:
                  summary: Subscription inactive
                  value:
                    error: instance subscription is not active
                blockedWorkspace:
                  summary: Workspace blocked
                  value:
                    error: You are blocked, contact support.
                operationNotSupportedMeta:
                  summary: WhatsApp Official (Meta) channel
                  value:
                    error: operation not supported for this instance
                    message: >-
                      Reading a contact is not supported on WhatsApp official
                      API (Meta) channels: the official API does not give access
                      to the contacts of the number. Use a WhatsApp Web channel
                      for contacts; GET /v1/channels/{id}/contacts/capabilities
                      lists what each channel supports.
                operationNotSupportedOtherChannel:
                  summary: >-
                    Telegram channel (Instagram and Messenger: same text, with
                    the channel name)
                  value:
                    error: operation not supported for this instance
                    message: >-
                      Reading a contact is not supported on Telegram channels:
                      contacts belong to a WhatsApp number, and this channel has
                      none. Use a WhatsApp Web channel for contacts; GET
                      /v1/channels/{id}/contacts/capabilities lists what each
                      channel supports.
                operationNotSupportedNoType:
                  summary: Channel without a type yet
                  value:
                    error: operation not supported for this instance
                    message: >-
                      Reading a contact is not supported on this instance: it is
                      not connected to any channel type yet. Use a WhatsApp Web
                      channel for contacts; GET
                      /v1/channels/{id}/contacts/capabilities lists what each
                      channel supports.
        '502':
          description: Channel response too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error: provider_response_too_large
                message: The channel answer is too large. Use a smaller pageSize.
components:
  schemas:
    ContactDetail:
      type: object
      properties:
        id:
          type: string
        phone:
          type: string
          nullable: true
        name:
          type: string
        shortName:
          type: string
        profileName:
          type: string
        vcardName:
          type: string
        about:
          type: string
          nullable: true
        photoUrl:
          type: string
          nullable: true
    Error:
      type: object
      properties:
        error:
          type: string
        field:
          type: string
        message:
          type: string
  responses:
    Unauthorized:
      description: >-
        Secret Key refused. Comes with the `WWW-Authenticate: Bearer` header;
        the `message` changes with the reason (see
        [Authentication](/en/authentication)).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Authorization invalid
            message: >-
              Authorization invalid: the Authorization header is missing or
              empty. Send the workspace Secret Key as "Authorization: Bearer
              <secret-key>". See
              https://developer.omni.z-api.io/en/authentication
      headers:
        WWW-Authenticate:
          description: Always `Bearer`
          schema:
            type: string
            example: Bearer
    Forbidden:
      description: >-
        IP not on the workspace allow list (see [IP
        restriction](/en/security/ip-restriction))
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: ip_not_allowed
            message: >-
              203.0.113.10 not allowed: this workspace only accepts API calls
              from the IPs on its allow list. The workspace Owner can add this
              IP under Administration > Security > IP Restriction in the panel
              (changes take up to 10 minutes to apply), or call from an allowed
              IP. See https://developer.omni.z-api.io/en/security/ip-restriction
    InstanceNotFound:
      description: Instance (channel) not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: instance not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Secret Key

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.