REST Resources

This document contains a description of the resources available via HTTPS. All resources are RESTful and represented using JSON. Authentication is performed using HTTP Basic Auth.

Base Resource Path Description Reference
/caps List and get cap counters Cap
/changelogs List and get changelogs Changelog
/credentials List, create, get, update, and delete credentials Credential
/entities List, create, get, update and delete entities Entity
/events List events Event
/events/stats Get counts of success, failure, and error events Event Statistics
/fields List, create, get, update and delete fields Field
/flows List, create, get, update, deploy, delete flows, get fields, and get field usages Flow
/modules Deprecated: use /packages instead Integration Module
/packages List integration packages Integration Package
/reports List, create, get, update, delete, preview, and run reports Report
/routers List, create, get, and update routers Router
/search/leads Search for Leads Lead Search Result
/status Get API status
/types Get field types Type
/vars List variables or get a variable Variable

If you are getting unexpected responses from the API, see the errors section.

Caps

The caps resource is used to work with caps.

Method Resource Description
GET /caps List all caps
GET /caps/{id} Get a cap

^ back to top

List all caps

Get the counters for all active caps. Caps that haven't received lead traffic during the current interval will not be included.

Resource Information

Method GET
URL https://next.leadconduit.com/caps
MIME Types application/vnd.com/leadconduit.cap+json
Status Code 200
Authenticated? Yes
Reference Cap

^ back to top

Query parameters

Parameter Description Type
flow_id Return the caps where flow_id matches this value BSON ID

Example

The below example shows how to retrieve the status of all caps using the curl utility. The response body is truncated for brevity. See the cap reference for full details.

$ curl -v -X GET -uX:1234567890 -H 'Accept: application/vnd.com.leadconduit.cap+json' https://next.leadconduit.com/caps

> GET /caps HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.cap+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.cap+json
< date: Mon, 17 Jul 2017 15:17:14 GMT
< connection: keep-alive
< transfer-encoding: chunked
<
[
  {
    "id": "55d1f41b976c0bfb67e7a837",
    "name": "My Cap",
    ...
  },
  {
    "id": "55d23db2969983686ab09488",
    "name": "My Favorite Cap",
    ...
  }
]

^ back to top

Get a cap

Get a counter for a single cap.

Resource Information

Method GET
URL https://next.leadconduit.com/caps/{id}
MIME Type application/vnd.com.leadconduit.cap+json
Status Code 200
Authenticated? Yes
Reference Cap

^ back to top

Query parameters

None.

Example

The below example shows how to get an existing cap using the curl utility. See the cap reference for full details.

$ curl -v -X GET -uX:1234567890 -H'Accept: application/vnd.com.leadconduit.cap+json' https://next.leadconduit.com/caps/5b898b13cea36a21e4618dfa

> GET /caps/5b898b13cea36a21e4618dfa HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.0
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.credential+json
> 
< HTTP/1.1 200 OK
< Date: Mon, 19 Jun 2017 13:54:29 GMT
< content-type: application/vnd.com.leadconduit.credential+json; charset=utf-8
< Content-Length: 392
< Connection: keep-alive
< Vary: Accept, Accept-Encoding
< ETag: W/"1a0-VHKThBxJS+u8wqSKXxvPgGiPxa8"
< 
{
  "id": "5b898b13cea36a21e4618dfa",
  "name": null,
  "updated_at": "2017-04-22T21:18:09.832Z",
  ...
}

^ back to top

Changelogs

The /changelogs resource is used to work with changelogs.

Method Resource Description
GET /changelogs List all changelogs
GET /changelogs/{id} Get a changelog

^ back to top

List all changelogs

Get the list of all changelogs.

Resource Information

Method GET
URL https://next.leadconduit.com/changelogs
MIME Type application/vnd.com.leadconduit.changelog+json
Status Code 200
Authenticated? Yes
Reference Changelog

^ back to top

Query parameters

Parameter Description Type
after_id Return only changelogs that were created after the one with this ID (exclusive) BSON ID
before_id Return only changelogs that were created before the one with this ID (exclusive) BSON ID
start Return only changelogs that were created at or after this time Timestamp
end Return only changelogs that were created at or before this time Timestamp
type Return only changelogs with this type (flow, field or entity) String
flow_id Return the changelogs where current_revision._id matches this value. Can not be used in conjunction with field_id or entity_id. BSON ID
field_id Return the changelogs where current_revision._id matches this value. Can not be used in conjunction with flow_id or entity_id. BSON ID
entity_id Return the changelogs where current_revision._id matches this value. Can not be used in conjunction with field_id or field_id. BSON ID
action The action performed to cause the change (create, update or delete) String
user_id Return the changelogs where user.id matches this value. Use null to return changelogs that don't have a reference a user. BSON ID
limit The maximum number of changelogs to return (maximum limit is 1000, default 1000) Integer
sort The sort direction (asc or desc, default desc) String

Normally to retrieve a range of changelogs either before_id and after_id are used together or start and end are used together. However, if both before_id and end are specified, the lesser of the two will be used. If both after_id and start are specified, the greater of the two will be used.

If used as a sub-resource (i.e. /flows/{id}/changelog) and {type}_id is present, the id that will be used to query the changelogs will be from the url path, not from the query parameters. After a flow, field, or entity has been deleted, the changelogs cannot be obtained as a sub-resource, but can be obtained using the {type}_id query parameter.

^ back to top

Example

The below example shows how to get a list of all changelogs using the curl utility. The response body is truncated for brevity. See the changelog reference for full details.

$ curl -v -X GET -uX:1234567890 -H 'Accept: application/vnd.com.leadconduit.changelog+json' https://next.leadconduit.com/changelogs

> GET /changelogs HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.changelog+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.changelog+json
< date: Mon, 17 Aug 2015 19:59:14 GMT
< connection: keep-alive
< transfer-encoding: chunked
<
[
  {
    "id": "55d1f41b976c0bfb67e7a836",
    "type": "flow",
    "action": "create"
    ...
  },
  {
    "id": "55d365059cb27bd3e6b26b41",
    "type": "entity",
    "action": "update"
    ...
  }
]

^ back to top

Get a changelog

Fetch a single changelog.

Resource Information

Method GET
URL https://next.leadconduit.com/changelogs/{id}
MIME Type application/vnd.com.leadconduit.changelog+json
Status Code 200
Authenticated? Yes
Reference Changelog

^ back to top

Query parameters

None.

Example

The below example shows how to get an existing changelog using the curl utility. The response body is truncated for brevity. See the changelog reference for full details

$ curl -v -X GET \
       -uX:1234567890 \
       -H'Accept: application/vnd.com.leadconduit.changelog+json' \
       https://next.leadconduit.com/changelogs/55d364d3fb50690015cfca33

> GET /changelogs/55d364d3fb50690015cfca33 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.changelog+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.changelog+json; charset=utf-8
< content-length: 1269
< etag: W/"7tv5tV52dBzQjrhhQt4PYg=="
< date: Fri, 14 Aug 2015 20:12:59 GMT
< connection: keep-alive
<
{
  "id": "55d364d3fb50690015cfca33",
  "type": "flow",
  "action": "update"
  ...
}

^ back to top

Credentials

The /credentials resource is used to work with credentials.

Method Resource Description
GET /credentials List all credentials
POST /credentials/ Create a credential
GET /credentials/{id} Get a credential
PUT /credentials/{id} Update a credential
DELETE /credentials/{id} Delete a credential

^ back to top

List all credentials

Get the list of all credentials.

Resource Information

Method GET
URL https://next.leadconduit.com/credentials
MIME Type application/vnd.com.leadconduit.credential+json
Status Code 200
Authenticated? Yes
Reference Credential

Query parameters

None.

Example

The below example shows how to get a list of all credentials using the curl utility. See the credential reference for full details. Note that once a credential is stored, the API will not repeat it back to the caller.

$ curl -v -X GET -uX:1234567890 -H 'Accept: application/vnd.com.leadconduit.credential+json' https://next.leadconduit.com/credentials

> GET /credentials HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.credential+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.credential+json
< date: Mon, 19 Jun 2017 13:53:29 GMT
< connection: keep-alive
< transfer-encoding: chunked
<
[
  {
    "id": "59481e4f9e966175cdee5684",
    "type": "user",
    "package": "leadconduit-example1"
    "username": "***"
    "password": "**********"
  },
  {
    "id": "59481e48410cd275c9062c02",
    "type": "token",
    "package": "*************"
    "token": "******************************"
  },
  {
    "id": "59481e5965b64775cf82b94c",
    "type": "oauth",
    "package": "leadconduit-example2"
    "access_token": "*******************************************",
    "refresh_token": "*******************************************",
  }
]

^ back to top

Create a credential

Create a new credential.

Resource Information

Method POST
URL https://next.leadconduit.com/credentials
MIME Type application/vnd.com.leadconduit.credential+json
Status Code 201
Authenticated? Yes
Reference Credential

Query parameters

None.

Example

The below example shows how to create a new credential. See the credential reference for full details.

$ curl -v -X POST \
       -uX:1234567890 \
       -H 'Accept: application/vnd.com.leadconduit.credential+json' \
       -H 'Content-Type: application/vnd.com.leadconduit.credential+json' \
       -d@credential.json
       https://next.leadconduit.com/credentials/


