Skip to main content

Reference

Data Platform

Count and query against the consumer, business, and other data sources. Synchronous endpoints for small counts; async count_requests for anything that takes more than a few seconds.

Count available records

POST /api/v1/data/count

Get a count of records matching the specified filters and criteria. This endpoint has a 60 second timeout. For complex counts that may take longer, use the count requests endpoint instead. list_suppression_ids must all be lists in your account that have finished processing, of any type except breakdowns. Any other id (unknown, deleted, another account's, still processing or importing, failed, withdrawn, or a breakdown) returns 422 with an error naming it. So does a request that gives the lists nothing to match records on (no match_type and no dedupe from select_type, phones or emails), and one whose match settings (match_type, select_type, or the lists' own match keys) the data source can't match the lists on, and one naming a list that has no values in any key the request matches on (for example an address and email file matched on phone, or an audience export whose phones or emails were not exported). A file holding only emails, only phones or only addresses is also matched on that key, so it is accepted. A list with no records to suppress also returns 422 naming its id, as does one that could not be checked for records just then (retry in a few minutes).

Body parameters

data_source_id integer Required

ID of the data source to query

select_type address_zip | last_address_zip | name_address_zip | phone | email | mkey | individual | null

Deduplication strategy (null means no deduplication)

dedupe_within | zip | city | county | state | national | null

Geographic boundary for deduplication

phones all | none

Phone number selection criteria: - all: Include all phone numbers - none: Exclude phone numbers

phone_type none | landline | wireless | landline_priority | wireless_priority | null

Phone type preference (required when phones is not "none")

phone_score integer | null

Minimum phone quality score (0-100)

dnc boolean

Leave out numbers on the Do Not Call list. With phones required, records whose phone is on the list are dropped; otherwise records are kept and their DNC numbers come back blank in phone columns. Always on for accounts that enforce the DNC scrub, whatever this value says.

emails all | none

Email selection criteria: - all: Include all emails - none: Exclude emails

filters array<object>

Array of filter criteria to apply

list_suppression_ids array | null

IDs of your account's lists to suppress from results. Every id must be a list in your account that has finished processing, of any type except breakdowns; any other id returns 422 naming the ids. Records are matched against the lists on match_type, or on the dedupe the request's select_type, phones, or emails imply, or on the keys the lists were built with. With none of these, the request returns 422.

match_type address_zip | last_address_zip | name_address_zip | phone | email | mkey | individual | null

Match type for suppression matching

contacts_per_business integer | null

Maximum contacts per business (for business data sources)

Response fields

count integer

Number of records matching the criteria

Query for records

POST /api/v1/data/query

Retrieve records from a data source. This is useful for lookups or one-off appends. You must contact your account manager to enable this feature. Maximum 50 records can be returned per request. Use limit and offset parameters for pagination. If you need bulk data, use the lists endpoint. If output_field_keys is empty or omitted, only the count will be returned (does not count against your account's query record usage). Billable record queries require enough available account records for the requested limit (default 50, max 50). Requests that exceed the available balance return 422. Requests with a positive email or phone filter query the matching contact table directly when every filter is stored natively on that table. This routing does not depend on select_type. Output fields may be resolved through left joins as needed. list_suppression_ids must all be lists in your account that have finished processing, of any type except breakdowns. Any other id (unknown, deleted, another account's, still processing or importing, failed, withdrawn, or a breakdown) returns 422 with an error naming it. So does a request that gives the lists nothing to match records on (no match_type and no dedupe from select_type, phones or emails), and one whose match settings (match_type, select_type, or the lists' own match keys) the data source can't match the lists on, and one naming a list that has no values in any key the request matches on (for example an address and email file matched on phone, or an audience export whose phones or emails were not exported). A file holding only emails, only phones or only addresses is also matched on that key, so it is accepted. A list with no records to suppress also returns 422 naming its id, as does one that could not be checked for records just then (retry in a few minutes). With radius or polygon filters, suppressed queries must match on address_zip, email or phone; other match settings return 422.

Response fields

count integer

Number of records matching the criteria

records array<object>

Array of matching records with requested fields (max 10 records)

List data sources

GET /api/v1/data_sources

Get a list of all data sources available for your account

Response fields

id integer

Unique identifier for the data source

name string

Name of the data source

size integer

Total number of records in the data source

Get data source configuration

GET /api/v1/data_sources/:id

Get detailed configuration for a data source including available fields, deduplication options, and field values. This information is used to build queries and understand what options are available. Only the data sources listed by GET /data_sources for your account are available. Any other id returns 404, the same as an id that does not exist. A token acting as a Giant Partners staff user can read any data source.

Path parameters

id integer Required

Data source ID

Submit count request

POST /api/v1/count_requests

Submit a count request for complex or long-running counts that can't complete within the normal request timeout. You can also specify derivatives to get multiple related counts from a single base request. Use the get count request endpoint to check status and retrieve results when ready. list_suppression_ids must all be lists in your account that have finished processing, of any type except breakdowns. Any other id (unknown, deleted, another account's, still processing or importing, failed, withdrawn, or a breakdown) returns 422 with an error naming it. So does a request that gives the lists nothing to match records on (no match_type and no dedupe from select_type, phones or emails), and one whose match settings (match_type, select_type, or the lists' own match keys) the data source can't match the lists on, and one naming a list that has no values in any key the request matches on (for example an address and email file matched on phone, or an audience export whose phones or emails were not exported). A file holding only emails, only phones or only addresses is also matched on that key, so it is accepted. A list with no records to suppress also returns 422 naming its id, as does one that could not be checked for records just then (retry in a few minutes). These checks run when the request is submitted. The count job checks the lists again when it runs, and a list deleted, withdrawn or reprocessed in between leaves the request with status failed; submit a new request. Derivatives use the base request's suppression lists and cannot set their own; a derivative whose overrides leave the lists nothing to match on also returns 422.

Response fields

id integer

Unique identifier for the count request

status pending | processing | ready | failed

Count request processing status: - pending: Request is queued for processing - processing: Request is currently being processed - ready: Results are available - failed: Request processing failed, including when a count runs longer than 10 minutes. Narrow the filters and submit a new request.

request object

The original request parameters

results object | null

Count results (null until status is ready)

created_at string

Timestamp when request was created

updated_at string

Timestamp when request was last updated

Get count request

GET /api/v1/count_requests/:id

Get the status and results of a count request

Path parameters

id integer Required

Count request ID

Response fields

id integer

Unique identifier for the count request

status pending | processing | ready | failed

Count request processing status: - pending: Request is queued for processing - processing: Request is currently being processed - ready: Results are available - failed: Request processing failed, including when a count runs longer than 10 minutes. Narrow the filters and submit a new request.

request object

The original request parameters

results object | null

Count results (null until status is ready)

created_at string

Timestamp when request was created

updated_at string

Timestamp when request was last updated