Zones

Fetch all zones


Return all the zones
GET /zones
page Page number of zones to return. Returns empty array if the page has no zones. If page parameter isn't present, returns the first page Optional
size Number of zones to return in a page. If size parameter isn't present, returns the page with 25 zones Optional
Response Body
[
    {
        "_id": "527cdd8acce8b4e278000020",
        "name": "Foo Zone",
        "leads": [
            {
                "_id": "521f26eccce8b4310e000074",
                "name": "[Sample] Foo"
            }
        ]
    }
]

Show a zone


Show details of an individual zone
GET /zones/:zone_id
zone_id Unique identifier of the zone Required
Response Body
{
      "_id": "527cdd8acce8b4e278000020",
      "name": "Foo Zone",
      "leads": [
          {
              "_id": "521f26eccce8b4310e000074",
              "name": "[Sample] Foo"
          }
      ]
}

Create a zone


Create a new zone
POST /zones
name Name of the zone Required
Response Body
{
    "_id": "527cdd8acce8b4e278000020",
    "name": "Foo Zone"
}

Update a zone


Update the name of a zone
PUT /zones/:zone_id
zone_id Unique identifier of the zone Required
name Name of the zone Optional
Response Body
{
    "_id": "527cdd8acce8b4e278000020",
    "name": "Foo Zone",
}

Delete a zone


Delete a zone
DELETE /zones/:zone_id
zone_id Unique identifier of the zone Required
Response Body
{}

Fetch all zones for a lead


Return all the zones for a specified lead
GET /leads/:lead_id/zones
lead_id Unique identifier of the lead Required
page Page number of zones to return. Returns empty array if the page has no zones. If page parameter isn't present, returns the first page Optional
size Number of zones to return in a page. If size parameter isn't present, returns the page with 25 zones Optional
Response Body
[
    {
        "_id": "527cdd8acce8b4e278000020",
        "name": "Foo Zone",
        "leads": [
            {
                "_id": "521f26eccce8b4310e000074",
                "name": "[Sample] Foo"
            }
        ]
    }
]

Show a zone for a lead


Show details of an individual zone associated with a specified lead
GET /leads/:lead_id/zones/:zone_id
lead_id Unique identifier of the lead Required
zone_id Unique identifier of the zone Required
Response Body
{
    "_id": "527cdd8acce8b4e278000020",
    "name": "Foo Zone",
    "leads": [
        {
            "_id": "521f26eccce8b4310e000074",
            "name": "[Sample] Foo"
        }
    ]
}

Add a zone to a lead


Add a zone to a specified lead
PUT /leads/:lead_id/zones/:zone_id
lead_id Unique identifier of the lead Required
zone_id Unique identifier of the zone Required
Response Body
{
    "_id": "527cdd8acce8b4e278000020",
    "name": "Foo Zone"
}

Remove a zone for a lead


Remove a zone from the list of zones associated with a specified lead
DELETE /leads/:lead_id/zones/:zone_id
lead_id Unique identifier of the lead Required
zone_id Unique identifier of the zone Required
Response Body
{}