{"openapi":"3.1.0","info":{"title":"Data Reaktor Job Search API","description":"Find who can refer you: for a job seeker's target companies, find the people inside from public sources, score a warm path to each and draft intros the user sends themselves (Data Reaktor never sends). Use an agent key created by the user at https://www.datareaktor.ai/settings/agents (X-API-Key or Authorization: Bearer). Operations tagged \"Job search\" are the product. Operations tagged \"Legacy B2B\" belong to the older builder API: they keep working for existing builder keys, but keys made there (POST /agents) cannot use the job-search routes (403 SCOPE_REQUIRED). No key yet? An agent can register itself with POST /agents/register (no human, no email, no captcha); it gets a small capped free trial.","version":"1.5.0","contact":{"name":"Data Reaktor Support","url":"https://www.datareaktor.ai"}},"servers":[{"url":"https://www.datareaktor.ai/api/v1","description":"Production server"}],"components":{"securitySchemes":{"apiKeyHeader":{"type":"apiKey","in":"header","name":"X-API-Key","description":"Agent key (job search, created in Agent access at /settings/agents) or legacy builder key (B2B API)."},"bearerAuth":{"type":"http","scheme":"bearer","description":"Bearer token from Replit Auth session"},"AdminKey":{"type":"apiKey","in":"header","name":"X-Admin-Key","description":"Operator only"}},"schemas":{"OutreachSequenceInput":{"type":"object","required":["contactName","company","contactRole","signals","userValueProp"],"description":"Input for outreach_sequence. contactRole OR role is required (either field accepted at runtime). signals required as array (may be empty). userValueProp required; server enriches with account settings if blank string provided.","properties":{"contactName":{"type":"string","description":"Full name of the prospect","example":"Sarah Chen"},"contactRole":{"type":"string","description":"Job title / role. Runtime alias: role — either field accepted","example":"VP of Sales"},"role":{"type":"string","description":"Alias for contactRole — accepted at runtime in place of contactRole","example":"VP of Sales"},"company":{"type":"string","description":"Company name or domain","example":"Acme Corp"},"industry":{"type":"string","description":"Industry sector (optional)","example":"B2B SaaS"},"signals":{"type":"array","items":{"type":"string"},"description":"Recent signals about the contact/company — funding, hiring, news, job postings. Empty array accepted; server enriches from user context if blank.","example":["Recently raised Series B","Hiring 5 SDRs","Published article on scaling outbound"]},"userValueProp":{"type":"string","description":"Your value proposition. Required — provide empty string to fall back to account setting.","example":"I help Series B SaaS companies build outbound from scratch"},"userTone":{"type":"string","enum":["professional","casual","direct","friendly"],"default":"professional"},"sequenceObjective":{"type":"string","description":"Goal of the sequence","example":"book a discovery call"}}},"OutreachSequenceOutput":{"type":"object","properties":{"contact":{"type":"string","example":"Sarah Chen"},"company":{"type":"string","example":"Acme Corp"},"sequenceStrategy":{"type":"string","description":"2-3 sentence strategic overview of the sequence approach"},"step1_connect":{"type":"string","description":"LinkedIn connect request content (flat key, ≤300 chars)"},"step2_inmail_subject":{"type":"string","description":"LinkedIn InMail subject line (flat key)"},"step2_inmail_1":{"type":"string","description":"LinkedIn InMail body (flat key, ≤400 chars)"},"step2_email_1":{"type":"string","description":"Email follow-up body (flat key, 100-150 words)"},"step3_breakup":{"type":"string","description":"Breakup message (flat key, ≤200 chars)"},"sequence":{"type":"object","properties":{"step1":{"type":"object","description":"LinkedIn Connect Request — Day 1, max 300 chars, no pitch","properties":{"channel":{"type":"string","example":"LinkedIn Connect Request"},"sendTiming":{"type":"string","example":"Day 1"},"content":{"type":"string"},"charCount":{"type":"integer"},"notes":{"type":"string"}}},"step2":{"type":"object","description":"LinkedIn InMail — Day 4 after connection, one signal hook, max 400 chars","properties":{"channel":{"type":"string","example":"LinkedIn InMail"},"sendTiming":{"type":"string","example":"Day 4 — after connection accepted"},"subject":{"type":"string"},"content":{"type":"string"},"charCount":{"type":"integer"},"notes":{"type":"string"}}},"step3":{"type":"object","description":"Email follow-up — Day 8, different angle than step 2, 100-150 words","properties":{"channel":{"type":"string","example":"Email"},"sendTiming":{"type":"string","example":"Day 8 — if no LinkedIn response"},"subject":{"type":"string"},"previewText":{"type":"string"},"content":{"type":"string"},"charCount":{"type":"integer"},"notes":{"type":"string"}}},"step4":{"type":"object","description":"Breakup message — Day 14, graceful close, max 200 chars","properties":{"channel":{"type":"string","example":"LinkedIn Message or Email"},"sendTiming":{"type":"string","example":"Day 14 — final touch"},"content":{"type":"string"},"charCount":{"type":"integer"},"notes":{"type":"string"}}}}},"lint":{"$ref":"#/components/schemas/CopyLint"},"voiceProfile":{"$ref":"#/components/schemas/CopyVoiceProfile"}}},"LeadScoringOutput":{"type":"object","required":["score","category","reasoning","recommendedAction","tier","recommendation"],"properties":{"score":{"type":"integer","minimum":0,"maximum":100},"category":{"type":"string","enum":["A","B","C","D"],"description":"Derived from score: A=80-100, B=60-79, C=40-59, D=0-39."},"reasoning":{"type":"string"},"recommendedAction":{"type":"string"},"tier":{"type":"string","enum":["A","B","C","D"],"deprecated":true,"description":"Deprecated compatibility alias of category."},"recommendation":{"type":"string","deprecated":true,"description":"Deprecated compatibility alias of recommendedAction."},"scoreBreakdown":{"type":"object","description":"roleFit 0-30, industryFit 0-25, sizeFit 0-20, signalStrength 0-25; the score is their sum."},"scoreAdjustments":{"type":"array","items":{"type":"string"},"description":"Caps applied in code (stale or missing signals)."},"icpUsed":{"type":"object","description":"Which ICP fields reached the score and from where (1.3.0): source request | campaign | account | merged | none, fields {field: source}, missing [fields], requestKey (userICP, userIcp or user_icp), ignoredKeys (keys in the ICP object that are not ICP fields)."}}},"EnrichmentOutput":{"type":"object","required":["confidence","confidenceScore","confidenceScale","sources","sourceDates","outreachSuppressed"],"description":"Identity-safe, domain-verified enrichment output. Confidence uses a numeric 0-100 scale. Generated outreach is omitted below 60 confidence.","properties":{"confidence":{"type":"number","minimum":0,"maximum":100},"confidenceScore":{"type":"number","minimum":0,"maximum":100},"confidenceScale":{"type":"string","enum":["0-100"]},"sources":{"type":"array","items":{"type":"object"}},"sourceDates":{"type":"array","items":{"type":"string"},"description":"ISO date-time for precise source dates; a bare YYYY-MM-DD ending in ~ is an approximate date from a relative label such as '6 days ago'"},"requestedIdentity":{"type":"object"},"outreachSuppressed":{"type":"boolean"},"outreachSuppressionReason":{"type":"string"},"match":{"type":"boolean","description":"contact_lookup: false when no person was verified (completed, fully refunded, outreachSuppressed true)."},"reason":{"type":"string","enum":["no_match","ambiguous","weak_evidence"],"description":"contact_lookup no-match reason. weak_evidence: only a search-result title or snippet paired the person with the organization; a match needs a fetched page body, the organization's own site, or two independent sources (different registrable domains)."},"candidates":{"type":"array","items":{"type":"object"},"description":"contact_lookup no-match: named people at the organization (name, role, sourceUrl, source) and close name matches; always an array."},"candidatesReason":{"type":"string","description":"Why candidates is empty."},"weakEvidence":{"type":"array","items":{"type":"object"},"description":"weak_evidence no-match: the search results that paired the person with the organization, and why they were not enough."},"confidenceBasis":{"type":"object","description":"Why the confidence number: model estimate, verified ceiling, core fields missing; contact_lookup adds corroboration (page_body, first_party_page, independent_sources, supplied_linkedin_url, email_in_source), independentSources and verified {nameWithOrganization, firstPartyPage, emailFoundInSource, linkedinUrl, role}."},"conversationHook":{"type":"object","description":"contact_lookup: at most one dated, sourced fact (fact, about, sourceUrl, sourceDate) usable to open a conversation; factual, never praise. Omitted below confidence 60."},"mutualConnections":{"type":"array","items":{"type":"object"},"description":"Only when the account has a connections import: your connections at the organization (name, title, company, why, source)."},"introPath":{"type":"object","description":"Null when there is no warm path. Only when the account has a connections import: you -> connector -> target (path, connector {name, role, company, source}, relation, score 0-100, reasons, source), or null with introPathReason."},"verdictCachedAt":{"type":"string","description":"contact_lookup: set when the same request within 24 hours found no new evidence and kept the earlier verdict."},"emailStatus":{"type":"string","enum":["found_in_source","not_found"],"description":"contact_lookup: found_in_source when a cited public page prints the whole address and it is this person's; never guessed from a pattern. Before not_found, the lookup checks the addresses people publish themselves: the company's own pages (author, blog, team, contact, mailto links) and public pages that name the person with the company's domain (Hacker News profile or posts, YC launch posts, public PDFs and filings). Never LinkedIn or anything behind a login."},"emailSourceUrl":{"type":"string","description":"contact_lookup: the public page that prints the email."},"emailStatusReason":{"type":"string","enum":["pattern_collision"],"description":"contact_lookup with emailStatus not_found: pattern_collision when an address that fits the person (e.g. first name only) also fits another named person at the organization, so it is not assigned to either."},"emailNote":{"type":"string","description":"contact_lookup: why an address seen in a source was not assigned (pattern_collision), with the source URL."}}},"Task":{"type":"object","properties":{"taskId":{"type":"string","example":"AT-abc123xyz456"},"taskType":{"type":"string","enum":["personalized_email","linkedin_message","lead_scoring","cold_call_script","career_profile_parse","warm_path_score","career_intro_draft","outreach_sequence","thought_leadership","outreach_generation","research","contact_lookup","domain_to_company"]},"status":{"type":"string","enum":["queued","processing","completed","failed","cancelled"]},"inputPayload":{"type":"object"},"outputPayload":{"anyOf":[{"$ref":"#/components/schemas/LeadScoringOutput"},{"$ref":"#/components/schemas/EnrichmentOutput"},{"$ref":"#/components/schemas/PersonalizedEmailOutput"},{"$ref":"#/components/schemas/LinkedInMessageOutput"},{"$ref":"#/components/schemas/OutreachSequenceOutput"},{"$ref":"#/components/schemas/OutreachGenerationOutput"},{"type":"object"}],"description":"Present for synchronous tasks. Shape is task-specific and matches the capability outputSchema."},"creditsCharged":{"type":"integer"},"creditsRefunded":{"type":"integer","description":"Credits returned after a failed or cancelled task"},"netCreditsCharged":{"type":"integer","description":"creditsCharged minus creditsRefunded"},"billingStatus":{"type":"string","enum":["not_charged","reserved","retained","refund_pending","refunded"]},"retryable":{"type":"boolean","description":"Derived consistently on every task-read surface. True only when retrying a terminal failure is safe and potentially useful."},"executionMode":{"type":"string","enum":["native","external","external_async","cache"],"description":"How the task was executed. External enrichment never relies on a null executionModel."},"callbackDelivered":{"type":"boolean","description":"Whether the optional caller-supplied callback was delivered. This is separate from the enrichment provider callback."},"providerResponseMode":{"type":"string","enum":["callback","poll","immediate","unacknowledged"],"description":"Public provider acceptance/completion mode. Internal provider status URLs and job handles are never exposed."},"providerAcceptedAt":{"type":"string","format":"date-time","nullable":true},"providerCallbackReceivedAt":{"type":"string","format":"date-time","nullable":true},"providerDispatchAttemptCount":{"type":"integer","minimum":0,"description":"Application dispatch attempts. This remains one until provider-side idempotency is verified."},"tokensUsed":{"type":"integer","nullable":true},"errorMessage":{"type":"string","nullable":true},"errorCode":{"type":"string","nullable":true,"description":"Stable machine-readable failure or cancellation code"},"createdAt":{"type":"string","format":"date-time"},"processingStartedAt":{"type":"string","format":"date-time","nullable":true},"completedAt":{"type":"string","format":"date-time","nullable":true}}},"Skill":{"type":"object","properties":{"taskType":{"type":"string"},"filename":{"type":"string"},"purpose":{"type":"string"},"model":{"type":"string"},"isNative":{"type":"boolean","description":"true = executed synchronously in the request; false = executed asynchronously in-app (poll the task)"}}},"WorkflowDefinition":{"type":"object","properties":{"id":{"type":"string","example":"cold-outreach-full"},"name":{"type":"string","example":"Cold Outreach Full Pipeline"},"description":{"type":"string"},"creditCost":{"type":"integer","example":22},"stepCount":{"type":"integer","example":4},"steps":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string"},"name":{"type":"string"},"taskType":{"type":"string"},"description":{"type":"string"}}}},"inputSchema":{"type":"object"},"outputSchema":{"type":"object"}}},"AgentSummary":{"type":"object","description":"Public-facing fields for a sub-agent. Returned by GET /agents and GET /agents/:id. Never includes the raw API key — only the prefix.","properties":{"id":{"type":"integer","example":42},"name":{"type":"string","example":"Outreach worker — Acme pipeline"},"apiKeyPrefix":{"type":"string","example":"drk_xxxxxxxxxxxx"},"tier":{"type":"string","enum":["free","starter","growth","scale","pro"]},"callbackUrl":{"type":"string","format":"uri","nullable":true},"status":{"type":"string","enum":["active","suspended","revoked"]},"monthlyCredits":{"type":"integer","description":"Per-agent monthly credit cap (0 = no cap)"},"usedCredits":{"type":"integer","description":"Credits spent this billing period"},"fundedBalance":{"type":"integer","description":"Prepaid spendable balance"},"monthlySpendingCap":{"type":"integer","description":"Owner safety cap; 0 means unlimited"},"monthlySpent":{"type":"integer","description":"Net credits charged in the current UTC calendar month"},"monthlyAllowanceRemaining":{"type":"integer","nullable":true,"description":"Remaining finite allowance, or null when unlimited"},"canProvision":{"type":"boolean","description":"True if this key can mint sub-agents and call /billing/* endpoints on behalf of its owner"},"apiKeyExpiresAt":{"type":"string","format":"date-time","nullable":true,"description":"Only present on GET /agents/:id"},"createdAt":{"type":"string","format":"date-time"}}},"AgentWithKey":{"allOf":[{"$ref":"#/components/schemas/AgentSummary"},{"type":"object","required":["agentId","apiKey"],"properties":{"agentId":{"type":"integer","description":"Alias of `id` for back-compat with older clients","example":42},"apiKey":{"type":"string","description":"The full API key, returned EXACTLY ONCE — store it immediately. Format: `drk_<32 url-safe bytes>`.","example":"drk_THIS_IS_SHOWN_EXACTLY_ONCE_STORE_IT_NOW"}}}]},"RotatedAgentKey":{"type":"object","required":["agentId","apiKey","apiKeyPrefix","apiKeyExpiresAt"],"description":"Response from POST /agents/:id/rotate-key. The full apiKey is returned exactly once — old key is invalidated immediately.","properties":{"agentId":{"type":"integer","example":42},"id":{"type":"integer","description":"Alias of agentId","example":42},"name":{"type":"string","example":"Outreach worker — Acme pipeline"},"apiKeyPrefix":{"type":"string","example":"drk_yyyyyyyyyyyy"},"apiKey":{"type":"string","description":"Full new API key — store immediately, only shown once.","example":"drk_NEW_KEY_SHOWN_ONCE"},"apiKeyExpiresAt":{"type":"string","format":"date-time","example":"2027-04-26T00:00:00.000Z"}}},"BillingBalanceUser":{"type":"object","required":["principal","userId","purchasedCredits"],"description":"Returned by GET /billing/credits when called by a human / owner key without ?agentId=","properties":{"principal":{"type":"string","enum":["user"]},"userId":{"type":"string","example":"replit_user_abc123"},"purchasedCredits":{"type":"integer","example":4500},"monthlyRecordsRemaining":{"type":"integer","example":8200},"monthlyRecordsLimit":{"type":"integer","example":10000}}},"BillingBalanceAgent":{"type":"object","required":["principal","agentId","balance","fundedBalance","minimumTaskCredits","monthlySpendingCap","monthlySpent","monthlyAllowanceRemaining","blockingConstraint"],"description":"Returned by GET /billing/credits when an agent key calls without ?agentId=, or when ?agentId= targets an owned sub-agent. blockingConstraint reports whether the agent can afford the cheapest supported task; use POST /tasks/estimate for an exact workload.","properties":{"principal":{"type":"string","enum":["agent"]},"agentId":{"type":"integer","example":42},"balance":{"type":"integer","description":"Currently available credits on this sub-agent","example":500},"minimumTaskCredits":{"type":"integer","minimum":1,"description":"Credit cost of the cheapest supported task used to calculate blockingConstraint","example":2},"monthlyCreditCap":{"type":"integer","example":1000},"usedCredits":{"type":"integer","example":250},"fundedBalance":{"type":"integer","description":"Prepaid spendable balance","example":500},"monthlySpendingCap":{"type":"integer","description":"Owner safety cap; 0 means unlimited and does not fund the agent","example":1000},"monthlySpent":{"type":"integer","description":"Net credits charged in the current UTC calendar month","example":250},"monthlyAllowanceRemaining":{"type":"integer","nullable":true,"description":"Cap minus monthly spend; null when the cap is unlimited","example":750},"blockingConstraint":{"type":"string","nullable":true,"enum":["funded_balance","monthly_spending_cap"],"description":"Constraint blocking even the cheapest supported task, or null when at least one task is affordable","example":"funded_balance"}}},"CreditTransferResult":{"type":"object","required":["success","agentId","creditsTransferred","userPurchasedCredits","agentBalance"],"properties":{"success":{"type":"boolean","enum":[true]},"agentId":{"type":"integer","example":42},"creditsTransferred":{"type":"integer","example":500},"userPurchasedCredits":{"type":"integer","description":"Owner's remaining purchased_credits balance after the move","example":4500},"agentBalance":{"type":"integer","description":"Sub-agent's new balance after the move","example":500}}},"CheckoutSession":{"type":"object","required":["checkoutUrl","sessionId"],"description":"Stripe Checkout session. Open `checkoutUrl` in a browser to complete payment.","properties":{"checkoutUrl":{"type":"string","format":"uri","example":"https://checkout.stripe.com/c/pay/cs_test_..."},"sessionId":{"type":"string","example":"cs_test_a1B2c3D4..."},"url":{"type":"string","format":"uri","description":"Back-compat alias of `checkoutUrl` for older SDKs"}}},"ProvisioningError":{"type":"object","required":["error"],"description":"Standard error envelope used by /agents and /billing/* endpoints. `code` is a stable string suitable for switch/case logic — see GET /errors for the full registry.","properties":{"error":{"type":"string","description":"Human-readable summary"},"message":{"type":"string","description":"Optional longer human-readable explanation. Currently set on the BETA_CHECKOUT_DISABLED 503 response."},"code":{"type":"string","description":"Machine-readable error code","enum":["OWNER_SCOPE_REQUIRED","BETA_CHECKOUT_DISABLED","INSUFFICIENT_CREDITS","AGENT_NOT_OWNED","INVALID_AMOUNT","CANNOT_REVOKE_SELF"]},"details":{"description":"Optional Zod validation details for 400 responses"},"available":{"type":"integer","description":"Available credits — present on 402 INSUFFICIENT_CREDITS"},"requested":{"type":"integer","description":"Requested credits — present on 402 INSUFFICIENT_CREDITS"}}},"SetupStatus":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","required":["id","label","done","skipped","detail"],"properties":{"id":{"type":"string","enum":["resume","targets","connections","search","companies","people","draft","voice"]},"label":{"type":"string"},"done":{"type":"boolean"},"skipped":{"type":"boolean"},"optional":{"type":"boolean"},"detail":{"type":"string"}}}},"nextStep":{"type":"string","nullable":true},"nextAction":{"type":"string","nullable":true,"description":"Agent keys only: what to do for nextStep"},"percent":{"type":"integer","minimum":0,"maximum":100,"description":"Required steps done or skipped"},"doneCount":{"type":"integer"},"requiredCount":{"type":"integer"},"mode":{"type":"string","enum":["manual","agent"],"nullable":true},"skipped":{"type":"array","items":{"type":"string"}},"dismissedAt":{"type":"string","format":"date-time","nullable":true},"completedAt":{"type":"string","format":"date-time","nullable":true},"lastStep":{"type":"string","nullable":true},"connectionsRequestedAt":{"type":"string","format":"date-time","nullable":true},"agentConnected":{"type":"boolean"},"agentLastSeenAt":{"type":"string","format":"date-time","nullable":true},"hasAgentKey":{"type":"boolean"},"activeJob":{"type":"object","nullable":true,"properties":{"jobId":{"type":"string"},"status":{"type":"string"},"searchId":{"type":"integer"},"targets":{"type":"integer"},"completedTargets":{"type":"integer"},"startedBy":{"type":"string","enum":["you","agent"]}}},"search":{"type":"object","nullable":true,"properties":{"id":{"type":"integer"},"name":{"type":"string"},"targets":{"type":"integer"},"createdVia":{"type":"string","nullable":true}}}}},"NotificationSettings":{"type":"object","properties":{"settings":{"type":"object","properties":{"reminderEmails":{"type":"boolean","default":false},"weeklyDigest":{"type":"boolean","default":false},"timezone":{"type":"string"},"unsubscribedAt":{"type":"string","format":"date-time","nullable":true}}},"eligible":{"type":"boolean","description":"The plan includes the follow-up tracker; emails are only sent when true"},"recipient":{"type":"string","enum":["account_email"],"description":"Emails go only to the account owner's own address"}}},"Referral":{"type":"object","properties":{"code":{"type":"string"},"shareUrl":{"type":"string","example":"https://www.datareaktor.ai/?ref=K7QH3MXW9P"},"reward":{"type":"object","description":"What an invite claimed now earns. companies (during the beta): the friend and the user each get companiesEach extra target companies, once per friend. discount (after the beta): percent off the friend's first paid plan.","required":["kind"],"properties":{"kind":{"type":"string","enum":["companies","discount"]},"companiesEach":{"type":"integer","example":5},"percent":{"type":"integer","example":20}}},"discountPercent":{"type":"integer","description":"Percent off a referred friend's first paid plan once checkout opens, applied at checkout","example":20},"counts":{"type":"object","properties":{"joined":{"type":"integer"},"purchased":{"type":"integer"},"bonusCompanies":{"type":"integer","description":"Extra target companies this account earned from invites"}}},"referredBy":{"type":"object","nullable":true,"properties":{"discountPercent":{"type":"integer"},"discountAvailable":{"type":"boolean"},"bonusCompanies":{"type":"integer","description":"Extra target companies this account got from signing up through an invite"}}}}},"HiringSignal":{"type":"object","required":["kind","title","url","matchesTargetRole","foundAt"],"properties":{"kind":{"type":"string","enum":["job_posting"]},"title":{"type":"string","example":"Senior PM, Merchant Risk"},"url":{"type":"string","format":"uri","description":"The public posting"},"postedAt":{"type":"string","format":"date-time","nullable":true},"location":{"type":"string","nullable":true},"matchesTargetRole":{"type":"boolean"},"foundAt":{"type":"string","format":"date-time"}}},"JobSearchError":{"type":"object","required":["error","code","retryable"],"properties":{"error":{"type":"string"},"message":{"type":"string","description":"Same text as error"},"code":{"type":"string","description":"See GET /errors"},"retryable":{"type":"boolean","description":"true: send the same request again later"},"troubleshootUrl":{"type":"string"},"detail":{}}},"ProfileUpdate":{"type":"object","additionalProperties":false,"description":"Every key is optional; send only what changes. Same keys GET /job-profile returns. Also accepted as aliases: level, function, remote, roles, location (one place), salaryBand ({min,max} or \"150000-200000\"). Any other key is a 400 VALIDATION_ERROR whose detail.validKeys lists the valid keys and detail.unknownKeys the nearest one.","properties":{"fullName":{"type":"string","nullable":true,"maxLength":120},"headline":{"type":"string","nullable":true,"maxLength":300},"currentTitle":{"type":"string","nullable":true,"maxLength":200},"yearsExperience":{"type":"integer","nullable":true,"minimum":0,"maximum":60},"targetRoles":{"type":"array","maxItems":10,"items":{"type":"string","maxLength":120}},"targetLevel":{"type":"string","nullable":true,"maxLength":32,"description":"For example junior, mid, senior, staff, director, vp"},"targetFunction":{"type":"string","nullable":true,"maxLength":64,"description":"For example product, engineering, design, sales"},"salaryMin":{"type":"integer","nullable":true,"minimum":0,"maximum":10000000},"salaryMax":{"type":"integer","nullable":true,"minimum":0,"maximum":10000000},"locations":{"type":"array","maxItems":10,"items":{"type":"string","maxLength":120}},"remoteOk":{"type":"boolean"},"employers":{"type":"array","maxItems":25,"items":{"type":"object","required":["company"],"properties":{"company":{"type":"string"},"title":{"type":"string","nullable":true},"start":{"type":"string","nullable":true},"end":{"type":"string","nullable":true}}}},"schools":{"type":"array","maxItems":10,"items":{"type":"object","required":["school"],"properties":{"school":{"type":"string"},"degree":{"type":"string","nullable":true},"year":{"type":"string","nullable":true}}}},"skills":{"type":"array","maxItems":40,"items":{"type":"string","maxLength":80}},"summary":{"type":"string","nullable":true,"maxLength":2000},"onboarded":{"type":"boolean","description":"true marks setup done"},"excludedIndustries":{"type":"array","maxItems":20,"items":{"type":"string","minLength":1,"maxLength":60},"example":["adtech","marketing","shopper tracking"],"description":"Industries the account never wants to see (#295), up to 20 terms of up to 60 characters: an industry slug from the shared taxonomy (for example adtech-martech, media-marketing, software) or a short term (\"marketing\", \"shopper tracking\"). [] clears it. A company matches when the industry Data Reaktor stores for it (its Reaktor Core industry slug and label, or free-text industry from earlier enrichment) contains the term as a whole word or phrase, case-insensitive, or the term reads as that taxonomy industry (\"adtech\" and \"shopper tracking\" read as adtech-martech, \"marketing\" as media-marketing). A company with no stored industry never matches. Matching companies are left out of GET /company-suggestions (skippedCount, skipped), marked status excluded_industry when added to a search, and skipped by people:discover unless includeExcluded: true. A per-account view filter: the shared company data is not changed."}},"example":{"targetRoles":["Senior Product Manager"],"targetLevel":"senior","targetFunction":"product","locations":["New York, NY"],"remoteOk":true,"salaryMin":150000,"salaryMax":200000}},"TargetScreenCriteria":{"type":"object","additionalProperties":false,"minProperties":1,"description":"Legitimacy screen (#294). Read from the company records Data Reaktor already holds (headquarters, offices, plants and facilities from the company profile, its quoted headcount and products) and the caller's own domain_to_company result for the domain (last 180 days). Nothing is looked up and nothing is charged. Ask for at least one check.","properties":{"usPresence":{"type":"boolean","description":"true: a US headquarters, office, plant, facility or job-posting location must be on record. Places on record that are all outside the US fail (\"no US address found (on record: Monterrey, Mexico)\"); no place on record, or one that names no country, is unknown."},"headcountRange":{"type":"array","minItems":2,"maxItems":2,"items":{"type":"integer","minimum":0},"example":[20,200],"description":"[min, max] employees. Exact counts are used first, stated bands (\"51-200\") only without one. Every source inside: pass; every source outside: fail (\"headcount 8 outside 20-200\"); none: unknown (\"no headcount on record\"); sources that disagree, or a band partly inside: unknown."},"requireLiveProduct":{"type":"boolean","description":"true: a product on record passes; a parked or placeholder website fails; otherwise unknown (\"no product on record\")."},"criteria":{"type":"array","minItems":1,"maxItems":5,"items":{"type":"string","minLength":1,"maxLength":120},"example":["runs its own CNC machining","has a quality team"],"description":"#359: what makes a company worth contacting, in the user's own words (1 to 5, up to 120 characters each, each once). POST /searches/{id}/targets only (not suggestions). Each criterion is judged only from the company facts Data Reaktor has stored (no web research) and gets a verdict in screen.criteriaResults. A search's companies carry at most 5 different criteria (400 VALIDATION_ERROR, detail.inSearch); adding a company again replaces its own. Free during the beta; each company screened with criteria counts one of the account's daily criteria screens (default 100; 429 SCREEN_CRITERIA_LIMIT_REACHED, nothing added). 503 SCREEN_CRITERIA_DISABLED when switched off."},"criteriaMode":{"type":"string","enum":["report","all"],"default":"report","description":"#359: report records the verdicts and changes no result or status. all: a no_match on any criterion fails the screen (status screened_out); otherwise an unsure one makes a pass unknown. Needs criteria."}}},"TargetScreen":{"type":"object","description":"The latest screen of one company. unknown is never counted as a pass or a fail.","properties":{"result":{"type":"string","enum":["pass","fail","unknown"]},"reasons":{"type":"array","items":{"type":"string"},"description":"fail: the failed checks' reasons; unknown: what is missing; pass: empty","example":["no US address found (on record: Monterrey, Mexico)","headcount 8 outside 20-200"]},"missing":{"type":"array","items":{"type":"string","enum":["location","headcount","product"]},"description":"Fields that would settle the unknown checks"},"checks":{"type":"array","items":{"type":"object","properties":{"check":{"type":"string","enum":["usPresence","headcountRange","requireLiveProduct"]},"result":{"type":"string","enum":["pass","fail","unknown"]},"reason":{"type":"string"},"missing":{"type":"string"},"evidence":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"source":{"type":"string","enum":["company_profile","domain_to_company","company_cache"]},"url":{"type":"string","nullable":true}}}}}}},"criteria":{"$ref":"#/components/schemas/TargetScreenCriteria"},"sourcesRead":{"type":"array","items":{"type":"string","enum":["company_profile","domain_to_company","company_cache"]}},"domain":{"type":"string","nullable":true},"screenedAt":{"type":"string","format":"date-time"},"version":{"type":"string","example":"1.0.0"},"criteriaResults":{"type":"array","description":"#359: one verdict per free-text criterion, in the order asked; absent when none were asked. match and no_match always cite at least one stored fact (a verdict without a citation, or citing a fact the company does not have, is turned to unsure before it is returned). unsure means nothing on record settles it: never present it as a no.","items":{"type":"object","properties":{"criterion":{"type":"string"},"verdict":{"type":"string","enum":["match","no_match","unsure"]},"reason":{"type":"string","example":"The company says it machines every part in-house."},"citations":{"type":"array","items":{"type":"object","properties":{"claimId":{"type":"integer"},"sourceUrl":{"type":"string"},"fact":{"type":"string"}}}}}}},"criteriaCheck":{"type":"object","description":"#359: how the criteria were checked. claimsRead: stored facts with a source URL read for the company; modelCalled false when nothing was on record (skipped no_facts), today's limit was used (daily_limit) or the check could not run (model_error); rejected: verdicts turned to unsure by the citation check. A re-screen when missing facts arrive (#341) keeps these verdicts; add the company again with the criteria to judge them again.","properties":{"mode":{"type":"string","enum":["report","all"]},"claimsRead":{"type":"integer"},"modelCalled":{"type":"boolean"},"rejected":{"type":"integer"},"skipped":{"type":"string","enum":["no_facts","daily_limit","model_error"]},"checkedAt":{"type":"string","format":"date-time"},"version":{"type":"string","example":"1.0.0"}}},"pending":{"type":"object","nullable":true,"description":"#341: on a target whose unknown result is missing a field a company profile can fill (headcount, location, product): a profile was requested (free) and the company is screened again when the facts arrive. Absent once they arrived (pass or fail), the profile came back without them, or after 7 days. The target's screenPending says whether it is still awaited.","properties":{"fields":{"type":"array","items":{"type":"string","enum":["headcount","location","product"]}},"requestedAt":{"type":"string","format":"date-time"},"via":{"type":"string","enum":["profile_request"]}}}}},"ScreenedOutTarget":{"type":"object","properties":{"targetId":{"type":"integer"},"companyName":{"type":"string"},"reasons":{"type":"array","items":{"type":"string"}}}},"JobEstimate":{"type":"object","properties":{"credits":{"type":"integer","description":"Upper bound charged to a personal key's monthly cap"},"units":{"type":"object","properties":{"targetCompanies":{"type":"integer"},"insidePeople":{"type":"integer"},"warmPathScores":{"type":"integer"},"drafts":{"type":"integer"}}}}},"JobView":{"type":"object","properties":{"jobId":{"type":"string","example":"JOB-3fQ9xV0aK2pL"},"status":{"type":"string","enum":["queued","processing","completed","failed","cancelled"]},"searchId":{"type":"integer"},"targets":{"type":"integer"},"completedTargets":{"type":"integer"},"log":{"type":"array","items":{"type":"object","properties":{"at":{"type":"string"},"step":{"type":"string"},"ref":{"type":"string"},"status":{"type":"string"},"message":{"type":"string"}}}},"estimate":{"$ref":"#/components/schemas/JobEstimate"},"error":{"type":"string","nullable":true},"creditsCharged":{"type":"integer","description":"Credits for the work done so far (final once the job ends). An agent key's reservation is settled to this figure."},"skippedForIndustry":{"type":"array","items":{"$ref":"#/components/schemas/SkippedForIndustry"},"description":"Only when targets were left out for the account's excludedIndustries; each also has a \"skipped\" log line."}}},"SkippedForIndustry":{"type":"object","description":"A target people:discover (or /estimate) left out because its stored industry matches the account's excludedIndustries. Nothing is charged for it.","properties":{"targetId":{"type":"integer"},"companyName":{"type":"string"},"term":{"type":"string","description":"The account's term that matched","example":"adtech"},"industry":{"type":"string","description":"The company's stored industry (taxonomy slug, or free text)","example":"adtech-martech"},"label":{"type":"string","example":"Ad tech and marketing technology"},"message":{"type":"string"}}},"ExcludedIndustry":{"type":"object","nullable":true,"description":"On a target: the account's excludedIndustries term its stored industry matches (null when none). While such a target has not been searched its status reads excluded_industry.","properties":{"term":{"type":"string","example":"adtech"},"industry":{"type":"string","example":"adtech-martech"},"label":{"type":"string","example":"Ad tech and marketing technology"}}},"Plan":{"type":"object","properties":{"plan":{"type":"string","enum":["free","job_hunt","search_pass","search_pass_ext","job_hunt_90d","owner"]},"planName":{"type":"string"},"beta":{"type":"boolean","description":"True while the beta runs (for every plan). During the beta, Free accounts get the Job Hunt allowances, including 1 agent key."},"betaNote":{"type":"string","nullable":true},"agentKeys":{"type":"integer","description":"Active agent keys this plan allows"},"meters":{"type":"object","description":"Plan units: targetCompanies, insidePeople, warmPathScores, drafts; each { grant, used, remaining } (null = unlimited)"},"freePeople":{"type":"object","description":"People on your boards this period that insidePeople doesn't count (free): from your connections export, or added by you","properties":{"fromConnections":{"type":"integer"},"addedByYou":{"type":"integer"}}},"key":{"type":"object","nullable":true,"description":"This key's monthly credit cap: { cap, spent, remaining } (null for people in the app)"},"creditsInfo":{"type":"object","description":"What a credit is. Credits only limit agent keys (monthly cap, per-run max_credits), are never bought and have no money value; the plan meters units.","properties":{"definition":{"type":"string"},"bought":{"type":"boolean","enum":[false]},"costs":{"type":"object"},"responseField":{"type":"string","enum":["creditsCharged"]}}}}},"JobDraft":{"type":"object","properties":{"id":{"type":"integer"},"personId":{"type":"integer"},"mode":{"type":"string"},"linkedinConnect":{"type":"string","maxLength":300},"linkedinMessage":{"type":"string"},"emailSubject":{"type":"string"},"emailBody":{"type":"string"},"whyThisWorks":{"type":"string"},"delivery":{"type":"string","enum":["user_sends"],"description":"Data Reaktor never sends. The user copies and sends."},"status":{"type":"string","enum":["draft","copied","sent"]},"contextUsed":{"type":"object","nullable":true,"description":"Plain summary of the user's own writing context behind this draft, and the check against their rules before it was returned (null on older drafts).","properties":{"voice":{"type":"boolean","description":"Something learned from the user's own feedback shaped this draft"},"purpose":{"type":"string","enum":["discovery"],"description":"#292: present on a discovery draft only (absent = job search)."},"traits":{"type":"array","items":{"type":"string"},"example":["shorter","casual"]},"examples":{"type":"integer","description":"Style examples used"},"rules":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"source":{"type":"string","enum":["learned","you"]}}}},"sources":{"type":"array","items":{"type":"string"},"example":["your profile","your writing rules"]},"ruleConflicts":{"type":"array","description":"#340: the user's rules used for this draft that contradict each other (one requires a phrase or title another bans). Absent when none. The draft followed the rules as written; the user decides which to change.","items":{"type":"object","properties":{"ruleA":{"type":"string","description":"Key of the rule that requires it"},"ruleB":{"type":"string","description":"Key of the rule that bans it"},"reason":{"type":"string"}}}},"introducer":{"type":"object","description":"#296: present on a draft written with introducer. The texts the user sends to the introducer; the name appears only inside introducerNote.","properties":{"relation":{"type":"string"},"pathLabel":{"type":"string","example":"Through an introducer (partner at a consultancy that works with the company)"},"introducerNote":{"type":"string"},"forwardableBlurb":{"type":"string"},"source":{"type":"string","enum":["model","template"],"description":"template: the model text failed a check or timed out, so a fixed template was used"}}},"check":{"type":"object","nullable":true,"properties":{"checked":{"type":"array","items":{"$ref":"#/components/schemas/DraftRuleCheckItem"}},"violated":{"type":"array","items":{"type":"string"},"description":"Check ids the first draft broke"},"repaired":{"type":"array","items":{"$ref":"#/components/schemas/DraftRuleCheckItem"},"description":"Fixed by the single repair pass"},"remaining":{"type":"array","items":{"$ref":"#/components/schemas/DraftRuleCheckItem"},"description":"Still broken; the user may trim by hand"},"repairRan":{"type":"boolean"},"notChecked":{"type":"array","items":{"type":"object","properties":{"rule":{"type":"string"},"text":{"type":"string"}}},"description":"Active rules that need judgement: given to the model, not checked mechanically"},"fixedInCode":{"type":"array","items":{"type":"string"},"description":"Check ids fixed in code after the repair pass (paragraph spacing, footer order, banned sentences, dashes, greeting)"}}}}},"pathType":{"type":"string","nullable":true,"description":"The route the draft was written for (first_degree, mutual_connection, former_colleague, alumni, cold). Null on older drafts."},"pathScore":{"type":"integer","nullable":true},"connectorName":{"type":"string","nullable":true,"description":"The connector the draft was written for (connector_ask)."},"stale":{"type":"boolean","description":"The person's best path changed since this draft was written: write a new version."},"staleReason":{"type":"string","nullable":true,"example":"Written for an older route. The best way in is now through James Markarian (a mutual connection, score 77)."},"currentRoute":{"type":"object","nullable":true,"properties":{"pathType":{"type":"string"},"score":{"type":"integer"},"connectorName":{"type":"string","nullable":true}}}}},"DraftRuleCheckItem":{"type":"object","properties":{"id":{"type":"string"},"rule":{"type":"string","description":"Writing rule key (see GET /writing-context)"},"kind":{"type":"string","enum":["max_length","tone_casual","tone_formal","banned_phrase","no_exclamation","one_question","no_greeting","greeting_name","footer","paragraph_spacing","no_dashes","no_link","no_booking_cta","opening_line","required_fact"]},"label":{"type":"string","example":"under 450 characters"},"fixed":{"type":"string","example":"kept under 450 characters"}}},"FollowUp":{"type":"object","properties":{"id":{"type":"integer"},"personId":{"type":"integer"},"draftId":{"type":"integer","nullable":true},"occurredAt":{"type":"string","format":"date-time"},"followUpDueAt":{"type":"string","format":"date-time"},"due_outcome_prompt":{"type":"boolean","description":"Due, and no outcome recorded since the note was sent: ask the user \"Did they reply?\" and record it with POST /people/{personId}/outcome (or snooze 3 days for \"not yet\")"},"outcome_since_sent":{"type":"string","nullable":true,"enum":["replied","meeting","no_reply","not_relevant","bounced"]}}},"SearchExportRow":{"type":"object","additionalProperties":false,"required":["company","domain","personName","title","roleConfidence","personCheckFlags","sourceUrl","warmPathScore","warmPathType","warmPathReason","email","emailSourceUrl","status","lastSentAt","personId"],"properties":{"company":{"type":"string"},"domain":{"type":"string","nullable":true},"personName":{"type":"string"},"title":{"type":"string","nullable":true},"roleConfidence":{"type":"integer","minimum":0,"maximum":100,"description":"How sure the role claim is (roleClaim.confidence)"},"personCheckFlags":{"type":"array","items":{"type":"string","enum":["stale_title","left_company","wrong_site","directory_only","social_only"]},"description":"#338 person checks to look at before writing (CSV: joined with \"; \")"},"sourceUrl":{"type":"string","nullable":true,"description":"The public page that names them (null for the user's own connections)"},"warmPathScore":{"type":"integer","nullable":true,"description":"Best warm-path score, 0-100 (null when not scored)"},"warmPathType":{"type":"string","nullable":true},"warmPathReason":{"type":"string","nullable":true,"description":"The best path's reasons, joined with \"; \""},"email":{"type":"string","nullable":true,"description":"Only an address already found on a public page; nothing is looked up or guessed for the export"},"emailSourceUrl":{"type":"string","nullable":true},"status":{"type":"string","enum":["new","drafted","contacted","replied","dismissed"]},"lastSentAt":{"type":"string","format":"date-time","nullable":true,"description":"Latest send the user reported"},"personId":{"type":"integer"}}},"SearchExport":{"type":"object","required":["search","exportedAt","includeDismissed","count","people","format","fileName","creditsCharged"],"properties":{"search":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer"},"name":{"type":"string"}}},"exportedAt":{"type":"string","format":"date-time"},"includeDismissed":{"type":"boolean"},"count":{"type":"integer","minimum":0},"people":{"type":"array","items":{"$ref":"#/components/schemas/SearchExportRow"}},"format":{"type":"string","enum":["json"]},"fileName":{"type":"string","example":"senior-pm-fintech.json"},"creditsCharged":{"type":"integer","enum":[0]}}},"CopyLintFlag":{"type":"object","required":["category","match"],"properties":{"category":{"type":"string","enum":["ai_vocabulary","puffed_significance","negative_parallelism","colon_reveal","rule_of_three","trailing_ing","stock_phrase","vague_attribution","formatting","profile","echoed_signal","contrast_setup"]},"match":{"type":"string","description":"The text that tripped the check"},"index":{"type":"integer","description":"Character offset in the field"},"field":{"type":"string","description":"Output field path, e.g. body or sequence.step1.content"},"check":{"type":"string","enum":["greeting","paragraph_sentences","max_words","sign_off","banned_phrase","booking_link","first_touch_url"],"description":"Profile flags only"}}},"CopyLint":{"type":"object","description":"LLM-tell lint of the generated copy (additive, optional). Flow: generate, lint, safe fixes in code (dashes, curly quotes, markdown, bullets, emoji), then at most ONE model rewrite of the flagged fields, code fixes again, re-lint. Never a second rewrite; no extra credits.","required":["passed","flags","rewritten","fixedInCode","fixedByRewrite","initialFlags","version"],"properties":{"passed":{"type":"boolean","description":"True when no flags remain"},"flags":{"type":"array","items":{"$ref":"#/components/schemas/CopyLintFlag"},"description":"Flags still present in the returned copy"},"rewritten":{"type":"boolean","description":"Whether the one rewrite pass ran and was applied"},"fixedInCode":{"type":"array","items":{"type":"string"},"description":"Categories cleared by deterministic code fixes, plus \"profile/<check>\" for a profile check they cleared (e.g. \"profile/paragraph_sentences\")"},"fixedByRewrite":{"type":"array","items":{"type":"string"},"description":"Categories cleared by the rewrite"},"initialFlags":{"type":"array","items":{"$ref":"#/components/schemas/CopyLintFlag"},"description":"Flags on the first draft"},"version":{"type":"string","enum":["1"]},"rewriteError":{"type":"string","enum":["invalid_json","rewrite_failed"],"description":"Only when the rewrite call failed; the code-fixed copy is returned"}}},"CopyVoiceProfile":{"type":"object","description":"The effective voice profile used for this run (additive, optional). Gold example text is not echoed.","properties":{"source":{"type":"string","enum":["default","account","run"]},"greetingStyle":{"type":"string"},"maxParagraphSentences":{"type":"integer"},"maxWords":{"type":"integer"},"signOff":{"type":"string"},"bannedPhrases":{"type":"array","items":{"type":"string"}},"goldExampleCount":{"type":"integer"}}},"VoiceProfile":{"type":"object","description":"Voice profile for personalized_email, linkedin_message, outreach_sequence and outreach_generation. Effective = built-in default ← account (PUT /voice-profile) ← run (inputPayload.voiceProfile), field by field.","properties":{"greetingStyle":{"type":"string","maxLength":80,"default":"FirstName,","description":"First line, alone. The token FirstName becomes the recipient's first name."},"maxParagraphSentences":{"type":"integer","minimum":1,"maximum":5,"default":2},"maxWords":{"type":"integer","minimum":20,"maximum":400,"default":85,"description":"Body word cap (greeting and sign-off not counted). Wins over word ranges in a skill's output schema."},"signOff":{"type":"string","maxLength":300,"description":"May be multi-line. Default: the account's first name. Empty = none required."},"bannedPhrases":{"type":"array","maxItems":50,"items":{"type":"string","maxLength":120,"pattern":"^[^\\r\\n]*$"},"description":"One line each"},"goldExamples":{"type":"array","minItems":1,"maxItems":4,"items":{"type":"string","maxLength":1500},"description":"Messages in the sender's own voice; the model imitates their voice and shape."},"draftVoice":{"type":"object","nullable":true,"description":"The draft voice for POST /people/{id}/drafts and career_intro_draft (rules, exemplars by archetype, asks, banned phrases and patterns, footers, subjectStyle). null removes it. See docs/voice-profile.md.","additionalProperties":true,"properties":{"subjectStyle":{"$ref":"#/components/schemas/DraftVoiceSubjectStyle"}}}},"additionalProperties":false},"DraftVoiceSubjectStyle":{"type":"object","description":"How this account's email subjects read (draftVoice.subjectStyle). Account wording, not code: the instruction and examples go into the request, the other fields are checked by the draft lint (rule subject_quality, direct-ask drafts only). A subject that fails is rewritten up to 3 attempts in total.","additionalProperties":false,"properties":{"instruction":{"type":"string","minLength":1,"maxLength":300,"description":"One sentence telling the writer what the subject names. Absent: the product default (2 to 6 words that name something specific about the person)."},"exemplars":{"type":"array","maxItems":8,"items":{"type":"string","minLength":1,"maxLength":70},"description":"Example subjects of the style. Style only: a draft subject that copies one (a 3-word run) is rejected."},"minWords":{"type":"integer","minimum":1,"maximum":12},"maxWords":{"type":"integer","minimum":1,"maximum":12,"description":"Must not be below minWords."},"namesFact":{"type":"boolean","description":"The subject must carry a distinctive word of the hook or the notes, not only the company or the role."},"namesProperNoun":{"type":"boolean","description":"When the hook text contains a proper noun (a talk, product or event name; the recipient's name, the source and the company do not count), the subject must carry one of them."},"namesCompany":{"type":"boolean","description":"The subject must carry the recipient's company name. Off unless set."}}},"PersonalizedEmailOutput":{"type":"object","required":["subjectLine","previewText","body","callToAction","characterCount"],"properties":{"subjectLine":{"type":"string"},"previewText":{"type":"string"},"body":{"type":"string","description":"Greeting line, body (at most the profile's maxWords), sign-off"},"callToAction":{"type":"string"},"characterCount":{"type":"integer"},"lint":{"$ref":"#/components/schemas/CopyLint"},"voiceProfile":{"$ref":"#/components/schemas/CopyVoiceProfile"}}},"LinkedInMessageOutput":{"type":"object","required":["connectRequest","followUpMessage","connectCharCount","followUpCharCount"],"properties":{"connectRequest":{"type":"string","description":"≤300 chars"},"followUpMessage":{"type":"string"},"connectCharCount":{"type":"integer"},"followUpCharCount":{"type":"integer"},"lint":{"$ref":"#/components/schemas/CopyLint"},"voiceProfile":{"$ref":"#/components/schemas/CopyVoiceProfile"}}},"OutreachGenerationOutput":{"type":"object","properties":{"contact_name":{"type":"string"},"company":{"type":"string"},"linkedin_connect":{"type":"string","description":"≤300 chars"},"inmail_subject_1":{"type":"string","description":"≤60 chars"},"inmail_body_1":{"type":"string","description":"≤400 chars"},"inmail_subject_2":{"type":"string","description":"≤60 chars"},"inmail_body_2":{"type":"string","description":"≤300 chars"},"lint":{"$ref":"#/components/schemas/CopyLint"},"voiceProfile":{"$ref":"#/components/schemas/CopyVoiceProfile"}}},"NextStep":{"type":"object","required":["action","description"],"properties":{"action":{"type":"string","example":"ask_user_to_upgrade"},"description":{"type":"string"},"method":{"type":"string"},"url":{"type":"string"}}},"ErrorWithNextSteps":{"type":"object","required":["error","code"],"properties":{"error":{"type":"string"},"code":{"type":"string","description":"Stable code from GET /errors"},"retryable":{"type":"boolean"},"detail":{"type":"object","additionalProperties":true},"nextSteps":{"type":"array","items":{"$ref":"#/components/schemas/NextStep"},"description":"What to do next, machine-readable. Honour the Retry-After header on 429/503."}}},"AgentRegistration":{"type":"object","required":["name","acceptTerms"],"additionalProperties":false,"properties":{"name":{"type":"string","minLength":3,"maxLength":64,"description":"Letters, numbers, spaces and . _ : / @ ( ) + -. Unique, case-insensitive.","example":"my-agent"},"acceptTerms":{"type":"boolean","enum":[true],"description":"Must be true: you accept https://www.datareaktor.ai/terms-of-service"},"purpose":{"type":"string","maxLength":280,"description":"Optional: what you will use it for"},"homepage":{"type":"string","format":"uri","description":"Optional https URL of the agent or its operator"},"utm_source":{"type":"string","maxLength":120,"description":"Optional attribution (body or query string). Counted for signups only."},"utm_medium":{"type":"string","maxLength":120},"utm_campaign":{"type":"string","maxLength":120},"utm_term":{"type":"string","maxLength":120},"utm_content":{"type":"string","maxLength":120},"ref":{"type":"string","maxLength":120,"description":"Optional referrer code or name"},"landing":{"type":"string","maxLength":120,"description":"Optional page or doc the agent found us on"},"test":{"type":"boolean","description":"Optional: true marks a test registration, kept out of signup counts"}}},"TrialLimits":{"type":"object","description":"Free-trial limits an agent can plan a batch against. Also in GET /whoami (trial.limits) and GET /agent/account. A 402/429 on a trial key carries the same facts plus nextSteps.","properties":{"requestsPerMinute":{"type":"integer","description":"Per key. Over it: 429 TRIAL_RATE_LIMITED with Retry-After."},"lookupsPerDay":{"type":"integer","description":"Contact and company lookups per UTC day. Over it: 429 DAILY_LIMIT_REACHED with detail.resetsAt."},"trialCredits":{"type":"integer","description":"Credits for the whole trial (a lifetime cap). Over it: 402 KEY_SPEND_CAP_REACHED, nothing charged."},"trialDays":{"type":"integer"},"creditCosts":{"type":"object","additionalProperties":{"type":"integer"},"description":"Credits per action, to budget a workflow before starting."},"creditScope":{"type":"string","enum":["lifetime_of_trial"]},"beta":{"type":"boolean","description":"True while BETA_MODE is on; limits are beta defaults and can be tightened when the beta ends."}}},"AgentRegistered":{"type":"object","properties":{"agentId":{"type":"integer"},"name":{"type":"string"},"apiKey":{"type":"string","description":"Shown once. Send as X-API-Key or Authorization: Bearer."},"shownOnce":{"type":"boolean","enum":[true]},"keyPrefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"trial":{"type":"object","properties":{"credits":{"type":"integer"},"grant":{"type":"string","enum":["full","reduced"],"description":"reduced: this address already had a full trial today"},"expiresAt":{"type":"string","format":"date-time"},"note":{"type":"string"}}},"limits":{"$ref":"#/components/schemas/TrialLimits"},"endpoints":{"type":"object","additionalProperties":{"type":"string"}},"nextSteps":{"type":"array","items":{"$ref":"#/components/schemas/NextStep"}},"paidTopUp":{"type":"object","properties":{"available":{"type":"boolean"},"note":{"type":"string"}}}}},"AdminAgentSignups":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time"},"signupOpen":{"type":"boolean"},"signups":{"type":"object","properties":{"total":{"type":"integer"},"today":{"type":"integer"},"last7Days":{"type":"integer"},"claimed":{"type":"integer"}}},"trialCredits":{"type":"object","description":"The daily spend budget meters credits USED by trial keys today (UTC), not credits granted.","properties":{"usedToday":{"type":"integer","description":"Net credits spent today by all trial keys (charges minus refunds)"},"grantedToday":{"type":"integer"},"outstanding":{"type":"integer","description":"Unspent credits on live (active, unexpired) trial keys"},"remaining":{"type":"integer","description":"dailySpendBudget - usedToday"},"dailySpendBudget":{"type":"integer"},"outstandingCap":{"type":"integer"},"outstandingRemaining":{"type":"integer"},"grantsToday":{"type":"object","properties":{"full":{"type":"integer"},"reduced":{"type":"integer"}}},"grantedTotal":{"type":"integer"},"usedTotal":{"type":"integer"}}},"costPerCredit":{"type":"object","description":"USD per credit from the provider cost each lookup records (model tokens and search queries at list price). usdPerCredit is null until there is data.","properties":{"usdPerCredit":{"type":"number","nullable":true},"costUsd":{"type":"number"},"credits":{"type":"integer"},"tasks":{"type":"integer"},"windowDays":{"type":"integer"},"usdAtDailyBudget":{"type":"number"},"source":{"type":"string"}}},"config":{"type":"object","additionalProperties":true}}},"AdminTaskLatency":{"type":"object","properties":{"timestamp":{"type":"string","format":"date-time"},"windowDays":{"type":"integer"},"byType":{"type":"array","items":{"type":"object","properties":{"taskType":{"type":"string"},"count":{"type":"integer"},"endToEnd":{"type":"object","properties":{"p50Ms":{"type":"integer"},"p95Ms":{"type":"integer"}}},"run":{"type":"object","properties":{"p50Ms":{"type":"integer","nullable":true},"p95Ms":{"type":"integer","nullable":true}}}}}}}}}},"security":[{"apiKeyHeader":[]},{"bearerAuth":[]}],"paths":{"/tasks":{"post":{"summary":"Submit a task","description":"Submit a task for execution. Native generation, enrichment cache hits, and immediate provider completion return 200. Contact and company enrichment accepted for asynchronous processing return 202 and finish through one signed terminal callback or a stable provider status URL. Terminal provider failures return 502, 503, or 504 and are never represented as 202. Poll GET /tasks/{taskId} every 2 seconds until completed, failed, or cancelled.","operationId":"createTask","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["taskType","inputPayload"],"properties":{"taskType":{"type":"string","enum":["personalized_email","linkedin_message","lead_scoring","cold_call_script","outreach_sequence","thought_leadership","outreach_generation","research","contact_lookup","domain_to_company"]},"inputPayload":{"type":"object","description":"Schema varies by taskType — see GET /skills for per-skill input schemas"},"callbackUrl":{"type":"string","format":"uri","description":"Optional webhook URL for async task completion notification"}}},"example":{"taskType":"personalized_email","inputPayload":{"contactName":"Sarah Chen","contactRole":"VP of Sales","company":"Acme Corp","industry":"B2B SaaS","signals":["Recently raised Series B","Hiring 3 SDRs"],"userValueProp":"I help Series A-B SaaS companies build outbound from scratch as a fractional VP of Sales"}}}}},"responses":{"200":{"description":"Task completed immediately — native output, enrichment cache hit, or validated immediate provider output included","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Task"},{"type":"object","properties":{"output":{"type":"object"},"tokensUsed":{"type":"integer"}}}]}}}},"202":{"description":"Task accepted and currently queued or processing. Poll GET /tasks/{taskId} every 2 seconds until terminal.","content":{"application/json":{"schema":{"type":"object","properties":{"taskId":{"type":"string"},"status":{"type":"string","enum":["queued","processing"]},"estimatedCredits":{"type":"integer"},"creditsCharged":{"type":"integer"},"creditsRefunded":{"type":"integer"},"netCreditsCharged":{"type":"integer"},"billingStatus":{"type":"string","enum":["reserved","retained","refund_pending","refunded"]},"pollUrl":{"type":"string"},"pollAfterMs":{"type":"integer","example":2000}}}}}},"400":{"description":"Invalid task type or input payload"},"401":{"description":"Missing or invalid API key"},"402":{"description":"Insufficient credits"},"502":{"description":"Provider rejected the contract, returned invalid output, or failed enrichment identity/domain quality validation. Task is terminally failed and charged credits are refunded."},"503":{"description":"Enrichment provider was unavailable. Task is terminally failed, retryable is true, and charged credits are refunded."},"504":{"description":"Enrichment provider acknowledgement timed out. Task is terminally failed, retryable is true, and charged credits are refunded."}},"tags":["Legacy B2B"],"x-legacy":true},"get":{"summary":"List tasks","operationId":"listTasks","parameters":[{"name":"limit","in":"query","schema":{"type":"integer","default":50}},{"name":"offset","in":"query","schema":{"type":"integer","default":0}}],"responses":{"200":{"description":"List of tasks","content":{"application/json":{"schema":{"type":"object","properties":{"tasks":{"type":"array","items":{"$ref":"#/components/schemas/Task"}},"pagination":{"type":"object","properties":{"limit":{"type":"integer"},"offset":{"type":"integer"},"count":{"type":"integer"}}}}}}}}},"tags":["Legacy B2B"],"x-legacy":true}},"/tasks/{taskId}":{"get":{"summary":"Get task details","operationId":"getTask","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Task details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"}}}},"404":{"description":"Task not found"}},"tags":["Legacy B2B"],"x-legacy":true},"delete":{"summary":"Cancel a queued task","operationId":"cancelTask","parameters":[{"name":"taskId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Cancellation won the queued-state race; status is cancelled and credits were refunded","content":{"application/json":{"schema":{"type":"object","properties":{"taskId":{"type":"string"},"status":{"type":"string","enum":["cancelled"]},"code":{"type":"string","enum":["TASK_CANCELLED"]}}}}}},"400":{"description":"Task was already known not to be queued"},"409":{"description":"Cancellation lost a race with execution or another terminal transition"}},"tags":["Legacy B2B"],"x-legacy":true}},"/skills":{"get":{"summary":"List available skills","description":"Returns all available skill definitions including their purpose, model, and whether they execute synchronously or asynchronously","operationId":"listSkills","security":[],"responses":{"200":{"description":"Skills registry","content":{"application/json":{"schema":{"type":"object","properties":{"skills":{"type":"array","items":{"$ref":"#/components/schemas/Skill"}}}}}}}},"tags":["Legacy B2B"],"x-legacy":true,"deprecated":true}},"/capabilities":{"get":{"summary":"List service capabilities and credit costs","operationId":"getCapabilities","security":[],"responses":{"200":{"description":"Capabilities including individual task types and multi-step workflows","content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"string"},"services":{"type":"array","items":{"type":"object","properties":{"taskType":{"type":"string"},"credits":{"type":"integer"},"rateLimit":{"type":"integer"}}}},"workflows":{"type":"array","description":"Pre-built multi-step workflow definitions","items":{"$ref":"#/components/schemas/WorkflowDefinition"}}}}}}}},"tags":["Legacy B2B"],"x-legacy":true,"deprecated":true}},"/workflows":{"get":{"summary":"List available multi-step workflows","description":"Returns all pre-built workflow definitions with their steps, credit costs, and input/output schemas. No authentication required.","operationId":"listWorkflows","security":[],"responses":{"200":{"description":"Workflow registry","content":{"application/json":{"schema":{"type":"object","properties":{"workflows":{"type":"array","items":{"$ref":"#/components/schemas/WorkflowDefinition"}}}}}}}},"tags":["Legacy B2B"],"x-legacy":true,"deprecated":true},"post":{"summary":"Submit a multi-step workflow","description":"Submit a named workflow with a single input payload. Credits for all steps are charged upfront. Returns immediately with a taskId — poll GET /tasks/{taskId} for step-by-step progress.","operationId":"submitWorkflow","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["workflowId","inputPayload"],"properties":{"workflowId":{"type":"string","enum":["cold-outreach-full","lead-qualification","account-research"],"description":"The workflow to execute — use GET /workflows to list available options"},"inputPayload":{"type":"object","description":"Workflow input — schema varies by workflowId, see GET /workflows for inputSchema"},"callbackUrl":{"type":"string","format":"uri","description":"Optional webhook URL — receives the final workflow result when all steps complete"}}},"example":{"workflowId":"cold-outreach-full","inputPayload":{"domain":"acme.com","userValueProp":"I help Series B SaaS companies build outbound from scratch","userTone":"professional"}}}}},"responses":{"202":{"description":"Workflow accepted — poll GET /tasks/{taskId} for progress","content":{"application/json":{"schema":{"type":"object","properties":{"taskId":{"type":"string","example":"WF-abc123xyz456"},"workflowId":{"type":"string"},"workflowName":{"type":"string"},"status":{"type":"string","enum":["processing"]},"totalSteps":{"type":"integer"},"creditsCharged":{"type":"integer"},"message":{"type":"string"}}}}}},"400":{"description":"Unknown workflowId or invalid input"},"401":{"description":"Missing or invalid API key"},"402":{"description":"Insufficient credits"}},"tags":["Legacy B2B"],"x-legacy":true,"deprecated":true}},"/agents":{"get":{"summary":"List sub-agents","description":"Owner-scoped list of sub-agents.\n\n- A human session or an owner key (`canProvision=true`) returns every agent owned by the calling user.\n- A non-owner agent key returns a single-element array containing only itself, so the agent can confirm its own identity without leaking siblings.","operationId":"listAgents","tags":["Legacy B2B"],"responses":{"200":{"description":"Array of agent summaries","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AgentSummary"}}}}},"401":{"description":"Authentication required"}},"x-legacy":true,"deprecated":true},"post":{"summary":"Create a sub-agent","description":"Mint a new sub-agent and its API key in one call. The full API key is returned **exactly once** in the response body — store it immediately.\n\n**Requires owner scope**: a Replit Auth session, or an API key with `canProvision=true`.\n\nRate-limited to 20 creates per hour per owning user (in addition to the global 60 req/min).","operationId":"createAgent","tags":["Legacy B2B"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200,"example":"Outreach worker — Acme pipeline"},"tier":{"type":"string","enum":["free","starter","growth","scale","pro"],"default":"free"},"callbackUrl":{"type":"string","format":"uri","description":"Optional webhook for async task completion. Empty string accepted as null.","example":"https://your.app/webhooks/datareaktor"},"monthlyCreditCap":{"type":"integer","minimum":0,"default":0,"description":"Per-agent monthly cap; 0 means no cap (subject to user-level limits)"}}}}}},"responses":{"201":{"description":"Agent created. The `apiKey` field is returned ONCE — store it immediately.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentWithKey"}}}},"400":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningError"},"example":{"error":"Validation error","details":[{"path":["name"],"message":"String must contain at least 1 character(s)"}]}}}},"401":{"description":"Authentication required"},"403":{"description":"Caller authenticated but lacks owner scope (`canProvision=true` or Replit Auth session).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningError"},"example":{"error":"Owner scope required to provision sub-agents.","code":"OWNER_SCOPE_REQUIRED"}}}},"429":{"description":"Rate limit exceeded — max 20 sub-agent creates per hour per owner"}},"x-legacy":true,"deprecated":true}},"/agents/{id}":{"get":{"summary":"Get sub-agent detail","description":"Fetch a single sub-agent's metadata.\n\n- Owners can fetch any agent they own.\n- A non-owner agent key may only fetch its own row (any other id returns 403 `OWNER_SCOPE_REQUIRED`).","operationId":"getAgent","tags":["Legacy B2B"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"},"description":"Numeric agent id"}],"responses":{"200":{"description":"Agent detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentSummary"}}}},"400":{"description":"Invalid agent id (non-numeric)"},"403":{"description":"Non-owner agent key tried to inspect a sibling.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningError"},"example":{"error":"This agent key can only inspect itself. Use an owner key or Replit Auth session to inspect siblings.","code":"OWNER_SCOPE_REQUIRED"}}}},"404":{"description":"Agent not found, or not owned by caller"}},"x-legacy":true,"deprecated":true},"delete":{"summary":"Revoke a sub-agent","description":"Revoke a sub-agent permanently. **Requires owner scope.** An agent key cannot revoke itself — use a different owner key or a Replit Auth session.","operationId":"revokeAgent","tags":["Legacy B2B"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Agent revoked","content":{"application/json":{"schema":{"type":"object","required":["success","agentId"],"properties":{"success":{"type":"boolean","enum":[true]},"agentId":{"type":"integer"}}}}}},"403":{"description":"Owner scope required (Replit Auth session OR API key with `canProvision=true`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningError"},"example":{"error":"Owner scope required to call this endpoint.","code":"OWNER_SCOPE_REQUIRED"}}}},"404":{"description":"Agent not found, or not owned by caller"},"409":{"description":"An agent key cannot revoke itself.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningError"},"example":{"error":"An agent key cannot revoke itself. Use a different owner key or Replit Auth session.","code":"CANNOT_REVOKE_SELF"}}}}},"x-legacy":true,"deprecated":true}},"/agents/{id}/rotate-key":{"post":{"summary":"Rotate a sub-agent's API key","description":"Generate a fresh API key for the target sub-agent. The previous key is invalidated immediately. The new key is returned **exactly once**.\n\n**Requires owner scope.**","operationId":"rotateAgentKey","tags":["Legacy B2B"],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"New API key issued. Store it immediately — it will not be shown again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotatedAgentKey"}}}},"400":{"description":"Invalid agent id"},"403":{"description":"Owner scope required (Replit Auth session OR API key with `canProvision=true`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningError"},"example":{"error":"Owner scope required to call this endpoint.","code":"OWNER_SCOPE_REQUIRED"}}}},"404":{"description":"Agent not found, or not owned by caller"}},"x-legacy":true,"deprecated":true}},"/billing/checkout":{"post":{"summary":"Start a Stripe checkout for credits or a subscription","description":"Programmatic counterpart to the web checkout flow. **Requires owner scope.**\n\nReturns a `checkoutUrl` for the calling agent to surface to its operator. While the platform is in beta, this endpoint returns `503` with `code=BETA_CHECKOUT_DISABLED` so callers can detect the gate cleanly and fall back to manual credit grants.","operationId":"createBillingCheckout","tags":["Legacy B2B"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","description":"Provide `pack` (preferred) or `packId` (legacy alias).","properties":{"pack":{"type":"string","description":"Pay-as-you-go pack id (`pack_basic`, `pack_plus`, `pack_max`) or subscription plan id (`starter`, `growth`, `scale`).","example":"pack_basic"},"packId":{"type":"string","description":"Alias for `pack`"},"agentId":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Optional sub-agent id to credit on success. Omit to credit the owning user's purchased_credits balance.","example":42}}},"example":{"pack":"pack_basic","agentId":42}}}},"responses":{"200":{"description":"Checkout session created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutSession"}}}},"400":{"description":"Missing `pack` / `packId`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningError"}}}},"403":{"description":"Owner scope required (Replit Auth session OR API key with `canProvision=true`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningError"},"example":{"error":"Owner scope required to call this endpoint.","code":"OWNER_SCOPE_REQUIRED"}}}},"503":{"description":"Beta gate: paid checkout is disabled. Paid plans open when the beta ends; email support@datareaktor.ai with questions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningError"},"example":{"error":"beta_mode_active","message":"Paid checkout is disabled in beta. Paid plans open when the beta ends.","code":"BETA_CHECKOUT_DISABLED"}}}}},"x-legacy":true,"deprecated":true}},"/billing/transfer":{"post":{"summary":"Transfer credits from owner balance to a sub-agent","description":"Atomically debits the owning user's `purchased_credits` and credits the target sub-agent's balance. **Requires owner scope.**\n\nWrites a `[Audit][provision]` log line and a `billing_events` row with `eventType=credit_purchased` for the audit trail.","operationId":"transferCreditsToAgent","tags":["Legacy B2B"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["agentId","credits"],"properties":{"agentId":{"oneOf":[{"type":"string"},{"type":"integer"}],"description":"Numeric id of the sub-agent to credit (string accepted and coerced)."},"credits":{"type":"integer","minimum":1,"description":"Positive integer credits to move."}}},"example":{"agentId":42,"credits":500}}}},"responses":{"200":{"description":"Credits moved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditTransferResult"}}}},"400":{"description":"Validation error or invalid amount","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningError"},"example":{"error":"Invalid credit amount — must be a positive integer","code":"INVALID_AMOUNT"}}}},"402":{"description":"Owner does not have enough purchased credits to cover the move","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningError"},"example":{"error":"Insufficient purchased credits to transfer","code":"INSUFFICIENT_CREDITS","available":120,"requested":500}}}},"403":{"description":"Owner scope required (Replit Auth session OR API key with `canProvision=true`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningError"},"example":{"error":"Owner scope required to call this endpoint.","code":"OWNER_SCOPE_REQUIRED"}}}},"404":{"description":"Target agent does not exist or is not owned by caller","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningError"},"example":{"error":"Agent not found or not owned by caller","code":"AGENT_NOT_OWNED"}}}}},"x-legacy":true,"deprecated":true}},"/billing/credits":{"get":{"summary":"Get the calling principal's credit balance","description":"Behaviour depends on caller and `?agentId=` query:\n\n- Agent key, no `?agentId=` → that agent's own balance + cap (`BillingBalanceAgent`). Its `blockingConstraint` indicates whether the cheapest supported task is currently affordable; call `POST /tasks/estimate` for an exact workload.\n- Owner key or human session, no `?agentId=` → user-level `purchasedCredits` + monthly records remaining (`BillingBalanceUser`).\n- Any caller with `?agentId=` → balance for the specified sub-agent if owned (or self, for non-owner agent keys). Returns 403 `OWNER_SCOPE_REQUIRED` for siblings, 404 for unowned ids.","operationId":"getBillingCredits","tags":["Legacy B2B"],"parameters":[{"name":"agentId","in":"query","required":false,"schema":{"type":"integer"},"description":"Optional sub-agent id to query. Omit to get the calling principal's own balance."}],"responses":{"200":{"description":"Credit balance — shape depends on caller and `agentId`","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/BillingBalanceUser"},{"$ref":"#/components/schemas/BillingBalanceAgent"}]}}}},"401":{"description":"Authentication required"},"403":{"description":"Non-owner agent key tried to inspect a sibling's balance","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProvisioningError"},"example":{"error":"This agent key can only inspect its own balance.","code":"OWNER_SCOPE_REQUIRED"}}}},"404":{"description":"Agent not found or not owned by caller"}},"x-legacy":true,"deprecated":true}},"/setup":{"get":{"operationId":"getSetupStatus","summary":"New-account setup checklist: which steps are done (derived from the account's data, whoever did them), the next step, mode, whether an agent is connected and the running people search. Free.","tags":["Job search"],"x-required-scope":"search:read","description":"Start here when you connect for a new user. Steps: resume, targets (roles + level or location), connections (Connections.csv imported; `connectionsRequestedAt` when they asked LinkedIn for it), search, companies, people (a company with people found), draft (optional), voice (optional). Agent keys also get `nextAction`, a one-line hint for nextStep. The first call with an agent key marks the agent as connected.","responses":{"200":{"description":"Setup status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatus"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}},"patch":{"operationId":"updateSetup","summary":"Record the user's setup choices: mode, skip / unskip a step, finish later (dismiss), complete, connectionsRequested. completedAt is also set automatically once every required step is done or skipped. Free.","tags":["Job search"],"x-required-scope":"search:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":1,"additionalProperties":false,"properties":{"mode":{"type":"string","enum":["manual","agent"]},"skip":{"type":"string","enum":["resume","targets","connections","search","companies","people","draft","voice"]},"unskip":{"type":"string","enum":["resume","targets","connections","search","companies","people","draft","voice"]},"dismiss":{"type":"boolean","description":"true = finish later (hides the wizard); false = resume"},"complete":{"type":"boolean"},"connectionsRequested":{"type":"boolean","description":"The user asked LinkedIn for their data export"},"lastStep":{"type":"string","enum":["resume","targets","connections","search","companies","people","draft","voice"]}}}}}},"responses":{"200":{"description":"Setup status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupStatus"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/plan":{"get":{"operationId":"getPlan","summary":"Owner's plan (beta flag, meters, what a credit is) and this key's monthly cap headroom","tags":["Job search"],"x-required-scope":"any","description":"Any agent key from /settings/agents works, whatever its scopes. Older B2B keys get 403 SCOPE_REQUIRED.","responses":{"200":{"description":"Plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Plan"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/estimate":{"post":{"operationId":"estimateCost","summary":"Upper-bound cost of a people-discovery run, with plan and key headroom","tags":["Job search"],"x-required-scope":"search:read","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"searchId":{"type":"integer"},"targetIds":{"type":"array","items":{"type":"integer"}},"maxPeoplePerTarget":{"type":"integer","minimum":1,"maximum":5},"draftsPerTarget":{"type":"integer","minimum":0,"maximum":3,"description":"Default 0 for agent keys, 2 in the app"},"includeExcluded":{"type":"boolean","description":"Count targets in an industry the account skips too (as people:discover with includeExcluded)"},"includeScreenedOut":{"type":"boolean","description":"Count screened-out companies too (people:discover skips them by default, so the estimate leaves them out)"}}}}}},"responses":{"200":{"description":"Estimate","content":{"application/json":{"schema":{"type":"object","properties":{"estimate":{"$ref":"#/components/schemas/JobEstimate"},"withinPlan":{"type":"boolean"},"withinKeyCap":{"type":"boolean"},"draftsPerTarget":{"type":"integer"},"creditsCharged":{"type":"integer","enum":[0]},"creditDefinition":{"type":"string"},"skippedForIndustry":{"type":"array","items":{"$ref":"#/components/schemas/SkippedForIndustry"},"description":"Targets left out of the estimate for the account's excludedIndustries"},"screenedOut":{"type":"array","items":{"$ref":"#/components/schemas/ScreenedOutTarget"},"description":"Companies left out of the estimate (status screened_out)"}}}}}},"400":{"description":"VALIDATION_ERROR (every company is screened out: pass includeScreenedOut)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/job-profile":{"get":{"operationId":"getProfile","summary":"Job seeker profile (with excludedIndustries) and connection-import status","tags":["Job search"],"x-required-scope":"search:read","responses":{"200":{"description":"Profile","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}},"put":{"operationId":"updateProfile","summary":"Update profile fields (send only the keys to change)","tags":["Job search"],"x-required-scope":"search:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProfileUpdate"}}}},"responses":{"200":{"description":"Profile","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}},"delete":{"operationId":"clearProfile","summary":"Clear the résumé text and every profile field (connections and searches stay). Agent keys must pass confirm=true.","tags":["Job search"],"x-required-scope":"search:write","parameters":[{"name":"confirm","in":"query","required":false,"schema":{"type":"boolean"},"description":"Required (true) for agent keys, after the user agreed. Not needed in the app."}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"}}}}}},"400":{"description":"VALIDATION_ERROR (confirm=true missing)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/job-profile/parse":{"post":{"operationId":"parseResume","summary":"Parse résumé text into the profile (facts not in the text are dropped)","tags":["Job search"],"x-required-scope":"search:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["resumeText"],"properties":{"resumeText":{"type":"string","minLength":80},"save":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"Parsed profile","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"402":{"description":"KEY_SPEND_CAP_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"502":{"description":"MODEL_OUTPUT_INVALID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/job-profile/resume-file":{"post":{"operationId":"parseResumeFile","summary":"Upload a résumé file (PDF, DOCX, .txt, .md; 5 MB) and parse it like /job-profile/parse. Only the extracted text is kept; the file is never stored.","tags":["Job search"],"x-required-scope":"search:write","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"save":{"type":"string","enum":["true","false"],"default":"true"}}}},"application/json":{"schema":{"type":"object","required":["fileName","contentBase64"],"properties":{"fileName":{"type":"string","example":"resume.pdf"},"contentBase64":{"type":"string","format":"byte","description":"File bytes, base64 (≤ 5 MB decoded)"},"save":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"Parsed profile (same shape as /job-profile/parse) plus file { kind, chars, truncated }","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"402":{"description":"KEY_SPEND_CAP_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"413":{"description":"RESUME_FILE_TOO_LARGE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"415":{"description":"RESUME_FILE_UNSUPPORTED (wrong type by contents, or an old .doc file)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"422":{"description":"RESUME_FILE_UNREADABLE (password-protected or damaged) or RESUME_NO_TEXT (scanned PDF with no text layer)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"502":{"description":"MODEL_OUTPUT_INVALID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/connections":{"get":{"operationId":"getConnections","summary":"Count of the user's contacts list: total, lastImportedAt, and bySource {linkedin, other, sources}","tags":["Job search"],"x-required-scope":"search:read","responses":{"200":{"description":"Count","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}},"delete":{"operationId":"deleteConnections","summary":"Delete the user's imported contacts: all of them, or one source","tags":["Job search"],"x-required-scope":"connections:write","parameters":[{"name":"source","in":"query","required":false,"schema":{"type":"string","pattern":"^[a-z][a-z0-9_-]{1,23}$"},"description":"Only this source, e.g. linkedin or crm"}],"responses":{"200":{"description":"Deleted: { deleted, source? }","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/connections/import":{"post":{"operationId":"importConnections","summary":"Import the user's contacts list (private to the user). source linkedin (default): their own LinkedIn Connections.csv as csv; replaces the previous LinkedIn import and leaves other sources alone. Any other source (crm, agent...): people they already know, as contacts or a CSV with a name column; rows merge with that source's earlier rows by name and company unless replace is true. Contacts give first-degree and mutual-connection paths whose reasons cite the record.","tags":["Job search"],"x-required-scope":"connections:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"source":{"type":"string","default":"linkedin","pattern":"^[a-z][a-z0-9_-]{1,23}$","example":"crm"},"csv":{"type":"string","description":"Connections.csv (linkedin), or a CSV with a name column (other sources), up to 2 MB / 5,000 rows"},"contacts":{"type":"array","maxItems":5000,"description":"Other sources only","items":{"type":"object","properties":{"fullName":{"type":"string"},"company":{"type":"string"},"title":{"type":"string"},"email":{"type":"string","format":"email"},"relationship":{"type":"string","maxLength":60,"example":"intro"},"lastInteraction":{"type":"string","example":"2024-05","description":"YYYY, YYYY-MM or YYYY-MM-DD"},"note":{"type":"string","maxLength":500}}}},"replace":{"type":"boolean","description":"Other sources: delete that source's earlier rows first"}}}}}},"responses":{"200":{"description":"Imported: { source, imported, added?, updated?, skipped, skippedRows, bySource {linkedin, other, sources}, ... }","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"CSV_INVALID or VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/searches":{"get":{"operationId":"listSearches","summary":"List active searches","tags":["Job search"],"x-required-scope":"search:read","responses":{"200":{"description":"Searches","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}},"post":{"operationId":"createSearch","summary":"Create a search","tags":["Job search"],"x-required-scope":"search:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"targetFunction":{"type":"string"},"targetLevel":{"type":"string"},"notes":{"type":"string"}}}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/searches/{id}":{"get":{"operationId":"getSearch","summary":"Get a search","tags":["Job search"],"x-required-scope":"search:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Search","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}},"patch":{"operationId":"updateSearch","summary":"Rename or archive a search","tags":["Job search"],"x-required-scope":"search:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}},"responses":{"200":{"description":"Search","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}},"delete":{"operationId":"deleteSearch","summary":"Delete a search and everything in it (companies, people, warm paths, drafts, follow-ups). Refused while its people search runs. Agent keys must pass confirm=true.","tags":["Job search"],"x-required-scope":"search:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"confirm","in":"query","required":false,"schema":{"type":"boolean"},"description":"Required (true) for agent keys, after the user agreed. Not needed in the app."}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean"},"removed":{"type":"object","properties":{"targets":{"type":"integer"},"people":{"type":"integer"},"drafts":{"type":"integer"}}}}}}}},"400":{"description":"VALIDATION_ERROR (confirm=true missing)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"409":{"description":"JOB_ALREADY_RUNNING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/searches/{id}/export":{"get":{"operationId":"exportSearch","summary":"One search's people as CSV or JSON, for a spreadsheet or CRM (#358). Free; nothing is looked up or charged.","tags":["Job search"],"x-required-scope":"search:read","description":"One row per person: company, domain, name, title, role confidence, person-check flags (#338), source URL, best warm-path score, type and reason, email and its source URL only when already found on a public page, status (new, drafted, contacted, replied, dismissed) and the latest send the user reported. Dismissed people are left out unless includeDismissed=true; people who asked to be left out (/remove-me) never appear. CSV: UTF-8 with a byte-order mark, a header row, cells starting with = + - @ prefixed with ' so spreadsheets don't run them. Content-Disposition names the file after the search. Another user's search id is 404.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","enum":["csv","json"],"default":"json"}},{"name":"includeDismissed","in":"query","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"The export","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchExport"}},"text/csv":{"schema":{"type":"string","description":"Header row: company,domain,person_name,title,role_confidence,person_check_flags,source_url,warm_path_score,warm_path_type,warm_path_reason,email,email_source_url,status,last_sent_at,person_id"}}}},"400":{"description":"VALIDATION_ERROR (format must be csv or json)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/searches/{id}/board":{"get":{"operationId":"getBoard","summary":"Compact board: targets, people, best paths, draft counts, active job","tags":["Job search"],"x-required-scope":"search:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Board","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/searches/{id}/targets":{"get":{"operationId":"listTargets","summary":"Target companies in a search, each with status (new, discovering, ready, failed, excluded_industry, screened_out), excludedIndustry (see ExcludedIndustry) and its latest screen (null if never screened) with screenPending (true while a company profile requested for the screen's missing fields is awaited). excluded_industry = in an industry the account skips, not searched yet.","tags":["Job search"],"x-required-scope":"search:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Targets","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}},"post":{"operationId":"addTargets","summary":"Add target companies (no charge until discovery runs), optionally screened first","tags":["Job search"],"x-required-scope":"search:write","description":"A company whose stored industry matches the account's excludedIndustries is still added, with status excluded_industry and excludedIndustry {term, industry, label}; people:discover skips it unless includeExcluded: true. The response's excludedIndustry counts them. With `screen`, each company is screened from the records Data Reaktor already holds (free; see TargetScreenCriteria) and carries `screen` (TargetScreen). A fail keeps the company in the search with status `screened_out`; people:discover and /estimate skip it unless `includeScreenedOut: true`. unknown leaves the status as it was. Adding a company that is already in the search with a screen screens it again (a later pass or unknown restores its status). Companies are shared data: the screen reads them and never edits them. An unknown result missing headcount, location or product (with a website on record) queues a company profile for that company (free) and the target carries screenPending: true and screen.pending; when the profile's facts arrive the target is screened again with the same criteria (a fail then sets screened_out) and screenPending turns false. It also turns false when the profile came back without the field or after 7 days. #359: screen.criteria (up to 5 in the user's own words) are judged only from the stored company facts: each target's screen.criteriaResults has match, no_match or unsure per criterion with a reason and citations (claimId, sourceUrl). criteriaMode report (default) changes no status; all fails the screen on a no_match.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["companyName"],"properties":{"companyName":{"type":"string"},"domain":{"type":"string"},"screen":{"$ref":"#/components/schemas/TargetScreenCriteria"}}},{"type":"object","required":["companies"],"properties":{"companies":{"type":"array","maxItems":25},"screen":{"$ref":"#/components/schemas/TargetScreenCriteria"}}}]}}}},"responses":{"201":{"description":"Targets: { targets (each with excludedIndustry, screen and screenPending), created, excludedIndustry (how many matched), screen?: {pass, fail, unknown, pending, criteria?: {mode, match, no_match, unsure}, note}, creditsCharged: 0 }","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"429":{"description":"SCREEN_CRITERIA_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"503":{"description":"SCREEN_CRITERIA_DISABLED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/searches/{id}/targets/{targetId}":{"delete":{"operationId":"removeTarget","summary":"Remove a target company with its people, drafts and follow-ups. Refused while the search's people search runs.","tags":["Job search"],"x-required-scope":"search:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"targetId","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"409":{"description":"JOB_ALREADY_RUNNING","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}},"patch":{"operationId":"updateTarget","summary":"Fix a target company's name or website (free). domain null clears it so the next people search looks it up again. To search the company again, call /estimate then people:discover with targetIds: [targetId] (normal plan use). Refused while the search's people search runs.","tags":["Job search"],"x-required-scope":"search:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"targetId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":1,"properties":{"companyName":{"type":"string","maxLength":200},"domain":{"type":"string","nullable":true,"maxLength":253,"example":"fernhill.com","description":"Host name; a full URL is reduced to its host"}}}}}},"responses":{"200":{"description":"Target: { target, creditsCharged: 0 }","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"409":{"description":"JOB_ALREADY_RUNNING or TARGET_ALREADY_IN_SEARCH","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/searches/{id}/targets/{targetId}/people":{"post":{"operationId":"addPerson","summary":"Add a person by hand at one target company (sourceType user_added, \"Added by you\"). Free. A LinkedIn URL is stored as given and never fetched. An existing person with that name is returned with created: false (and brought back if they were dismissed).","tags":["Job search"],"x-required-scope":"search:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"targetId","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["fullName"],"properties":{"fullName":{"type":"string","minLength":2,"maxLength":120},"title":{"type":"string","nullable":true,"maxLength":200},"url":{"type":"string","nullable":true,"format":"uri","description":"A public page about them, or their LinkedIn URL"},"email":{"type":"string","nullable":true,"format":"email","description":"Only an address the user gave"},"bucket":{"type":"string","enum":["hiring_manager","teammate","alumni","connector","recruiter","executive"],"description":"Default teammate"},"whyRelevant":{"type":"string","nullable":true,"maxLength":300}}}}}},"responses":{"200":{"description":"Already there: { person, created: false, creditsCharged: 0 }","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Person added: { person, created: true, creditsCharged: 0 }","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/searches/{id}/targets/{targetId}/signals":{"get":{"operationId":"getHiringSignals","summary":"Hiring signals: open roles at a target company from public job listings","tags":["Job search"],"x-required-scope":"search:read","description":"Public job postings (Greenhouse, Lever, Ashby, company careers pages) for one target company, most relevant first (matches the user's target role, then freshest). Every signal has a URL; no URL, no signal. Captured during people discovery plus at most one extra search per company per day. `?refresh=true` re-checks now (needs search:write; still at most one extra search per company per day). No charge.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"targetId","in":"path","required":true,"schema":{"type":"integer"}},{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Signals","content":{"application/json":{"schema":{"type":"object","properties":{"targetId":{"type":"integer"},"companyName":{"type":"string"},"enabled":{"type":"boolean"},"checkedAt":{"type":"string","format":"date-time","nullable":true,"description":"When public listings were last checked; null = never"},"signals":{"type":"array","items":{"$ref":"#/components/schemas/HiringSignal"}}}}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/searches/{id}/changes":{"get":{"operationId":"listSearchChanges","summary":"What changed at a search's target companies since a date (free)","tags":["Job search"],"x-required-scope":"search:read","description":"Read from stored data only; no fetching and no charge. opening_new: a job opening first seen after `since`, with its posting URL. person_new: a person a run found after `since`. person_flagged: a person check flag (stale_title, left_company, wrong_site, directory_only, social_only) on a person found after `since`, with the flag code and source URL. opening_closed and company_fact_changed are not returned yet. Only the caller's own search; another user's id is 404.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"since","in":"query","required":false,"schema":{"type":"string","format":"date-time"},"description":"ISO date; default 7 days ago, at most 90 days back (otherwise VALIDATION_ERROR)."}],"responses":{"200":{"description":"Changes","content":{"application/json":{"schema":{"type":"object","properties":{"searchId":{"type":"integer"},"since":{"type":"string","format":"date-time"},"items":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["opening_new","person_new","person_flagged"]},"targetId":{"type":"integer"},"companyName":{"type":"string"},"at":{"type":"string","format":"date-time"},"summary":{"type":"string"},"url":{"type":"string","nullable":true},"personId":{"type":"integer"},"code":{"type":"string","description":"person_flagged only"}}}},"counts":{"type":"object","properties":{"opening_new":{"type":"integer"},"person_new":{"type":"integer"},"person_flagged":{"type":"integer"}}},"creditsCharged":{"type":"integer"}}}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/searches/{id}/people:discover":{"post":{"operationId":"discoverPeople","summary":"Start a background people-discovery job (202 → poll /jobs/{jobId})","tags":["Job search"],"x-required-scope":"people:discover","description":"Finds up to 5 people per target with public evidence, scores warm paths and drafts intros for the best ones. Spend controls in order: plan entitlement, per-key monthly cap, per-call max_credits (required for agent keys). LinkedIn is never fetched.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"Idempotency-Key","in":"header","description":"Any string up to 120 characters, scoped to the user. Send it so a call whose 202 you never received can be retried safely: the same key with the same search and body returns the original job (202, replayed: true, the original job_id and estimate) with no second job and no second charge, even while the job runs or after it finishes (keys are kept as long as the job, at least 24 hours). The same key with a different body is 409 IDEMPOTENCY_CONFLICT (detail.jobId), and nothing is charged. No key: every call starts a job as before.","schema":{"type":"string","maxLength":120}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"targetIds":{"type":"array","items":{"type":"integer"}},"maxPeoplePerTarget":{"type":"integer","default":5},"draftsPerTarget":{"type":"integer","minimum":0,"maximum":3,"description":"Drafts per company. Default 0 for agent keys (no hidden drafts); the app sends its own value (2 if omitted by a person)."},"max_credits":{"type":"integer"},"roles":{"type":"array","maxItems":18,"items":{"type":"string","enum":["founder","ceo","cto","coo","cfo","cpo","cro","cmo","president","owner","plant_manager","general_manager","vp_operations","director_operations","quality_director","ci_director","it_director","erp_mes_manager"]},"description":"Wanted roles, case-insensitive. Public search looks for these titles first, people whose current title holds one come first, and the usual cap on founders and C-level people is lifted. Founders and C-level (defect 177), e.g. [founder, ceo, cto] for a buyer at a 20-200 person company: a title counts only when it names the role itself; VP, Director, Head of, assistant to, chief of staff and former holders never match. Operating roles at a manufacturer (defect 209), e.g. [plant_manager, vp_operations, quality_director]: VP, Director and manager titles DO count; supervisors, engineers, specialists and other individual-contributor titles do not. Title words per value: founder = founder, co-founder, founding CEO/CTO/partner; ceo = CEO, chief executive; cto = CTO, chief technology/technical officer; coo = COO, chief operating officer; cfo = CFO, chief financial officer; cpo = CPO, chief product officer; cro = CRO, chief revenue officer; cmo = CMO, chief marketing officer; president = president (not vice president); owner = owner, managing partner; plant_manager = plant or factory manager, director, leader, head or general manager; head of plant; site director or site leader; general_manager = general manager, GM, managing director; vp_operations = VP, SVP, EVP or vice president of operations, manufacturing or production (not sales, revenue, marketing, people, IT or other business operations); director_operations = director, senior director or head of operations, manufacturing or production (not sales, revenue, marketing, people, IT or other business operations); quality_director = director, head, VP, manager or lead of quality, quality assurance, quality control, QA, QC or supplier quality; chief quality officer (not software QA); ci_director = director, head, VP, manager or lead of continuous improvement, operational excellence, business excellence, lean or six sigma; it_director = director, head, VP or manager of IT, information technology or IT infrastructure; CIO, chief information officer; erp_mes_manager = manager, director, head, lead or VP of ERP, MES, manufacturing systems or operations systems. Without roles, targetLevel from the search steers as before."},"roleMatch":{"type":"string","enum":["prefer","only"],"default":"prefer","description":"With roles. prefer: matches first, then other people at the company. only: matches or nobody (the rest are dropped). GET /jobs/{jobId} roleFilter[targetId] = {requested, match, matched, others, note}; note and a log line say when nobody at the requested level was found (\"No CTO at Acme had public evidence, so nobody was returned.\"), or name who already holds the role on the board (\"already on your board: Di Hale (CTO)\"), never a silent substitute."},"includeExcluded":{"type":"boolean","default":false,"description":"Targets whose stored industry matches the account's excludedIndustries are skipped by default: each is listed in the response's and the job's skippedForIndustry with a \"skipped\" log line, left out of the estimate and not charged. true searches them anyway."},"includeScreenedOut":{"type":"boolean","default":false,"description":"Also search companies with status screened_out (failed the legitimacy screen). By default they are skipped: not estimated, not charged, listed in the response's screenedOut and in the job log."}}}}}},"responses":{"202":{"description":"Job queued","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string"},"estimate":{"$ref":"#/components/schemas/JobEstimate"},"creditsCharged":{"type":"integer","description":"Credits reserved on the agent key now (0 for people); settled to the real figure when the job ends"},"creditsSettledAtEnd":{"type":"boolean"},"poll":{"type":"string"},"replayed":{"type":"boolean","description":"true when the Idempotency-Key matched an earlier call: this is that call's job, nothing new was started"},"screenedOut":{"type":"array","items":{"$ref":"#/components/schemas/ScreenedOutTarget"},"description":"Screened-out companies skipped by this run (also logged with step screen)"}}}}}},"400":{"description":"VALIDATION_ERROR (every company asked for is screened out: pass includeScreenedOut)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"402":{"description":"PLAN_LIMIT_REACHED / KEY_SPEND_CAP_REACHED / RUN_CAP_REACHED (nothing charged)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"409":{"description":"JOB_ALREADY_RUNNING / IDEMPOTENCY_CONFLICT (same Idempotency-Key, different body)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"422":{"description":"ALL_TARGETS_EXCLUDED: every requested target is in an industry the account skips (detail.skippedForIndustry); nothing started or charged","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/jobs":{"get":{"operationId":"listJobs","summary":"Active jobs","tags":["Job search"],"x-required-scope":"search:read","responses":{"200":{"description":"Jobs","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/jobs/{jobId}":{"get":{"operationId":"getJob","summary":"Job progress, log and terminal state. Sends an ETag (changes with status, completedTargets, log length, creditsCharged); send it back as If-None-Match to get 304 with an empty body when nothing changed. While the job is active the response has Retry-After: 10.","tags":["Job search"],"x-required-scope":"search:read","parameters":[{"name":"jobId","in":"path","required":true,"schema":{"type":"string"}},{"name":"If-None-Match","in":"header","required":false,"schema":{"type":"string"},"description":"ETag of the last response; 304 when unchanged."}],"responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobView"}}},"headers":{"ETag":{"schema":{"type":"string"}},"Retry-After":{"schema":{"type":"integer"},"description":"10, only while the job is active."}}},"304":{"description":"Unchanged since the ETag; empty body."},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/searches/{id}/people":{"get":{"operationId":"listPeople","summary":"People found, with evidence ('found via') and ranked paths. Each person has roleClaim {title, confidence, source {url, type}, affiliation verified|unverified, basis} (#237): verified means the company's own site, a page naming its domain, or the user's imported connections; unverified means only the company's name matched (a LinkedIn listing, a people directory or a name-only page). Each evidence item carries affiliation (company_domain, domain_mentioned, profile_listing, aggregator, name_only). Each person has roleRank (#337): 0 = the first role the search asked for, 1 = the second, null = not a requested role (or no roles asked); when the search asked for roles, people are listed requested roles first in that order, then by warm-path score. People quoted on testimonial or customer pages are never returned, and with the domain known a founder or C-level claim seen only on name-matched pages is withheld. #338: roleClaim.flags (each {code, reason, url}; codes stale_title, left_company, wrong_site, directory_only, social_only) and roleClaim.entityConflict {field: title|employer, chosen (most recent; null = no longer at the company), values} appear when a check fired; such a person is still listed, with confidence capped (left 30, social only 35, directories only 40, other site 45, stale title 65).","tags":["Job search"],"x-required-scope":"search:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"targetId","in":"query","schema":{"type":"integer"}}],"responses":{"200":{"description":"People","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/searches/{id}/paths:score":{"post":{"operationId":"scorePaths","summary":"Re-score warm paths (charged at most once per person)","tags":["Job search"],"x-required-scope":"search:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"personIds":{"type":"array","items":{"type":"integer"}},"targetId":{"type":"integer","description":"Only this company"},"addConnections":{"type":"boolean","description":"Add imported connections at the companies first (default: true unless personIds is given; free)"}}}}}},"responses":{"200":{"description":"Scored: scored[], addedFromConnections, connectionsImported, warning (NO_CONNECTIONS_IMPORTED when none are imported), creditsCharged","content":{"application/json":{"schema":{"type":"object","properties":{"scored":{"type":"array","items":{"type":"object"}},"stoppedReason":{"type":"string","nullable":true},"addedFromConnections":{"type":"integer"},"connectionsImported":{"type":"integer"},"warning":{"type":"object","nullable":true},"creditsCharged":{"type":"integer"}}}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/people/{id}":{"patch":{"operationId":"setPersonStatus","summary":"Set a person's status","tags":["Job search"],"x-required-scope":"search:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["new","drafted","contacted","replied","dismissed"]},"dismissReason":{"type":"string","enum":["wrong_function","too_junior","too_senior","left_company","wrong_location","not_a_person","other"],"description":"Optional, with dismissed: why not relevant. Steers the next people searches."},"dismissNote":{"type":"string","maxLength":300}}}}}},"responses":{"200":{"description":"Person","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/people/{id}/drafts":{"post":{"operationId":"draftIntro","summary":"Draft LinkedIn connect/message and email for one person. Never sent by Data Reaktor. Without mode, the person's best path decides: a mutual connection → an intro request written to the connector naming the person; otherwise a note to the person. A mode the path cannot support is switched (modeSwitched, and the draft is still charged as the requested mode: use strict: true when a connector is required) or, with strict: true, refused for free. Accounts with a draft voice can steer the draft with recipientType (connector, team_leader, peer_practitioner, hiring_manager, warm_reconnect, thank_you, stranger_cold; inferred when omitted), askId, hookId, variantLabel, and variantOf plus variantDimension (hook, ask, fieldLine, lengthBucket, opener, close, layout) to change exactly one dimension of an earlier draft; the draft returns askVariant and variantLabel. Also hook {text, source, date} (or a leading \"Hook:\" line in notes; hookId h1 to h5 names an evidence item) shown in every channel, and field and topic, separate phrases for the field line and the ask. warnings (TOPIC_RELEVANCE_LOW) is added when the topic does not fit the person's role or company. Job openings (defect 141): the draft names a job opening only when the request passes openingId or openingUrl for an opening the user picked (from GET …/targets/{targetId}/signals); it then names that opening and no other, and the response has opening {id, title, url}. Without one, opening is null and the draft names no opening, posting or role title at the company. Purpose (#292): purpose job_search (default, the job-seeker note) or discovery (peer or customer discovery). A discovery draft uses no job-profile facts, target roles or job-seeking lines; the sender is introduced with senderIntro (max 160 characters) or by name only, and a job-seeking phrase (\"looking for my next role\", \"seeking Head of Engineering work\") in any channel is rejected before return. The response echoes purpose.","tags":["Job search"],"x-required-scope":"drafts:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"Idempotency-Key","in":"header","description":"A repeated POST with the same key (up to 120 characters) after a charge was recorded returns this person's most recent draft with replayed: true and creditsCharged: 0 instead of writing and charging another. It returns the person's latest draft, which is the original unless another draft was made in between. The response carries a message saying no new draft was written; to re-test an identical request send a new key (or none) and add replacesDraftId. Retention window of a key: [metric needed].","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"mode":{"type":"string","enum":["connector_ask","hiring_manager_note","alumni_note","follow_up","thank_you"]},"notes":{"type":"string","description":"Facts the user gives about their history with this person. Required facts: the draft must use them (checked)."},"role":{"type":"string"},"strict":{"type":"boolean","description":"Refuse with NO_CONNECTOR_PATH / NO_ALUMNI_PATH instead of switching the mode."},"replacesDraftId":{"type":"integer","description":"A not-sent draft for this person (any mode) that the new draft replaces; it is kept as an older version (supersededBy). Without it, only older not-copied, not-edited drafts in the same mode are replaced."},"recipientType":{"type":"string","enum":["connector","team_leader","peer_practitioner","hiring_manager","warm_reconnect","thank_you","stranger_cold"],"description":"Draft-voice accounts: who the draft is for (picks the ask). Inferred when omitted."},"askId":{"type":"string","maxLength":40,"description":"Draft-voice accounts: a configured ask for the recipient type; also picks the connect note's ask when it has one with that id."},"hookId":{"type":"string","maxLength":40,"description":"h1 to h5 name the person's 1st to 5th evidence item. A hand-added label cannot be named. An id that resolves to nothing adds the warning HOOK_ID_UNRESOLVED and the draft falls back to the next hook source."},"hook":{"type":"object","additionalProperties":false,"required":["text"],"properties":{"text":{"type":"string","maxLength":300},"source":{"type":"string","maxLength":300,"description":"Where the hook came from. Written into the hook sentence only when the hook has a date or a kind (a dated item: \"MoldMaking Technology's Aug. 17 report\"). Without either, the hook is stated as a plain fact and source is metadata, never written as \"<source> says\"."},"kind":{"type":"string","maxLength":40,"description":"What the hook is, in your words (\"post\", \"talk\", \"report\", \"customer story\"). The draft uses exactly this noun and invents none; without it the hook sentence stays close to the text."},"date":{"type":"string","maxLength":20,"description":"YYYY-MM-DD, written into the hook sentence as Mon. D"}},"description":"A hook the caller supplies; shown in every channel. A leading \"Hook:\" line in notes works the same."},"field":{"type":"string","maxLength":80,"description":"Phrase for the field line (the ask slot <field>)"},"topic":{"type":"string","maxLength":80,"description":"Phrase for the ask topic (the ask slot <topic>). Kept apart from field. Checked against the person's title, company, hook, notes and evidence and the company's stored industry and profile (trade synonyms count): TOPIC_RELEVANCE_LOW warning when nothing links, never a refusal or a different charge."},"variantLabel":{"type":"string","maxLength":80},"variantOf":{"type":"integer","description":"Id of an earlier draft for this person; with variantDimension, only that dimension changes."},"variantDimension":{"type":"string","enum":["hook","ask","fieldLine","lengthBucket","opener","close","layout"]},"openingId":{"type":"integer","description":"The id of a job opening the user picked (GET …/targets/{targetId}/signals). Only then does the draft name an opening. Unknown id: VALIDATION_ERROR, nothing charged."},"openingUrl":{"type":"string","maxLength":2000,"description":"The same as openingId, by the posting's url. Pass one or the other."},"introducer":{"type":"object","additionalProperties":false,"required":["name","relation"],"properties":{"name":{"type":"string","maxLength":80,"description":"The introducer's name, used only in introducerNote's text (never stored as a contact)."},"relation":{"type":"string","maxLength":120,"description":"How they know the company, in the user's words, e.g. \"partner at a consultancy that works with the company\". Neither text adds a relationship beyond it."}},"description":"#296: a named introducer who knows the company but is not in the user's imported connections there. Adds introducerNote and forwardableBlurb to the response, stores them on the draft (contextUsed.introducer) and records the draft's route as pathType introducer with relationLabel \"Through an introducer (relation)\". Goes with mode hiring_manager_note or no mode (other modes: VALIDATION_ERROR, nothing charged). Same charge as any draft."},"purpose":{"type":"string","enum":["job_search","discovery"],"default":"job_search","description":"What the outreach is for (#292). discovery: peer or customer discovery, written with no job-profile facts, target roles or job-seeking lines. role, openingId and openingUrl are refused with discovery (VALIDATION_ERROR). Without purpose, the account's saved setting decides (purposeSource), and a request with role or an opening is a job search."},"senderIntro":{"type":"string","minLength":1,"maxLength":160,"description":"With purpose discovery only: how the sender introduces themselves, in their own words (\"I'm a builder with shipped AI products\"). Without it a discovery draft introduces the sender by name only."}}}}}},"responses":{"201":{"description":"Draft","content":{"application/json":{"schema":{"type":"object","properties":{"draft":{"$ref":"#/components/schemas/JobDraft"},"delivery":{"type":"string","enum":["user_sends"]},"creditsCharged":{"type":"integer","description":"Credits counted against the key's monthly cap (0 for people in the app)"},"purpose":{"type":"string","enum":["job_search","discovery"],"description":"What the draft was written for (#292). A discovery draft also has draft.contextUsed.purpose = discovery."},"purposeSource":{"type":"string","enum":["request","account","default"],"description":"#298: request = the body's purpose (a body role or opening alone counts as job_search); account = the account's saved setting (preferences.outreachPurpose on PUT /writing-context); default = job search."},"route":{"type":"object","properties":{"pathType":{"type":"string","nullable":true,"description":"\"introducer\" for a draft written with introducer (#296)."},"score":{"type":"integer","nullable":true},"connectorName":{"type":"string","nullable":true},"writtenTo":{"type":"string"},"relationLabel":{"type":"string","description":"With introducer: \"Through an introducer (relation)\" (no name)."},"reasons":{"type":"array","items":{"type":"string"},"description":"With introducer: [relation], the cited reason."}}},"introducerNote":{"type":"string","description":"With introducer (#296): a note from the user to the introducer asking whether they would make the introduction, with one line on why this person. The user sends it."},"forwardableBlurb":{"type":"string","description":"With introducer (#296): 2 or 3 sentences in the user's voice, addressed to the person, that the introducer can paste as is."},"modeSwitched":{"type":"object","description":"Present when the requested mode did not fit the path.","properties":{"from":{"type":"string"},"to":{"type":"string"},"reason":{"type":"string"}}}}}}}},"401":{"description":"Missing, invalid or revoked key"},"402":{"description":"PLAN_LIMIT_REACHED / KEY_SPEND_CAP_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"422":{"description":"NO_CONNECTOR_PATH / NO_ALUMNI_PATH (strict only; nothing charged), or VOICE_LINT_FAILED (status voice_lint_failed; nothing stored, nothing charged). Since 2026-11-14 (#260) this route retries a voice-lint miss once and, if that misses too, stores a plain draft to edit (contextUsed.voiceProfile.fallback = plain_after_voice_lint, with the last lint report) instead of answering 422; VOICE_TIME_BUDGET on the first try is still a 422. A VOICE_LINT_FAILED body carries rejectedAttempts: { usable: false, notice, attempt, channels: { email: { subject, body, hits }, linkedinMessage: { text, hits }, linkedinConnect: { text, hits } } }, the last rejected text per channel with its own lint hits, for diagnosis only. It is not a draft: it is never stored, never selectable, and must not be sent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"429":{"description":"DRAFT_RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"504":{"description":"VOICE_TIME_BUDGET (status voice_time_budget): writing the draft ran out of its 75 second budget; nothing stored, nothing charged, retryable. The body carries timings (per attempt: model call and lint milliseconds) and rejectedAttempts (diagnostic only, never a draft).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/people/{id}/replies":{"post":{"operationId":"logReply","summary":"Record a reply the user received. Closes the open follow-up.","tags":["Job search"],"x-required-scope":"followups:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["linkedin","email","other"]},"notes":{"type":"string","maxLength":1000},"occurred_at":{"type":"string","format":"date-time"}}}}}},"responses":{"200":{"description":"Touch","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/drafts":{"get":{"operationId":"listDrafts","summary":"List drafts (one active draft per person and mode; older replaced versions only with includeSuperseded=true)","tags":["Job search"],"x-required-scope":"search:read","parameters":[{"name":"personId","in":"query","schema":{"type":"integer"}},{"name":"includeSuperseded","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Drafts","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/drafts/{id}":{"patch":{"operationId":"editDraft","summary":"Edit draft text. A saved edit counts as an edit in the writing context and the edited text can become a style example.","tags":["Job search"],"x-required-scope":"drafts:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"linkedinConnect":{"type":"string","maxLength":300},"linkedinMessage":{"type":"string","maxLength":1900},"emailSubject":{"type":"string","maxLength":150},"emailBody":{"type":"string","maxLength":5000},"learn":{"type":"boolean","description":"false: save the edit but learn nothing from it. Default true."}}}}}},"responses":{"200":{"description":"Draft","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}},"delete":{"operationId":"deleteDraft","summary":"Delete one draft with its rating and comment; sent/reply history stays; learned rules are recalculated. Agent keys must pass confirm=true.","tags":["Job search"],"x-required-scope":"drafts:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"confirm","in":"query","required":false,"schema":{"type":"boolean"},"description":"Required (true) for agent keys, after the user agreed. Not needed in the app."}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"VALIDATION_ERROR (confirm=true missing)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/drafts:delete":{"post":{"operationId":"deleteDrafts","summary":"Bulk delete: { draftIds } (up to 200) or { unsent: true, personId? } for every draft never marked sent. Agent keys must pass confirm: true in the body.","tags":["Job search"],"x-required-scope":"drafts:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"draftIds":{"type":"array","items":{"type":"integer"},"maxItems":200},"unsent":{"type":"boolean","enum":[true]},"personId":{"type":"integer"},"confirm":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/people/{id}/touches":{"get":{"operationId":"listTouches","summary":"The user's sent/reply records with one person, newest first","tags":["Job search"],"x-required-scope":"search:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Touches","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}},"post":{"operationId":"logSent","summary":"Record a message the USER sent without a draft (requires user_reported: true). Schedules a follow-up +5 business days, like mark-sent. Free.","tags":["Job search"],"x-required-scope":"followups:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["kind","user_reported"],"properties":{"kind":{"type":"string","enum":["sent"]},"user_reported":{"type":"boolean","enum":[true]},"channel":{"type":"string","enum":["linkedin","email","other"]},"occurred_at":{"type":"string","format":"date-time"},"notes":{"type":"string","maxLength":1000}}}}}},"responses":{"201":{"description":"Touch: { touch, followUpDueAt, reportedVia, creditsCharged: 0 }","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/touches/{id}":{"delete":{"operationId":"undoTouch","summary":"Undo a sent or reply record reported by mistake: its follow-up goes, the draft is no longer marked sent, the person's status is worked out again. Agent keys must pass confirm=true.","tags":["Job search"],"x-required-scope":"followups:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}},{"name":"confirm","in":"query","required":false,"schema":{"type":"boolean"},"description":"Required (true) for agent keys, after the user agreed. Not needed in the app."}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"VALIDATION_ERROR (confirm=true missing)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/product-feedback":{"post":{"operationId":"reportProductFeedback","summary":"Report a bug, a clearly wrong result or an idea to the Data Reaktor team. Not shown to other users. 20 a day (DAILY_LIMIT_REACHED).","tags":["Job search"],"x-required-scope":"any","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["kind","message"],"properties":{"kind":{"type":"string","enum":["bug","bad_result","idea","other"]},"message":{"type":"string","minLength":10,"maxLength":2000},"context":{"type":"object","description":"Flat ids and details (searchId, personId, draftId, jobId); ≤12 keys."}}}}}},"responses":{"201":{"description":"Feedback","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"429":{"description":"DAILY_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}},"get":{"operationId":"listOwnFeedback","summary":"Feedback this user (or their agents) sent, newest first","tags":["Job search"],"x-required-scope":"any","responses":{"200":{"description":"FeedbackList","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"}}}},"/drafts/{id}/copied":{"post":{"operationId":"markCopied","summary":"Record that the user copied a draft (optional field: which text was copied)","tags":["Job search"],"x-required-scope":"drafts:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"field":{"type":"string","enum":["linkedinMessage","linkedinConnect","emailBody"]}}}}}},"responses":{"200":{"description":"Draft","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/drafts/{id}/mark-sent":{"post":{"operationId":"markSent","summary":"Record that the USER sent a draft (requires user_reported: true). Schedules a follow-up +5 business days.","tags":["Job search"],"x-required-scope":"followups:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["user_reported"],"properties":{"user_reported":{"type":"boolean","enum":[true]},"channel":{"type":"string","enum":["linkedin","email","other"]},"occurred_at":{"type":"string","format":"date-time"},"notes":{"type":"string"}}}}}},"responses":{"200":{"description":"Touch","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"VALIDATION_ERROR when user_reported is not true","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/drafts/{id}/feedback":{"post":{"operationId":"rateDraft","summary":"The user's feedback on a draft: rating up/down, reasons and a short note, and/or an outcome. Tunes this user's future drafts only.","tags":["Job search"],"x-required-scope":"drafts:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rating":{"type":"string","enum":["up","down"]},"reasons":{"type":"array","maxItems":8,"items":{"type":"string","enum":["too_long","too_formal","too_casual","generic","wrong_facts","not_my_voice","wrong_person","great"]},"description":"wrong_person: the note reads fine but this is the wrong person to contact (does not change the writing rules)."},"note":{"type":"string","maxLength":500},"outcome":{"type":"string","enum":["replied","meeting","no_reply","not_relevant","bounced"]},"reason":{"type":"string","maxLength":500,"description":"Same field as note"},"editedBody":{"type":"string","maxLength":5000,"description":"The owner's edited email body; saved on the draft"},"editedSubject":{"type":"string","maxLength":150},"learn":{"type":"boolean","description":"false: store the rating or edit but learn nothing from it (no voice candidate, no writing-context relearn, no version bump). Default true."},"dryRun":{"type":"boolean","description":"true: validate and answer 200 with wouldRecord; nothing is written."}},"anyOf":[{"required":["rating"]},{"required":["reasons"]},{"required":["note"]},{"required":["outcome"]},{"required":["reason"]},{"required":["editedBody"]},{"required":["editedSubject"]}]}}}},"responses":{"201":{"description":"Feedback recorded","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/people/{id}/outcome":{"post":{"operationId":"recordOutcome","summary":"How an outreach to this person went (attached to the latest note sent to them). replied/meeting also log a reply and close the follow-up.","tags":["Job search"],"x-required-scope":"followups:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["outcome"],"properties":{"outcome":{"type":"string","enum":["replied","meeting","no_reply","not_relevant","bounced"]},"note":{"type":"string","maxLength":500}}}}}},"responses":{"201":{"description":"Outcome recorded","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/writing-context":{"get":{"operationId":"getWritingContext","summary":"What was learned about how the user writes: voice summary, rules (activeRules: the ones used for drafts, the user's own first), conflicts (learned rules that contradicted one of the user's own and were reworded or dropped), each rule's appliesTo (#339: all, default or discovery; which drafts it is used for), ruleConflicts (#340: the user's own rules that contradict each other, one requiring a phrase or title another bans, as [{ruleA, ruleB, reason}] with rule keys; [] when none), examples per channel (email / linkedin, line breaks and footer kept), rating and edit counts (saved edits count). Private to the user; used only for their drafts.","tags":["Job search"],"x-required-scope":"search:read","responses":{"200":{"description":"Writing context","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}},"put":{"operationId":"updateWritingContext","summary":"Edit the writing context (voice summary, own rules, notes), dismiss/restore learned rules, remove examples, or reset everything (reset: true). preferences.outreachPurpose (#298) sets what the account's outreach is for: discovery makes every new draft that names no purpose a discovery note (POST /people/{id}/drafts answers purposeSource: account), introduced with preferences.senderIntro; job_search or null clears it. Only the preference keys sent change, and a reset keeps the outreach settings. The response carries ruleConflicts (#340, also in context.ruleConflicts): own rules that contradict each other, [{ruleA, ruleB, reason}], [] when none. A conflict is a warning only: the rules are saved as sent, never a 4xx, and never edited.","tags":["Job search"],"x-required-scope":"search:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reset":{"type":"boolean","enum":[true]},"voiceSummary":{"type":"string","nullable":true,"maxLength":600},"preferences":{"type":"object","properties":{"notes":{"type":"string","nullable":true,"maxLength":500},"outreachPurpose":{"type":"string","nullable":true,"enum":["job_search","discovery"],"description":"#298: what the account's outreach is for (absent = job search)"},"senderIntro":{"type":"string","nullable":true,"maxLength":160,"description":"#298: how the sender introduces themselves in discovery drafts"}}},"userRules":{"type":"array","maxItems":10,"description":"#339: replaces the user's own rules. A rule is its text, or {text, scope} where scope is all (every draft), default (default-purpose drafts only) or discovery (purpose: discovery drafts only). Without a scope, a rule that states who the user is (a title, a proof line) or makes a job or founder offer is used for default-purpose drafts only; every rule in GET carries appliesTo.","items":{"oneOf":[{"type":"string","maxLength":200},{"type":"object","required":["text"],"properties":{"text":{"type":"string","maxLength":200},"scope":{"type":"string","nullable":true,"enum":["all","default","discovery"]}}}]}},"dismissRules":{"type":"array","items":{"type":"string"}},"restoreRules":{"type":"array","items":{"type":"string"}},"removeExemplars":{"type":"array","items":{"type":"integer"}}}}}}},"responses":{"200":{"description":"Writing context","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/skip-list/companies":{"get":{"operationId":"getSkipListCompanies","summary":"The account skip list (companies), with the total and the 500-entry limit. Free.","tags":["Job search"],"x-required-scope":"search:read","responses":{"200":{"description":"Skip list","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}},"post":{"operationId":"addSkipListCompanies","summary":"Add 1 to 500 companies to the account skip list. One bad value does not fail the rest. Free.","tags":["Job search"],"x-required-scope":"search:write","description":"Stored on the account (no migration), up to 500 entries in total for companies and people together. Returns inserted, existing and invalid [{value, reason}].","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["values"],"additionalProperties":false,"properties":{"values":{"type":"array","minItems":1,"maxItems":500,"items":{},"description":"Companies: domains or URLs. People: {name, companyDomain} objects or profile URLs (text, never fetched)."}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"422":{"description":"SKIP_LIST_FULL: the request would pass 500 entries; nothing was added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/skip-list/companies/remove":{"post":{"operationId":"removeSkipListCompanies","summary":"Remove companies from the account skip list. Free.","tags":["Job search"],"x-required-scope":"search:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["values"],"additionalProperties":false,"properties":{"values":{"type":"array","minItems":1,"maxItems":500,"items":{},"description":"Companies: domains or URLs. People: {name, companyDomain} objects or profile URLs (text, never fetched)."}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/skip-list/people":{"get":{"operationId":"getSkipListPeople","summary":"The account skip list (people), with the total and the 500-entry limit. Free.","tags":["Job search"],"x-required-scope":"search:read","responses":{"200":{"description":"Skip list","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}},"post":{"operationId":"addSkipListPeople","summary":"Add 1 to 500 people to the account skip list. One bad value does not fail the rest. Free.","tags":["Job search"],"x-required-scope":"search:write","description":"Stored on the account (no migration), up to 500 entries in total for companies and people together. Returns inserted, existing and invalid [{value, reason}].","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["values"],"additionalProperties":false,"properties":{"values":{"type":"array","minItems":1,"maxItems":500,"items":{},"description":"Companies: domains or URLs. People: {name, companyDomain} objects or profile URLs (text, never fetched)."}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"422":{"description":"SKIP_LIST_FULL: the request would pass 500 entries; nothing was added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/skip-list/people/remove":{"post":{"operationId":"removeSkipListPeople","summary":"Remove people from the account skip list. Free.","tags":["Job search"],"x-required-scope":"search:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["values"],"additionalProperties":false,"properties":{"values":{"type":"array","minItems":1,"maxItems":500,"items":{},"description":"Companies: domains or URLs. People: {name, companyDomain} objects or profile URLs (text, never fetched)."}}}}}},"responses":{"200":{"description":"Result","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"VALIDATION_ERROR","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/company-suggestions":{"get":{"operationId":"suggestCompanies","summary":"Companies hiring for the user's target roles, from the public job listings of the companies Data Reaktor tracks. Free.","tags":["Job search"],"x-required-scope":"search:read","description":"Up to 10 companies with open roles like the profile's target roles, each with a one-line reason and up to 3 matching roles with their URLs. Companies already on the user's searches are left out, and so are companies whose stored industry matches the account's excludedIndustries: skippedCount says how many, skipped (up to 20) which and by what term. Empty with a note when the profile has no target roles. With any of usPresence, headcountRange or requireLiveProduct (#294), each suggestion is screened like POST /searches/{id}/targets `screen` and carries `screen` (TargetScreen); those that fail are left out and listed in `screenedOut` [{companyName, domain, reasons}] unless includeScreenedOut=true. No charge.","parameters":[{"name":"usPresence","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"headcountRange","in":"query","required":false,"schema":{"type":"string","example":"20-200"},"description":"min-max employees"},{"name":"requireLiveProduct","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"includeScreenedOut","in":"query","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"Suggestions","content":{"application/json":{"schema":{"type":"object","properties":{"suggestions":{"type":"array","items":{"type":"object","properties":{"companyName":{"type":"string"},"domain":{"type":"string"},"reason":{"type":"string"},"roles":{"type":"array","items":{"type":"object"}},"matchingRoles":{"type":"integer"},"openRoles":{"type":"integer"},"seenOn":{"type":"string"},"screen":{"$ref":"#/components/schemas/TargetScreen"}}}},"basis":{"type":"object"},"excludedIndustries":{"type":"array","items":{"type":"string"}},"skippedCount":{"type":"integer","description":"Companies left out for excludedIndustries (0 when none are set)"},"skipped":{"type":"array","items":{"type":"object","properties":{"companyName":{"type":"string"},"domain":{"type":"string"},"term":{"type":"string"},"industry":{"type":"string"},"label":{"type":"string"}}}},"screen":{"type":"object","description":"With a screen: {criteria, pass, unknown, fail}"},"screenedOut":{"type":"array","items":{"type":"object","properties":{"companyName":{"type":"string"},"domain":{"type":"string"},"reasons":{"type":"array","items":{"type":"string"}}}},"description":"Suggestions that failed the screen (left out unless includeScreenedOut=true)"},"note":{"type":"string"}}}}}},"400":{"description":"VALIDATION_ERROR (bad screen value)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/followups":{"get":{"operationId":"listFollowups","summary":"Open follow-ups, soonest first. Items with due_outcome_prompt: true need the user's answer to \"Did they reply?\" (outcome_prompt lists the answers).","tags":["Job search"],"x-required-scope":"search:read","parameters":[{"name":"due","in":"query","schema":{"type":"string","enum":["today"]}}],"responses":{"200":{"description":"Follow-ups","content":{"application/json":{"schema":{"type":"object","properties":{"followups":{"type":"array","items":{"$ref":"#/components/schemas/FollowUp"}},"outcome_prompt":{"type":"object"}}}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/followups/{id}/done":{"post":{"operationId":"completeFollowup","summary":"Mark a follow-up done","tags":["Job search"],"x-required-scope":"followups:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/followups/{id}/snooze":{"post":{"operationId":"snoozeFollowup","summary":"Snooze a follow-up by N business days, or until a date. Pass exactly one of days / until.","tags":["Job search"],"x-required-scope":"followups:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"days":{"type":"integer","minimum":1,"maximum":30,"description":"Business days from now"},"until":{"type":"string","description":"ISO date (YYYY-MM-DD = 12:00 UTC that day) or date-time; after now, at most 365 days out"}},"oneOf":[{"required":["days"]},{"required":["until"]}]}}}},"responses":{"200":{"description":"Snoozed","content":{"application/json":{"schema":{"type":"object","properties":{"followUpDueAt":{"type":"string","format":"date-time"}}}}}},"400":{"description":"VALIDATION_ERROR (both or neither given, past date, > 365 days)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/referral":{"get":{"operationId":"getReferral","summary":"Invite code, share link, what an invite earns (during the beta, 5 extra companies each), and counts","tags":["Job search"],"x-required-scope":"search:read","responses":{"200":{"description":"Referral","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Referral"}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"NOT_FOUND (also returned for other users' ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/referral/claim":{"post":{"operationId":"claimReferral","summary":"A newly signed-up account claims a referral code (human session only, within 7 days of sign-up, once)","tags":["Job search"],"x-required-scope":"human session","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string"}}}}}},"responses":{"201":{"description":"Claimed","content":{"application/json":{"schema":{"type":"object","properties":{"claimed":{"type":"boolean"},"discountPercent":{"type":"integer"},"discountAvailable":{"type":"boolean"}}}}}},"401":{"description":"Missing, invalid or revoked key"},"403":{"description":"SCOPE_REQUIRED: the key lacks the scope (or is a legacy B2B key)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"404":{"description":"REFERRAL_CODE_INVALID","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}},"409":{"description":"REFERRAL_NOT_ELIGIBLE (detail.reason)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobSearchError"}}}}}}},"/health":{"servers":[{"url":"https://www.datareaktor.ai/api/v1","description":"GET /api/v1/health"},{"url":"https://www.datareaktor.ai","description":"GET /health"}],"get":{"operationId":"health","summary":"Uptime check (app and database). No key needed; a key is ignored.","tags":["Health"],"security":[],"responses":{"200":{"description":"Up","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"db":{"type":"string","enum":["ok"]},"ms":{"type":"integer"}}}}}},"503":{"description":"Database not answering","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[false]},"db":{"type":"string","enum":["down"]},"ms":{"type":"integer"}}}}}}}}},"/whoami":{"get":{"operationId":"whoami","summary":"Who is calling. Read-only, free, any valid key. Call it at the start of a run: label saved results and costs with userId, confirm the account (email, role, accountType) before spending, check credits, pace against rateLimit. Only the key prefix is returned.","tags":["Account"],"responses":{"200":{"description":"Caller","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"oneOf":[{"type":"integer"},{"type":"string"}],"description":"Numeric when the account id is numeric"},"email":{"type":"string","nullable":true},"role":{"type":"string","enum":["super_admin","user"]},"accountType":{"type":"string","enum":["production","test","development"],"description":"test = plus-addressed or test/qa/demo emails; development = not the production deployment"},"apiKey":{"type":"object","nullable":true,"description":"Null for a signed-in person","properties":{"id":{"type":"string"},"label":{"type":"string"},"prefix":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"lastUsedAt":{"type":"string","format":"date-time","nullable":true,"description":"This key's most recent task"},"kind":{"type":"string","enum":["legacy","personal"]},"scopes":{"type":"array","items":{"type":"string"}}}},"credits":{"type":"object","properties":{"balance":{"type":"integer","nullable":true},"unlimited":{"type":"boolean"},"source":{"type":"string","enum":["agent_wallet","plan","purchased_credits"]}}},"trial":{"type":"object","description":"Only for self-registered free-trial keys: credits left, expiry and the limits to plan against.","properties":{"creditsGranted":{"type":"integer","nullable":true},"creditsUsed":{"type":"integer"},"creditsRemaining":{"type":"integer","nullable":true},"expiresAt":{"type":"string","format":"date-time","nullable":true},"limits":{"$ref":"#/components/schemas/TrialLimits"}}},"rateLimit":{"type":"object","properties":{"perMinute":{"type":"integer"},"remaining":{"type":"integer"},"resetAt":{"type":"string","format":"date-time","nullable":true}}},"serverTime":{"type":"string","format":"date-time"}}}}}},"401":{"description":"No or invalid key"}}}},"/voice-profile":{"get":{"operationId":"getVoiceProfile","summary":"The account's effective voice profile for legacy outreach copy (personalized_email, linkedin_message, outreach_sequence, outreach_generation). Free and read-only.","tags":["Account"],"responses":{"200":{"description":"Effective profile","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"$ref":"#/components/schemas/VoiceProfile"},"isDefault":{"type":"boolean","description":"True when the account has no saved profile (built-in default)"},"source":{"type":"string","enum":["default","account"]},"stored":{"type":"object","nullable":true,"description":"What the account saved (partial), or null"},"appliesTo":{"type":"array","items":{"type":"string"}}}}}}},"401":{"description":"No or invalid key"}}},"put":{"operationId":"putVoiceProfile","summary":"Save the account's voice profile (partial; replaces what was saved; unknown keys refused; banned phrases are one line each; prompt-injection patterns are removed from saved strings). The body must be a JSON object: only an explicit {} or { voiceProfile: null } resets to the built-in default; an empty or non-object body is 400. Changes only the caller's own account. Needs a signed-in session, an owner key (canProvision) or an owner-plan key with the drafts:write scope; other agent keys get 403 OWNER_SCOPE_REQUIRED and can still override per run with inputPayload.voiceProfile. The body may also carry draftVoice (rules, exemplars by archetype, banned phrases and patterns, footers; null removes it) and draftVoiceActions ({ confirm, reject, banPhrases } for learned candidates); a reset or a legacy-only PUT keeps the draftVoice. See docs/voice-profile.md.","tags":["Account"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceProfile"}}}},"responses":{"200":{"description":"Saved; the new effective profile","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"$ref":"#/components/schemas/VoiceProfile"},"isDefault":{"type":"boolean","description":"True when the account has no saved profile (built-in default)"},"source":{"type":"string","enum":["default","account"]},"stored":{"type":"object","nullable":true,"description":"What the account saved (partial), or null"},"appliesTo":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"VALIDATION_ERROR: the body is missing or not a JSON object, or a field is invalid (details lists each field)"},"401":{"description":"No or invalid key"},"403":{"description":"OWNER_SCOPE_REQUIRED: an agent key without canProvision"}}}},"/voice-profile/asks:confirm":{"post":{"operationId":"confirmVoiceProfileAsks","summary":"The owner approves ask wordings the code authored (draftVoice.pendingOwnerConfirmation in GET /voice-profile lists them with id, label, text and where). Body { askIds }: every message ask and connect-note ask with one of those ids loses its needsOwnerConfirmation flag; the profile version goes up by one. Free. Same gate as PUT /voice-profile: a signed-in owner, an owner key (canProvision) or an owner-plan key with the drafts:write scope (403 OWNER_SCOPE_REQUIRED otherwise). 404 NOT_FOUND for an id that matches no ask (nothing is changed) or an account with no draft voice. The same can be done with PUT /voice-profile and draftVoiceActions { confirmAsks }.","tags":["Account"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["askIds"],"additionalProperties":false,"properties":{"askIds":{"type":"array","minItems":1,"maxItems":30,"items":{"type":"string","maxLength":40}}}}}}},"responses":{"200":{"description":"{ confirmed: ids that were pending, ...the voice profile view }","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"$ref":"#/components/schemas/VoiceProfile"},"isDefault":{"type":"boolean","description":"True when the account has no saved profile (built-in default)"},"source":{"type":"string","enum":["default","account"]},"stored":{"type":"object","nullable":true,"description":"What the account saved (partial), or null"},"appliesTo":{"type":"array","items":{"type":"string"}}}}}}},"400":{"description":"VALIDATION_ERROR"},"401":{"description":"No or invalid key"},"403":{"description":"OWNER_SCOPE_REQUIRED"},"404":{"description":"NOT_FOUND"}}}},"/agents/register":{"get":{"operationId":"describeAgentRegistration","summary":"What to send to register. Public, free, read-only.","tags":["Agent signup"],"security":[],"responses":{"200":{"description":"Body fields, example, trial size and limits"}}},"post":{"operationId":"registerAgent","summary":"Register an agent on your own: no human, no email, no captcha. Returns an API key (shown once) and a small, capped free trial. Never charges a card.","description":"Send { name, acceptTerms: true }. The 201 body has apiKey and nextSteps. Grants per address per UTC day: one full trial, then two reduced trials (trial.grant \"reduced\"), then 429 AGENT_SIGNUP_IP_LIMIT with Retry-After; a /24 (or IPv6 /48) gets three full and six reduced. Also: a few attempts per minute, a global cap on unspent trial credits (503 AGENT_SIGNUP_BUDGET_EXHAUSTED), and an operator kill switch (503 AGENT_SIGNUP_DISABLED). Refusals carry machine-readable nextSteps and Retry-After. Past the trial credits or the trial window, the user creates a key at /settings/agents; paid top-up for agents is not offered.","tags":["Agent signup"],"security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegistration"}}}},"responses":{"201":{"description":"Registered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegistered"}}}},"400":{"description":"VALIDATION_ERROR: bad or missing fields, or a body that is not valid JSON (code, message, troubleshootUrl; detail.issues lists each)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorWithNextSteps"}}}},"409":{"description":"AGENT_NAME_TAKEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorWithNextSteps"}}}},"413":{"description":"PAYLOAD_TOO_LARGE: the body is over 4 KB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorWithNextSteps"}}}},"429":{"description":"AGENT_SIGNUP_RATE_LIMITED or AGENT_SIGNUP_IP_LIMIT (address or /24 had today's grants; detail.scope; see Retry-After and detail.resetsAt)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorWithNextSteps"}}}},"503":{"description":"AGENT_SIGNUP_DISABLED (kill switch) or AGENT_SIGNUP_BUDGET_EXHAUSTED (global cap on unspent trial credits; Retry-After)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorWithNextSteps"}}}}}}},"/agent/account":{"get":{"operationId":"agentAccount","summary":"Your trial credits (granted, used, remaining), expiry and limits. Cheap and free. Only for keys made by POST /agents/register.","tags":["Agent signup"],"responses":{"200":{"description":"Account and trial status, with nextSteps"},"401":{"description":"AUTH_REQUIRED, INVALID_API_KEY or KEY_EXPIRED (the trial window ended)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorWithNextSteps"}}}},"429":{"description":"TRIAL_RATE_LIMITED (per-key requests per minute) or KEY_SUSPENDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorWithNextSteps"}}}}}}},"/agent/rotate-key":{"post":{"operationId":"rotateAgentKey","summary":"Get a new key; the old key is rejected at once. Rotation does not extend the trial.","tags":["Agent signup"],"responses":{"200":{"description":"New apiKey, shown once"},"401":{"description":"Not a valid self-signup key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorWithNextSteps"}}}},"429":{"description":"TRIAL_RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorWithNextSteps"}}}}}}},"/agent/revoke":{"post":{"operationId":"revokeAgentKey","summary":"Revoke this key for good. Body must be { confirm: true }.","tags":["Agent signup"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["confirm"],"properties":{"confirm":{"type":"boolean","enum":[true]}}}}}},"responses":{"200":{"description":"Revoked"},"400":{"description":"VALIDATION_ERROR: confirm missing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorWithNextSteps"}}}},"401":{"description":"Not a valid self-signup key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorWithNextSteps"}}}}}}},"/api/admin/agent-signups":{"get":{"operationId":"adminAgentSignups","summary":"Admin only: self-signup counts and trial credit metering (used today, granted today, outstanding, remaining, cost per credit).","description":"Requires X-Admin-Key, the super admin's session, or the owner's own agent key. Everyone else gets 404. No names, keys or addresses.","tags":["Operator (admin only)"],"servers":[{"url":"https://www.datareaktor.ai"}],"security":[{"AdminKey":[]},{"apiKeyHeader":[]}],"responses":{"200":{"description":"Counts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminAgentSignups"}}}},"404":{"description":"Not the operator"}}}},"/api/admin/task-latency":{"get":{"operationId":"adminTaskLatency","summary":"Admin only: p50/p95 task duration per task type.","tags":["Operator (admin only)"],"servers":[{"url":"https://www.datareaktor.ai"}],"security":[{"AdminKey":[]},{"apiKeyHeader":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":90,"default":7}}],"responses":{"200":{"description":"Latency per task type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTaskLatency"}}}},"404":{"description":"Not the operator"}}}}},"x-workflow-progress":{"description":"When polling GET /tasks/{taskId} for a workflow task, outputPayload contains step-level progress","schema":{"type":"object","properties":{"workflowId":{"type":"string"},"workflowName":{"type":"string"},"totalSteps":{"type":"integer"},"completedSteps":{"type":"integer"},"currentStep":{"type":"integer"},"status":{"type":"string","enum":["running","completed","partial","failed"]},"steps":{"type":"array","items":{"type":"object","properties":{"stepId":{"type":"string"},"name":{"type":"string"},"taskType":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed","skipped"]},"output":{"type":"object"},"error":{"type":"string"}}}},"finalOutput":{"type":"object"}}}},"tags":[{"name":"Job search","description":"The job search desk. Needs an agent key from /settings/agents (scope per operation in x-required-scope)."},{"name":"Health","description":"Uptime checks. No key needed."},{"name":"Account","description":"The calling account: who is calling (GET /whoami, read-only) and the voice profile for outreach copy (GET / PUT /voice-profile). Any valid key or session."},{"name":"Legacy B2B","description":"Older B2B builder API, kept for existing builder keys. Not for job seekers; keys it mints do not work on the job-search routes."},{"name":"Operator (admin only)","description":"Operator endpoints. Agents get a 404."},{"name":"Agent signup","description":"An agent gets its own key with no human: POST /agents/register. Small capped free trial; manage the key at /agent/*."}]}