Contacts

Fetch all contacts


Return all the contacts
GET /contacts
page Page number of contacts to return. Returns empty array if the page has no contacts. If page parameter isn't present, returns the first page Optional
size Number of contacts to return in a page. If size parameter isn't present, returns the page with 25 contacts Optional
name Name to match Optional
email Email to match Optional
phone Phone number to match Optional
Response Body
[
    {
        "_id": "521f26eccce8b4310e000076",
        "name": "Foo Guy",
        "designation": null,
        "email": "fooguy@foocorp.com",
        "phone": "5553331234",
        "address": null,
        "fields":  [
            {
              "_id": "531ed3a49a21f6e90b00000e",
              "name": "custom contact field",
              "value": "Annual"
            }
        ],
        "organization": {
            "_id": "521f26eccce8b4310e000075",
            "name": "Foo Organization",
            "email": "contact@foocorp.com",
            "phone": "5553336666",
            "website": "http://www.foocorp.com",
            "address": "Foo City"
        }
    },
    {
        "_id": "5277831fcce8b4c0d20002cd",
        "name": "Sigourney Weaver",
        "designation": "Basket Weaver",
        "email": "weavergroup@gmail.com",
        "phone": "1-455-666-7777",
        "address": "Weaver City",
        "fields":  [
            {
              "_id": "531ed3a49a21f6e90b00000e",
              "name": "custom contact field",
              "value": "Weekly"
            }
        ],
        "organization": {
            "_id": "5277831fcce8b4c0d20002ce",
            "name": "Weaver LLP",
            "email": null,
            "phone": null,
            "website": "http://www.weaverllp.com",
            "address": null
        }
    }
]

Show a contact


Show details of an individual contact
GET /contacts/:contact_id
contact_id Unique identifier of the contact Required
Response Body
{
    "_id": "521f26eccce8b4310e000076",
    "name": "Foo Guy",
    "designation": null,
    "email": "fooguy@foocorp.com",
    "phone": "5553331234",
    "address": null,
    "fields":  [
        {
          "_id": "531ed3a49a21f6e90b00000e",
          "name": "custom contact field",
          "value": "Annual"
        }
    ],
    "organization": {
        "_id": "521f26eccce8b4310e000075",
        "name": "Foo Organization",
        "email": "contact@foocorp.com",
        "phone": "5553336666",
        "website": "http://www.foocorp.com",
        "address": "Foo City"
    }
}

Create a contact


Create a new contact
POST /contacts
name Name of the contact Required
designation Designation of the contact Optional
email Email of the contact Optional
phone Phone number of the contact Optional
address Address of the contact Optional
organization_id Unique identifier of the organization the contact belongs to Optional
Response Body
{
    "_id": "521f26eccce8b4310e000076",
    "name": "Foo Guy",
    "designation": null,
    "email": "fooguy@foocorp.com",
    "phone": "5553331234",
    "address": null,
    "fields":  [
        {
          "_id": "531ed3a49a21f6e90b00000e",
          "name": "custom contact field",
          "value" : null
        }
    ],
    "organization": {
        "_id": "521f26eccce8b4310e000075",
        "name": "Foo Organization",
        "email": "contact@foocorp.com",
        "phone": "5553336666",
        "website": "http://www.foocorp.com",
        "address": "Foo City"
    }
}

Update a contact


Update the name of a contact
PUT /contacts/:contact_id
contact_id Unique identifier of the contact Required
name Name of the contact Optional
designation Designation of the contact Optional
email Email of the contact Optional
phone Phone number of the contact Optional
address Address of the contact Optional
organization_id Unique identifier of the organization the contact belongs to Optional
Response Body
{
    "_id": "521f26eccce8b4310e000076",
    "name": "Foo Guy",
    "designation": null,
    "email": "fooguy@foocorp.com",
    "phone": "5553331234",
    "address": null,
    "fields":  [
        {
          "_id": "531ed3a49a21f6e90b00000e",
          "name": "custom contact field",
          "value" : null
        }
    ],
    "organization": {
        "_id": "521f26eccce8b4310e000075",
        "name": "Foo Organization",
        "email": "contact@foocorp.com",
        "phone": "5553336666",
        "website": "http://www.foocorp.com",
        "address": "Foo City"
    }
}