> POST /credentials HTTP/1.1
> Host: next.leadconduit.com
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.54.0
> Accept: application/vnd.com.leadconduit.credential+json
> Content-Type: application/vnd.com.leadconduit.credential+json
> Content-Length: 96
>
< HTTP/1.1 201 Created
< Vary: Accept, Accept-Encoding
< Content-Type: application/vnd.com.leadconduit.credential+json; charset=utf-8
< ETag: W/"dc-A3ZYgTWQP4XcSBhYuHE2S6CMblo"
< Content-Length: 196
< Date: Tue, 11 Sep 2018 20:55:12 GMT
< Connection: keep-alive
<
{
  "id":"59481e4f9e966175cdee5684",
  "type":"token",
  "package":"leadconduit-example1",
  "token":"example_token",
  "name":"Example Account",
}

^ back to top

Get a credential

Fetch a single credential. Note that once a credential is stored, the API will not repeat it back to the caller.

Resource Information

Method GET
URL https://next.leadconduit.com/credentials/{id}
MIME Type application/vnd.com.leadconduit.credential+json
Status Code 200
Authenticated? Yes
Reference Credential

^ back to top

Query parameters

None.

Example

The below example shows how to get an existing credential using the curl utility. See the credential reference for full details. Note that once a credential is stored, the API will not repeat it back to the caller.

$ curl -v -X GET \
       -uX:1234567890 \
       -H'Accept: application/vnd.com.leadconduit.credential+json' \
       https://next.leadconduit.com/credentials/59481e4f9e966175cdee5684

> GET /credentials/55d364d3fb50690015cfca33 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.credential+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.credential+json; charset=utf-8
< content-length: 145
< etag: W/"7tv5tV52dBzQjrhhQt4PYg=="
< date: Mon, 19 Jun 2017 13:54:29 GMT
< connection: keep-alive
<
{
  "id": "59481e4f9e966175cdee5684",
  "type": "user",
  "package": "leadconduit-example1"
  "username": "***"
  "password": "**********"
}

^ back to top

Update a credential

Update an existing credential. Note that once a credential is stored, the API will not repeat it back to the caller.

Resource Information

Method PUT
URL https://next.leadconduit.com/credentials/{id}
MIME Type application/vnd.com.leadconduit.credential+json
Status Code 200
Authenticated? Yes
Reference Credential

^ back to top

Query parameters

None.

Example

The below example shows how to update an existing credential using the curl utility. See the credential reference for full details. Note that once a credential is stored, the API will not repeat it back to the caller.

$ curl -v -X PUT \
       -uX:1234567890 \
       -H'Content-Type: application/vnd.com.leadconduit.credential+json' \
       -H'Accept: application/vnd.com.leadconduit.credential+json' \
       -d@flow.json \
       https://next.leadconduit.com/credentials/59481e4f9e966175cdee5684

> PUT /credentials/59481e4f9e966175cdee5684 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.flow+json
> Content-Type: application/vnd.com.leadconduit.flow+json

< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.flow+json; charset=utf-8
< content-length: 157
< date: Mon, 19 Jun 2017 13:57:29 GMT
< connection: keep-alive
<
{
  "id": "59481e4f9e966175cdee5684",
  "type": "user",
  "package": "leadconduit-example1"
  "username": "*****"
  "password": "*************************"
}

^ back to top

Delete a credential

Delete an existing credential. If a credential is referenced in a flow and it is deleted, an HTTP 202 will be returned but that flow will continue to operate as though the credential still exists. The errors for each flow will be returned in the response body and the recorded on the flow's error property. Further changes to the flow must dereference the credential.

Resource Information

Method DELETE
URL https://next.leadconduit.com/credentials/{id}
MIME Type application/vnd.com.leadconduit.credentials+json
Status Code 200
Authenticated? Yes
Reference Credential

^ back to top

Example

The below example shows how to delete an existing credential using the curl utility.

$ curl -X DELETE -uX:1234567890 https://next.leadconduit.com/credential/59481e4f9e966175cdee5684

> DELETE /credential/59481e4f9e966175cdee5684 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.credential+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.credential+json; charset=utf-8
< content-length: 0
< date: Mon, 19 Jun 2017 13:57:29 GMT
< connection: keep-alive
<

The below example shows what happens when you delete a field that is in use in flow(s).

$ curl -X DELETE -uX:1234567890 https://next.leadconduit.com/credential/59481e4f9e966175cdee5684

> DELETE /credential/59481e4f9e966175cdee5684 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.credential+json
>
< HTTP/1.1 202 Accepted
< vary: Accept, Accept-Encoding
< content-type: application/json; charset=utf-8
< content-length: 192
< date: Mon, 19 Jun 2017 13:57:29 GMT
< connection: keep-alive
<
{
  "message": "1 flow has errors that need to be fixed",
  "results": {
    "count": 1,
    "success_flows": [],
    "error_flows": [
      {
        "id": "55d1f41b976c0bfb67e7a836",
        "name": "My Flow",
        "errors": {
          "steps": [
            "integration": {
              "mappings: [
                {
                  value": [ "Not a valid value" ]
                }
              ]
            }
          ]
        }
      }
    ]
  }
}

^ back to top

Entities

The /entities resource is used to work with entities.

Method Resource Description
GET /entities List all entities
GET /entities/{id} Get an entity
POST /entities/{id} Create an entity
PUT /entities/{id} Update an entity
DELETE /entities/{id} Delete an entity
GET /entities/{id}/changelogs List changelogs for an entity

^ back to top

List all entities

Get the list of all entities.

Resource Information

Method GET
URL https://next.leadconduit.com/entities
MIME Type application/vnd.com.leadconduit.entity+json
Status Code 200
Authenticated? Yes
Reference Entity

^ back to top

Query parameters

None.

Example

The below example shows how to get a list of all entities using the curl utility. The response body is truncated for brevity. See the entity reference for full details.

$ curl -v -X GET -uX:1234567890 -H 'Accept: application/vnd.com.leadconduit.entity+json' https://next.leadconduit.com/entities

> GET /entities HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.entity+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.entity+json
< date: Mon, 17 Aug 2015 19:59:14 GMT
< connection: keep-alive
< transfer-encoding: chunked
<
[
  {
    "id": "55d1f41b976c0bfb67e7a836",
    "name": "My Entity",
    ...
  },
  {
    "id": "55d365059cb27bd3e6b26b41",
    "name": "My Favorite Entity",
    ...
  }
]

^ back to top

Get an entity

Get a single entity.

Resource Information

Method GET
URL https://next.leadconduit.com/entities/{id}
MIME Type application/vnd.com.leadconduit.entity+json
Status Code 200
Authenticated? Yes
Reference Entity

^ back to top

Query parameters

None.

Example

The below example shows how to get an entity using the curl utility. The response body is truncated for brevity. See the entity reference for full details.

$ curl -v -X GET -uX:1234567890 -H 'Accept: application/vnd.com.leadconduit.entity+json' https://next.leadconduit.com/entities/55d1f41b976c0bfb67e7a836

> GET /entities/55d1f41b976c0bfb67e7a836 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.entity+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.entity+json
< date: Mon, 17 Aug 2015 19:59:14 GMT
< connection: keep-alive
< transfer-encoding: chunked
<
{
  "id": "55d1f41b976c0bfb67e7a836",
  "name": "My Entity",
  "flow_ids": [
    "55ce4e5538b57a7508b034c5"
  ]
  ...
}

^ back to top

Create an entity

Create a new entity, adding it to the list of all entities in the account.

Resource Information

Method POST
URL https://next.leadconduit.com/entities
MIME Type application/vnd.com.leadconduit.entity+json
Status Code 201
Authenticated? Yes
Reference Entity

^ back to top

Example

The below example shows how to create a new entity using the curl utility. The response body is truncated for brevity. See the entity reference for full details.

$ curl -v -X POST \
       -uX:1234567890 \
       -H'Content-Type: application/vnd.com.leadconduit.entity+json' \
       -H'Accept: application/vnd.com.leadconduit.entity+json' \
       -d@entity.json \
       https://next.leadconduit.com/entities

> POST /entities HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.entity+json
> Content-Type: application/vnd.com.leadconduit.entity+json

< HTTP/1.1 201 Created
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.entity+json; charset=utf-8
< content-length: 1279
< date: Mon, 17 Aug 2015 14:47:55 GMT
< connection: keep-alive
<
{
  "id": "55d1f41b976c0bfb67e7a836",
  "name": "My Entity",
  ...
}

^ back to top

Update an entity

Update an existing entity. Standard entities cannot be updated unless it is your own account entity.

Resource Information

Method PUT
URL https://next.leadconduit.com/entities/{id}
MIME Type application/vnd.com.leadconduit.entity+json
Status Code 200
Authenticated? Yes
Reference Entity

^ back to top

Example

The below example shows how to update an existing entity using the curl utility. The response body is truncated for brevity. See the entity reference for full details.

$ curl -v -X PUT \
       -uX:1234567890 \
       -H'Content-Type: application/vnd.com.leadconduit.entity+json' \
       -H'Accept: application/vnd.com.leadconduit.entity+json' \
       -d@entity.json \
       https://next.leadconduit.com/entities/55d1f41b976c0bfb67e7a836

> PUT /entities/55d1f41b976c0bfb67e7a836 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.entity+json
> Content-Type: application/vnd.com.leadconduit.entity+json

< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.entity+json; charset=utf-8
< content-length: 1279
< date: Mon, 17 Aug 2015 14:51:55 GMT
< connection: keep-alive
<
{
  "id": "55d1f41b976c0bfb67e7a836",
  "name": "My Entity",
  ...
}

^ back to top

Delete an entity

Delete an existing entity. If an entity is configured as a source or recipient in a flow and it is deleted, an HTTP 202 will be returned and that flow will continue to operate as though the entity still exists. The errors for each flow will be returned in the response body and the recorded on the flow's error property. Further changes to the flow must include the removal of the entity.

Resource Information

