Exports

Export

An export job that produces a CSV of lead events for a given time range and field selection.

id
required
string (ID) ^[0-9a-fA-F]{24}$

ID of this export

created_at
required
string <date-time>

When the export was requested.

status
required
string

Current state of the export job.

Enum: "created" "processing" "complete" "error" "truncated"
start
string <date-time>

Start of the time range covered by this export (inclusive).

end
string <date-time>

End of the time range covered by this export (exclusive).

Array of objects

Rules used to filter the events included in the export.

email_to
Array of strings

Email addresses notified when the export completes.

fields
Array of strings

Lead/event fields included in the resulting CSV.

standard_dates
boolean

Request only. true selects the standard date format for the CSV, otherwise the export uses legacy. Reflected as date_format on the created export.

date_format
string

Date format used in the resulting CSV. Set from standard_dates when the export is created.

Enum: "standard" "legacy"
object

User who requested the export.

expires_at
string <date-time>

When the export becomes unavailable for download.

object

Optional explanation when the status is truncated or error.

error
string

Error message when the status is error.

exported_docs
integer

Number of lead/event records included in the resulting CSV.

file_name
string

Name of the resulting CSV file.

downloads
Array of objects

Audit log of users who have downloaded this export.

{
  • "id": "5fd4371e940df5a34a3888b2",
  • "created_at": "2019-08-24T14:15:22Z",
  • "status": "created",
  • "start": "2019-08-24T14:15:22Z",
  • "end": "2019-08-24T14:15:22Z",
  • "filter_rules": [
    • {
      • "lhv": "string",
      • "op": "string",
      • "rhv": "string"
      }
    ],
  • "email_to": [
    • "string"
    ],
  • "fields": [
    • "string"
    ],
  • "date_format": "standard",
  • "user": {
    • "id": "string",
    • "first_name": "string",
    • "last_name": "string",
    • "email": "string",
    • "sso_id": "string"
    },
  • "expires_at": "2019-08-24T14:15:22Z",
  • "reason": {
    • "message": "string"
    },
  • "error": "string",
  • "exported_docs": 0,
  • "file_name": "string",
  • "downloads": [
    • { }
    ]
}

List all exports

Returns the export jobs requested by users in the calling account, newest first. The list is filtered to exports whose expires_at is in the future (i.e. still downloadable). Use the before_id cursor and limit to paginate; pass the id of the last item from the previous page as before_id to fetch the next page.

SecurityAPIKey
Request
query Parameters
before_id
string (ID) ^[0-9a-fA-F]{24}$

Return only exports created before the one with this ID (exclusive). Used for cursor pagination.

Example: before_id=5fd4371e940df5a34a3888b2
after_id
string (ID) ^[0-9a-fA-F]{24}$

Return only exports created after the one with this ID (exclusive).

Example: after_id=5fd4371e940df5a34a3888b2
limit
integer [ 1 .. 100 ]

The maximum number of exports to return (maximum limit is 100).

Responses
200

OK

400

Invalid request parameters.

401

Authorization information is missing or invalid.

get/exports
Request samples
Response samples
application/json
[
  • {
    • "id": "5fd4371e940df5a34a3888b2",
    • "created_at": "2019-08-24T14:15:22Z",
    • "status": "created",
    • "start": "2019-08-24T14:15:22Z",
    • "end": "2019-08-24T14:15:22Z",
    • "filter_rules": [
      • {
        • "lhv": "string",
        • "op": "string",
        • "rhv": "string"
        }
      ],
    • "email_to": [
      • "string"
      ],
    • "fields": [
      • "string"
      ],
    • "date_format": "standard",
    • "user": {
      • "id": "string",
      • "first_name": "string",
      • "last_name": "string",
      • "email": "string",
      • "sso_id": "string"
      },
    • "expires_at": "2019-08-24T14:15:22Z",
    • "reason": {
      • "message": "string"
      },
    • "error": "string",
    • "exported_docs": 0,
    • "file_name": "string",
    • "downloads": [
      • { }
      ]
    }
]

Create an export

Requests a CSV export of lead events for a time range. The export runs in the background: poll GET /exports/{id} until status is complete, then call GET /exports/{id}/file to get a download link. The addresses in email_to are notified when the file is ready.

Only start, end, fields, filter_rules, email_to, and standard_dates are read from the request; the other properties of an export are set by LeadConduit. Send standard_dates: true for the standard date format in the CSV; the export's date_format reflects the choice and defaults to legacy.

SecurityAPIKey
Request
Request Body schema: application/json
required

The export to create

created_at
required
string <date-time>

When the export was requested.

status
required
string

Current state of the export job.

Enum: "created" "processing" "complete" "error" "truncated"
start
string <date-time>

