mySDRDocs

API reference

Preview company leads

What POST /leads can cost at most, with the same body. No source call and nothing is charged.

POSThttps://mysdr.app/api/v1/leads/preview
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).

Body parameters

  • companies object[] · required — 1 to 25 companies, as POST /leads accepts them.
  • filters object · required — At least one of titles (job titles, up to 10), seniority (c_level, vp, director, manager) or departments (ceo, sales, marketing, finance, operations, hr, it, talent_acquisition, engineering, product, customer_success, data, procurement, legal). countries is ISO alpha-2, up to 20. Titles rank people but do not exclude them. Departments, seniority and countries do: a department filters on LinkedIn's own function of the role (engineering keeps engineering and IT), except ceo and chief_of_staff, which only rank on title (ceo alone looks at C-level and owners). Values in one list are alternatives. roles is the earlier name of titles and still works.
  • per_company integer | null — As on POST /leads: max_rows is then this many per valid company.
  • limit integer — Caps max_rows. Defaults to 25, and without per_company one page never exceeds 25 people.
  • max_credits integer | null — Caps the preview.

Response

  • object string · required — Always cost_preview. One of: cost_preview.
  • endpoint string · required — Which call this previews. One of: searches, leads, person.enrich, monitors.
  • row_key string · required — The row type that sets the headline price.
  • credits_per_row integer · required — Credits for one row of row_key.
  • max_rows integer · required — The most rows this call can return.
  • max_credits integer · required — The most the call can spend. A max_credits you sent caps it.
  • period string · required — call for one request, day for a monitor. One of: call, day.
  • rows object[] · required — Every row type the call can deliver: row_key, credits_per_row, max_rows.
  • notes string[] · required — Plain-language limits of this preview.

Credits

Free. A delivered person on the real call costs 1 credit.

Errors

  • 400 invalid_request — The body would also be rejected by POST /leads.
  • 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/leads/preview" \
  -H "Authorization: Bearer $MYSDR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "companies": [
      {
        "domain": "acme-analytics.example"
      }
    ],
    "filters": {
      "departments": [
        "finance"
      ],
      "seniority": [
        "c_level"
      ]
    },
    "limit": 3
  }'

JavaScript

const response = await fetch('https://mysdr.app/api/v1/leads/preview', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.MYSDR_API_KEY}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "companies": [
      {
        "domain": "acme-analytics.example"
      }
    ],
    "filters": {
      "departments": [
        "finance"
      ],
      "seniority": [
        "c_level"
      ]
    },
    "limit": 3
  })
});
const body = await response.json();

Python

import json
import os
import urllib.request

payload = {
  "companies": [
    {
      "domain": "acme-analytics.example"
    }
  ],
  "filters": {
    "departments": [
      "finance"
    ],
    "seniority": [
      "c_level"
    ]
  },
  "limit": 3
}

request = urllib.request.Request(
    "https://mysdr.app/api/v1/leads/preview",
    headers={
    "Authorization": f"Bearer {os.environ['MYSDR_API_KEY']}",
    "Content-Type": "application/json"
    },
    data=json.dumps(payload).encode(),
    method="POST",
)
with urllib.request.urlopen(request) as response:
    body = json.load(response)

Example response

{
  "object": "cost_preview",
  "endpoint": "leads",
  "row_key": "leads_person",
  "credits_per_row": 1,
  "max_rows": 3,
  "max_credits": 3,
  "period": "call",
  "rows": [
    {
      "row_key": "leads_person",
      "credits_per_row": 1,
      "max_rows": 3
    }
  ],
  "notes": []
}