Method DELETE
URL https://next.leadconduit.com/entities
MIME Type application/json
Status Code 200 or 202
Authenticated? Yes
Reference Entity

^ back to top

Example

The below example shows how to delete an existing entity using the curl utility.

$ curl -v -X DELETE \
       -uX:1234567890 \
       -H'Accept: application/json' \
       https://next.leadconduit.com/entities/55d364d3fb50690015cfca33

> DELETE /entities/55d364d3fb50690015cfca33 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.entity+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.entity+json; charset=utf-8
< content-length: 0
< date: Fri, 14 Aug 2015 20:12:59 GMT
< connection: keep-alive
<

The below example shows what happens when you delete an entity that is in use as a source or recipient in flow(s).

$ curl -v -X DELETE \
       -uX:1234567890 \
       -H'Accept: application/json' \
       https://next.leadconduit.com/entities/55d364d3fb50690015cfca33

> DELETE /entities/55479a2afbec3d235e65965f HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/json
>
< HTTP/1.1 202 Accepted
< vary: Accept, Accept-Encoding
< content-type: application/json; charset=utf-8
< content-length: 192
< date: Tue, 18 Aug 2015 17:09:29 GMT
< connection: keep-alive
<
{
  "message": "2 flows have errors that need to be fixed",
  "results": {
    "count": 2,
    "success_flows": [],
    "error_flows": [
      {
        "id": "55d1f41b976c0bfb67e7a836",
        "name": "My Flow",
        "errors": {
          "sources": {
            "0": {
              "entity": {
                "id": [
                  "Unknown source"
                ]
              }
            }
          }
        }
      },
      {
        "id": "55d23db2969983686ab09487",
        "name": "My Favorite Flow",
        "errors": {
          "sources": {
            "0": {
              "entity": {
                "id": [
                  "Unknown source"
                ]
              }
            }
          }
        }
      }
    ]
  }
}

^ back to top

Events

The /events resource is used to query events generated while handling leads. For each lead, one event is generated for each configured flow step that handles the lead. After lead processing completes, a source event is also recorded.

Resource Information

Method GET
URL https://next.leadconduit.com/events
MIME Type application/vnd.com.leadconduit.event+json
Status Code 200
Authenticated? Yes
Reference Event

^ back to top

Query parameters

