Sources

Fetch all sources


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

Show a source


Show details of an individual source
GET /sources/:source_id
source_id Unique identifier of the source Required
Response Body
{
      "_id": "527cdd8acce8b4e278000020",
      "name": "Foo Source",
      "leads": [
          {
              "_id": "521f26eccce8b4310e000074",
              "name": "[Sample] Foo"
          }
      ]
}

Create a source


Create a new source
POST /sources
name Name of the source Required
Response Body
{
    "_id": "527cdd8acce8b4e278000020",
    "name": "Foo Source"
}

Update a source


Update the name of a source
PUT /sources/:source_id
source_id Unique identifier of the source Required
name Name of the source Optional
Response Body
{
    "_id": "527cdd8acce8b4e278000020",
    "name": "Foo Source",
}

Delete a source


Delete a source
DELETE /sources/:source_id
source_id Unique identifier of the source Required
Response Body
{}

Fetch all sources for a lead


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

Show a source for a lead


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

Add a source to a lead


Add a source to a specified lead
PUT /leads/:lead_id/sources/:source_id
lead_id Unique identifier of the lead Required
source_id Unique identifier of the source Required
Response Body
{
    "_id": "527cdd8acce8b4e278000020",
    "name": "Foo Source"
}

Remove a source for a lead


Remove a source from the list of sources associated with a specified lead
DELETE /leads/:lead_id/sources/:source_id
lead_id Unique identifier of the lead Required
source_id Unique identifier of the source Required
Response Body
{}