# Send Contact Message

**POST** `/{phone_number_id}/messages`

Product: [WhatsApp](https://devdocs.pinnacle.in/docs/whatsapp.md)  
Version: [3.0](https://devdocs.pinnacle.in/docs/whatsapp/3-0.md)

This API is used to send the contact message to the end user.

## Request

URL: `https://partnersv1.pinbot.ai/v3/{phone_number_id}/messages`

Authentication location: `header`

Authentication name: `apikey`

### Request schema


```json
{
  "type": "object",
  "properties": {
    "to": {
      "type": "string"
    },
    "type": {
      "type": "string"
    },
    "contacts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "org": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string"
              },
              "company": {
                "type": "string"
              },
              "department": {
                "type": "string"
              }
            }
          },
          "name": {
            "type": "object",
            "properties": {
              "prefix": {
                "type": "string"
              },
              "suffix": {
                "type": "string"
              },
              "last_name": {
                "type": "string"
              },
              "first_name": {
                "type": "string"
              },
              "middle_name": {
                "type": "string"
              },
              "formatted_name": {
                "type": "string"
              }
            }
          },
          "urls": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "emails": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                }
              }
            }
          },
          "phones": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "phone": {
                  "type": "string"
                },
                "wa_id": {
                  "type": "string"
                }
              }
            }
          },
          "birthday": {
            "type": "string"
          },
          "addresses": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "zip": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                },
                "street": {
                  "type": "string"
                },
                "country": {
                  "type": "string"
                },
                "country_code": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "messaging_product": {
      "type": "string"
    }
  }
}
```

### Request example


```json
{
  "to": "{{Recipient-Phone-Number}}",
  "type": "contacts",
  "contacts": [
    {
      "org": {
        "title": "<CONTACT_ORG_TITLE>",
        "company": "<CONTACT_ORG_COMPANY>",
        "department": "<CONTACT_ORG_DEPARTMENT>"
      },
      "name": {
        "prefix": "<CONTACT_PREFIX>",
        "suffix": "<CONTACT_SUFFIX>",
        "last_name": "<CONTACT_LAST_NAME>",
        "first_name": "<CONTACT_FIRST_NAME>",
        "middle_name": "<CONTACT_MIDDLE_NAME>",
        "formatted_name": "<CONTACT_FORMATTED_NAME>"
      },
      "urls": [
        {
          "url": "<CONTACT_URL>",
          "type": "<HOME|WORK>"
        }
      ],
      "emails": [
        {
          "type": "<WORK|HOME>",
          "email": "<CONTACT_EMAIL>"
        }
      ],
      "phones": [
        {
          "type": "<HOME|WORK>",
          "phone": "<CONTACT_PHONE>",
          "wa_id": "<CONTACT_WA_ID>"
        }
      ],
      "birthday": "<CONTACT_BIRTHDAY>",
      "addresses": [
        {
          "zip": "<ADDRESS_ZIP>",
          "city": "<ADDRESS_CITY>",
          "type": "<HOME|WORK>",
          "state": "<ADDRESS_STATE>",
          "street": "<ADDRESS_STREET>",
          "country": "<ADDRESS_COUNTRY>",
          "country_code": "<ADDRESS_COUNTRY_CODE>"
        }
      ]
    }
  ],
  "messaging_product": "whatsapp"
}
```

## Response schema


```json
{
  "type": "object",
  "properties": {
    "raw_example": {
      "type": "string"
    }
  }
}
```

## Response examples


```json
{
  "200": {
    "raw_example": "{\n\"messaging_product\": \"whatsapp\",\n\"contacts\": [\n{\n\"input\": \"9175XXXXXXXX\",\n\"wa_id\": \"9175XXXXXXXX\"\n}\n],\n\"messages\": [\n{\n\"id\":\n\"wamid.HBgMOTE3OTcyODkyNzEyFQIAERgSQzAwRDEzNkQ1NDFFNkM3NkEzAA=\n=\"\n}]\n"
  }
}
```

## Status codes


```json
[
  {
    "code": 200,
    "description": "The request was successful."
  },
  {
    "code": 400,
    "description": "Bad request or invalid parameters."
  },
  {
    "code": 401,
    "description": "API key is missing or invalid."
  },
  {
    "code": 403,
    "description": "The request is not authorized for this resource."
  },
  {
    "code": 404,
    "description": "The requested resource was not found."
  },
  {
    "code": 500,
    "description": "The server encountered an error."
  }
]
```