Parameter Description Type
after_id Return only events that were created after the one with this ID (exclusive) BSON ID
before_id Return only events that were created before the one with this ID (exclusive) BSON ID
start Return only events that were created at or after this time Timestamp
end Return only events that were created at or before this time Timestamp
type Return only events with this type (source, recipient, filter, feedback-received, or feedback-sent). Can be used multiple times to specify multiple types. String
lead_id Return the events where vars.lead.id matches this value BSON ID
reference Return the events where vars.lead.reference matches this value String
flow_id Return the events where vars.flow.id matches this value BSON ID
source_id Return the events where vars.source.id matches this value BSON ID
recipient_id Return the events where vars.recipient.id matches this value (recipient events only) BSON ID
outcome Return events with this outcome (success, failure, error, stop, continue String
limit The maximum number of events to return (maximum limit is 1000, default 1000) Integer
sort The sort direction (asc or desc, default desc) String
include A field to include. Can be used multiple times to include multiple fields. Cannot be used with exclude. String
exclude A field to exclude. Can be used multiple times to exclude mulitple fields. Cannot be used with include. String

Normally to retrieve a range of events either before_id and after_id are used together or start and end are used together. However, if both before_id and end are specified, the lesser of the two will be used. If both after_id and start are specified, the greater of the two will be used.

^ back to top

Example

$ curl -X GET -uX:1234567890 https://next.leadconduit.com/events

> GET /events HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/json; charset=utf-8
< content-length: 123
< etag: W/"7tv5tV52dBzQjrhhQt4PYg=="
< date: Fri, 14 Aug 2015 20:15:12 GMT
< connection: keep-alive
<

[
  {
    "id": "56f3510ee3d4b787f8befccd",
    "outcome": "success",
    "type": "source",
    "vars": {
      "lead": {
         "first_name": "Bob",
         "email": {
            "raw": "BOB@Totmail.com",
            "normal": "bob@hotmail.com",
            "user": "bob",
            "domain": "hotmail.com",
            "tld": "com",
            "valid": true
         }
      }
    }
    ...
  },
  {
    ...
  }
]

Event Statistics

The /events/stats resource is used to count events, broken out by outcome (success, failure, error). The event count can grouped by any field collected with the lead or appended to the lead during flow processing. The API also supports returning results in JSON or CSV using the appropriate MIME type in the Accept header.

Resource Information

Method GET
URL https://next.leadconduit.com/events/stats
MIME Type application/json or text/csv
Status Code 200
Authenticated? Yes
Reference Event Statistics

^ back to top

Query parameters

Parameter Description Type
type Convenience option that specifies a filter on event type (source, recipient, filter, feedback-received, or feedback-sent). Can be used multiple times to specify multiple types. (default: source) String
rule Limit counted events using this rule. Can be used multiple times to specify multiple rules. Each rule must be sent as URL encoded JSON. Event Statistics Filter Rule
group_by Group event counts by unique values of this property. Can be used multiple times to specify multiple properties. (default: none) String
interval Groups event counts into sub-timeframes spanning a specified length of time: minutely, hourly, daily, weekly, monthly, yearly (default: none) String
timezone When an interval is specified, this time zone will be used to set the start and end of each interval Any tz database time zone name (i.e. America/Chicago) or the number of seconds to offset time from UTC (i.e. -18000)
start Count events that were created at or after this time (default: beginning of the day today) Timestamp
end Count events that were created at or before this time (default: end of the day today) Timestamp
outcome DEPRECATED: use column instead. The outcome to count (default: success, failure, error). Can be used multiple times to specify multiple types. String
column A column to aggregate. Can be used multiple times to specify multiple columns. source-success, source-failure, source-error
by_lead Boolean indicating whether to count unique leads or unique events - false counts individual events (default: true) Boolean

^ back to top

Event Statistics Columns

Columns

The following columns are supported. The default columns are source-success, source-failure, and source-error.

The {{outcome}} placeholders can be replaced with any outcome: success, failure, error, or submitted. The submitted outcome isn't a true outcome and represents the success, failure, and error outcomes as one. The {{feedback type}} placeholders can be replaced with any feedback type. Currently the feedback types supported by the LeadConduit UI are return and conversion. The {{event type}} placeholders can be replaced with: source, recipient, filter, feedback-received, or feedback-sent.

^ back to top

Example

This is a basic stats query which groups on an arbitrary field value. You can use multiple group_by parameters to group by as many fields as necessary. This example groups on the state abbreviation.

$ curl -X GET -uX:1234567890 -H 'Accept: application/json' 'https://next.leadconduit.com/events/stats?group_by=vars.lead.state.abbr'

> GET /events/stats HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/json; charset=utf-8
< content-length: 772
< etag: W/"7tv5tV52dBzQjrhhQt4PYg=="
< date: Mon, 02 Sep 2017 10:23:49 GMT
< connection: keep-alive
<

[
  {
    "total": 12,
    "success": 8,
    "failure": 2,
    "error": 2,
    "vars.lead.state.abbr": "TX"
  },
  {
    "total": 7,
    "success": 6,
    "failure": 1,
    "error": 0,
    "vars.lead.state.abbr": "MI"
  },
  {
    ...
  }
]

To group fields into intervals, use the interval parameter. Each row in the result set now contains the start and end properties which define the time interval for that row. The below example shows what the results set would look like when specifying a daily interval. The start and end parameters tell the API to return counts starting at the beginning of 2017-09-01 and ending at the end of 2017-09-15.

$ curl -X GET -uX:1234567890 \
       -H 'Accept: application/json' \
       'https://next.leadconduit.com/events/stats?start=2017-09-02T04%3A00%3A00&end=2017-09-15T3%3A59%3A59interval=daily'

> GET /events/stats HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/json; charset=utf-8
< content-length: 772
< etag: W/"7tv5tV52dBzQjrhhQt4PYg=="
< date: Mon, 02 Sep 2017 11:15:41 GMT
< connection: keep-alive
<

[
  {
    "total": 9,
    "success": 8,
    "failure": 1,
    "error": 0,
    "start": "2017-09-02T04:00:00.000Z",
    "end": "2017-09-03T3:59:59.000Z"
  },
  {
    "total": 5,
    "success": 4,
    "failure": 1,
    "error": 0,
    "start": "2017-09-01T04:00:00.000Z",
    "end": "2017-09-02T3:59:59.000Z"
  },
  {
    ...
  }
]

^ back to top

Fields

The /fields resource is used to work with fields.

Method Resource Description
GET /fields List all fields
POST /fields Create a field
PUT /fields/{id} Update a field
DELETE /fields/{id} Delete a field
GET /fields/{id}/changelogs List changelogs for a field

^ back to top

List all fields

Get the list of all fields, including all standard and custom fields.

Resource Information

Method GET
URL https://next.leadconduit.com/fields
MIME Type application/vnd.com.leadconduit.field+json
Status Code 200
Authenticated? Yes
Reference Field

^ back to top

Query parameters

None.

Example

The below example shows how to get a list of all fields using the curl utility. The response body is truncated for brevity. See the field reference for full details.

$ curl -v -X GET -uX:1234567890 -H 'Accept: application/vnd.com.leadconduit.field+json' https://next.leadconduit.com/fields

> GET /fields HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.field+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.field+json
< date: Mon, 17 Aug 2015 20:11:01 GMT
< connection: keep-alive
< transfer-encoding: chunked
<
[
  {
    "id": "address_1",
    "type": "street",
    "name": "Address 1",
    "description": "Address 1",
    "standard": true
  },
  {
    "id": "address_2",
    "type": "string",
    "name": "Address 2",
    "description": "Address 2",
    "standard": true
  },
  ...
]

^ back to top

Create a field

Create a new custom field, adding it to the list of all fields in the account.

Resource Information

Method POST
URL https://next.leadconduit.com/fields
MIME Type application/vnd.com.leadconduit.field+json
Status Code 201
Authenticated? Yes
Reference Field

^ back to top

Example

The below example shows how to create a new field using the curl utility.

$ curl -v -X POST \
       -uX:1234567890 \
       -H'Content-Type: application/vnd.com.leadconduit.field+json' \
       -H'Accept: application/vnd.com.leadconduit.field+json' \
       -d@field.json \
       https://next.leadconduit.com/fields

> POST /fields HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.field+json
> Content-Type: application/vnd.com.leadconduit.field+json

< HTTP/1.1 201 Created
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.field+json; charset=utf-8
< content-length: 213
< date: Mon, 17 Aug 2015 14:47:55 GMT
< connection: keep-alive
<
{
  "id": "my_custom_field",
  "name": "My Custom Field",
  "description": "This is my very first custom field",
  "type": "string",
  "created_at": "2015-08-18T13:49:01.795Z",
  "updated_at": "2015-08-18T13:49:01.795Z",
  "standard": false
}

^ back to top

Update a field

Update an existing custom field. Standard fields cannot be updated.

Resource Information

Method PUT
URL https://next.leadconduit.com/fields/{id}
MIME Type application/vnd.com.leadconduit.field+json
Status Code 200
Authenticated? Yes
Reference Field

^ back to top

Example

The below example shows how to update an existing field using the curl utility.

$ curl -v -X PUT \
       -uX:1234567890 \
       -H'Content-Type: application/vnd.com.leadconduit.field+json' \
       -H'Accept: application/vnd.com.leadconduit.field+json' \
       -d@field.json \
       https://next.leadconduit.com/fields/my_custom_field

> PUT /fields/my_custom_field HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.field+json
> Content-Type: application/vnd.com.leadconduit.field+json

< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.field+json; charset=utf-8
< content-length: 191
< date: Mon, 17 Aug 2015 14:51:55 GMT
< connection: keep-alive
<
{
  "id": "my_custom_field",
  "name": "A new name",
  "description": "A new description",
  "type": "string",
  "created_at": "2015-08-18T13:49:01.795Z",
  "updated_at": "2015-08-18T13:52:01.795Z",
  "standard": false
}

^ back to top

Get a field

Fetch a single field.

Resource Information

Method GET
URL https://next.leadconduit.com/fields/{id}
MIME Type application/vnd.com.leadconduit.field+json
Status Code 200
Authenticated? Yes
Reference Field

^ back to top

Query parameters

None.

Example

The below example shows how to get an existing field using the curl utility.

$ curl -v -X GET \
       -uX:1234567890 \
       -H'Accept: application/vnd.com.leadconduit.field+json' \
       https://next.leadconduit.com/fields/my_custom_field

> GET /fields/my_custom_field HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.field+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.field+json; charset=utf-8
< content-length: 191
< date: Fri, 14 Aug 2015 20:14:12 GMT
< connection: keep-alive
<
{
  "id": "my_custom_field",
  "name": "A new name",
  "description": "A new description",
  "type": "string",
  "created_at": "2015-08-18T13:49:01.795Z",
  "updated_at": "2015-08-18T13:52:01.795Z",
  "standard": false
}

^ back to top

Delete a field

Delete an existing custom field. If a field is referenced in a flow and it is deleted, an HTTP 202 will be returned but that flow will continue to operate as though the field still exists. The errors for each flow will be returned in the response body and the recorded on the flow's error property. Further changes to the flow must dereference the field.

Standard fields cannot be deleted.

Resource Information

Method DELETE
URL https://next.leadconduit.com/fields/{id}
MIME Type application/vnd.com.leadconduit.field+json
Status Code 200
Authenticated? Yes
Reference Field

^ back to top

Example

The below example shows how to delete an existing field using the curl utility.

$ curl -X DELETE -uX:1234567890 https://next.leadconduit.com/fields/my_custom_field

> DELETE /fields/my_custom_field HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.field+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.field+json; charset=utf-8
< content-length: 0
< date: Fri, 14 Aug 2015 20:12:59 GMT
< connection: keep-alive
<

The below example shows what happens when you delete a field that is in use in flow(s).

$ curl -v -X DELETE \
       -uX:1234567890 \
       -H'Accept: application/json' \
       https://next.leadconduit.com/fields/my_custom_field

> DELETE /fields/my_custom_field HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/json
>
< HTTP/1.1 202 Accepted
< vary: Accept, Accept-Encoding
< content-type: application/json; charset=utf-8
< content-length: 192
< date: Tue, 18 Aug 2015 17:09:29 GMT
< connection: keep-alive
<
{
  "message": "1 flow has errors that need to be fixed",
  "results": {
    "count": 1,
    "success_flows": [],
    "error_flows": [
      {
        "id": "55d1f41b976c0bfb67e7a836",
        "name": "My Flow",
        "errors": {
          "fields": {
            "4": [ "Unknown field" ]
          }
        }
      }
    ]
  }
}

^ back to top

Flows

The /flows resource is used to work with flows.

Method Resource Description
GET /flows List all flows
POST /flows/{id} Create a flow
PUT /flows/{id} Update a flow
POST /flows/{id}/deploy Deploy a flow
GET /flows/{id} Get a flow
DELETE /flows/{id} Delete a flow
GET /flows/{id}/changelogs List changelogs for a flow

^ back to top

List all flows

Get the list of all flows.

Resource Information

Method GET
URL https://next.leadconduit.com/flows
MIME Type application/vnd.com.leadconduit.flow+json
Status Code 200
Authenticated? Yes
Reference Flow

^ back to top

Query parameters

None.

Example

The below example shows how to get a list of all flows using the curl utility. The response body is truncated for brevity. See the flow reference for full details.

$ curl -v -X GET -uX:1234567890 -H 'Accept: application/vnd.com.leadconduit.flow+json' https://next.leadconduit.com/flows

> GET /flows HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.flow+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.flow+json
< date: Mon, 17 Aug 2015 19:59:14 GMT
< connection: keep-alive
< transfer-encoding: chunked
<
[
  {
    "id": "55d1f41b976c0bfb67e7a836",
    "name": "My Flow",
    ...
  },
  {
    "id": "55d23db2969983686ab09487",
    "name": "My Favorite Flow",
    ...
  }
]

^ back to top

Create a flow

Create a new flow, adding it to the list of all flows in the account. The caller may specify an ID for a flow, provided it is a valid BSON ID.

Resource Information

Method POST
URL https://next.leadconduit.com/flows
MIME Type application/vnd.com.leadconduit.flow+json
Status Code 201
Authenticated? Yes
Reference Flow

^ back to top

Example

The below example shows how to create a new flow using the curl utility. The response body is truncated for brevity. See the flow reference for full details.

$ curl -v -X POST \
       -uX:1234567890 \
       -H'Content-Type: application/vnd.com.leadconduit.flow+json' \
       -H'Accept: application/vnd.com.leadconduit.flow+json' \
       -d@flow.json \
       https://next.leadconduit.com/flows/55d1f41b976c0bfb67e7a836

> POST /flows/55ce4e5538b57a7508b034c5 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.flow+json
> Content-Type: application/vnd.com.leadconduit.flow+json

< HTTP/1.1 201 Created
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.flow+json; charset=utf-8
< content-length: 1279
< date: Mon, 17 Aug 2015 14:47:55 GMT
< connection: keep-alive
<
{
  "id": "55d1f41b976c0bfb67e7a836",
  "name": "My Flow",
  ...
}

^ back to top

Update a flow

Update an existing flow.

Resource Information

Method PUT
URL https://next.leadconduit.com/flows/{id}
MIME Type application/vnd.com.leadconduit.flow+json
Status Code 200
Authenticated? Yes
Reference Flow

^ back to top

Example

The below example shows how to update an existing flow using the curl utility. The response body is truncated for brevity. See the flow reference for full details.

$ curl -v -X PUT \
       -uX:1234567890 \
       -H'Content-Type: application/vnd.com.leadconduit.flow+json' \
       -H'Accept: application/vnd.com.leadconduit.flow+json' \
       -d@flow.json \
       https://next.leadconduit.com/flows/55d1f41b976c0bfb67e7a836

> PUT /flows/55ce4e5538b57a7508b034c5 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.flow+json
> Content-Type: application/vnd.com.leadconduit.flow+json

< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.flow+json; charset=utf-8
< content-length: 1279
< date: Mon, 17 Aug 2015 14:51:55 GMT
< connection: keep-alive
<
{
  "id": "55d1f41b976c0bfb67e7a836",
  "name": "My Flow",
  ...
}

^ back to top

Deploy a flow

A flow defines how lead submissions will be handled. In order to make a flow's latest state active for lead handling, it must be deployed. Because changes to a flow can be made with out deploying them, you are free make flow updates without affecting current lead handling. Put another way, a deploy must be performed after it is created or updated in order for lead handling to start using the new configuration.

Resource Information

Method POST
URL https://next.leadconduit.com/flows/{id}/deploy
Status Code 200
Authenticated? Yes

^ back to top

Example

The below example shows how to deploy a flow using the curl utility.

$ curl -v -X POST \
       -uX:1234567890 \
       https://next.leadconduit.com/flows/55ce4e5538b57a7508b034c5/deploy

> POST /flows/55d1f41b976c0bfb67e7a836/deploy HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: */*
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/json; charset=utf-8
< content-length: 77
< date: Tue, 18 Aug 2015 15:05:30 GMT
< connection: keep-alive
<
{"message":"Your flow was deployed and the most recent changes are now live"}

Get a flow

Fetch a single flow.

Resource Information

Method GET
URL https://next.leadconduit.com/flows/{id}
MIME Type application/vnd.com.leadconduit.flow+json
Status Code 200
Authenticated? Yes
Reference Flow

^ back to top

Query parameters

None.

Example

The below example shows how to get an existing flow using the curl utility. The response body is truncated for brevity. See the flow reference for full details

$ curl -v -X GET \
       -uX:1234567890 \
       -H'Accept: application/vnd.com.leadconduit.flow+json' \
       https://next.leadconduit.com/flows/55ce4e5538b57a7508b034c5

> GET /flows/55ce4e5538b57a7508b034c5 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.flow+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.flow+json; charset=utf-8
< content-length: 1269
< etag: W/"7tv5tV52dBzQjrhhQt4PYg=="
< date: Fri, 14 Aug 2015 20:12:59 GMT
< connection: keep-alive
<
{
  "id": "55ce4e5538b57a7508b034c5",
  "name": "My first flow",
  ...
}

^ back to top

Delete a flow

Delete an existing flow. Once a flow is deleted it will no longer accept leads. Attempting to submit leads to a deleted flow will result in an HTTP 404.

Resource Information

Method DELETE
URL https://next.leadconduit.com/flows/{id}
MIME Type application/vnd.com.leadconduit.flow+json
Status Code 200
Authenticated? Yes
Reference Flow

^ back to top

Example

The below example shows how to delete an existing flow using the curl utility. The response body is truncated for brevity. See the flow reference for full details.

$ curl -X DELETE -uX:1234567890 https://next.leadconduit.com/flows/55ce4e5538b57a7508b034c5

> DELETE /flows/55ce4e5538b57a7508b034c5 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.flow+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.flow+json; charset=utf-8
< content-length: 1269
< etag: W/"7tv5tV52dBzQjrhhQt4PYg=="
< date: Fri, 14 Aug 2015 20:12:59 GMT
< connection: keep-alive
<

^ back to top

Get flow fields

List the full detail of fields being used in a flow.

Resource Information

Method GET
URL https://next.leadconduit.com/flows/{id}/fields
MIME Type application/vnd.com.leadconduit.field+json
Status Code 200
Authenticated? Yes
Reference Field

^ back to top

Example

The below example shows how to get all the fields used in a flow using the curl utility. The response body is truncated for brevity. See the field reference for full details.

$ curl -X GET -uX:1234567890 https://next.leadconduit.com/flows/55ce4e5538b57a7508b034c5/fields

> GET /flows/55ce4e5538b57a7508b034c5/fields HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.field+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.flow+json; charset=utf-8
< content-length: 456
< etag: W/"7tv5tV52dBzQjrhhQt4PYg=="
< date: Fri, 14 Aug 2015 20:12:59 GMT
< connection: keep-alive
<

[
  {
    "id": "phone_1",
    "name": "Phone 1",
    "description": "Phone number 1",
    "type": "phone"
  },
  {
    "email": "email",
    "name": "Email",
    "description": "Email address",
    "type": "email"
  }
  ...
]

^ back to top

Get flow field usages

Count the number of leads processed by flow field. This tells you which how much each flow field was used today. You can change the timeframe using the timeframe parameter (i.e. timeframe=previous_30_days), though this is discouraged because this query is fairly heavy.

Resource Information

Method GET
URL https://next.leadconduit.com/flows/{id}/fields/usage
MIME Type application/json
Status Code 200
Authenticated? Yes

^ back to top

Example

The below example shows how to get the field usage for a flow using the curl utility.

$ curl -X GET -uX:1234567890 https://next.leadconduit.com/flows/55ce4e5538b57a7508b034c5/fields/usage

> GET /flows/55ce4e5538b57a7508b034c5/fields HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/json; charset=utf-8
< content-length: 123
< etag: W/"7tv5tV52dBzQjrhhQt4PYg=="
< date: Fri, 14 Aug 2015 20:15:12 GMT
< connection: keep-alive
<

{
  "first_name": 534,
  "last_name": 519,
  "email": 522,
  "phone_1": 534
}

^ back to top

Modules

The /modules resource is used to list integration modules.

Method Resource Description
GET /modules List all modules

^ back to top

List all modules

Get the list of all integration modules.

Resource Information

Method GET
URL https://next.leadconduit.com/modules
MIME Type application/vnd.com.leadconduit.module+json
Status Code 200
Authenticated? Optional
Reference Module

^ back to top

Query parameters

None.

Example

The below example shows how to get a list of all modules using the curl utility. The response body is truncated for brevity. See the module reference for full details.

$ curl -v -X GET -uX:1234567890 -H 'Accept: application/vnd.com.leadconduit.module+json' https://next.leadconduit.com/modules

> GET /modules HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.module+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.module+json
< date: Mon, 17 Dec 2017 11:12:01 GMT
< connection: keep-alive
< transfer-encoding: chunked
<
[
  {
    "id": "leadconduit-activecampaign.outbound.post",
    "name": "Contact Add",
    ...
  },
  {
    "id": "leadconduit-anura.outbound.fraud_check",
    "name": "Fraud Check",
    ...
  },
  ...
]

^ back to top

Packages

The /packages resource is used to list integration packages.

Method Resource Description
GET /packages List all packages
GET /packages/{module-id} Get a package

^ back to top

List all packages

Get the list of all integration packages.

Resource Information

Method GET
URL https://next.leadconduit.com/packages
MIME Type application/vnd.com.leadconduit.package+json
Status Code 200
Authenticated? Optional
Reference Package

^ back to top

Query parameters

None.

Example

The below example shows how to get a list of all packages using the curl utility. The response body is truncated for brevity. See the package reference for full details.

$ curl -v -X GET -uX:1234567890 -H 'Accept: application/vnd.com.leadconduit.package+json' https://next.leadconduit.com/packages

> GET /packages HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.package+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.package+json
< date: Tues, 18 May 2018 10:29:15 GMT
< connection: keep-alive
< transfer-encoding: chunked
<
[
  {
    "id": "leadconduit-activecampaign",
    "provider": "ActiveCampaign",
    "name": "ActiveCampaign",
    "description": "<p>Email Marketing - Marketing Automation - Sales Automation.</p>\n",
    "link": "https://activecampaign.com/",
    "version": "1.0.5",
    "ui": true,
    "images": true,
    "integrations": [
      {
        "id": "leadconduit-activecampaign.outbound.post",
        "name": "Contact Add",
        "type": "delivery",
        "direction": "outbound",
        "feedback": false,
        "median_wait_ms": 467,
        "pricing": {
          "type": "flat",
          "unit": "event",
          "unit_price": "0.05",
          "transaction": true
        },
        "request_variables": [
          {
            "name": "activecampaign.account",
            "type": "string",
            "required": true,
            "description": "ActiveCampaign account name"
          },
          {
            "name": "activecampaign.api_key",
            "type": "string",
            "required": true,
            "description": "ActiveCampaign API key"
          },
          {
            "name": "activecampaign.list_id",
            "type": "string",
            "required": true,
            "description": "ActiveCampaign list ID"
          },
          {
            "name": "lead.first_name",
            "type": "string",
            "required": false,
            "description": "First name"
          },
          {
            "name": "lead.last_name",
            "type": "string",
            "required": false,
            "description": "Last name"
          },
          {
            "name": "lead.email",
            "type": "email",
            "required": true,
            "description": "Email address"
          },
          ...
        ],
        "response_variables": [
          {
            "name": "outcome",
            "type": "string",
            "description": "The outcome of the post"
          },
          {
            "name": "reason",
            "type": "string",
            "description": "If the outcome was not success, this is the reason"
          }
        ]
      }
    ]
  },
  {
    "id": "leadconduit-anura",
    "provider": "Anura",
    "name": "Anura",
    "description": "<p>Use an IP Address and User-Agent to identify fraudulent leads in real-time.</p>\n",
    "link": "https://anura.io/",
    "version": "0.1.4",
    "ui": false,
    "images": true,
    "integrations": [
      {
        "id": "leadconduit-anura.outbound.fraud_check",
        "name": "Fraud Check",
        "type": "marketplace enhancement",
        "entity_id": "59f76b038778a76f214aa3f1",
        "direction": "outbound",
        "feedback": false,
        "median_wait_ms": 198,
        "pricing": {
          "type": "flat",
          "unit": "append",
          "unit_price": "0.01",
          "transaction": false
        },
        "request_variables": [
          {
            "name": "lead.ip_address",
            "type": "string",
            "required": true,
            "description": "IP address field from the submitted lead, or from a prior TrustedForm claim"
          },
          {
            "name": "lead.user_agent",
            "type": "string",
            "required": false,
            "description": "User agent string from the submitted lead, or from a prior TrustedForm claim"
          },
          {
            "name": "timeout_seconds",
            "type": "number",
            "description": "Produce an \"error\" outcome if the server fails to respond within this number of seconds (default: 360)",
            "required": false
          }
        ],
        "response_variables": [
          {
            "name": "outcome",
            "type": "string",
            "description": "The outcome of the post"
          },
          {
            "name": "reason",
            "type": "string",
            "description": "If the outcome was not success, this is the reason"
          },
          {
            "name": "billable",
            "type": "number",
            "description": "Number of transactions to be billed"
          },
          {
            "name": "is_suspect",
            "type": "boolean",
            "description": "Whether or not the visitor is suspect"
          }
        ]
      }
    ]
  },
  ...
]

^ back to top

Get a package

Fetch a single integration package.

Resource Information

Method GET
URL https://next.leadconduit.com/packages/{module-id}
MIME Type application/vnd.com.leadconduit.package+json
Status Code 200
Authenticated? Optional
Reference Package

^ back to top

Query parameters

None.

Example

The below example shows how to fetch a package using the curl utility. The response body is truncated for brevity. See the package reference for full details.

$ curl -v -X GET -H 'Accept: application/vnd.com.leadconduit.package+json' https://next.leadconduit.com/packages/leadconduit-trustedform

> GET /packages/leadconduit-trustedform HTTP/1.1
> User-Agent: curl/7.54.0
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.package+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.package+json
< date: Tue, 09 Oct 2018 15:53:05 GMT
< connection: keep-alive
<
{
  "id": "leadconduit-trustedform",
  "provider": "ActiveProspect",
  "name": "TrustedForm",
  "description": "<p>Independently verify the origin of Internet leads with a real-time replay of the web form as seen by the consumer.</p>\n",
  "link": "https://activeprospect.com/products/trustedform/",
  "version": "1.9.2",
  "ui": false,
  "images": true,
  "integrations": [
    {
      "id": "leadconduit-trustedform.outbound.claim",
      "name": "TrustedForm",
      "tag": "TCPA",
      "type": "marketplace enhancement",
      "description": "<p>Claim certificates to append associated lead origin data, scan web page for text, and store for legal (TCPA) compliance.</p>\n",
      "entity_id": "535e9f8c94149d05b5000002",
      "direction": "outbound",
      "feedback": false,
      "median_wait_ms": 416.4946013843397,
      "request_variables": [
        {
          "name": "lead.trustedform_cert_url",
          "type": "string",
          "required": true,
          "description": "TrustedForm Certificate URL"
        },
        {
          "name": "trustedform.scan_required_text",
          "type": "array",
          "required": false,
          "description": "Required text to search snapshot for"
        },
        {
          "name": "trustedform.api_key",
          "type": "credential",
          "required": false,
          "description": "Optional TrustedForm API key. Used for claiming certs that belong to another account"
        },
        {
          "name": "lead.email",
          "type": "string",
          "required": false,
          "description": "Lead email that will be fingerprinted, defaults to the lead's \"Email\" field"
        },
        ...
      ],
      "response_variables": [
        {
          "name": "outcome",
          "type": "string",
          "description": "certificate claim result"
        },
        {
          "name": "reason",
          "type": "string",
          "description": "in case of failure, the reason for failure"
        },
        {
          "name": "user_agent",
          "type": "string",
          "description": "Consumer browsers user-agent"
        },
        {
          "name": "browser",
          "type": "string",
          "description": "Human friendly version of user-agent"
        },
        ...
      ]
    }
  ]
}

^ back to top

Reports

The /reports resource is used to work with reports.

Method Resource Description
GET /reports List all reports
POST /reports Create a report
PUT /reports/{id} Update a report
DELETE /reports/{id} Delete a report
POST /reports/preview Preview a report
GET /reports/{id}/run Run a report

^ back to top

List all reports

Get the list of all reports.

Resource Information

Method GET
URL https://next.leadconduit.com/reports
MIME Type application/json
Status Code 200
Authenticated? Yes
Reference report

^ back to top

Query parameters

None.

Example

The below example shows how to get a list of all reports using the curl utility. The response body is truncated for brevity. See the report reference for full details.

$ curl -v -X GET -uX:1234567890 -H 'Accept: application/json' https://next.leadconduit.com/reports

> GET /reports HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.54.1
> Host: next.leadconduit.com
> Accept: application/json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/json
< Date: Wed, 07 Nov 2018 19:04:33 GMT
< connection: keep-alive
< transfer-encoding: chunked
<
[
  {
    "id": "55d1f41b976c0bfb67e7a836",
    "name": "Stats by Source",
    ...
  },
  {
    "id": "55d365059cb27bd3e6b26b41",
    "name": "Stats by Recipient",
    ...
  }
]

^ back to top

Create a report

Create a new report, adding it to the list of all reports in the account.

Resource Information

Method POST
URL https://next.leadconduit.com/reports
MIME Type application/json
Status Code 201
Authenticated? Yes
Reference report

^ back to top

Example

The below example shows how to create a new report using the curl utility. The response body is truncated for brevity. See the report reference for full details.

$ curl -v -X POST \
       -uX:1234567890 \
       -H'Content-Type: application/json' \
       -H'Accept: application/json' \
       -d '{
            "name": "source report",
            "columns": ["source", "source-success", "source-failure", "source-error"],
            "group_by": ["vars.source.id"]
        }'
       https://next.leadconduit.com/reports

> POST /reports HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.54.1
> Host: next.leadconduit.com
> Accept: application/json
> Content-Type: application/json

< HTTP/1.1 201 Created
< vary: Accept, Accept-Encoding
< content-type: application/json; charset=utf-8
< content-length: 249
< Date: Wed, 07 Nov 2018 19:04:33 GMT
< connection: keep-alive
<
{
  "id": "5bec7411e58d4711f3a0850a",
  "name": "source report",
  "columns":["source","source-success","source-failure","source-error"],
  "group_by": ["vars.source.id"],
  "token": null,
  "created_at": "2018-11-06T19:14:25.336Z",
  "updated_at": "2018-11-06T19:14:25.336Z"
}

^ back to top

Update a report

Update an existing report.

Resource Information

Method PUT
URL https://next.leadconduit.com/reports/{id}
MIME Type application/json
Status Code 200
Authenticated? Yes
Reference report

^ back to top

Example

The below example shows how to update an existing report using the curl utility. The response body is truncated for brevity. See the report reference for full details.

$ curl -v -X PUT \
       -uX:1234567890 \
       -H'Content-Type: application/json' \
       -H'Accept: application/json' \
       -d '{
         "id": "5be1b2945b8636e47b7f71f2",
         "name": "flow report",
         "columns": [
            "recipient",
            "recipient-success",
            "recipient-failure",
            "recipient-error"
          ]
        }'
       https://next.leadconduit.com/reports/5be1b2945b8636e47b7f71f2

> PUT /reports/5be1b2945b8636e47b7f71f2 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.54.1
> Host: next.leadconduit.com
> Accept: application/json
> Content-Type: application/json

< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/json; charset=utf-8
< content-length: 280
< Date: Wed, 07 Nov 2018 19:29:32 GMT
< connection: keep-alive
<
{
 "id": "5be1b2945b8636e47b7f71f2",
 "name": "flow report",
 "columns": ["recipient","recipient-success","recipient-failure","recipient-error"],
 "group_by": ["vars.recipient.id","vars.flow.id"],
 "token": null,
 "created_at": "2018-11-06T15:26:12.164Z",
 "updated_at": "2018-11-06T15:26:12.164Z"
}

^ back to top

Get an report

Fetch a single report.

Resource Information

Method GET
URL https://next.leadconduit.com/reports/{id}
MIME Type application/json
Status Code 200
Authenticated? Yes
Reference report

^ back to top

Query parameters

None.

Example

The below example shows how to get an existing report using the curl utility. The response body is truncated for brevity. See the report reference for full details

$ curl -v -X GET \
       -uX:1234567890 \
       -H'Accept: application/json' \
       https://next.leadconduit.com/reports/5be1b2945b8636e47b7f71f2

> GET /reports/5be1b2945b8636e47b7f71f2 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.54.1
> Host: next.leadconduit.com
> Accept: application/json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/json; charset=utf-8
< content-length: 280
< etag: W/"7tv5tV52dBzQjrhhQt4PYg=="
< date: Fri, 09 Nov 2018 20:12:59 GMT
< connection: keep-alive
<
{
  "id": "5be1b2945b8636e47b7f71f2",
  "name":"flow report",
  "columns": ["recipient","recipient-success","recipient-failure","recipient-error"],
  "group_by": ["vars.recipient.id","vars.flow.id"],
  "token": null,
  "created_at": "2018-11-06T15:26:12.164Z",
  "updated_at": "2018-11-09T19:29:32.565Z"
}

^ back to top

Delete an report

Delete an existing report.

Resource Information

Method DELETE
URL https://next.leadconduit.com/reports
MIME Type application/json
Status Code 200 or 202
Authenticated? Yes
Reference report

^ back to top

Example

The below example shows how to delete an existing report using the curl utility.

$ curl -v -X DELETE \
       -uX:1234567890 \
       -H'Accept: application/json' \
       https://next.leadconduit.com/reports/5be1b2945b8636e47b7f71f2

> DELETE /reports/5be1b2945b8636e47b7f71f2 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.54.1
> Host: next.leadconduit.com
> Accept: application/json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/json; charset=utf-8
< content-length: 292
< etag: W/"7tv5tV52dBzQjrhhQt4PYg=="
< date: Fri, 09 Nov 2018 20:12:59 GMT
< connection: keep-alive
<
{
 "id": "5be1b2945b8636e47b7f71f2",
 "name": "flow report",
 "columns": ["recipient","recipient-success","recipient-failure","recipient-error"],
 "group_by": ["vars.recipient.id","vars.flow.id"],
 "token": null,
 "created_at": "2018-11-06T15:26:12.164Z",
 "updated_at": "2018-11-09T19:29:32.565Z"
}

^ back to top

Preview a report

Create a report but don't save it. The report definition is provided in the post body and the time range is provided as query parameters.

Resource Information

Method POST
URL https://next.leadconduit.com/reports/preview
MIME Type application/json
Status Code 200
Authenticated? Yes
Reference report

Query parameters

Parameter Description Type
start limit events counted in report to those recorded at or after this time Timestamp
end limit events counted in report to those recorded at or before this time Timestamp

^ back to top

Example

The below example shows how to preview a new report using the curl utility. See the report reference for full details.

$ curl -v -X POST \
       -uX:1234567890 \
       -H'Content-Type: application/json' \
       -H'Accept: application/json' \
       -d '{
            "name": "source report",
            "columns": ["source", "source-success", "source-failure", "source-error"],
            "group_by": ["vars.source.id"]
        }'
       https://next.leadconduit.com/reports/preview?start=2018-10-01T00:00:00.000Z&end=2018-11-01T00:00:00.000Z

> POST /reports/preview?start=2018-10-01T00:00:00.000Z&end=2018-11-01T00:00:00.000Z HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.54.1
> Host: next.leadconduit.com
> Accept: application/json
> Content-Type: application/json

< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/json; charset=utf-8
< content-length: 440
< Date: Wed, 07 Nov 2018 19:04:33 GMT
< connection: keep-alive
<
[
  {
    "vars.flow.id": "5b6b3e0db79c7d6ba7028b66",
    "source": 121,
    "source-success": 121,
    "source-failure": 0,
    "source-error": 0
  },
  {
    "vars.flow.id": "5b6ba3c51a36f101fc17e1fc",
    "source": 932,
    "source-success": 921,
    "source-failure": 11,
    "source-error": 0
  }
]

^ back to top

Run a report

Run a report that was previously created. The time range is provided as query parameters.

Resource Information

Method POST
URL https://next.leadconduit.com/reports/{id}/run
MIME Type application/json
Status Code 200
Authenticated? Yes
Reference report

Query parameters

Parameter Description Type
start limit events counted in report to those recorded at or after this time Timestamp
end limit events counted in report to those recorded at or before this time Timestamp

^ back to top

Example

The below example shows how to run a report using the curl utility. See the report reference for full details.

$ curl -v -X GET \
       -uX:1234567890 \
       -H'Content-Type: application/json' \
       -H'Accept: application/json' \
       https://next.leadconduit.com/reports/5be1b2945b8636e47b7f71f2/run?start=2018-10-01T00:00:00.000Z&end=2018-11-01T00:00:00.000Z

> GET /reports/5be1b2945b8636e47b7f71f2/run?start=2018-10-01T00:00:00.000Z&end=2018-11-01T00:00:00.000Z HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.54.1
> Host: next.leadconduit.com
> Accept: application/json
> Content-Type: application/json

< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/json; charset=utf-8
< content-length: 440
< Date: Wed, 07 Nov 2018 19:04:33 GMT
< connection: keep-alive
<
[
  {
    "vars.flow.id": "5b6b3e0db79c7d6ba7028b66",
    "source": 121,
    "source-success": 121,
    "source-failure": 0,
    "source-error": 0
  },
  {
    "vars.flow.id": "5b6ba3c51a36f101fc17e1fc",
    "source": 932,
    "source-success": 921,
    "source-failure": 11,
    "source-error": 0
  }
]

^ back to top

Routers

The /routers resource is used to work with routers.

Method Resource Description
GET /routers List all routers
POST /routers/{id} Create a router
PUT /routers/{id} Update a router
GET /routers/{id} List a router

^ back to top

List all routers

Get the list of all routers.

Resource Information

Method GET
URL https://next.leadconduit.com/routers
MIME Type application/vnd.com.leadconduit.router+json
Status Code 200
Authenticated? Yes
Reference router

^ back to top

Query parameters

None.

Example

The below example shows how to get a list of all routers using the curl utility. The response body is truncated for brevity. See the router reference for full details.

$ curl -v -X GET -uX:1234567890 -H 'Accept: application/vnd.com.leadconduit.router+json' https://next.leadconduit.com/routers

> GET /routers HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.router+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.router+json
< date: Mon, 17 Aug 2015 20:11:01 GMT
< connection: keep-alive
< transfer-encoding: chunked
<
{
"id": "5bb4e57462210328cd12bcb7",
"module_id": "leadconduit-facebook.inbound.apfacebook",
"routes": [
  {
  "flow_id": "5baba87dc610e6deb30e57f6",
  "source_id": "56f19c74b5436e195a8c297b",
  "rule_set": {
    "op": "or",
    "rules": [
    {
      "lhv": "facebook.page_id",
      "op": "is included in",
      "rhv": [
      "71158000000"
      ],
    }
    ]
  },
  }
],
"created_at": "2018-10-03T15:51:16.051Z",
"updated_at": "2018-10-04T19:28:51.285Z"
}

^ back to top

Create a router

Create a new custom router, adding it to the list of all routers in the account.

Resource Information

Method POST
URL https://next.leadconduit.com/routers
MIME Type application/vnd.com.leadconduit.router+json
Status Code 201
Authenticated? Yes
Reference router

^ back to top

Example

The below example shows how to create a new router using the curl utility.

$ curl -v -X POST \
       -uX:1234567890 \
       -H'Content-Type: application/vnd.com.leadconduit.router+json' \
       -H'Accept: application/vnd.com.leadconduit.router+json' \
       -d@router.json \
       https://next.leadconduit.com/routers

> POST /routers HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.router+json
> Content-Type: application/vnd.com.leadconduit.router+json

< HTTP/1.1 201 Created
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.router+json; charset=utf-8
< date: Mon, 17 Aug 2015 14:47:55 GMT
< connection: keep-alive
<
{
"id": "5bb4e57462210328cd12bcb7",
"module_id": "leadconduit-facebook.inbound.apfacebook",
"routes": [
  {
  "flow_id": "55d1f41b976c0bfb67e7a836",
  "source_id": "55d1f41b976c0bfb67e7a889",
  "rule_set": {
    "op": "or",
    "rules": [
    {
      "lhv": "facebook.page_id",
      "op": "is included in",
      "rhv": [
      "71158000000"
      ],
    }
    ]
  },
  }
],
"created_at": "2018-10-03T15:51:16.051Z",
"updated_at": "2018-10-04T19:28:51.285Z"
}

^ back to top

Update a router

Update an existing custom router. Standard routers cannot be updated.

Resource Information

Method PUT
URL https://next.leadconduit.com/routers/{id}
MIME Type application/vnd.com.leadconduit.router+json
Status Code 200
Authenticated? Yes
Reference router

^ back to top

Example

The below example shows how to update an existing router using the curl utility.

$ curl -v -X PUT \
       -uX:1234567890 \
       -H'Content-Type: application/vnd.com.leadconduit.router+json' \
       -H'Accept: application/vnd.com.leadconduit.router+json' \
       -d@router.json \
       https://next.leadconduit.com/routers/5bb4e57462210328cd12bcb7

> PUT /routers/5bb4e57462210328cd12bcb7 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.router+json
> Content-Type: application/vnd.com.leadconduit.router+json

< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.router+json; charset=utf-8
< date: Mon, 17 Aug 2015 14:51:55 GMT
< connection: keep-alive
<
{
"id": "5bb4e57462210328cd12bcb7",
"module_id": "leadconduit-facebook.inbound.apfacebook",
"routes": [
  {
  "flow_id": "55d1f41b976c0bfb67e7a836",
  "source_id": "55d1f41b976c0bfb67e7a889",
  "rule_set": {
    "op": "or",
    "rules": [
    {
      "lhv": "facebook.page_id",
      "op": "is included in",
      "rhv": [
      "71158000000"
      ],
    }
    ]
  },
  }
],
"created_at": "2018-10-03T15:51:16.051Z",
"updated_at": "2018-10-06T11:28:51.285Z"
}

^ back to top

Get a router

Fetch a single router.

Resource Information

Method GET
URL https://next.leadconduit.com/routers/{id}
MIME Type application/vnd.com.leadconduit.router+json
Status Code 200
Authenticated? Yes
Reference router

^ back to top

Query parameters

None.

Example

The below example shows how to get an existing router using the curl utility.

$ curl -v -X GET \
       -uX:1234567890 \
       -H'Accept: application/vnd.com.leadconduit.router+json' \
       https://next.leadconduit.com/routers/5bb4e57462210328cd12bcb7

> GET /routers/5bb4e57462210328cd12bcb7 HTTP/1.1
> Authorization: Basic MTIzNDU2Nzg5MA==
> User-Agent: curl/7.37.1
> Host: next.leadconduit.com
> Accept: application/vnd.com.leadconduit.router+json
>
< HTTP/1.1 200 OK
< vary: Accept, Accept-Encoding
< content-type: application/vnd.com.leadconduit.router+json; charset=utf-8
< date: Fri, 14 Aug 2015 20:14:12 GMT
< connection: keep-alive
<
{
"id": "5bb4e57462210328cd12bcb7",
"module_id": "leadconduit-facebook.inbound.apfacebook",
"routes": [
  {
  "flow_id": "55d1f41b976c0bfb67e7a836",
  "source_id": "55d1f41b976c0bfb67e7a889",
  "rule_set": {
    "op": "or",
    "rules": [
    {
      "lhv": "facebook.page_id",
      "op": "is included in",
      "rhv": [
      "71158000000"
      ],
    }
    ]
  },
  }
],
"created_at": "2018-10-03T15:51:16.051Z",
"updated_at": "2018-10-04T19:28:51.285Z"
}

^ back to top

Search for Leads

The /search/leads resource is used to find leads using full text search. For example, you can search for fred in texas using:

/search/leads?query=fred+tx

Search Criteria

The search results can be sorted and paginated. There are two query parameter to control sorting: sort_by and sort_dir. The sort_by parameter takes a field name (see list below) and sort_dir is ascending (asc) or descending (desc). By default the results are sorted by relevance.

There are two query parameters to control paging: from and limit. The from parameter specifies the starting offset of that page in the search results and the limit parameter specifies how many search results to return. From is zero-based so to get the first 10 results, use from=0&limit=10, the second 10 using from=10&limit=10, etc... The maximum limit is 100 at a time, with an overall maximum of 1,000 search results.

Search Results

The search results has the total number of matching leads and an array of hits, where each hit is a matching Lead Search Result. Each lead search result contains basic information about the lead, the latest event for that lead, and highlighting of the matched text.

Resource Information

Method GET
URL https://next.leadconduit.com/search/leads
MIME Type application/json
Status Code 200
Authenticated? Yes
Reference Lead Search Result

^ back to top

Query parameters

Parameter Description Type
query text to search for (see Search Criteria above) String
sort_by One of the following field names: lead_id, submission_timestamp, first_name, last_name, email, phone_1, phone_2, address_1, city, state, postal_code, reference String
sort_dir The sort direction:asc or desc, default is by relevance String
from The starting offset of leads to return in the matching result set, zero-based Integer
limit The maximum number of leads to return (maximum is 100, default is 10) Integer

^ back to top

Example

This is a search for a lead with a known email address.

$ curl -X GET -uX:1234567890 -H 'Accept: application/json' 'https://next.leadconduit.com/search/leads?query=fred%40example.com'

> GET /search/leads?query=fred%40example.com HTTP/1.1
> Host: next.leadconduit.com
> User-Agent: curl/7.51.0
> Accept: application/json
> Authorization: Basic MTIzNDU2Nzg5MA==
>
< HTTP/1.1 200 OK
< Date: Mon, 29 Jan 2018 15:42:49 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 2303
< Connection: keep-alive
< Access-Control-Allow-Origin: *
< Vary: Accept, Accept-Encoding
< ETag: W/"917-1r1nooVfxJ6M5f42JYzNPu1dDmU"

{
    "total": 12,
    "hits": [
        {
          "address_1": "100 Main St",
          "city": "Springfield",
          "email": "fred@example.com",
          "first_name": "Fred",
          "flow_id": "58f4f88be9187630ca65fc8b",
          "flow_name": "Test Flow",
          "last_name": "Smith",
          "lead_id": "5a6f219e73bfe869b8e2e1b2",
          "phone_1": "8005551212",
          "phone_2": "",
          "postal_code": "06109",
          "reference": "",
          "source_id": "58f4edd0b80a0435ab7659dd",
          "source_name": "Acme, Inc.",
          "state": "TX",
          "submission_timestamp": "2018-01-29T13:29:02.530Z",
          "highlight": {
            "email": [
              "<em>fred@example.com</em>"
            ]
          },
          "latest_event": {
            ...
          }
        },
        {
            ...
        }
        ...
    ]
}

^ back to top

Status

Types

Variables

The /vars resource is used to identify which data points have been collected in your flows. This resource is used to determine which data points are available for exports and stats queries.

As a lead is processed by a flow, a variable for every field value and every piece of appended data is created. If the variable for a data point already exists, a new one is not created. That is to say that there will only ever be one lead.email variable. Each time an email address is collected, the last_seen_at timestamp is updated.

Resource Information

Method GET
URL https://next.leadconduit.com/vars
MIME Type application/json
Status Code 200
Authenticated? Yes
Reference Variable

^ back to top

Query parameters

Parameter Description Type
start Return only variables that were seen at or after this time Timestamp
end Return only variables that were seen at or before this time Timestamp
flow_id Return only variables where the flow ID matches this value (multiple flow_id parameters may be used to select variables across several specific flows) BSON ID

^ back to top

Example

$ curl -X GET -uX:1234567890 -H 'Accept: application/json' 'https://next.leadconduit.com/vars'

> GET /vars HTTP/1.1
> Host: next.leadconduit.com
> User-Agent: curl/7.51.0
> Accept: application/json
> Authorization: Basic MTIzNDU2Nzg5MA==
>
< HTTP/1.1 200 OK
< Date: Mon, 29 Jan 2018 15:42:49 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 4221
< Connection: keep-alive
< Access-Control-Allow-Origin: *
< Vary: Accept, Accept-Encoding

[
  {
    "name": "account.id",
    "last_used_at": "2018-04-19T16:18:31.137Z",
    "label": "Account ID",
    "type": "string",
    "description": "The receiving account's unique identifier in LeadConduit",
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      "5ad8c1565289471adf5ce25e"
    ]
  },
  {
    "name": "account.name",
    "last_used_at": "2018-04-19T16:18:31.137Z",
    "label": "Account Name",
    "type": "string",
    "description": "The receiving account's name",
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      "Account 0"
    ]
  },
  {
    "name": "account.sso_id",
    "last_used_at": "2018-04-19T16:18:31.137Z",
    "label": "Account SSO ID",
    "type": "string",
    "description": "The unique ID of the account in SSO",
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      "5ad8c1565289471adf5ce260"
    ]
  },
  {
    "name": "flow.id",
    "last_used_at": "2018-04-19T16:18:31.137Z",
    "label": "Flow ID",
    "type": "string",
    "description": "The unique ID of the flow",
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      "5ad8c1565289471adf5ce274"
    ]
  },
  {
    "name": "flow.name",
    "last_used_at": "2018-04-19T16:18:31.137Z",
    "label": "Flow Name",
    "type": "string",
    "description": "The name of the flow",
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      "Flow 1"
    ]
  },
  {
    "name": "lead.email",
    "last_used_at": "2018-04-19T16:18:31.137Z",
    "label": "Email",
    "description": "Email address",
    "type": "email",
    "aggregate": false,
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      {
        "normal": "foo@bar.com",
        "raw": "foo@bar.com",
        "user": "foo",
        "is_free": false,
        "is_disposable": false,
        "domain": "bar.com",
        "host": "bar",
        "tld": "com",
        "valid": true
      }
    ]
  },
  {
    "name": "lead.id",
    "last_used_at": "2018-04-19T16:18:31.137Z",
    "label": "Lead ID",
    "type": "string",
    "description": "The unique ID of the lead",
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      "5ad8c1575289471adf5ce289"
    ]
  },
  {
    "name": "lead.phone",
    "last_used_at": "2018-04-19T16:18:31.137Z",
    "label": "Phone",
    "description": "The field 2 field",
    "type": "phone",
    "aggregate": false,
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      {
        "normal": "5127891111",
        "prefix": "1",
        "raw": "5127891111",
        "area": "512",
        "exchange": "789",
        "line": "1111",
        "number": "7891111",
        "extension": null,
        "country_code": "US",
        "is_tollfree": false,
        "type": null,
        "valid": true
      }
    ]
  },
  {
    "name": "random",
    "last_used_at": "2018-04-19T16:18:31.137Z",
    "label": "Random Number",
    "type": "number",
    "description": "A random number between 1 and 100",
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      28
    ]
  },
  {
    "name": "recipient.id",
    "last_used_at": "2018-04-19T16:18:31.131Z",
    "label": "Recipient ID",
    "type": "string",
    "description": "The unique ID of the recipient (recipient events only)",
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      "5ad8c1565289471adf5ce269"
    ]
  },
  {
    "name": "recipient.name",
    "last_used_at": "2018-04-19T16:18:31.131Z",
    "label": "Recipient Name",
    "type": "string",
    "description": "The name of the recipient (recipient events only)",
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      "Recipient 0"
    ]
  },
  {
    "name": "recipient_0.foo.bar",
    "last_used_at": "2018-04-19T16:18:31.137Z",
    "label": "Recipient 0 Foo Bar",
    "description": null,
    "type": "string",
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      "baz"
    ]
  },
  {
    "name": "recipient_0.outcome",
    "last_used_at": "2018-04-19T16:18:31.137Z",
    "type": "string",
    "description": "The outcome of the transaction (default is success)",
    "label": "Recipient 0 Outcome",
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      "success"
    ]
  },
  {
    "name": "source.id",
    "last_used_at": "2018-04-19T16:18:31.137Z",
    "label": "Source ID",
    "type": "string",
    "description": "The unique ID of the source",
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      "5ad8c1565289471adf5ce266"
    ]
  },
  {
    "name": "source.name",
    "last_used_at": "2018-04-19T16:18:31.137Z",
    "label": "Source Name",
    "type": "string",
    "description": "The name of the source",
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      "Source 0"
    ]
  },
  {
    "name": "submission.timestamp",
    "last_used_at": "2018-04-19T16:18:31.137Z",
    "label": "Submission Timestamp",
    "description": "The time the lead was submitted",
    "type": "date",
    "flow_ids": [
      "5ad8c1565289471adf5ce274"
    ],
    "examples": [
      "2018-04-19T16:18:31.086Z"
    ]
  }
]

^ back to top

Errors

Things can go wrong when using the API. This reference table explains common error outcomes and what they mean. If you receive an error code that is not listed here, please contact support@activeprospect.com.

HTTP Status Name Description
401 Unauthorized The API key is missing, incorrect, or specified incorrectly
402 Payment Required Unpaid account
403 Forbidden An attempt has been made to modify a resource which cannot be modified
404 Not Found The resource being requested does not exist
406 Not Acceptable An unsupported MIME type has been requested in the Accept header
409 Conflict The request to update a resource has failed because a more recent version exists
415 Unsupported Media Type The request contains a request body of an unsupported MIME type
422 Unprocessable Entity The JSON in the request body is incorrect, probably caught by validation
503 Service Unavailable The API service is currently unavailable, probably due to high load

^ back to top

Validation

The server will validate calls to create or update a resource. If you attempt to make a change that fails validation, you will receive an HTTP 422. The body of the response maps the error messages to the original JSON document submitted.