Skip to content

Queries

Returns saved queries that have associated domains. Use this to find queries for inclusion/exclusion in discovery.

GET /queries/saved
ParameterTypeDefaultDescription
max_recordsinteger100Maximum records to return (1-1000)
offsetinteger0Records to skip for pagination. Must be 0 or greater
actionstringnoneFilter by action type (e.g. discover, exclusion)
tagsarray[string]noneFilter by tags; returns queries matching any of the given tags. Repeat the parameter (tags=a&tags=b) or pass comma-separated (tags=a,b).

Tag filters are normalized the same way stored tags are (lowercased, spaces become hyphens), so tags=Q2 Outbound matches a stored q2-outbound.

{
"results": [
{
"query_id": "uuid",
"query_name": "My Discovery Query",
"action": "discover",
"user_name": "John Doe",
"mtime": "2026-01-29T12:00:00",
"domains": ["company1.com", "company2.com"],
"domain_count": 2,
"query_params": { ... },
"tags": ["campaign-q1"]
}
],
"count": 50
}

Save a set of result rows as a reusable saved query. This is the REST equivalent of the save-mcp-query MCP tool: it stores a “thin” wrapper (the domains plus any custom columns you send), and the full company data is re-hydrated from your domains when the query is opened in the app.

POST /queries/save-results
FieldTypeRequiredDescription
query_namestringYesName for the saved query (1-255 characters)
actionstringYesUnderlying action: discover, segment, contacts, append, or match. Stored as thin_<action>
dataarray[object]YesResult rows. Each row should include a domain (see domain_column); any extra columns are preserved
query_paramsobjectNoOriginal query params, kept for reconstructing the query in the UI
domain_columnstringNoColumn holding the domain. Default domain
tagsarray[string]NoTags to attach (max 20 tags, each 2-50 characters)
Terminal window
curl -X POST "https://api.discolike.com/v1/queries/save-results" \
-H "x-discolike-key: API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query_name": "US fintech shortlist",
"action": "discover",
"data": [{"domain": "stripe.com", "score": 0.92}, {"domain": "plaid.com", "score": 0.88}],
"tags": ["fintech", "outbound-q3"]
}'
{
"query_id": "uuid",
"query_name": "US fintech shortlist",
"action": "thin_discover",
"domain_count": 2,
"persona_id_count": 0,
"row_count": 2,
"tags": ["fintech", "outbound-q3"]
}
  • Domain-based actions (discover, segment, append, match) require at least one domain across data; only contacts accepts persona-only rows (via a persona_id column). Requests satisfying neither return 400.
  • Values in the domain column must look like domains (e.g. acme.com); rows with other values make the request return 400 listing the offending values.
  • persona_id values must be integers: fractional numbers, booleans, and strings return 400 rather than being coerced.
  • Limits: up to 50,000 rows and 50 MB of serialized payload. Larger requests return 413. To save a larger reusable list of domains or persona IDs, use Create Exclusion List.
  • Rate limit: 10 requests/minute base, scaled by your plan’s rate-limit multiplier.
  • The saved query appears in GET /queries/saved and can be used with inclusion_query_id / exclusion_query_id in discover and contacts queries.

Create a new exclusion list from a list of domains or persona IDs. The list can be used for inclusion/exclusion filtering in discovery and contacts queries.

POST /queries/exclusion-list

Domain list example:

{
"query_name": "My Exclusion List",
"domains": ["competitor1.com", "competitor2.com", "competitor3.com"],
"tags": ["competitors", "scheduled-removal"]
}

Persona ID list example (from contacts search results):

Terminal window
curl -X POST "https://api.discolike.com/v1/queries/exclusion-list" \
-H "x-discolike-key: API_KEY" \
-H "Content-Type: application/json" \
-d '{"query_name": "Contacted VPs", "persona_ids": [12345678, 87654321]}'
FieldTypeRequiredDescription
query_namestringYesName for the exclusion list (1-255 characters)
domainsarray[string]NoList of domains to save. Provide domains, persona_ids, or both.
persona_idsarray[integer]NoArray of persona IDs to save (from contacts search results). Provide domains, persona_ids, or both.
tagsarray[string]NoTags to apply at creation (max 20 tags, each 2-50 characters). Tags are sanitized: lowercased, spaces become hyphens, invalid characters removed. The response echoes the stored form.
{
"query_id": "uuid",
"query_name": "My Exclusion List",
"domain_count": 3,
"tags": ["competitors", "scheduled-removal"]
}
  • Minimum of 20 domains for domain lists (persona-only lists are exempt). Smaller domain lists return 400.
  • Maximum of 250,000 domains or 500,000 persona IDs per exclusion list (lists exceeding this limit are automatically truncated). The same caps apply when a list is used for exclusion; an over-cap list returns 400.
  • Duplicate domains and persona IDs are automatically removed
  • At least one of domains or persona_ids must be provided
  • Lists created from contacts search results store persona IDs. Lists created from discover or other endpoints store domains. Both types appear in the same saved queries listing and can be used with exclusion_query_id or inclusion_query_id parameters.
  • The created query has action: "exclusion"
  • Use the returned query_id in the inclusion_query_id or exclusion_query_id parameters of the discover or contacts endpoints

Update the name and/or tags of a saved query. You can update just the name, just the tags, or both in a single request.

PATCH /queries/{query_id}
{
"query_name": "New Query Name",
"tags": ["campaign-q1", "enterprise"]
}
FieldTypeRequiredDescription
query_namestringNoNew name for the query
tagsarray[string]NoNew list of tags (replaces existing)

At least one field must be provided.

{
"query_id": "uuid",
"query_name": "New Query Name",
"tags": ["campaign-q1", "enterprise"]
}

Delete a saved query (including exclusion lists) by ID. You can only delete queries owned by your account.

DELETE /queries/{query_id}
{
"message": "Query deleted successfully"
}

Returns 404 if no query with that ID exists under your client domain.