> ## Documentation Index
> Fetch the complete documentation index at: https://razorpay-881012b3.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch All Contacts

> Fetch all Contacts using API.

<div style={{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"0.35rem 0.9rem",border:"1px solid rgba(128,128,128,0.28)",borderRadius:"0.5rem",padding:"0.45rem 0.75rem",margin:"0 0 1.25rem",fontSize:"0.875rem"}}>
  <span style={{fontWeight:600}}>Available in</span>
  <span>🇮🇳 India</span>
  <span>🇸🇬 Singapore</span>
  <span>🇺🇸 United States</span>
</div>

Use this endpoint to retrieve the details of all contacts.

<RequestExample>
  ```bash Curl theme={null}
  curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
  -X GET https://api.razorpay.com/v1/contacts
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
  "entity": "collection",
  "count": 1,
  "items": [
    {
    "id": "cont_00000000000001",
    "entity": "contact",
    "name": "Gaurav Kumar",
    "contact": "9000090000",
    "email": "gaurav.kumar@example.com",
    "type": "self",
    "reference_id": "Acme Contact ID 12345",
    "batch_id": null,
    "active": true,
    "notes": {
      "notes_key_1":"Tea, Earl Grey, Hot",
      "notes_key_2":"Tea, Earl Grey… decaf."
    },
    "created_at": 1545322986
    }
   ]
  }
  ```

  ```json Failure theme={null}
  {
    "error": {
        "code": "BAD_REQUEST_ERROR",
        "description": "The name field is required.",
        "source": "business",
        "step": null,
        "reason": "input_validation_failed",
        "metadata": {},
        "field": "name"
    }
  }
  ```
</ResponseExample>

## Query Parameters

<ParamField query="name" type="string">
  Name by which results should be filtered. For example, `Gaurav`.
</ParamField>

<ParamField query="email" type="string">
  Email address by which results should be filtered. For example, `gaurav.kumar@example.com`.
</ParamField>

<ParamField query="contact" type="string">
  Phone number by which results should be filtered. For example, `9000090000`.
</ParamField>

<ParamField query="reference_id" type="string">
  The user-generated reference by which results should be filtered. For example, `Acme Contact ID 12345`. Maximum length is 40 characters.
</ParamField>

<ParamField query="active" type="boolean">
  The state by which results should be filtered. Possible values:

  * `1`: active
  * `0`: inactive
</ParamField>

<ParamField query="type" type="string">
  The classification by which results should be filtered. Possible values:

  * `vendor`
  * `customer`
  * `employee`
  * `self`
</ParamField>

<ParamField query="from" type="integer">
  Timestamp, in Unix, from when contacts are to be retrieved.
</ParamField>

<ParamField query="to" type="integer">
  Timestamp, in Unix, till when contacts are to be retrieved.
</ParamField>

<ParamField query="count" type="integer">
  The number of contacts to be retrieved. Default = `10`. Maximum = `100`. This can be used for pagination, in combination with `skip`.
</ParamField>

<ParamField query="skip" type="integer">
  The number of contacts to be skipped. Default = `0`. This can be used for pagination, in combination with `count`.
</ParamField>

## Response Parameters

<ResponseField name="id" type="string">
  The unique identifier linked to the contact. For example, `cont_00000000000001`.
</ResponseField>

<ResponseField name="entity" type="string">
  The entity being created. Here, it is `contact`.
</ResponseField>

<ResponseField name="name" type="string">
  The contact's name. For example, `Gaurav Kumar`.
</ResponseField>

<ResponseField name="contact" type="string">
  The contact's phone number. For example, `9000090000`.
</ResponseField>

<ResponseField name="email" type="string">
  The contact's email address. For example, `gaurav.kumar@example.com`.
</ResponseField>

<ResponseField name="type" type="string">
  A classification for the contact being created. For example, `employee`.
</ResponseField>

<ResponseField name="reference_id" type="string">
  A user-entered reference for the contact. For example, `Acme Contact ID 12345`.
</ResponseField>

<ResponseField name="batch_id" type="string">
  This value is returned if the contact was created as part of a bulk upload. For example, `batch_00000000000001`.
</ResponseField>

<ResponseField name="active" type="boolean">
  Possible values:

  * `true` (default) : active
  * `false` : inactive
</ResponseField>

<ResponseField name="notes" type="object">
  Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, `"note_key": "Beam me up Scotty”`.
</ResponseField>

<ResponseField name="created_at" type="integer">
  Timestamp, in Unix, when the contact was created. For example, `1545320320`.
</ResponseField>

## Errors

<AccordionGroup>
  <Accordion title="The `name` field is required.">
    **Code:** `4xx`

    The `name` field is missing in the request body.

    **Solution:** Enter the details in the recommended format as per the request body.
  </Accordion>

  <Accordion title="The `name` field is invalid.">
    **Code:** `4xx`

    There are special characters used in the `name` field.

    **Solution:** Enter details as per the format recommended for Create a Contact request for `name` field.
  </Accordion>

  <Accordion title="Invalid type: `contact_typeA`">
    **Code:** `4xx`

    * There are special characters in the `type` field.
    * Casing does not match as per the `type`. `type` is case-sensitive.
    * Contact type sent in the request does not match the types present in the Dashboard.

    **Solution:** Enter the correct contact type in the request body. You cannot create new contact types via API. You must create them via the [RazorpayX Dashboard](http://x.razorpay.com/auth).
  </Accordion>
</AccordionGroup>