Update the value of contact's custom field
PUT /contacts/:contact_id/fields/:field_id
contact_id Unique identifier of the contact Required
field_id Unique identifier of the field Required
value Value of the field Optional
Response Body
{
    "_id": "521f26eccce8b4310e000076",
    "name": "Foo Guy",
    "designation": null,
    "email": "fooguy@foocorp.com",
    "phone": "5553331234",
    "address": null,
    "fields":  [
        {
          "_id": "531ed3a49a21f6e90b00000e",
          "name": "custom contact field",
          "value" : "Annual"
        }
    ],
    "organization": {
        "_id": "521f26eccce8b4310e000075",
        "name": "Foo Organization",
        "email": "contact@foocorp.com",
        "phone": "5553336666",
        "website": "http://www.foocorp.com",
        "address": "Foo City"
    }
}

Delete a contact


Delete a contact
DELETE /contacts/:contact_id
contact_id Unique identifier of the contact Required
Response Body
{}

Fetch all contacts for a lead


Return all the contacts for a specified lead
GET /leads/:lead_id/contacts
lead_id Unique identifier of the lead Required
page Page number of contacts to return. Returns empty array if the page has no contacts. If page parameter isn't present, returns the first page Optional
size Number of contacts to return in a page. If size parameter isn't present, returns the page with 25 contacts Optional
Response Body
[
    {
        "_id": "521f26eccce8b4310e000076",
        "name": "Foo Guy",
        "designation": null,
        "email": "fooguy@foocorp.com",
        "phone": "5553331234",
        "address": null,
        "fields":  [
            {
              "_id": "531ed3a49a21f6e90b00000e",
              "name": "custom contact field",
              "value" : "Annual"
            }
        ],
        "organization": {
            "_id": "521f26eccce8b4310e000075",
            "name": "Foo Organization",
            "email": "contact@foocorp.com",
            "phone": "5553336666",
            "website": "http://www.foocorp.com",
            "address": "Foo City"
        }
    },
    {
        "_id": "5277831fcce8b4c0d20002cd",
        "name": "Sigourney Weaver",
        "designation": "Basket Weaver",
        "email": "weavergroup@gmail.com",
        "phone": "1-455-666-7777",
        "address": null,
        "fields":  [
            {
              "_id": "531ed3a49a21f6e90b00000e",
              "name": "custom contact field",
              "value" : "Weekly"
            }
        ],
        "organization": {
            "_id": "5277831fcce8b4c0d20002ce",
            "name": "Weaver LLP",
            "email": null,
            "phone": null,
            "website": "http://www.weaverllp.com",
            "address": null
        }
    }
]

Show a contact for a lead


Show details of an individual contact associated with a specified lead
GET /leads/:lead_id/contacts/:contact_id
lead_id Unique identifier of the lead Required
contact_id Unique identifier of the contact Required
Response Body
{
    "_id": "521f26eccce8b4310e000076",
    "name": "Foo Guy",
    "designation": null,
    "email": "fooguy@foocorp.com",
    "phone": "5553331234",
    "address": null,
    "fields":  [
        {
          "_id": "531ed3a49a21f6e90b00000e",
          "name": "custom contact field",
          "value" : "Annual"
        }
    ],
    "organization": {
        "_id": "521f26eccce8b4310e000075",
        "name": "Foo Organization",
        "email": "contact@foocorp.com",
        "phone": "5553336666",
        "website": "http://www.foocorp.com",
        "address": "Foo City"
    }
}

Add a contact to a lead


Add a contact to a specified lead
PUT /leads/:lead_id/contacts/:contact_id
lead_id Unique identifier of the lead Required
contact_id Unique identifier of the contact Required
Response Body
{
    "_id": "521f26eccce8b4310e000076",
    "name": "Foo Guy",
    "designation": null,
    "email": "fooguy@foocorp.com",
    "phone": "5553331234",
    "address": null,
    "fields":  [
        {
          "_id": "531ed3a49a21f6e90b00000e",
          "name": "custom contact field",
          "value" : "Annual"
        }
    ],
    "organization": {
        "_id": "521f26eccce8b4310e000075",
        "name": "Foo Organization",
        "email": "contact@foocorp.com",
        "phone": "5553336666",
        "website": "http://www.foocorp.com",
        "address": "Foo City"
    }
}

Remove a contact for a lead


Remove a contact from the list of contacts associated with a specified lead
DELETE /leads/:lead_id/contacts/:contact_id
lead_id Unique identifier of the lead Required
contact_id Unique identifier of the contact Required
Response Body
{}