> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cogfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Send contacts message

> Sends one or more contact cards.

Requires an open service window: the recipient must have messaged the business in the last 24 hours. Use `POST /messages/template` to reach recipients outside that window.



## OpenAPI

````yaml POST /messages/contacts
openapi: 3.1.0
info:
  title: Cogfy Messenger Public API
  version: 1.0.0
  description: API for interacting with the Cogfy Messenger platform
servers:
  - url: https://messenger-public-api.cogfy.com
    description: Production server
  - url: http://localhost:3100
    description: Local server
security:
  - ApiKeyAuth: []
paths:
  /messages/contacts:
    post:
      tags:
        - Messages
      summary: Send contacts message
      description: >-
        Sends one or more contact cards.


        Requires an open service window: the recipient must have messaged the
        business in the last 24 hours. Use `POST /messages/template` to reach
        recipients outside that window.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                from:
                  type: string
                  minLength: 1
                  description: WhatsApp id of the sender phone number
                to:
                  type: string
                  minLength: 1
                  description: Recipient phone number, digits only, including country code
                contacts:
                  minItems: 1
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: object
                        properties:
                          formatted_name:
                            type: string
                            description: Full name as it should be displayed
                          first_name:
                            type: string
                          last_name:
                            type: string
                          middle_name:
                            type: string
                          suffix:
                            type: string
                          prefix:
                            type: string
                        required:
                          - formatted_name
                      phones:
                        type: array
                        items:
                          type: object
                          properties:
                            phone:
                              type: string
                            type:
                              description: Phone type, e.g. CELL, HOME or WORK
                              type: string
                            wa_id:
                              description: WhatsApp id of the phone number
                              type: string
                          required:
                            - phone
                      addresses:
                        type: array
                        items:
                          type: object
                          properties:
                            street:
                              type: string
                            city:
                              type: string
                            state:
                              type: string
                            zip:
                              type: string
                            country:
                              type: string
                            country_code:
                              type: string
                            type:
                              description: Address type, e.g. HOME or WORK
                              type: string
                      birthday:
                        description: Birthday in YYYY-MM-DD format
                        type: string
                      emails:
                        type: array
                        items:
                          type: object
                          properties:
                            email:
                              type: string
                            type:
                              description: Email type, e.g. HOME or WORK
                              type: string
                      org:
                        type: object
                        properties:
                          company:
                            type: string
                          department:
                            type: string
                          title:
                            type: string
                      urls:
                        type: array
                        items:
                          type: object
                          properties:
                            url:
                              type: string
                            type:
                              description: URL type, e.g. HOME or WORK
                              type: string
                    required:
                      - name
                  description: Contact cards to send
              required:
                - from
                - to
                - contacts
      responses:
        '200':
          description: Message sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                    pattern: >-
                      ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                    description: Id of the created message
                required:
                  - id
                additionalProperties: false
        '400':
          description: >-
            Bad request — invalid input data, or the message was rejected by the
            WhatsApp Cloud API (e.g. invalid template)
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                  title:
                    type: string
                  detail:
                    type: string
                  code:
                    description: >-
                      WhatsApp Cloud API error code, present when the request
                      was rejected by Meta (e.g. invalid template, rate limit)
                    type: number
                required:
                  - status
                  - title
                  - detail
                additionalProperties: false
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                  title:
                    type: string
                  detail:
                    type: string
                  code:
                    description: >-
                      WhatsApp Cloud API error code, present when the request
                      was rejected by Meta (e.g. invalid template, rate limit)
                    type: number
                required:
                  - status
                  - title
                  - detail
                additionalProperties: false
        '404':
          description: >-
            Sender phone number not found or not linked to a WhatsApp Business
            Account
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: number
                  title:
                    type: string
                  detail:
                    type: string
                  code:
                    description: >-
                      WhatsApp Cloud API error code, present when the request
                      was rejected by Meta (e.g. invalid template, rate limit)
                    type: number
                required:
                  - status
                  - title
                  - detail
                additionalProperties: false
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api-key

````