mySDRDocs

API reference

Cancel a search

Stops a search that is still queued or running. Nothing is charged.

POSThttps://mysdr.app/api/v1/searches/{search_id}/cancel
View Markdown

Authentication

Send Authorization: Bearer gtk_…. Create the key under Connect assistant → API keys. A missing, invalid or revoked key is 401. A valid key while this API is not enabled for your organization answers 403 api_not_enabled, with what the key can do instead. Every response includes mySDR-Api-Version, mySDR-Request-Id and Cache-Control: no-store, and a response to an accepted key also X-RateLimit-* (so not a 401, a 405, an OPTIONS or a 404 for an unknown path).

Path parameters

  • search_id string · required — The search to stop.

Response

  • id string · required — Search id, srch_….
  • object string · required — Always search. One of: search.
  • status string · required — Where the search is. One of: queued, running, succeeded, failed, cancelled.
  • signal_type string · required — The signal you asked for. One of: linkedin_engagement, own_engagement, social_listening, funding_raised, new_in_role, events, tech_adoption.
  • created_at string · required — When the search was created (ISO 8601).
  • completed_at string | null — When it finished.
  • expires_at string | null — Until when the search and its rows stay readable (30 days after it finished).
  • progress object | null — stage and message while it runs.
  • funnel object | null — What the search read on the way, such as the posts and the people seen on them.
  • result object | null — Set when status is succeeded: rows, has_more, next_cursor, total_estimate and truncated_by (max_credits or daily_limit when a cap left rows out).
  • credits object · required — charged, reserved (worst case while open, 0 when finished) and max_credits.
  • sources string[] · required — Where the rows come from: funding_data, job_postings, linkedin or web.
  • error object | null — Set when status is failed: type, message, retryable.
  • request object · required — The body as validated, with defaults filled in.
  • notes string[] · required — What was left out and what was not checked, in plain language.

Credits

Free. A cancelled search is not charged.

Errors

  • 409 invalid_state — The search already finished. The error includes its status.
  • 404 not_found — No search with this id exists for your organization.
  • 401 authentication_error — The Authorization header is missing, or the key is unknown or revoked.
  • 403 permission_error — API access is not part of your plan, or your account is suspended.
  • 403 api_not_enabled — The key is valid, but the Signals API or the Company API is not enabled for your organization yet. The error says what this key can do.
  • 429 rate_limit_error — More than 60 requests per minute, or more than 3 at the same time, on one key. Wait for the Retry-After header.
  • 500 internal_error — Something went wrong on our side.

Example

cURL

curl -X POST "https://mysdr.app/api/v1/searches/srch_01J9Z6P8C8V0K3W6T2N8R5M1XA/cancel" \
  -H "Authorization: Bearer $MYSDR_API_KEY"

JavaScript

const response = await fetch('https://mysdr.app/api/v1/searches/srch_01J9Z6P8C8V0K3W6T2N8R5M1XA/cancel', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.MYSDR_API_KEY}`
  }
});
const body = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://mysdr.app/api/v1/searches/srch_01J9Z6P8C8V0K3W6T2N8R5M1XA/cancel",
    headers={
    "Authorization": f"Bearer {os.environ['MYSDR_API_KEY']}"
    },
    method="POST",
)
with urllib.request.urlopen(request) as response:
    body = json.load(response)

Example response

{
  "id": "srch_01J9Z6P8C8V0K3W6T2N8R5M1XA",
  "object": "search",
  "status": "cancelled",
  "credits": {
    "charged": 0,
    "reserved": 0,
    "max_credits": null
  }
}