Start of the time range covered by this export (inclusive).

end
string <date-time>

End of the time range covered by this export (exclusive).

Array of objects

Rules used to filter the events included in the export.

email_to
Array of strings

Email addresses notified when the export completes.

fields
Array of strings

Lead/event fields included in the resulting CSV.

standard_dates
boolean

Request only. true selects the standard date format for the CSV, otherwise the export uses legacy. Reflected as date_format on the created export.

object

User who requested the export.

expires_at
string <date-time>

When the export becomes unavailable for download.

object

Optional explanation when the status is truncated or error.

error
string

Error message when the status is error.

exported_docs
integer

Number of lead/event records included in the resulting CSV.

file_name
string

Name of the resulting CSV file.

downloads
Array of objects

Audit log of users who have downloaded this export.

Responses
201

Created

401

Authorization information is missing or invalid.

422

The export is not valid.

post/exports
Request samples
application/json
{
  • "created_at": "2019-08-24T14:15:22Z",
  • "status": "created",
  • "start": "2019-08-24T14:15:22Z",
  • "end": "2019-08-24T14:15:22Z",
  • "filter_rules": [
    • {
      • "lhv": "string",
      • "op": "string",
      • "rhv": "string"
      }
    ],
  • "email_to": [
    • "string"
    ],
  • "fields": [
    • "string"
    ],
  • "standard_dates": true,
  • "user": {
    • "id": "string",
    • "first_name": "string",
    • "last_name": "string",
    • "email": "string",
    • "sso_id": "string"
    },
  • "expires_at": "2019-08-24T14:15:22Z",
  • "reason": {
    • "message": "string"
    },
  • "error": "string",
  • "exported_docs": 0,
  • "file_name": "string",
  • "downloads": [
    • { }
    ]
}
Response samples
application/json
{
  • "id": "5fd4371e940df5a34a3888b2",
  • "created_at": "2019-08-24T14:15:22Z",
  • "status": "created",
  • "start": "2019-08-24T14:15:22Z",
  • "end": "2019-08-24T14:15:22Z",
  • "filter_rules": [
    • {
      • "lhv": "string",
      • "op": "string",
      • "rhv": "string"
      }
    ],
  • "email_to": [
    • "string"
    ],
  • "fields": [
    • "string"
    ],
  • "date_format": "standard",
  • "user": {
    • "id": "string",
    • "first_name": "string",
    • "last_name": "string",
    • "email": "string",
    • "sso_id": "string"
    },
  • "expires_at": "2019-08-24T14:15:22Z",
  • "reason": {
    • "message": "string"
    },
  • "error": "string",
  • "exported_docs": 0,
  • "file_name": "string",
  • "downloads": [
    • { }
    ]
}

Get an export

Fetch a single export, including its status and, once complete, the file_name and exported_docs count.

SecurityAPIKey
Request
path Parameters
id
required
string (ID) ^[0-9a-fA-F]{24}$

The ID of the export

Example: 5fd4371e940df5a34a3888b2
Responses
200

OK

400

The ID is not valid.

401

Authorization information is missing or invalid.

404

No export exists with this ID in the calling account. The response has no body.

get/exports/{id}
Request samples
Response samples
application/json
{
  • "id": "5fd4371e940df5a34a3888b2",
  • "created_at": "2019-08-24T14:15:22Z",
  • "status": "created",
  • "start": "2019-08-24T14:15:22Z",
  • "end": "2019-08-24T14:15:22Z",
  • "filter_rules": [
    • {
      • "lhv": "string",
      • "op": "string",
      • "rhv": "string"
      }
    ],
  • "email_to": [
    • "string"
    ],
  • "fields": [
    • "string"
    ],
  • "date_format": "standard",
  • "user": {
    • "id": "string",
    • "first_name": "string",
    • "last_name": "string",
    • "email": "string",
    • "sso_id": "string"
    },
  • "expires_at": "2019-08-24T14:15:22Z",
  • "reason": {
    • "message": "string"
    },
  • "error": "string",
  • "exported_docs": 0,
  • "file_name": "string",
  • "downloads": [
    • { }
    ]
}

Get a download link for an export

Returns a pre-signed URL for the export's CSV file. The URL is valid for 10 seconds, so request it right before downloading and do not store it. Each call is recorded in the export's downloads list.

SecurityAPIKey
Request
path Parameters
id
required
string (ID) ^[0-9a-fA-F]{24}$

The ID of the export

Example: 5fd4371e940df5a34a3888b2
Responses
200

OK

401

Authorization information is missing or invalid.

404

No export exists with this ID, or its file is not ready yet (the export is still running or ended in error).

422

The ID is not valid.

get/exports/{id}/file
Request samples
Response samples