{"openapi":"3.1.0","info":{"title":"DM Hero API","version":"2026-10-08","description":"Supported DMHero-Version values: 2026-10-08. Other scopes and integrations are available as a custom arrangement: contact the DM Hero team."},"servers":[{"url":"https://api.dmhero.ai"}],"paths":{"/v1/analytics/ab-comparison":{"get":{"operationId":"analytics.ab_comparison","summary":"Reply performance compared across campaigns, templates or niches, with comparability findings.","description":"The report the app's comparison panel reads. `scope` is what a denominator counts (a lead reached by the sequence, or by one step), `dimension` what separates the arms; templates compare only at step scope. Pass `arms` (2 to 4 keys from `options`) to compose the experiment. Rates are reweighted over the reps in scope; a key restricted to reps must pass `rep_id`.","tags":["Analytics"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"scope","in":"query","required":false,"schema":{"type":"string","enum":["sequence","step"]}},{"name":"dimension","in":"query","required":false,"schema":{"type":"string","enum":["campaign","template","niche"]}},{"name":"step_order","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":50}},{"name":"niche","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"days","in":"query","required":false,"schema":{"description":"Rolling window in days. Absent: all time.","type":"integer","minimum":1,"maximum":3650}},{"name":"include_breakup","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"arms","in":"query","required":false,"schema":{"description":"Arm keys from `options`, repeated or as one comma-separated value.","maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},{"name":"rep_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"A rep (connected Instagram account) id."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["analytics:read"],"x-dmhero-rate-class":"heavy","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"scope":{"type":"string","enum":["sequence","step"]},"dimension":{"type":"string","enum":["campaign","template","niche"]},"options":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"reached":{"type":"number"}},"required":["key","label","reached"],"additionalProperties":false}},"experiment":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]},"findings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"severity":{"type":"string"},"detail":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["code","severity","detail"],"additionalProperties":false}}},"required":["scope","dimension","options","experiment","findings"],"additionalProperties":false}}}},"400":{"description":"COMPARISON_QUERY_INVALID_400: The combination is not comparable (for example templates at sequence scope, or step scope without step_order); `reason` names the rule.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"API_REP_RESTRICTED_403: A key restricted to reps asked for workspace-level numbers, which include other reps' traffic. Pass one of the key's reps as rep_id.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"REP_NOT_FOUND_404: The rep does not exist in this workspace, is archived, or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404","API_REP_RESTRICTED_403","COMPARISON_QUERY_INVALID_400"]}},"/v1/analytics/funnel":{"get":{"operationId":"analytics.funnel","summary":"The lead status funnel and the daily cohort series of first DMs.","description":"Workspace-level, so a key restricted to reps is refused.","tags":["Analytics"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"description":"Reporting window in days, over each lead's first DM. Default 30.","type":"integer","minimum":1,"maximum":3650}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["analytics:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["days"],"additionalProperties":false},"stages":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"count":{"type":"number"}},"required":["status","count"],"additionalProperties":false}},"cohort":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"reached":{"type":"number"},"replied":{"type":"number"},"converted":{"type":"number"}},"required":["day","reached","replied","converted"],"additionalProperties":false}}},"required":["period","stages","cohort"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"API_REP_RESTRICTED_403: A key restricted to reps asked for workspace-level numbers, which include other reps' traffic. Pass one of the key's reps as rep_id.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["API_REP_RESTRICTED_403"]}},"/v1/analytics/overview":{"get":{"operationId":"analytics.overview","summary":"Headline numbers: leads, reach, replies and conversions, plus the reps' threads and today's sends.","description":"`stats` and `outreach_funnel` are workspace-level (leads are shared by every rep), so a key restricted to reps must pass `rep_id` and gets them as null. `reps` covers `rep_id` when given, else every rep the key may act as.","tags":["Analytics"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"description":"Reporting window in days, over each lead's first DM. Default 30.","type":"integer","minimum":1,"maximum":3650}},{"name":"rep_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"A rep (connected Instagram account) id."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["analytics:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"period":{"type":"object","properties":{"days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["days"],"additionalProperties":false},"stats":{"anyOf":[{"type":"object","properties":{"total_leads":{"type":"number"},"contacted":{"type":"number"},"replied":{"type":"number"},"converted":{"type":"number"},"not_interested":{"type":"number"},"reply_rate":{"type":"number"},"conversion_rate":{"type":"number"}},"required":["total_leads","contacted","replied","converted","not_interested","reply_rate","conversion_rate"],"additionalProperties":false},{"type":"null"}]},"outreach_funnel":{"anyOf":[{"type":"object","properties":{"reached":{"type":"number"},"replied":{"type":"number"},"converted":{"type":"number"},"reply_rate":{"type":"number"},"conversion_rate":{"type":"number"}},"required":["reached","replied","converted","reply_rate","conversion_rate"],"additionalProperties":false},{"type":"null"}]},"reps":{"type":"object","properties":{"rep_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"conversations":{"type":"object","properties":{"total":{"type":"number"},"unread":{"type":"number"}},"required":["total","unread"],"additionalProperties":false},"today":{"type":"object","properties":{"sent":{"type":"number"},"skipped":{"type":"number"},"not_interested":{"type":"number"}},"required":["sent","skipped","not_interested"],"additionalProperties":false}},"required":["rep_ids","conversations","today"],"additionalProperties":false}},"required":["period","stats","outreach_funnel","reps"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"API_REP_RESTRICTED_403: A key restricted to reps asked for workspace-level numbers, which include other reps' traffic. Pass one of the key's reps as rep_id.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"REP_NOT_FOUND_404: The rep does not exist in this workspace, is archived, or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404","API_REP_RESTRICTED_403"]}},"/v1/analytics/setter":{"get":{"operationId":"analytics.setter","summary":"The AI Setter report for one rep: variants, funnel, turns, follow-ups, silence, segments, objections.","description":"The report the app's setter Analytics tab draws, per rep. `days` limits it to threads first contacted inside the window, `variant_id` to one setter variant.","tags":["Analytics"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"rep_id","in":"query","required":true,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"A rep (connected Instagram account) id."}},{"name":"days","in":"query","required":false,"schema":{"description":"Threads first contacted in the last N days. Absent: all time.","type":"integer","minimum":1,"maximum":3650}},{"name":"variant_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["analytics:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"rep_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"metrics":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"totals":{"type":"object","properties":{"engaged":{"type":"number"},"replied":{"type":"number"},"booked":{"type":"number"}},"required":["engaged","replied","booked"],"additionalProperties":false},"funnel":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"turns":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"followup":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"silence":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"segments":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"objection_flow":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"emerging_objections":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"recommendation":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"depth":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}]}},"required":["rep_id","metrics","totals","funnel","turns","followup","silence","segments","objection_flow","emerging_objections","recommendation","depth"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"REP_NOT_FOUND_404: The rep does not exist in this workspace, is archived, or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404"]}},"/v1/campaign-leads":{"post":{"operationId":"campaign_leads.upsert_enroll","summary":"Upsert one lead, then enroll it into a campaign (the Clay add-to-campaign column).","description":"A refusal to enroll (already in a campaign, opted out) is a 200 with skipped_reason; the lead keeps the fields the upsert wrote.","tags":["Campaigns"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["leads:write","enrollments:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"ig_handle":{"description":"Required for every lead: the matching key."},"name":{},"first_name":{},"last_name":{},"fb_handle":{},"profile_url":{},"niche":{},"followers":{"description":"A number, or a numeric string."},"notes":{},"tags":{"description":"An array of tags or one comma-separated string, at most 20."},"folder":{"description":"Folder NAME, created when missing."},"custom_fields":{"description":"{ key: value } of the workspace's custom fields."},"external_id":{},"email":{},"phone":{},"merge":{"description":"fill_empty (default) or overwrite."},"campaign_id":{"description":"Required: a campaign of the key's workspace."},"rep_ig_username":{"description":"One of the key's reps; omitted, the least loaded one."},"skip_if_in_any_campaign":{"description":"Boolean, default true."}}}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"lead_id":{"type":"string"},"result":{"type":"string"},"updated_fields":{"type":"array","items":{"type":"string"}},"enrolled":{"type":"boolean"},"skipped_reason":{"type":["string","null"]},"campaign_id":{"type":"string"},"rep_ig_username":{"type":["string","null"]},"queue_state":{"type":["string","null"]},"lead_status":{"type":"string"}},"required":["lead_id","result","updated_fields","enrolled","skipped_reason","campaign_id","rep_ig_username","queue_state","lead_status"],"additionalProperties":false},{"type":"object","properties":{"replayed":{"type":"boolean","const":true},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ids":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["replayed","status","ids"],"additionalProperties":false}]}}}},"400":{"description":"CUSTOM_FIELD_UNKNOWN_400: custom_fields names a key this workspace has not defined. Create it with POST /v1/custom-fields first.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: No campaign with that campaign_id in this API key's workspace.\nREP_NOT_FOUND_404: No rep with this id or username that this API key may use.\nLEAD_NOT_FOUND_404: The lead was deleted while the call ran; nothing was enrolled.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CAMPAIGN_ARCHIVED_409: The campaign is archived and takes no new leads.\nREP_NONE_AVAILABLE_409: This API key has no active rep to enroll leads on.\nLEAD_AMBIGUOUS_409: More than one lead in this workspace has that Instagram handle.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"description":"LEADS_DAILY_LIMIT_429: The organization reached its daily limit of leads created through the API.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CAMPAIGN_NOT_FOUND_404","CAMPAIGN_ARCHIVED_409","REP_NOT_FOUND_404","REP_NONE_AVAILABLE_409","CUSTOM_FIELD_UNKNOWN_400","LEAD_AMBIGUOUS_409","LEAD_NOT_FOUND_404","LEADS_DAILY_LIMIT_429"]}},"/v1/campaigns":{"get":{"operationId":"campaigns.list","summary":"List the workspace's campaigns, newest first.","description":"Offset paging (`limit`, `offset`) is kept for existing integrations; `cursor` (from `next_cursor`) is the keyset alternative and cannot be combined with `offset`. `limit` and `offset` out of range are clamped.","tags":["Campaigns"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","paused","completed","archived"]}},{"name":"limit","in":"query","required":false,"schema":{"default":100,"type":"integer","minimum":1,"maximum":200}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":1000000}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["campaigns:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","completed","archived"]},"timezone":{"type":"string"},"business_hours":{"type":"string"},"send_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"send_rank":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Enrollments the key may see: its reps' ones, and for an unrestricted key also the unassigned ones."},"active_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, the ones still in the sequence."},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"step_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"template_id":{"type":["string","null"]},"delay_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"platform":{"type":"string"},"message_mode":{"type":"string","enum":["template","ai"],"description":"Read only. `ai`: the step sends a first message written for each lead, and `template_id` is its fallback, sent only when no such message can be written. `template`: the step sends `template_id`. Set in the app; `campaigns.steps.replace` keeps each step's mode by `step_order`."}},"required":["id","step_order","template_id","delay_days","platform","message_mode"],"additionalProperties":false}},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","status","timezone","business_hours","send_weight","send_rank","enrolled_count","active_count","created_at","updated_at"],"additionalProperties":false}},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","total","limit","offset","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":[]},"post":{"operationId":"campaigns.create","summary":"Create a campaign, optionally with its steps. It starts paused.","description":"Every step's template is checked before anything is written. Start the campaign with POST /v1/campaigns/{campaign_id}/start.","tags":["Campaigns"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["campaigns:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"timezone":{"description":"IANA timezone; defaults to the workspace's.","type":"string","maxLength":64},"business_hours":{"description":"Free text the AI Setter reads when it books.","type":"string","maxLength":200},"send_weight":{"type":"integer","minimum":1,"maximum":100},"send_rank":{"type":"integer","minimum":0,"maximum":1000},"steps":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"template_id":{"type":"string","maxLength":64,"description":"A template of this workspace (uuid)."},"delay_days":{"type":"integer","minimum":0,"maximum":90,"description":"Days after the previous step (the first step: after enrollment)."}},"required":["template_id","delay_days"]},"description":"The whole sequence, in order: the first item is step 1."}},"required":["name"]}}}},"responses":{"201":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","completed","archived"]},"timezone":{"type":"string"},"business_hours":{"type":"string"},"send_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"send_rank":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Enrollments the key may see: its reps' ones, and for an unrestricted key also the unassigned ones."},"active_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, the ones still in the sequence."},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"step_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"template_id":{"type":["string","null"]},"delay_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"platform":{"type":"string"},"message_mode":{"type":"string","enum":["template","ai"],"description":"Read only. `ai`: the step sends a first message written for each lead, and `template_id` is its fallback, sent only when no such message can be written. `template`: the step sends `template_id`. Set in the app; `campaigns.steps.replace` keeps each step's mode by `step_order`."}},"required":["id","step_order","template_id","delay_days","platform","message_mode"],"additionalProperties":false}},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","status","timezone","business_hours","send_weight","send_rank","enrolled_count","active_count","created_at","updated_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"TEMPLATE_NOT_FOUND_404: A step names a template that is not in the key's workspace. Nothing was written.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["TEMPLATE_NOT_FOUND_404"]}},"/v1/campaigns/{campaign_id}":{"delete":{"operationId":"campaigns.delete","summary":"Delete a campaign with its steps and enrollments.","tags":["Campaigns"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Campaign id (uuid)"}},{"name":"confirm","in":"query","required":false,"schema":{"description":"Must be true.","type":"boolean"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["campaigns:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":true,"responses":{"204":{"description":"No content","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"CONFIRM_REQUIRED_400: This action cannot be undone; send confirm=true.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: No campaign with this id exists in the key's workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CAMPAIGN_NOT_FOUND_404","CONFIRM_REQUIRED_400"]},"get":{"operationId":"campaigns.get","summary":"Get one campaign with its steps.","tags":["Campaigns"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Campaign id (uuid)"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["campaigns:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","completed","archived"]},"timezone":{"type":"string"},"business_hours":{"type":"string"},"send_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"send_rank":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Enrollments the key may see: its reps' ones, and for an unrestricted key also the unassigned ones."},"active_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, the ones still in the sequence."},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"step_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"template_id":{"type":["string","null"]},"delay_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"platform":{"type":"string"},"message_mode":{"type":"string","enum":["template","ai"],"description":"Read only. `ai`: the step sends a first message written for each lead, and `template_id` is its fallback, sent only when no such message can be written. `template`: the step sends `template_id`. Set in the app; `campaigns.steps.replace` keeps each step's mode by `step_order`."}},"required":["id","step_order","template_id","delay_days","platform","message_mode"],"additionalProperties":false}},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","status","timezone","business_hours","send_weight","send_rank","enrolled_count","active_count","created_at","updated_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: No campaign with this id exists in the key's workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CAMPAIGN_NOT_FOUND_404"]},"patch":{"operationId":"campaigns.update","summary":"Update a campaign's settings.","description":"`status` cannot be set here: use the start, pause, resume and archive endpoints.","tags":["Campaigns"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Campaign id (uuid)"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["campaigns:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"timezone":{"description":"IANA timezone; defaults to the workspace's.","type":"string","maxLength":64},"business_hours":{"description":"Free text the AI Setter reads when it books.","type":"string","maxLength":200},"send_weight":{"type":"integer","minimum":1,"maximum":100},"send_rank":{"type":"integer","minimum":0,"maximum":1000},"status":{"description":"Refused: use the control endpoints.","type":"string","maxLength":32}}}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","completed","archived"]},"timezone":{"type":"string"},"business_hours":{"type":"string"},"send_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"send_rank":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Enrollments the key may see: its reps' ones, and for an unrestricted key also the unassigned ones."},"active_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, the ones still in the sequence."},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"step_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"template_id":{"type":["string","null"]},"delay_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"platform":{"type":"string"},"message_mode":{"type":"string","enum":["template","ai"],"description":"Read only. `ai`: the step sends a first message written for each lead, and `template_id` is its fallback, sent only when no such message can be written. `template`: the step sends `template_id`. Set in the app; `campaigns.steps.replace` keeps each step's mode by `step_order`."}},"required":["id","step_order","template_id","delay_days","platform","message_mode"],"additionalProperties":false}},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","status","timezone","business_hours","send_weight","send_rank","enrolled_count","active_count","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"CAMPAIGN_STATUS_VIA_CONTROL_400: The body sets `status`; use start, pause, resume or archive.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: No campaign with this id exists in the key's workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CAMPAIGN_NOT_FOUND_404","CAMPAIGN_STATUS_VIA_CONTROL_400"]}},"/v1/campaigns/{campaign_id}/archive":{"post":{"operationId":"campaigns.archive","summary":"Archive a campaign: every enrollment stops sending.","tags":["Campaigns"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Campaign id (uuid)"}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["campaigns:control"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":true,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"description":"Must be true.","type":"boolean"}}}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","completed","archived"]},"timezone":{"type":"string"},"business_hours":{"type":"string"},"send_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"send_rank":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Enrollments the key may see: its reps' ones, and for an unrestricted key also the unassigned ones."},"active_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, the ones still in the sequence."},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"step_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"template_id":{"type":["string","null"]},"delay_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"platform":{"type":"string"},"message_mode":{"type":"string","enum":["template","ai"],"description":"Read only. `ai`: the step sends a first message written for each lead, and `template_id` is its fallback, sent only when no such message can be written. `template`: the step sends `template_id`. Set in the app; `campaigns.steps.replace` keeps each step's mode by `step_order`."}},"required":["id","step_order","template_id","delay_days","platform","message_mode"],"additionalProperties":false}},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","status","timezone","business_hours","send_weight","send_rank","enrolled_count","active_count","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"CONFIRM_REQUIRED_400: This action cannot be undone; send confirm=true.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: No campaign with this id exists in the key's workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CAMPAIGN_NOT_FOUND_404","CONFIRM_REQUIRED_400"]}},"/v1/campaigns/{campaign_id}/clone":{"post":{"operationId":"campaigns.clone","summary":"Copy a campaign and its steps, without its enrollments. The copy starts paused.","tags":["Campaigns"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Campaign id (uuid)"}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["campaigns:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80}}}}}},"responses":{"201":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","completed","archived"]},"timezone":{"type":"string"},"business_hours":{"type":"string"},"send_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"send_rank":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Enrollments the key may see: its reps' ones, and for an unrestricted key also the unassigned ones."},"active_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, the ones still in the sequence."},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"step_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"template_id":{"type":["string","null"]},"delay_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"platform":{"type":"string"},"message_mode":{"type":"string","enum":["template","ai"],"description":"Read only. `ai`: the step sends a first message written for each lead, and `template_id` is its fallback, sent only when no such message can be written. `template`: the step sends `template_id`. Set in the app; `campaigns.steps.replace` keeps each step's mode by `step_order`."}},"required":["id","step_order","template_id","delay_days","platform","message_mode"],"additionalProperties":false}},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","status","timezone","business_hours","send_weight","send_rank","enrolled_count","active_count","created_at","updated_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: No campaign with this id exists in the key's workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CAMPAIGN_NOT_FOUND_404"]}},"/v1/campaigns/{campaign_id}/enrollments":{"get":{"operationId":"enrollments.list","summary":"List a campaign's enrollments, newest first.","description":"A rep-restricted key sees its reps' enrollments only; an unrestricted key also the unassigned ones.","tags":["Enrollments"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Campaign id (uuid)"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","paused","replied","completed","opted_out","failed"]}},{"name":"rep_id","in":"query","required":false,"schema":{"type":"string","maxLength":64}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["campaigns:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"campaign_id":{"type":"string"},"lead_id":{"type":"string"},"rep_id":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","replied","completed","opted_out","failed"]},"current_step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"next_action_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"completed_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","campaign_id","lead_id","rep_id","status","current_step","enrolled_at","next_action_at","completed_at"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: No campaign with this id exists in the key's workspace.\nREP_NOT_FOUND_404: The rep is not one the key may act as.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CAMPAIGN_NOT_FOUND_404","REP_NOT_FOUND_404"]},"post":{"operationId":"enrollments.create","summary":"Enroll leads in a campaign, by id or by filter.","description":"Send `lead_ids` (1 to 100) or `filter` with `limit` (1 to 5 000, a random sample when more match). Enrolled leads are DMed by the extension from the campaign's first step on, and a DM cannot be unsent. On an ACTIVE campaign a filter enrollment needs a prior call with `dry_run: true`, which answers the match count and a `confirm_token` valid for 15 minutes; the real call sends that token with the same filter, limit, rep and skip setting. `skip_if_in_any_campaign` (default true) skips leads already enrolled in any campaign. Both forms skip opted-out (`not_interested`) and converted leads, and a lead the workspace is already talking to in a DM thread in which the person wrote; by id they are reported in `skipped_reasons` (`already_in_conversation` for that one), where a lead deleted while the call runs counts as `not_found`. By filter the other skipped leads never match, so `skipped` counts only the `already_in_conversation` ones.","tags":["Enrollments"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Campaign id (uuid)"}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["enrollments:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"lead_ids":{"description":"Up to 100 lead ids (uuid).","minItems":1,"type":"array","items":{"type":"string","maxLength":64}},"filter":{"type":"object","properties":{"status":{"type":"string","maxLength":32},"niche":{"type":"string","maxLength":200},"tag":{"type":"string","maxLength":50},"folder_id":{"description":"A folder id, or `none` for unfiled leads.","anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"string","const":"none"}]},"search":{"type":"string","maxLength":200},"custom_fields":{"description":"Custom field conditions, ANDed with each other and with the other members, in the same JSON form as the bulk preview's and the export's filter (spec 6.3.2). Every key must be defined in the workspace (400 CUSTOM_FIELD_UNKNOWN_400 otherwise).","maxItems":5,"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":100,"description":"A custom field key the workspace defines (GET /v1/custom-fields)."},"op":{"type":"string","const":"equals"},"value":{"type":"string","minLength":1,"maxLength":500,"description":"Compared trimmed and ignoring case, as a whole value."}},"required":["key","op","value"]},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":100,"description":"A custom field key the workspace defines (GET /v1/custom-fields)."},"op":{"type":"string","const":"contains"},"value":{"type":"string","minLength":1,"maxLength":500,"description":"A substring, ignoring case. Every character is literal (% and _ included)."}},"required":["key","op","value"]},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":100,"description":"A custom field key the workspace defines (GET /v1/custom-fields)."},"op":{"type":"string","const":"present"}},"required":["key","op"]},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":100,"description":"A custom field key the workspace defines (GET /v1/custom-fields)."},"op":{"type":"string","const":"missing"}},"required":["key","op"]}],"description":"equals: the value, trimmed, equals this text ignoring case. contains: the value holds this text ignoring case. present: the lead has a non-blank value. missing: the lead has no value or a blank one."}}},"additionalProperties":false,"description":"Lead filter: status, niche, tag, folder_id, search and custom_fields only; any other member is refused (400 VALIDATION_FAILED_400 naming filter.<member>), never ignored. Inbound-first leads, opted-out (`not_interested`) and converted leads, and leads already in this campaign are always skipped."},"limit":{"description":"Required with `filter`.","type":"integer","minimum":1,"maximum":5000},"dry_run":{"type":"boolean"},"confirm_token":{"type":"string","maxLength":256},"rep_id":{"description":"The rep that sends to these leads; by default they are spread over the key's reps.","type":"string","maxLength":64},"skip_if_in_any_campaign":{"default":true,"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"enrolled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"skipped_reasons":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["enrolled","skipped"],"additionalProperties":false},{"type":"object","properties":{"matched_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"confirm_token":{"type":"string"},"confirm_expires_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["matched_count","confirm_token","confirm_expires_at"],"additionalProperties":false}]}}}},"400":{"description":"ENROLL_BATCH_TOO_LARGE_400: More than 100 lead ids.\nCUSTOM_FIELD_UNKNOWN_400: filter.custom_fields names a key the workspace has not defined.\nENROLL_CONFIRM_REQUIRED_400: A filter enrollment on an active campaign without a valid confirm_token from a dry run with the same parameters.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: No campaign with this id exists in the key's workspace.\nLEAD_NOT_FOUND_404: A lead id is not in the key's workspace. The answer names no id.\nREP_NOT_FOUND_404: The rep is not one the key may act as.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CAMPAIGN_ARCHIVED_409: The campaign is archived.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CAMPAIGN_NOT_FOUND_404","LEAD_NOT_FOUND_404","REP_NOT_FOUND_404","CAMPAIGN_ARCHIVED_409","ENROLL_BATCH_TOO_LARGE_400","CUSTOM_FIELD_UNKNOWN_400","ENROLL_CONFIRM_REQUIRED_400"]}},"/v1/campaigns/{campaign_id}/enrollments/{lead_id}":{"delete":{"operationId":"enrollments.remove","summary":"Remove a lead from a campaign: nothing more is sent to it from this campaign.","tags":["Enrollments"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Campaign id (uuid)"}},{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Lead id (uuid)"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["enrollments:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":true,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"removed":{"type":"boolean"},"reason":{"type":"string","enum":["not_enrolled","already_terminal"]}},"required":["removed"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: No campaign with this id exists in the key's workspace.\nLEAD_NOT_FOUND_404: A lead id is not in the key's workspace. The answer names no id.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CAMPAIGN_NOT_FOUND_404","LEAD_NOT_FOUND_404"]}},"/v1/campaigns/{campaign_id}/pause":{"post":{"operationId":"campaigns.pause","summary":"Pause an active campaign.","description":"active -> paused. Nothing more is sent until it is resumed. A campaign that is already paused is answered as is.","tags":["Campaigns"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Campaign id (uuid)"}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["campaigns:control"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","completed","archived"]},"timezone":{"type":"string"},"business_hours":{"type":"string"},"send_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"send_rank":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Enrollments the key may see: its reps' ones, and for an unrestricted key also the unassigned ones."},"active_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, the ones still in the sequence."},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"step_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"template_id":{"type":["string","null"]},"delay_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"platform":{"type":"string"},"message_mode":{"type":"string","enum":["template","ai"],"description":"Read only. `ai`: the step sends a first message written for each lead, and `template_id` is its fallback, sent only when no such message can be written. `template`: the step sends `template_id`. Set in the app; `campaigns.steps.replace` keeps each step's mode by `step_order`."}},"required":["id","step_order","template_id","delay_days","platform","message_mode"],"additionalProperties":false}},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","status","timezone","business_hours","send_weight","send_rank","enrolled_count","active_count","created_at","updated_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: No campaign with this id exists in the key's workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CAMPAIGN_STATUS_CONFLICT_409: The campaign is not in a status this transition starts from, or its status changed meanwhile.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CAMPAIGN_NOT_FOUND_404","CAMPAIGN_STATUS_CONFLICT_409"]}},"/v1/campaigns/{campaign_id}/resume":{"post":{"operationId":"campaigns.resume","summary":"Resume a paused campaign.","description":"paused -> active, without the steps check of start. A campaign that is already active is answered as is.","tags":["Campaigns"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Campaign id (uuid)"}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["campaigns:control"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","completed","archived"]},"timezone":{"type":"string"},"business_hours":{"type":"string"},"send_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"send_rank":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Enrollments the key may see: its reps' ones, and for an unrestricted key also the unassigned ones."},"active_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, the ones still in the sequence."},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"step_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"template_id":{"type":["string","null"]},"delay_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"platform":{"type":"string"},"message_mode":{"type":"string","enum":["template","ai"],"description":"Read only. `ai`: the step sends a first message written for each lead, and `template_id` is its fallback, sent only when no such message can be written. `template`: the step sends `template_id`. Set in the app; `campaigns.steps.replace` keeps each step's mode by `step_order`."}},"required":["id","step_order","template_id","delay_days","platform","message_mode"],"additionalProperties":false}},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","status","timezone","business_hours","send_weight","send_rank","enrolled_count","active_count","created_at","updated_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: No campaign with this id exists in the key's workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CAMPAIGN_STATUS_CONFLICT_409: The campaign is not in a status this transition starts from, or its status changed meanwhile.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CAMPAIGN_NOT_FOUND_404","CAMPAIGN_STATUS_CONFLICT_409"]}},"/v1/campaigns/{campaign_id}/start":{"post":{"operationId":"campaigns.start","summary":"Start a paused campaign.","description":"paused -> active. The extension then sends each enrollment's due step at its own pace. A campaign that is already active is answered as is.","tags":["Campaigns"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Campaign id (uuid)"}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["campaigns:control"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","completed","archived"]},"timezone":{"type":"string"},"business_hours":{"type":"string"},"send_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"send_rank":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Enrollments the key may see: its reps' ones, and for an unrestricted key also the unassigned ones."},"active_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, the ones still in the sequence."},"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"step_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"template_id":{"type":["string","null"]},"delay_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"platform":{"type":"string"},"message_mode":{"type":"string","enum":["template","ai"],"description":"Read only. `ai`: the step sends a first message written for each lead, and `template_id` is its fallback, sent only when no such message can be written. `template`: the step sends `template_id`. Set in the app; `campaigns.steps.replace` keeps each step's mode by `step_order`."}},"required":["id","step_order","template_id","delay_days","platform","message_mode"],"additionalProperties":false}},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","description","status","timezone","business_hours","send_weight","send_rank","enrolled_count","active_count","created_at","updated_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: No campaign with this id exists in the key's workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CAMPAIGN_STATUS_CONFLICT_409: The campaign is not in a status this transition starts from, or its status changed meanwhile.\nCAMPAIGN_NO_STEPS_409: The campaign has no steps yet.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CAMPAIGN_NOT_FOUND_404","CAMPAIGN_STATUS_CONFLICT_409","CAMPAIGN_NO_STEPS_409"]}},"/v1/campaigns/{campaign_id}/stats":{"get":{"operationId":"campaigns.stats","summary":"A campaign's funnel and enrollment numbers.","description":"`funnel` (active enrollments by current step) and `withheld_custom` (active enrollments held back for a missing custom field value) are as of now. `enrolled`, `active`, `completed` and `replied` cover the enrollments of the last `days` days when given. Every number covers only the enrollments the key may see.","tags":["Campaigns"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Campaign id (uuid)"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":365}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["campaigns:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"funnel":{"type":"array","items":{"type":"object","properties":{"step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["step","count"],"additionalProperties":false}},"enrolled":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"active":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"completed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"withheld_custom":{"type":"object","properties":{"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"by_key":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}},"required":["total","by_key"],"additionalProperties":false}},"required":["funnel","enrolled","active","completed","replied","withheld_custom"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: No campaign with this id exists in the key's workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CAMPAIGN_NOT_FOUND_404"]}},"/v1/campaigns/{campaign_id}/steps":{"put":{"operationId":"campaigns.steps.replace","summary":"Replace a campaign's whole step sequence.","description":"One transaction: a refused step leaves the old sequence intact. Enrollments keep their current step number, so a lead on step 2 continues with the new step 2. Each step keeps the `message_mode` the step with the same `step_order` had; a new step is `template`.","tags":["Campaigns"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Campaign id (uuid)"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["campaigns:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"steps":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"template_id":{"type":"string","maxLength":64,"description":"A template of this workspace (uuid)."},"delay_days":{"type":"integer","minimum":0,"maximum":90,"description":"Days after the previous step (the first step: after enrollment)."}},"required":["template_id","delay_days"]},"description":"The whole sequence, in order: the first item is step 1."}},"required":["steps"]}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"step_order":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"template_id":{"type":["string","null"]},"delay_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"platform":{"type":"string"},"message_mode":{"type":"string","enum":["template","ai"],"description":"Read only. `ai`: the step sends a first message written for each lead, and `template_id` is its fallback, sent only when no such message can be written. `template`: the step sends `template_id`. Set in the app; `campaigns.steps.replace` keeps each step's mode by `step_order`."}},"required":["id","step_order","template_id","delay_days","platform","message_mode"],"additionalProperties":false}}},"required":["steps"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: No campaign with this id exists in the key's workspace.\nTEMPLATE_NOT_FOUND_404: A step names a template that is not in the key's workspace. Nothing was written.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CAMPAIGN_NOT_FOUND_404","TEMPLATE_NOT_FOUND_404"]}},"/v1/conversations":{"get":{"operationId":"conversations.list","summary":"List conversations, newest activity first.","description":"Ordered by last_message_at (threads with no message last), then id. Never marks a thread read. Carries thread metadata only.","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"rep_id","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"lead_id","in":"query","required":false,"schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["active","archived","spam"]}},{"name":"folder","in":"query","required":false,"schema":{"type":"string","enum":["primary","general","requests"]}},{"name":"needs_human","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"unread","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"updated_after","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["conversations:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"rep_id":{"type":"string"},"lead_id":{"type":["string","null"]},"participant_username":{"type":["string","null"]},"participant_name":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived","spam"]},"folder":{"type":"string","enum":["primary","general","requests"]},"is_starred":{"type":"boolean"},"unread_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reply_intent":{"description":"Null when there is none, or when the plan does not include the AI Setter.","type":["string","null"]},"setter_state":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stage":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"needs_human":{"description":"Null when the plan does not include the AI Setter.","type":["boolean","null"]},"last_message_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"reply_window_closes_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","lead_id","participant_username","participant_name","status","folder","is_starred","unread_count","reply_intent","setter_state","setter_stage","needs_human","last_message_at","reply_window_closes_at","created_at"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"REP_NOT_FOUND_404: rep_id names no rep this key may see.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404"]}},"/v1/conversations/{conversation_id}":{"get":{"operationId":"conversations.get","summary":"Read one conversation.","description":"Never marks the thread read and never changes unread_count.","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["conversations:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"rep_id":{"type":"string"},"lead_id":{"type":["string","null"]},"participant_username":{"type":["string","null"]},"participant_name":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived","spam"]},"folder":{"type":"string","enum":["primary","general","requests"]},"is_starred":{"type":"boolean"},"unread_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reply_intent":{"description":"Null when there is none, or when the plan does not include the AI Setter.","type":["string","null"]},"setter_state":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stage":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"needs_human":{"description":"Null when the plan does not include the AI Setter.","type":["boolean","null"]},"last_message_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"reply_window_closes_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","lead_id","participant_username","participant_name","status","folder","is_starred","unread_count","reply_intent","setter_state","setter_stage","needs_human","last_message_at","reply_window_closes_at","created_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CONVERSATION_NOT_FOUND_404: No conversation with this id is visible to this key: missing, in another workspace, or on a rep the key is not restricted to.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CONVERSATION_NOT_FOUND_404"]}},"/v1/conversations/{conversation_id}/archive":{"post":{"operationId":"conversations.archive","summary":"Archive a conversation.","description":"Sets status to archived. Idempotent.","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["conversations:state"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"rep_id":{"type":"string"},"lead_id":{"type":["string","null"]},"participant_username":{"type":["string","null"]},"participant_name":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived","spam"]},"folder":{"type":"string","enum":["primary","general","requests"]},"is_starred":{"type":"boolean"},"unread_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reply_intent":{"description":"Null when there is none, or when the plan does not include the AI Setter.","type":["string","null"]},"setter_state":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stage":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"needs_human":{"description":"Null when the plan does not include the AI Setter.","type":["boolean","null"]},"last_message_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"reply_window_closes_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","lead_id","participant_username","participant_name","status","folder","is_starred","unread_count","reply_intent","setter_state","setter_stage","needs_human","last_message_at","reply_window_closes_at","created_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CONVERSATION_NOT_FOUND_404: No conversation with this id is visible to this key: missing, in another workspace, or on a rep the key is not restricted to.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CONVERSATION_NOT_FOUND_404"]}},"/v1/conversations/{conversation_id}/drafts":{"get":{"operationId":"conversations.drafts.list","summary":"List the AI Setter's pending draft of a conversation.","description":"At most one draft: the newest pending one, as the DM Hero inbox shows it. Empty when the setter is waiting for nothing. Never marks the thread read.","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["setter:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"kind":{"type":"string","enum":["suggestion","escalation"]},"text":{"type":"string"},"booking":{"anyOf":[{"type":"object","properties":{"starts_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"timezone":{"type":"string"}},"required":["starts_at","timezone"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","conversation_id","kind","text","booking","created_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"API_SETTER_NOT_IN_PLAN_403: The organization's plan does not include the AI Setter.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"CONVERSATION_NOT_FOUND_404: No conversation with this id is visible to this key: missing, in another workspace, or on a rep the key is not restricted to.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CONVERSATION_NOT_FOUND_404","API_SETTER_NOT_IN_PLAN_403"]}},"/v1/conversations/{conversation_id}/drafts/{draft_id}/approve":{"post":{"operationId":"conversations.drafts.approve","summary":"Approve the AI Setter's draft: send it unchanged.","description":"Sends the draft exactly as the AI Setter wrote it, through the Instagram Graph API, inside the 24 h window after the lead's last message. Takes no text: a request carrying `text` is refused; to say something else, dismiss the draft. A draft that books a Google Calendar slot books it before the DM goes out, and the booking is undone if Instagram refuses the DM. If the send breaks off so that nobody can tell whether the DM went out (`CONVERSATION_SEND_OUTCOME_UNKNOWN_502`), the draft counts as handled and its booking stands; check the thread in the DM Hero inbox. Approving a suggestion keeps the setter on the thread; approving an escalation's draft answers it, and a person then owns the thread. Idempotency-Key is required; a retry with the same key never sends a second DM.","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKeyRequired"}],"x-dmhero-scopes":["setter:write"],"x-dmhero-rate-class":"send","x-dmhero-idempotency":"required","x-dmhero-destructive":false,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"not":{}}}}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"string"},"draft_id":{"type":"string"},"message_id":{"type":["string","null"]},"ig_message_id":{"type":"string"},"recorded":{"type":"boolean"},"booked":{"type":"boolean"},"taken_over":{"type":"boolean"}},"required":["conversation_id","draft_id","message_id","ig_message_id","recorded","booked","taken_over"],"additionalProperties":false}}}},"400":{"description":"API_IDEMPOTENCY_KEY_REQUIRED_400: The request carries no Idempotency-Key header.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"API_SETTER_NOT_IN_PLAN_403: The organization's plan does not include the AI Setter.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"CONVERSATION_NOT_FOUND_404: No conversation with this id is visible to this key: missing, in another workspace, or on a rep the key is not restricted to.\nSETTER_DRAFT_NOT_FOUND_404: No draft with this id belongs to this conversation on a rep the key may see.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"SETTER_DRAFT_HANDLED_409: The draft was already approved or dismissed, here or in the DM Hero inbox, or a newer draft replaced it. List the drafts again.\nSETTER_DRAFT_IN_PROGRESS_409: Another approval of this draft is being sent right now.\nSETTER_DRAFT_UNSENDABLE_409: The draft cannot be sent as it is (too long for Instagram). Dismiss it, or edit it in the DM Hero inbox.\nCONVERSATION_WINDOW_CLOSED_409: More than 24 hours passed since the lead's last message, or the lead never wrote. The body carries reply_window_closes_at.\nCALENDAR_SLOT_TAKEN_409: The draft books a time that is no longer free in the calendar. Nothing was sent.\nCALENDAR_UNAVAILABLE_409: The draft books a meeting and Google Calendar is not connected or lost access. Nothing was sent.\nCALENDAR_INVALID_EMAIL_409: The draft books a meeting and the prospect's email address cannot receive an invitation. Nothing was sent.\nREP_NOT_CONNECTED_409: The rep has no usable Instagram connection. Nothing was sent.\nREP_ARCHIVED_409: The rep is archived. Nothing was sent.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"description":"CONVERSATION_RATE_LIMITED_429: More than 10 replies were sent to this conversation in the last hour.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/Shared500"},"502":{"description":"CALENDAR_ERROR_502: Google Calendar did not create the event the draft books. Nothing was sent; the Idempotency-Key may be reused.\nCONVERSATION_SEND_FAILED_502: Instagram refused the message; nothing was sent, the draft stays pending and the Idempotency-Key may be reused.\nCONVERSATION_SEND_OUTCOME_UNKNOWN_502: The connection to Instagram failed mid-send, so the message may have been delivered. The draft is marked as handled and cannot be approved again; any booking it carried stands.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"API_SEND_DISABLED_503: Sending through the API is switched off for now.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-dmhero-error-codes":["CONVERSATION_NOT_FOUND_404","API_SETTER_NOT_IN_PLAN_403","SETTER_DRAFT_NOT_FOUND_404","SETTER_DRAFT_HANDLED_409","API_IDEMPOTENCY_KEY_REQUIRED_400","SETTER_DRAFT_IN_PROGRESS_409","SETTER_DRAFT_UNSENDABLE_409","CONVERSATION_WINDOW_CLOSED_409","CALENDAR_SLOT_TAKEN_409","CALENDAR_UNAVAILABLE_409","CALENDAR_INVALID_EMAIL_409","REP_NOT_CONNECTED_409","REP_ARCHIVED_409","CONVERSATION_RATE_LIMITED_429","CALENDAR_ERROR_502","CONVERSATION_SEND_FAILED_502","CONVERSATION_SEND_OUTCOME_UNKNOWN_502","API_SEND_DISABLED_503"]}},"/v1/conversations/{conversation_id}/drafts/{draft_id}/dismiss":{"post":{"operationId":"conversations.drafts.dismiss","summary":"Dismiss the AI Setter's draft without sending it.","description":"Discards the conversation's pending draft. A Google Calendar slot it held is freed. The setter is not paused: it answers the prospect's next message as usual.","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["setter:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"string"},"draft_id":{"type":"string"},"dismissed":{"type":"boolean","const":true}},"required":["conversation_id","draft_id","dismissed"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"API_SETTER_NOT_IN_PLAN_403: The organization's plan does not include the AI Setter.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"CONVERSATION_NOT_FOUND_404: No conversation with this id is visible to this key: missing, in another workspace, or on a rep the key is not restricted to.\nSETTER_DRAFT_NOT_FOUND_404: No draft with this id belongs to this conversation on a rep the key may see.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"SETTER_DRAFT_HANDLED_409: The draft was already approved or dismissed, here or in the DM Hero inbox, or a newer draft replaced it. List the drafts again.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CONVERSATION_NOT_FOUND_404","API_SETTER_NOT_IN_PLAN_403","SETTER_DRAFT_NOT_FOUND_404","SETTER_DRAFT_HANDLED_409"]}},"/v1/conversations/{conversation_id}/read":{"post":{"operationId":"conversations.mark_read","summary":"Mark a conversation read.","description":"Clears the operator's unread badge (unread_count = 0). The explicit way for an agent that handled a thread to say so; reads never do it.","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["conversations:state"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"rep_id":{"type":"string"},"lead_id":{"type":["string","null"]},"participant_username":{"type":["string","null"]},"participant_name":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived","spam"]},"folder":{"type":"string","enum":["primary","general","requests"]},"is_starred":{"type":"boolean"},"unread_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reply_intent":{"description":"Null when there is none, or when the plan does not include the AI Setter.","type":["string","null"]},"setter_state":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stage":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"needs_human":{"description":"Null when the plan does not include the AI Setter.","type":["boolean","null"]},"last_message_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"reply_window_closes_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","lead_id","participant_username","participant_name","status","folder","is_starred","unread_count","reply_intent","setter_state","setter_stage","needs_human","last_message_at","reply_window_closes_at","created_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CONVERSATION_NOT_FOUND_404: No conversation with this id is visible to this key: missing, in another workspace, or on a rep the key is not restricted to.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CONVERSATION_NOT_FOUND_404"]}},"/v1/conversations/{conversation_id}/setter/hand":{"post":{"operationId":"conversations.setter.hand","summary":"Hand a conversation to the AI Setter.","description":"For a thread the setter never drove, or stopped driving. The thread becomes the AI Setter's: any handoff and stale follow-up are cleared, the thread is linked to a lead of this workspace (created when there is none), and a pending draft is dismissed. When the prospect wrote last, inside the reply window, the setter replies now; otherwise it answers their next message. Sending a reply never resumes the setter; this call does. Idempotent: a thread the setter already drives is answered as it is.","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["setter:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"string"},"setter_state":{"type":"string","enum":["setter","booked"]},"reply_queued":{"type":"boolean"},"lead_id":{"type":"string"},"lead_created":{"type":"boolean"}},"required":["conversation_id","setter_state","reply_queued","lead_id","lead_created"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"API_SETTER_NOT_IN_PLAN_403: The organization's plan does not include the AI Setter.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"CONVERSATION_NOT_FOUND_404: No conversation with this id is visible to this key: missing, in another workspace, or on a rep the key is not restricted to.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"SETTER_DISABLED_409: The AI Setter is off for this thread's channel (inbound or outbound) on its rep.\nSETTER_LEAD_OPTED_OUT_409: The thread's lead is marked not interested, so the AI Setter does not write to them.\nSETTER_CAMPAIGN_ACTIVE_409: The lead is still in an active campaign sequence; the AI Setter takes over by itself when they reply.\nSETTER_HANDLE_EXCLUDED_409: The thread has no lead and its participant is on the rep's excluded accounts.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CONVERSATION_NOT_FOUND_404","API_SETTER_NOT_IN_PLAN_403","SETTER_DISABLED_409","SETTER_LEAD_OPTED_OUT_409","SETTER_CAMPAIGN_ACTIVE_409","SETTER_HANDLE_EXCLUDED_409"]}},"/v1/conversations/{conversation_id}/setter/resume":{"post":{"operationId":"conversations.setter.resume","summary":"Resume the AI Setter on a conversation handed to a person.","description":"For a thread with needs_human: an escalation or a person's takeover. The thread becomes the AI Setter's: any handoff and stale follow-up are cleared, the thread is linked to a lead of this workspace (created when there is none), and a pending draft is dismissed. When the prospect wrote last, inside the reply window, the setter replies now; otherwise it answers their next message. Sending a reply never resumes the setter; this call does. The same effect as conversations.setter.hand, under the name the inbox button has.","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["setter:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"string"},"setter_state":{"type":"string","enum":["setter","booked"]},"reply_queued":{"type":"boolean"},"lead_id":{"type":"string"},"lead_created":{"type":"boolean"}},"required":["conversation_id","setter_state","reply_queued","lead_id","lead_created"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"API_SETTER_NOT_IN_PLAN_403: The organization's plan does not include the AI Setter.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"CONVERSATION_NOT_FOUND_404: No conversation with this id is visible to this key: missing, in another workspace, or on a rep the key is not restricted to.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"SETTER_DISABLED_409: The AI Setter is off for this thread's channel (inbound or outbound) on its rep.\nSETTER_LEAD_OPTED_OUT_409: The thread's lead is marked not interested, so the AI Setter does not write to them.\nSETTER_CAMPAIGN_ACTIVE_409: The lead is still in an active campaign sequence; the AI Setter takes over by itself when they reply.\nSETTER_HANDLE_EXCLUDED_409: The thread has no lead and its participant is on the rep's excluded accounts.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CONVERSATION_NOT_FOUND_404","API_SETTER_NOT_IN_PLAN_403","SETTER_DISABLED_409","SETTER_LEAD_OPTED_OUT_409","SETTER_CAMPAIGN_ACTIVE_409","SETTER_HANDLE_EXCLUDED_409"]}},"/v1/conversations/{conversation_id}/star":{"post":{"operationId":"conversations.star","summary":"Star a conversation.","description":"Idempotent: starring a starred thread changes nothing.","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["conversations:state"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"rep_id":{"type":"string"},"lead_id":{"type":["string","null"]},"participant_username":{"type":["string","null"]},"participant_name":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived","spam"]},"folder":{"type":"string","enum":["primary","general","requests"]},"is_starred":{"type":"boolean"},"unread_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reply_intent":{"description":"Null when there is none, or when the plan does not include the AI Setter.","type":["string","null"]},"setter_state":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stage":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"needs_human":{"description":"Null when the plan does not include the AI Setter.","type":["boolean","null"]},"last_message_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"reply_window_closes_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","lead_id","participant_username","participant_name","status","folder","is_starred","unread_count","reply_intent","setter_state","setter_stage","needs_human","last_message_at","reply_window_closes_at","created_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CONVERSATION_NOT_FOUND_404: No conversation with this id is visible to this key: missing, in another workspace, or on a rep the key is not restricted to.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CONVERSATION_NOT_FOUND_404"]}},"/v1/conversations/{conversation_id}/unarchive":{"post":{"operationId":"conversations.unarchive","summary":"Move a conversation back to active.","description":"Sets status to active (also from spam). Idempotent.","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["conversations:state"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"rep_id":{"type":"string"},"lead_id":{"type":["string","null"]},"participant_username":{"type":["string","null"]},"participant_name":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived","spam"]},"folder":{"type":"string","enum":["primary","general","requests"]},"is_starred":{"type":"boolean"},"unread_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reply_intent":{"description":"Null when there is none, or when the plan does not include the AI Setter.","type":["string","null"]},"setter_state":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stage":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"needs_human":{"description":"Null when the plan does not include the AI Setter.","type":["boolean","null"]},"last_message_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"reply_window_closes_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","lead_id","participant_username","participant_name","status","folder","is_starred","unread_count","reply_intent","setter_state","setter_stage","needs_human","last_message_at","reply_window_closes_at","created_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CONVERSATION_NOT_FOUND_404: No conversation with this id is visible to this key: missing, in another workspace, or on a rep the key is not restricted to.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CONVERSATION_NOT_FOUND_404"]}},"/v1/conversations/{conversation_id}/unstar":{"post":{"operationId":"conversations.unstar","summary":"Remove the star from a conversation.","description":"Idempotent: unstarring a thread without a star changes nothing.","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["conversations:state"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"rep_id":{"type":"string"},"lead_id":{"type":["string","null"]},"participant_username":{"type":["string","null"]},"participant_name":{"type":["string","null"]},"status":{"type":"string","enum":["active","archived","spam"]},"folder":{"type":"string","enum":["primary","general","requests"]},"is_starred":{"type":"boolean"},"unread_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reply_intent":{"description":"Null when there is none, or when the plan does not include the AI Setter.","type":["string","null"]},"setter_state":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stage":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"needs_human":{"description":"Null when the plan does not include the AI Setter.","type":["boolean","null"]},"last_message_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"reply_window_closes_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","lead_id","participant_username","participant_name","status","folder","is_starred","unread_count","reply_intent","setter_state","setter_stage","needs_human","last_message_at","reply_window_closes_at","created_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CONVERSATION_NOT_FOUND_404: No conversation with this id is visible to this key: missing, in another workspace, or on a rep the key is not restricted to.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CONVERSATION_NOT_FOUND_404"]}},"/v1/custom-fields":{"get":{"operationId":"custom_fields.list","summary":"The workspace's custom fields (at most 5) and how many leads carry each.","tags":["Custom fields"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"coverage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Leads of the workspace that carry a non-blank value for this field."}},"required":["key","label","created_at","coverage"],"additionalProperties":false}},"max":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["data","max"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":[]},"post":{"operationId":"custom_fields.create","summary":"Define a custom field. The key is derived from the label unless given, and never changes.","tags":["Custom fields"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["leads:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"key":{"type":"string","maxLength":100}},"required":["label"]}}}},"responses":{"201":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"coverage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Leads of the workspace that carry a non-blank value for this field."}},"required":["key","label","created_at","coverage"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"409":{"description":"CUSTOM_FIELD_LIMIT_409: The workspace already has its 5 custom fields.\nCUSTOM_FIELD_KEY_TAKEN_409: A custom field with this key already exists.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CUSTOM_FIELD_LIMIT_409","CUSTOM_FIELD_KEY_TAKEN_409"]}},"/v1/custom-fields/{key}":{"delete":{"operationId":"custom_fields.delete","summary":"Delete a custom field and strip its value from every lead of the workspace. Needs confirm=true.","tags":["Custom fields"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"confirm","in":"query","required":false,"schema":{"type":"boolean"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:delete"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":true,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"values_stripped":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["key","values_stripped"],"additionalProperties":false}}}},"400":{"description":"CONFIRM_REQUIRED_400: confirm=true is missing: deleting a field strips its value from every lead.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CUSTOM_FIELD_NOT_FOUND_404: No custom field with this key exists in this workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CONFIRM_REQUIRED_400","CUSTOM_FIELD_NOT_FOUND_404"]},"patch":{"operationId":"custom_fields.update","summary":"Rename a custom field's label. The key stays.","tags":["Custom fields"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"}},"required":["label"]}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"coverage":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Leads of the workspace that carry a non-blank value for this field."}},"required":["key","label","created_at","coverage"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CUSTOM_FIELD_NOT_FOUND_404: No custom field with this key exists in this workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CUSTOM_FIELD_NOT_FOUND_404"]}},"/v1/discovery/balance":{"get":{"operationId":"discovery.balance","summary":"The organization's discovery token balance.","description":"Tokens the organization can spend now (plan and purchased), tokens held by its runs that are still moving, and when the plan period ends. Shared by every workspace of the organization.","tags":["Discovery"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["discovery:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"available_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reserved_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"period_ends_at":{"type":["string","null"]}},"required":["available_tokens","reserved_tokens","period_ends_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"DISCOVERY_ORGANIZATION_NOT_FOUND_404: The key's creator is no longer a member of the organization.\nDISCOVERY_CREDITS_404: The token ledger has no wallet for the organization.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["DISCOVERY_ORGANIZATION_NOT_FOUND_404","DISCOVERY_CREDITS_404"]}},"/v1/discovery/handles/resolve":{"post":{"operationId":"discovery.handles.resolve","summary":"Resolve Instagram handles to accounts, to use as a recipe's seeds.","description":"Up to ten handles per request. The answer does not say whether a handle was already known or looked up; a lookup may spend from the platform's vendor budget, which is why the scope is discovery:spend.","tags":["Discovery"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["discovery:spend"],"x-dmhero-rate-class":"discovery_spend","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"handles":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}}},"required":["handles"]}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"handle":{"type":"string"},"ig_user_id":{"type":["string","null"]},"status":{"type":"string","enum":["found","not_found","private","unavailable","invalid"]}},"required":["handle","ig_user_id","status"],"additionalProperties":false}}},"required":["results"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"DISCOVERY_ORGANIZATION_NOT_FOUND_404: The key's creator is no longer a member of the organization.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"DISCOVERY_HANDLES_REPLAY_409: A repeated Idempotency-Key whose first answer could not be stored; send the request again with a new key.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"description":"DISCOVERY_HANDLES_PROVIDER_503: No account lookup is possible right now. Retry later.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-dmhero-error-codes":["DISCOVERY_ORGANIZATION_NOT_FOUND_404","DISCOVERY_HANDLES_PROVIDER_503","DISCOVERY_HANDLES_REPLAY_409"]}},"/v1/discovery/icp-profiles":{"get":{"operationId":"discovery.icp_profiles.list","summary":"The organization's customer profiles (ICP), each at its newest version.","description":"Name a profile and version in a recipe's qualify step to judge the run's accounts against it.","tags":["Discovery"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["discovery:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","version"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"DISCOVERY_ORGANIZATION_NOT_FOUND_404: The key's creator is no longer a member of the organization.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["DISCOVERY_ORGANIZATION_NOT_FOUND_404"]}},"/v1/discovery/modes":{"get":{"operationId":"discovery.modes","summary":"The discovery modes and what this deployment can run.","description":"The mode catalog (rate per result, quote shape, availability) and the deployment's capabilities.","tags":["Discovery"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["discovery:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"modes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"family":{"type":"string"},"ratePerResult":{"type":"number"},"quoteShape":{"type":"string"},"available":{"type":"boolean"},"deployable":{"type":"boolean"}},"required":["id","family","ratePerResult","quoteShape","available","deployable"],"additionalProperties":{}}},"capabilities":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["modes","capabilities"],"additionalProperties":{}}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":[]}},"/v1/discovery/quote":{"post":{"operationId":"discovery.quote","summary":"Price a recipe in tokens without saving or starting anything.","description":"Nothing is written, reserved or bought. Counts against the organization's daily budget of quotes (1 000 a day, shared with every response of POST /v1/discovery/runs that carries a quote).","tags":["Discovery"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["discovery:read"],"x-dmhero-rate-class":"discovery_quote","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"doc":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"A search recipe document (`{ v: 1, steps: [...] }`), as the app's recipe builder saves it."}},"required":["doc"]}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"quote":{"type":"object","properties":{"shape":{"type":"string","enum":["exact","ceiling","range"]},"tokensMin":{"type":"number"},"tokensMax":{"type":"number"},"expectedResultsMin":{"type":["number","null"]},"expectedResultsMax":{"type":["number","null"]},"estimatedSeconds":{"type":"number"},"seedCount":{"type":"number"},"seedAudienceTotal":{"type":"number"},"lowYield":{"type":"boolean"},"refundThreshold":{"type":["number","null"]},"blockedReason":{"anyOf":[{"type":"string","enum":["spend_ceiling","invalid_recipe"]},{"type":"null"}]}},"required":["shape","tokensMin","tokensMax","expectedResultsMin","expectedResultsMax","estimatedSeconds","seedCount","seedAudienceTotal","lowYield","refundThreshold","blockedReason"],"additionalProperties":{},"description":"The price of a recipe in tokens (the app's Quote)."},"mode":{"type":["string","null"]},"refusal":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"}},"required":["code","message","path"],"additionalProperties":false},{"type":"null"}]}},"required":["quote","mode","refusal"],"additionalProperties":{}}}}},"400":{"description":"DISCOVERY_RECIPE_400: The recipe document does not validate; `error` names the first problem.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"DISCOVERY_ORGANIZATION_NOT_FOUND_404: The key's creator is no longer a member of the organization.\nDISCOVERY_CREDITS_404: The token ledger has no wallet for the organization.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"DISCOVERY_CEILING_409: The organization's spend ceiling could not be read; nothing was priced or reserved.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"description":"DISCOVERY_QUOTE_DAILY_LIMIT_429: The organization used its daily budget of quotes.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["DISCOVERY_RECIPE_400","DISCOVERY_ORGANIZATION_NOT_FOUND_404","DISCOVERY_CREDITS_404","DISCOVERY_CEILING_409","DISCOVERY_QUOTE_DAILY_LIMIT_429"]}},"/v1/discovery/recipes":{"post":{"operationId":"discovery.recipes.create","summary":"Save a search recipe.","description":"Recipes are saved once per organization per canonical document: saving the same search again answers 200 with the first save's id and name instead of 201.","tags":["Discovery"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["discovery:spend"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"doc":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"A search recipe document (`{ v: 1, steps: [...] }`), as the app's recipe builder saves it."}},"required":["name","doc"]}}}},"responses":{"201":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"hash":{"type":"string"},"name":{"type":"string"}},"required":["id","hash","name"],"additionalProperties":false}}}},"400":{"description":"DISCOVERY_RECIPE_400: The recipe document does not validate; `error` names the first problem.\nDISCOVERY_RECIPE_NAME_400: The recipe name is empty or longer than 200 characters.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"DISCOVERY_ICP_PROFILE_404: The recipe's qualify step names a customer profile version that is missing, archived or another organization's.\nDISCOVERY_ORGANIZATION_NOT_FOUND_404: The key's creator is no longer a member of the organization.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["DISCOVERY_RECIPE_400","DISCOVERY_RECIPE_NAME_400","DISCOVERY_ICP_PROFILE_404","DISCOVERY_ORGANIZATION_NOT_FOUND_404"]}},"/v1/discovery/runs":{"get":{"operationId":"discovery.runs.list","summary":"The workspace's runs, newest first.","tags":["Discovery"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"state","in":"query","required":false,"schema":{"type":"string","enum":["queued","running","awaiting_preview","partial","done","cancelled","failed"]}},{"name":"created_after","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":50}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["discovery:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"mode":{"type":"string"},"state":{"type":"string","enum":["queued","running","awaiting_preview","partial","done","cancelled","failed"]},"progress":{"type":"object","properties":{"done":{"type":"number"},"total":{"type":"number"},"step":{"type":"string"}},"required":["done","total","step"],"additionalProperties":false},"startedAt":{"type":"string"},"etaSeconds":{"type":["number","null"]},"candidatesReady":{"type":"number"},"matchedTotal":{"type":"number"},"paidFor":{"type":"number"},"family":{"type":"string"},"previewReady":{"type":"boolean"},"previewDecision":{"anyOf":[{"type":"string","enum":["pending","continue","stopped"]},{"type":"null"}]},"skippedSources":{"type":"number"},"queuedBehind":{"anyOf":[{"type":"object","properties":{"runId":{"type":"string"},"label":{"type":"string"},"etaAt":{"type":"string"}},"required":["runId","label","etaAt"],"additionalProperties":{}},{"type":"null"}]}},"required":["id","mode","state","progress","startedAt","etaSeconds","candidatesReady","matchedTotal","paidFor","family","previewReady","previewDecision","skippedSources","queuedBehind"],"additionalProperties":{},"description":"One discovery run (the app's Run). The single-run read adds `activity` and, where the mode has one, `graph`, `likers` or `search`; the list adds `searchSummary`, `tokens` and `promotedCount`."}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"DISCOVERY_WORKSPACE_NOT_FOUND_404: The key's creator is no longer a member of the workspace's organization.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["DISCOVERY_WORKSPACE_NOT_FOUND_404"]},"post":{"operationId":"discovery.runs.create","summary":"Start a discovery run: price the recipe, reserve its tokens and queue it.","description":"Send `recipe_id` (a saved recipe) or `recipe` (`{ name, doc }`, saved first, then started), not both. A refusal that is a price (402) carries the `quote`. Every request counts against the organization's daily budget of quotes, the one POST /v1/discovery/quote spends, and a spent budget answers 429 before anything is priced. Requires an Idempotency-Key: a retry with the same key never starts a second run.","tags":["Discovery"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKeyRequired"}],"x-dmhero-scopes":["discovery:spend"],"x-dmhero-rate-class":"discovery_spend","x-dmhero-idempotency":"required","x-dmhero-destructive":false,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"recipe_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"recipe":{"type":"object","properties":{"name":{"type":"string"},"doc":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"A search recipe document (`{ v: 1, steps: [...] }`), as the app's recipe builder saves it."}},"required":["name","doc"]}}}}}},"responses":{"201":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"run":{"type":"object","properties":{"id":{"type":"string"},"mode":{"type":"string"},"state":{"type":"string","enum":["queued","running","awaiting_preview","partial","done","cancelled","failed"]},"progress":{"type":"object","properties":{"done":{"type":"number"},"total":{"type":"number"},"step":{"type":"string"}},"required":["done","total","step"],"additionalProperties":false},"startedAt":{"type":"string"},"etaSeconds":{"type":["number","null"]},"candidatesReady":{"type":"number"},"matchedTotal":{"type":"number"},"paidFor":{"type":"number"},"family":{"type":"string"},"previewReady":{"type":"boolean"},"previewDecision":{"anyOf":[{"type":"string","enum":["pending","continue","stopped"]},{"type":"null"}]},"skippedSources":{"type":"number"},"queuedBehind":{"anyOf":[{"type":"object","properties":{"runId":{"type":"string"},"label":{"type":"string"},"etaAt":{"type":"string"}},"required":["runId","label","etaAt"],"additionalProperties":{}},{"type":"null"}]}},"required":["id","mode","state","progress","startedAt","etaSeconds","candidatesReady","matchedTotal","paidFor","family","previewReady","previewDecision","skippedSources","queuedBehind"],"additionalProperties":{},"description":"One discovery run (the app's Run). The single-run read adds `activity` and, where the mode has one, `graph`, `likers` or `search`; the list adds `searchSummary`, `tokens` and `promotedCount`."},"quote":{"anyOf":[{"type":"object","properties":{"shape":{"type":"string","enum":["exact","ceiling","range"]},"tokensMin":{"type":"number"},"tokensMax":{"type":"number"},"expectedResultsMin":{"type":["number","null"]},"expectedResultsMax":{"type":["number","null"]},"estimatedSeconds":{"type":"number"},"seedCount":{"type":"number"},"seedAudienceTotal":{"type":"number"},"lowYield":{"type":"boolean"},"refundThreshold":{"type":["number","null"]},"blockedReason":{"anyOf":[{"type":"string","enum":["spend_ceiling","invalid_recipe"]},{"type":"null"}]}},"required":["shape","tokensMin","tokensMax","expectedResultsMin","expectedResultsMax","estimatedSeconds","seedCount","seedAudienceTotal","lowYield","refundThreshold","blockedReason"],"additionalProperties":{},"description":"The price of a recipe in tokens (the app's Quote)."},{"type":"null"}],"description":"Null only on an idempotent replay, which rebuilds the run from its id."},"reserved_tokens":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["run","quote","reserved_tokens"],"additionalProperties":false}}}},"400":{"description":"DISCOVERY_RECIPE_400: The recipe document does not validate; `error` names the first problem.\nDISCOVERY_RECIPE_NAME_400: The recipe name is empty or longer than 200 characters.\nDISCOVERY_CREDITS_400: The token ledger refused the amount to reserve; nothing was reserved.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"description":"DISCOVERY_CREDITS_402: The organization holds fewer tokens than the run needs; the body carries the quote.\nDISCOVERY_CEILING_402: The organization reached its spend ceiling for the period; the body carries the quote.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"DISCOVERY_RECIPE_404: The recipe does not exist in this organization.\nDISCOVERY_ICP_PROFILE_404: The recipe's qualify step names a customer profile version that is missing, archived or another organization's.\nDISCOVERY_WORKSPACE_NOT_FOUND_404: The key's creator is no longer a member of the workspace's organization.\nDISCOVERY_CREDITS_404: The token ledger has no wallet for the organization.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"DISCOVERY_CEILING_409: The spend ceiling could not be read, or the run would exceed its enrichment ratio; nothing was reserved.\nDISCOVERY_QUALIFY_UNAVAILABLE_409: The recipe judges accounts against a customer profile, which is not available to this organization right now; the body carries the quote.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"description":"DISCOVERY_QUOTE_DAILY_LIMIT_429: The organization used its daily budget of quotes.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["DISCOVERY_RECIPE_404","DISCOVERY_RECIPE_400","DISCOVERY_RECIPE_NAME_400","DISCOVERY_ICP_PROFILE_404","DISCOVERY_WORKSPACE_NOT_FOUND_404","DISCOVERY_CREDITS_402","DISCOVERY_CEILING_402","DISCOVERY_CEILING_409","DISCOVERY_QUALIFY_UNAVAILABLE_409","DISCOVERY_CREDITS_404","DISCOVERY_CREDITS_400","DISCOVERY_QUOTE_DAILY_LIMIT_429"]}},"/v1/discovery/runs/{run_id}":{"get":{"operationId":"discovery.runs.get","summary":"One run, with its live activity. Poll every 10 seconds while it moves.","tags":["Discovery"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"description":"A run id (uuid). An id that is not a run of this workspace answers 404."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["discovery:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"mode":{"type":"string"},"state":{"type":"string","enum":["queued","running","awaiting_preview","partial","done","cancelled","failed"]},"progress":{"type":"object","properties":{"done":{"type":"number"},"total":{"type":"number"},"step":{"type":"string"}},"required":["done","total","step"],"additionalProperties":false},"startedAt":{"type":"string"},"etaSeconds":{"type":["number","null"]},"candidatesReady":{"type":"number"},"matchedTotal":{"type":"number"},"paidFor":{"type":"number"},"family":{"type":"string"},"previewReady":{"type":"boolean"},"previewDecision":{"anyOf":[{"type":"string","enum":["pending","continue","stopped"]},{"type":"null"}]},"skippedSources":{"type":"number"},"queuedBehind":{"anyOf":[{"type":"object","properties":{"runId":{"type":"string"},"label":{"type":"string"},"etaAt":{"type":"string"}},"required":["runId","label","etaAt"],"additionalProperties":{}},{"type":"null"}]}},"required":["id","mode","state","progress","startedAt","etaSeconds","candidatesReady","matchedTotal","paidFor","family","previewReady","previewDecision","skippedSources","queuedBehind"],"additionalProperties":{},"description":"One discovery run (the app's Run). The single-run read adds `activity` and, where the mode has one, `graph`, `likers` or `search`; the list adds `searchSummary`, `tokens` and `promotedCount`."}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"DISCOVERY_RUN_NOT_FOUND_404: The run does not exist in this workspace (the same answer for another workspace's run).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["DISCOVERY_RUN_NOT_FOUND_404"]}},"/v1/discovery/runs/{run_id}/cancel":{"post":{"operationId":"discovery.runs.cancel","summary":"Cancel a run that is still moving and release its unspent tokens.","description":"A run that has already ended answers `cancelled: false` with its current state.","tags":["Discovery"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"description":"A run id (uuid). An id that is not a run of this workspace answers 404."}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["discovery:spend"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":true,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"cancelled":{"type":"boolean"},"run":{"type":"object","properties":{"id":{"type":"string"},"mode":{"type":"string"},"state":{"type":"string","enum":["queued","running","awaiting_preview","partial","done","cancelled","failed"]},"progress":{"type":"object","properties":{"done":{"type":"number"},"total":{"type":"number"},"step":{"type":"string"}},"required":["done","total","step"],"additionalProperties":false},"startedAt":{"type":"string"},"etaSeconds":{"type":["number","null"]},"candidatesReady":{"type":"number"},"matchedTotal":{"type":"number"},"paidFor":{"type":"number"},"family":{"type":"string"},"previewReady":{"type":"boolean"},"previewDecision":{"anyOf":[{"type":"string","enum":["pending","continue","stopped"]},{"type":"null"}]},"skippedSources":{"type":"number"},"queuedBehind":{"anyOf":[{"type":"object","properties":{"runId":{"type":"string"},"label":{"type":"string"},"etaAt":{"type":"string"}},"required":["runId","label","etaAt"],"additionalProperties":{}},{"type":"null"}]}},"required":["id","mode","state","progress","startedAt","etaSeconds","candidatesReady","matchedTotal","paidFor","family","previewReady","previewDecision","skippedSources","queuedBehind"],"additionalProperties":{},"description":"One discovery run (the app's Run). The single-run read adds `activity` and, where the mode has one, `graph`, `likers` or `search`; the list adds `searchSummary`, `tokens` and `promotedCount`."}},"required":["cancelled","run"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"DISCOVERY_RUN_NOT_FOUND_404: The run does not exist in this workspace (the same answer for another workspace's run).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["DISCOVERY_RUN_NOT_FOUND_404"]}},"/v1/discovery/runs/{run_id}/candidates":{"get":{"operationId":"discovery.candidates.list","summary":"A run's results, in its delivery order.","tags":["Discovery"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"description":"A run id (uuid). An id that is not a run of this workspace answers 404."}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":100}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["discovery:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"handle":{"type":"string"},"fullName":{"type":["string","null"]},"avatarUrl":{"type":["string","null"]},"followers":{"type":["number","null"]},"following":{"type":["number","null"]},"postsCount":{"type":["number","null"]},"bioExcerpt":{"type":["string","null"]},"category":{"type":["string","null"]},"lang":{"type":["string","null"]},"websiteDomain":{"type":["string","null"]},"seedHits":{"type":"number"},"pathCount":{"type":"number"},"paths":{"type":"array","items":{"type":"object","properties":{"seedHandle":{"type":"string"},"viaHandle":{"type":["string","null"]},"edge":{"type":"string"}},"required":["seedHandle","viaHandle","edge"],"additionalProperties":{}}},"state":{"type":"string","enum":["new","shortlisted","rejected","promoted"]},"duplicateOf":{"anyOf":[{"type":"object","properties":{"leadId":{"type":"string"},"since":{"type":"string"}},"required":["leadId","since"],"additionalProperties":false},{"type":"null"}]}},"required":["id","handle","fullName","avatarUrl","followers","following","postsCount","bioExcerpt","category","lang","websiteDomain","seedHits","pathCount","paths","state","duplicateOf"],"additionalProperties":{},"description":"One result of a run (the app's Candidate), in the run's delivery order. A run that judges against a customer profile adds `verdict`; a local business run adds `local`."}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"DISCOVERY_RUN_NOT_FOUND_404: The run does not exist in this workspace (the same answer for another workspace's run).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["DISCOVERY_RUN_NOT_FOUND_404"]}},"/v1/discovery/runs/{run_id}/preview-decision":{"post":{"operationId":"discovery.runs.preview_decision","summary":"Answer a run's preview: continue spending its reservation, or stop and release it.","tags":["Discovery"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"description":"A run id (uuid). An id that is not a run of this workspace answers 404."}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["discovery:spend"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"decision":{"type":"string","enum":["continue","stop"]}},"required":["decision"]}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"mode":{"type":"string"},"state":{"type":"string","enum":["queued","running","awaiting_preview","partial","done","cancelled","failed"]},"progress":{"type":"object","properties":{"done":{"type":"number"},"total":{"type":"number"},"step":{"type":"string"}},"required":["done","total","step"],"additionalProperties":false},"startedAt":{"type":"string"},"etaSeconds":{"type":["number","null"]},"candidatesReady":{"type":"number"},"matchedTotal":{"type":"number"},"paidFor":{"type":"number"},"family":{"type":"string"},"previewReady":{"type":"boolean"},"previewDecision":{"anyOf":[{"type":"string","enum":["pending","continue","stopped"]},{"type":"null"}]},"skippedSources":{"type":"number"},"queuedBehind":{"anyOf":[{"type":"object","properties":{"runId":{"type":"string"},"label":{"type":"string"},"etaAt":{"type":"string"}},"required":["runId","label","etaAt"],"additionalProperties":{}},{"type":"null"}]}},"required":["id","mode","state","progress","startedAt","etaSeconds","candidatesReady","matchedTotal","paidFor","family","previewReady","previewDecision","skippedSources","queuedBehind"],"additionalProperties":{},"description":"One discovery run (the app's Run). The single-run read adds `activity` and, where the mode has one, `graph`, `likers` or `search`; the list adds `searchSummary`, `tokens` and `promotedCount`."}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"DISCOVERY_RUN_NOT_FOUND_404: The run does not exist in this workspace (the same answer for another workspace's run).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"DISCOVERY_PREVIEW_NOT_PENDING_409: The run is not waiting for a preview decision (it was answered, or it moved on).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["DISCOVERY_RUN_NOT_FOUND_404","DISCOVERY_PREVIEW_NOT_PENDING_409"]}},"/v1/discovery/runs/{run_id}/promote":{"post":{"operationId":"discovery.candidates.promote","summary":"Move a run's results into the CRM as leads.","description":"Send `candidate_ids` (1 to 200) or `all: true` (the next 200 results not yet moved, not rejected and with a usable Instagram handle, in delivery order; `has_more` says whether to send it again). Someone the workspace already has becomes a duplicate of that lead, never a second lead. `folder_id` and `tags` apply to the leads this request creates, in a step after the move: if that step fails the leads exist unfiled, and moving the same results again creates nothing and files nothing, so file them through the leads operations. Moving the same results twice creates nothing the second time.","tags":["Discovery"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"description":"A run id (uuid). An id that is not a run of this workspace answers 404."}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["discovery:read","leads:write"],"x-dmhero-rate-class":"discovery_spend","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"candidate_ids":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"all":{"type":"boolean","const":true},"folder_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"tags":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string","minLength":1,"maxLength":50}}}}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"run_id":{"type":"string"},"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"duplicates":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lead_ids":{"type":"array","items":{"type":"string"},"description":"The leads this request created. Empty on an idempotent replay."},"has_more":{"type":"boolean"}},"required":["run_id","created","duplicates","lead_ids","has_more"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"DISCOVERY_RUN_NOT_FOUND_404: The run does not exist in this workspace (the same answer for another workspace's run).\nDISCOVERY_CANDIDATES_NOT_FOUND_404: Some of the candidate ids are not results of this run; nothing was moved.\nFOLDER_NOT_FOUND_404: The folder does not exist in this workspace; nothing was moved.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"DISCOVERY_RUN_STALE_409: The run finished too long ago for its results to be trusted; run the search again.\nDISCOVERY_CANDIDATE_NOT_PROMOTABLE_409: One of the results has no usable Instagram handle; nothing was moved.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"description":"LEADS_DAILY_LIMIT_429: The organization reached its daily limit of leads created through the API.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["DISCOVERY_RUN_NOT_FOUND_404","DISCOVERY_CANDIDATES_NOT_FOUND_404","FOLDER_NOT_FOUND_404","DISCOVERY_RUN_STALE_409","DISCOVERY_CANDIDATE_NOT_PROMOTABLE_409","LEADS_DAILY_LIMIT_429"]}},"/v1/enrollments/{enrollment_id}":{"get":{"operationId":"enrollments.get","summary":"Get one enrollment.","tags":["Enrollments"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"enrollment_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Enrollment id (uuid)"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["campaigns:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"campaign_id":{"type":"string"},"lead_id":{"type":"string"},"rep_id":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","replied","completed","opted_out","failed"]},"current_step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"next_action_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"completed_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","campaign_id","lead_id","rep_id","status","current_step","enrolled_at","next_action_at","completed_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"ENROLLMENT_NOT_FOUND_404: No enrollment with this id exists in the key's workspace, or it belongs to a rep the key is not restricted to.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["ENROLLMENT_NOT_FOUND_404"]}},"/v1/enrollments/{enrollment_id}/pause":{"post":{"operationId":"enrollments.pause","summary":"Pause one enrollment (active -> paused); one already paused is answered as is.","tags":["Enrollments"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"enrollment_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Enrollment id (uuid)"}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["enrollments:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"campaign_id":{"type":"string"},"lead_id":{"type":"string"},"rep_id":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","replied","completed","opted_out","failed"]},"current_step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"next_action_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"completed_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","campaign_id","lead_id","rep_id","status","current_step","enrolled_at","next_action_at","completed_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"ENROLLMENT_NOT_FOUND_404: No enrollment with this id exists in the key's workspace, or it belongs to a rep the key is not restricted to.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ENROLLMENT_STATUS_CONFLICT_409: The enrollment is not in a status this transition starts from, or its status changed meanwhile.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["ENROLLMENT_NOT_FOUND_404","ENROLLMENT_STATUS_CONFLICT_409"]}},"/v1/enrollments/{enrollment_id}/resume":{"post":{"operationId":"enrollments.resume","summary":"Resume one enrollment (paused -> active); one already active is answered as is.","tags":["Enrollments"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"enrollment_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Enrollment id (uuid)"}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["enrollments:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"campaign_id":{"type":"string"},"lead_id":{"type":"string"},"rep_id":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","replied","completed","opted_out","failed"]},"current_step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"next_action_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"completed_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","campaign_id","lead_id","rep_id","status","current_step","enrolled_at","next_action_at","completed_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"ENROLLMENT_NOT_FOUND_404: No enrollment with this id exists in the key's workspace, or it belongs to a rep the key is not restricted to.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"ENROLLMENT_STATUS_CONFLICT_409: The enrollment is not in a status this transition starts from, or its status changed meanwhile.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["ENROLLMENT_NOT_FOUND_404","ENROLLMENT_STATUS_CONFLICT_409"]}},"/v1/folders":{"get":{"operationId":"folders.list","summary":"The workspace's lead folders with their lead counts, and how many leads are in none.","tags":["Folders"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"lead_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","name","lead_count","created_at"],"additionalProperties":false}},"unfiled_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["data","unfiled_count"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":[]},"post":{"operationId":"folders.create","summary":"Create a lead folder.","tags":["Folders"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["leads:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}}},"responses":{"201":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"lead_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","name","lead_count","created_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"409":{"description":"FOLDER_NAME_TAKEN_409: A folder with this name already exists in the workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["FOLDER_NAME_TAKEN_409"]}},"/v1/folders/{folder_id}":{"delete":{"operationId":"folders.delete","summary":"Delete a lead folder. Its leads are kept and end up in no folder.","tags":["Folders"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"folder_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"description":"The folder id."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"204":{"description":"No content","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"FOLDER_NOT_FOUND_404: No folder with this id exists in this workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["FOLDER_NOT_FOUND_404"]},"patch":{"operationId":"folders.update","summary":"Rename a lead folder.","tags":["Folders"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"folder_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"description":"The folder id."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"lead_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","name","lead_count","created_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"FOLDER_NOT_FOUND_404: No folder with this id exists in this workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"FOLDER_NAME_TAKEN_409: A folder with this name already exists in the workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["FOLDER_NOT_FOUND_404","FOLDER_NAME_TAKEN_409"]}},"/v1/jobs":{"get":{"operationId":"jobs.list","summary":"The workspace's jobs, newest first.","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["leads_import","leads_export","leads_bulk"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["awaiting_confirmation","queued","running","succeeded","failed","cancelled","expired"]}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["leads_import","leads_export","leads_bulk"]},"action":{"anyOf":[{"type":"string","enum":["update_status","add_tags","remove_tags","set_folder","delete","enroll","unenroll","set_custom_fields"]},{"type":"null"}]},"status":{"type":"string","enum":["awaiting_confirmation","queued","running","succeeded","failed","cancelled","expired"]},"progress":{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total"],"additionalProperties":false},"queue_position":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"For a queued job, its place among this organization's queued jobs (1 runs next); null otherwise."},"preview":{"anyOf":[{"type":"object","properties":{"matched_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"warnings":{"type":"array","items":{"type":"string"}},"sample":{"description":"In the preview response only, never stored.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"ig_handle":{"type":["string","null"]},"fb_handle":{"type":["string","null"]},"profile_url":{"type":["string","null"]},"niche":{"type":["string","null"]},"followers":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["new","contacted","replied","converted","not_interested","not_found"]},"notes":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"bio":{"type":["string","null"]},"company_name":{"type":["string","null"]},"last_contacted_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"folder_id":{"type":["string","null"]},"custom_fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]},"description":"Every custom field the workspace defines, in its order, null when the lead has no value for it; then any other key stored on the lead, as stored (an integrations key may write keys the workspace never defined)."},"external_id":{"type":["string","null"]},"assigned_rep_id":{"type":["string","null"]},"is_inbound":{"type":"boolean"},"icp_verdict":{"type":["string","null"]},"setter_stage":{"description":"List only: the newest thread's stage, when the key holds conversations:read and may see that thread's rep; null otherwise, and null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stall_reason":{"description":"List only, under the same condition as setter_stage; null when the plan does not include the AI Setter.","type":["string","null"]},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","count"],"additionalProperties":false},{"type":"null"}],"description":"List only: the campaign that matters (a live enrollment first, then the newest) and how many the lead is in."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","workspace_id","name","first_name","last_name","ig_handle","fb_handle","profile_url","niche","followers","status","notes","email","phone","website","bio","company_name","last_contacted_at","tags","folder_id","custom_fields","external_id","assigned_rep_id","is_inbound","icp_verdict","setter_stage","setter_stall_reason","campaign","created_at","updated_at"],"additionalProperties":false}}},"required":["matched_count","warnings"],"additionalProperties":false},{"type":"null"}]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"},{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"code":{"type":"string"}},"required":["row","code"],"additionalProperties":false}}]}},{"type":"null"}],"description":"Counts and short codes only, never lead data. errors_sample names row numbers and codes."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"started_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"confirm_expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"result_url":{"description":"The export's CSV, once the job succeeded.","type":["string","null"]}},"required":["id","kind","action","status","progress","queue_position","preview","result","error","created_at","started_at","finished_at","confirm_expires_at","result_url"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":[]}},"/v1/jobs/{job_id}":{"get":{"operationId":"jobs.get","summary":"One job: its status, progress and result counts.","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"description":"The job id."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["leads_import","leads_export","leads_bulk"]},"action":{"anyOf":[{"type":"string","enum":["update_status","add_tags","remove_tags","set_folder","delete","enroll","unenroll","set_custom_fields"]},{"type":"null"}]},"status":{"type":"string","enum":["awaiting_confirmation","queued","running","succeeded","failed","cancelled","expired"]},"progress":{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total"],"additionalProperties":false},"queue_position":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"For a queued job, its place among this organization's queued jobs (1 runs next); null otherwise."},"preview":{"anyOf":[{"type":"object","properties":{"matched_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"warnings":{"type":"array","items":{"type":"string"}},"sample":{"description":"In the preview response only, never stored.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"ig_handle":{"type":["string","null"]},"fb_handle":{"type":["string","null"]},"profile_url":{"type":["string","null"]},"niche":{"type":["string","null"]},"followers":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["new","contacted","replied","converted","not_interested","not_found"]},"notes":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"bio":{"type":["string","null"]},"company_name":{"type":["string","null"]},"last_contacted_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"folder_id":{"type":["string","null"]},"custom_fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]},"description":"Every custom field the workspace defines, in its order, null when the lead has no value for it; then any other key stored on the lead, as stored (an integrations key may write keys the workspace never defined)."},"external_id":{"type":["string","null"]},"assigned_rep_id":{"type":["string","null"]},"is_inbound":{"type":"boolean"},"icp_verdict":{"type":["string","null"]},"setter_stage":{"description":"List only: the newest thread's stage, when the key holds conversations:read and may see that thread's rep; null otherwise, and null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stall_reason":{"description":"List only, under the same condition as setter_stage; null when the plan does not include the AI Setter.","type":["string","null"]},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","count"],"additionalProperties":false},{"type":"null"}],"description":"List only: the campaign that matters (a live enrollment first, then the newest) and how many the lead is in."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","workspace_id","name","first_name","last_name","ig_handle","fb_handle","profile_url","niche","followers","status","notes","email","phone","website","bio","company_name","last_contacted_at","tags","folder_id","custom_fields","external_id","assigned_rep_id","is_inbound","icp_verdict","setter_stage","setter_stall_reason","campaign","created_at","updated_at"],"additionalProperties":false}}},"required":["matched_count","warnings"],"additionalProperties":false},{"type":"null"}]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"},{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"code":{"type":"string"}},"required":["row","code"],"additionalProperties":false}}]}},{"type":"null"}],"description":"Counts and short codes only, never lead data. errors_sample names row numbers and codes."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"started_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"confirm_expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"result_url":{"description":"The export's CSV, once the job succeeded.","type":["string","null"]}},"required":["id","kind","action","status","progress","queue_position","preview","result","error","created_at","started_at","finished_at","confirm_expires_at","result_url"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"JOB_NOT_FOUND_404: No job with this id exists in this workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["JOB_NOT_FOUND_404"]}},"/v1/jobs/{job_id}/cancel":{"post":{"operationId":"jobs.cancel","summary":"Cancel a job. A running job stops at its next slice; work already done stays done.","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"description":"The job id."}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["leads:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["leads_import","leads_export","leads_bulk"]},"action":{"anyOf":[{"type":"string","enum":["update_status","add_tags","remove_tags","set_folder","delete","enroll","unenroll","set_custom_fields"]},{"type":"null"}]},"status":{"type":"string","enum":["awaiting_confirmation","queued","running","succeeded","failed","cancelled","expired"]},"progress":{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total"],"additionalProperties":false},"queue_position":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"For a queued job, its place among this organization's queued jobs (1 runs next); null otherwise."},"preview":{"anyOf":[{"type":"object","properties":{"matched_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"warnings":{"type":"array","items":{"type":"string"}},"sample":{"description":"In the preview response only, never stored.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"ig_handle":{"type":["string","null"]},"fb_handle":{"type":["string","null"]},"profile_url":{"type":["string","null"]},"niche":{"type":["string","null"]},"followers":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["new","contacted","replied","converted","not_interested","not_found"]},"notes":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"bio":{"type":["string","null"]},"company_name":{"type":["string","null"]},"last_contacted_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"folder_id":{"type":["string","null"]},"custom_fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]},"description":"Every custom field the workspace defines, in its order, null when the lead has no value for it; then any other key stored on the lead, as stored (an integrations key may write keys the workspace never defined)."},"external_id":{"type":["string","null"]},"assigned_rep_id":{"type":["string","null"]},"is_inbound":{"type":"boolean"},"icp_verdict":{"type":["string","null"]},"setter_stage":{"description":"List only: the newest thread's stage, when the key holds conversations:read and may see that thread's rep; null otherwise, and null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stall_reason":{"description":"List only, under the same condition as setter_stage; null when the plan does not include the AI Setter.","type":["string","null"]},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","count"],"additionalProperties":false},{"type":"null"}],"description":"List only: the campaign that matters (a live enrollment first, then the newest) and how many the lead is in."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","workspace_id","name","first_name","last_name","ig_handle","fb_handle","profile_url","niche","followers","status","notes","email","phone","website","bio","company_name","last_contacted_at","tags","folder_id","custom_fields","external_id","assigned_rep_id","is_inbound","icp_verdict","setter_stage","setter_stall_reason","campaign","created_at","updated_at"],"additionalProperties":false}}},"required":["matched_count","warnings"],"additionalProperties":false},{"type":"null"}]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"},{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"code":{"type":"string"}},"required":["row","code"],"additionalProperties":false}}]}},{"type":"null"}],"description":"Counts and short codes only, never lead data. errors_sample names row numbers and codes."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"started_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"confirm_expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"result_url":{"description":"The export's CSV, once the job succeeded.","type":["string","null"]}},"required":["id","kind","action","status","progress","queue_position","preview","result","error","created_at","started_at","finished_at","confirm_expires_at","result_url"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"JOB_NOT_FOUND_404: No job with this id exists in this workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"JOB_NOT_CANCELLABLE_409: The job has already ended.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["JOB_NOT_FOUND_404","JOB_NOT_CANCELLABLE_409"]}},"/v1/jobs/{job_id}/result":{"get":{"operationId":"jobs.result","summary":"The CSV file an export job built (text/csv), for 24 hours after it finished.","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"description":"The job id."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:read"],"x-dmhero-rate-class":"heavy","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"string","description":"text/csv: the file, BOM and header row included."}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"JOB_NOT_FOUND_404: No job with this id exists in this workspace.\nJOB_RESULT_NOT_FOUND_404: The job is not an export, or ended without a file.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"JOB_RESULT_NOT_READY_409: The export has not finished yet.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"410":{"description":"JOB_RESULT_EXPIRED_410: The file was deleted 24 hours after the job finished.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["JOB_NOT_FOUND_404","JOB_RESULT_NOT_FOUND_404","JOB_RESULT_NOT_READY_409","JOB_RESULT_EXPIRED_410"]}},"/v1/leads":{"get":{"operationId":"leads.list","summary":"List the workspace's leads, newest first, with filters.","description":"Keyset pagination: pass next_cursor as cursor with the same filters and order. order=updated_at_asc with updated_after is the incremental sync. Custom fields filter with query keys that start with cf.: cf.<key>=<text> (equals, trimmed, ignoring case), cf.<key>.contains=<text> (substring, ignoring case, every character literal), cf.<key>.present=true (has a non-blank value), cf.<key>.missing=true (no value or a blank one). Conditions AND together with each other and every other filter; at most 5; each key must be one the workspace defines (GET /v1/custom-fields), else 400 CUSTOM_FIELD_UNKNOWN_400; a value is at most 500 characters.","tags":["Leads"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["new","contacted","replied","converted","not_interested","not_found"]}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":100}},{"name":"niche","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"folder_id","in":"query","required":false,"schema":{"description":"A folder id, or none for leads in no folder.","type":"string","minLength":1,"maxLength":200}},{"name":"search","in":"query","required":false,"schema":{"description":"Case-insensitive match on name, handles and notes.","type":"string","minLength":1,"maxLength":200}},{"name":"external_id","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}},{"name":"ig_handle","in":"query","required":false,"schema":{"description":"Matched case-insensitively, a leading @ ignored.","type":"string","minLength":1,"maxLength":100}},{"name":"created_after","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"created_before","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"updated_after","in":"query","required":false,"schema":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},{"name":"exclude_inbound","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"campaign_id","in":"query","required":false,"schema":{"description":"Leads enrolled in this campaign.","type":"string","minLength":1,"maxLength":200}},{"name":"enrollment","in":"query","required":false,"schema":{"description":"Leads in at least one campaign (any) or in none.","type":"string","enum":["any","none"]}},{"name":"order","in":"query","required":false,"schema":{"default":"created_at","type":"string","enum":["created_at","updated_at","updated_at_asc"]}},{"name":"cf.{key}","in":"query","required":false,"description":"Custom field conditions, one query key each: cf.<key>=<text> equals, cf.<key>.contains=<text>, cf.<key>.present=true, cf.<key>.missing=true. At most 5, ANDed; the key must be defined in the workspace.","schema":{"type":"string"},"x-dmhero-query-prefix":"cf."},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"ig_handle":{"type":["string","null"]},"fb_handle":{"type":["string","null"]},"profile_url":{"type":["string","null"]},"niche":{"type":["string","null"]},"followers":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["new","contacted","replied","converted","not_interested","not_found"]},"notes":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"bio":{"type":["string","null"]},"company_name":{"type":["string","null"]},"last_contacted_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"folder_id":{"type":["string","null"]},"custom_fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]},"description":"Every custom field the workspace defines, in its order, null when the lead has no value for it; then any other key stored on the lead, as stored (an integrations key may write keys the workspace never defined)."},"external_id":{"type":["string","null"]},"assigned_rep_id":{"type":["string","null"]},"is_inbound":{"type":"boolean"},"icp_verdict":{"type":["string","null"]},"setter_stage":{"description":"List only: the newest thread's stage, when the key holds conversations:read and may see that thread's rep; null otherwise, and null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stall_reason":{"description":"List only, under the same condition as setter_stage; null when the plan does not include the AI Setter.","type":["string","null"]},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","count"],"additionalProperties":false},{"type":"null"}],"description":"List only: the campaign that matters (a live enrollment first, then the newest) and how many the lead is in."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","workspace_id","name","first_name","last_name","ig_handle","fb_handle","profile_url","niche","followers","status","notes","email","phone","website","bio","company_name","last_contacted_at","tags","folder_id","custom_fields","external_id","assigned_rep_id","is_inbound","icp_verdict","setter_stage","setter_stall_reason","campaign","created_at","updated_at"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"description":"CUSTOM_FIELD_UNKNOWN_400: A cf.<key> condition names a key this workspace has not defined.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: campaign_id names no campaign of this workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["CAMPAIGN_NOT_FOUND_404","CUSTOM_FIELD_UNKNOWN_400"]},"post":{"operationId":"leads.upsert","summary":"Create or update one lead, or a batch of up to 100.","description":"Matches on external_id, then the Instagram handle. on_conflict decides what a match does: merge (default), skip, or error (409 LEAD_EXISTS_409, a create-only call). A batch runs one lead per transaction and reports each item in place.","tags":["Leads"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["leads:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"ig_handle":{"description":"Required for every lead: the matching key."},"name":{},"first_name":{},"last_name":{},"fb_handle":{},"profile_url":{},"niche":{},"followers":{"description":"A number, or a numeric string."},"notes":{},"tags":{"description":"An array of tags or one comma-separated string, at most 20."},"folder":{"description":"Folder NAME, created when missing."},"custom_fields":{"description":"{ key: value } of the workspace's custom fields."},"external_id":{},"email":{},"phone":{},"merge":{"description":"fill_empty (default) or overwrite."},"leads":{"description":"A batch: an array of 1 to 100 lead objects. Omit for one lead."},"on_conflict":{"type":"string","enum":["merge","skip","error"]}}}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"lead_id":{"type":"string"},"result":{"type":"string","enum":["created","updated","unchanged","skipped"]},"updated_fields":{"type":"array","items":{"type":"string"}},"lead_status":{"type":"string"}},"required":["lead_id","result","updated_fields","lead_status"],"additionalProperties":false},{"type":"object","properties":{"results":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"lead_id":{"type":"string"},"result":{"type":"string","enum":["created","updated","unchanged","skipped"]},"updated_fields":{"type":"array","items":{"type":"string"}},"lead_status":{"type":"string"},"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["lead_id","result","updated_fields","lead_status","index"],"additionalProperties":false},{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"error":{"type":"string"},"message":{"type":"string"},"code":{"type":"string"},"lead_id":{"type":"string"},"fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["index","error","message","code"],"additionalProperties":false}]}}},"required":["results"],"additionalProperties":false},{"type":"object","properties":{"replayed":{"type":"boolean","const":true},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ids":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["replayed","status","ids"],"additionalProperties":false}]}}}},"400":{"description":"LEADS_BATCH_TOO_LARGE_400: The batch holds more than 100 leads.\nCUSTOM_FIELD_UNKNOWN_400: custom_fields names a key this workspace has not defined. Create it with POST /v1/custom-fields first.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"409":{"description":"LEAD_AMBIGUOUS_409: More than one lead in this workspace has that Instagram handle.\nLEAD_EXISTS_409: on_conflict is error and the lead already exists.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"description":"LEADS_DAILY_LIMIT_429: The organization reached its daily limit of leads created through the API.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["LEADS_BATCH_TOO_LARGE_400","CUSTOM_FIELD_UNKNOWN_400","LEAD_AMBIGUOUS_409","LEAD_EXISTS_409","LEADS_DAILY_LIMIT_429"]}},"/v1/leads/{lead_id}":{"delete":{"operationId":"leads.delete","summary":"Delete a lead, its tags and its enrollments.","tags":["Leads"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"description":"The lead id."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:delete"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":true,"responses":{"204":{"description":"No content","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"LEAD_NOT_FOUND_404: No lead with this id exists in this workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["LEAD_NOT_FOUND_404"]},"get":{"operationId":"leads.get","summary":"One lead. The ETag header is the version PATCH accepts as If-Match.","tags":["Leads"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"description":"The lead id."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"ig_handle":{"type":["string","null"]},"fb_handle":{"type":["string","null"]},"profile_url":{"type":["string","null"]},"niche":{"type":["string","null"]},"followers":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["new","contacted","replied","converted","not_interested","not_found"]},"notes":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"bio":{"type":["string","null"]},"company_name":{"type":["string","null"]},"last_contacted_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"folder_id":{"type":["string","null"]},"custom_fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]},"description":"Every custom field the workspace defines, in its order, null when the lead has no value for it; then any other key stored on the lead, as stored (an integrations key may write keys the workspace never defined)."},"external_id":{"type":["string","null"]},"assigned_rep_id":{"type":["string","null"]},"is_inbound":{"type":"boolean"},"icp_verdict":{"type":["string","null"]},"setter_stage":{"description":"List only: the newest thread's stage, when the key holds conversations:read and may see that thread's rep; null otherwise, and null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stall_reason":{"description":"List only, under the same condition as setter_stage; null when the plan does not include the AI Setter.","type":["string","null"]},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","count"],"additionalProperties":false},{"type":"null"}],"description":"List only: the campaign that matters (a live enrollment first, then the newest) and how many the lead is in."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","workspace_id","name","first_name","last_name","ig_handle","fb_handle","profile_url","niche","followers","status","notes","email","phone","website","bio","company_name","last_contacted_at","tags","folder_id","custom_fields","external_id","assigned_rep_id","is_inbound","icp_verdict","setter_stage","setter_stall_reason","campaign","created_at","updated_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"LEAD_NOT_FOUND_404: No lead with this id exists in this workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["LEAD_NOT_FOUND_404"]},"patch":{"operationId":"leads.update","summary":"Change a lead's fields. Send If-Match with the ETag you read to refuse a concurrent change.","tags":["Leads"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"description":"The lead id."}},{"name":"If-Match","in":"header","required":false,"schema":{"description":"The ETag of GET /v1/leads/{lead_id}.","type":"string","minLength":1,"maxLength":200}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"ig_handle":{"type":["string","null"]},"fb_handle":{"type":["string","null"]},"profile_url":{"type":["string","null"]},"niche":{"type":["string","null"]},"followers":{"anyOf":[{"type":"integer","minimum":0,"maximum":2147483647},{"type":"null"}]},"notes":{"type":["string","null"]},"status":{"type":"string","enum":["new","contacted","replied","converted","not_interested","not_found"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"assigned_rep_id":{"description":"A rep this key may use, or null.","anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"folder_id":{"description":"null leaves the lead in no folder.","anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"custom_fields":{"description":"{ key: value | null }; null removes the value. Keys the request does not name are left alone.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]}}}}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"ig_handle":{"type":["string","null"]},"fb_handle":{"type":["string","null"]},"profile_url":{"type":["string","null"]},"niche":{"type":["string","null"]},"followers":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["new","contacted","replied","converted","not_interested","not_found"]},"notes":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"bio":{"type":["string","null"]},"company_name":{"type":["string","null"]},"last_contacted_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"folder_id":{"type":["string","null"]},"custom_fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]},"description":"Every custom field the workspace defines, in its order, null when the lead has no value for it; then any other key stored on the lead, as stored (an integrations key may write keys the workspace never defined)."},"external_id":{"type":["string","null"]},"assigned_rep_id":{"type":["string","null"]},"is_inbound":{"type":"boolean"},"icp_verdict":{"type":["string","null"]},"setter_stage":{"description":"List only: the newest thread's stage, when the key holds conversations:read and may see that thread's rep; null otherwise, and null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stall_reason":{"description":"List only, under the same condition as setter_stage; null when the plan does not include the AI Setter.","type":["string","null"]},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","count"],"additionalProperties":false},{"type":"null"}],"description":"List only: the campaign that matters (a live enrollment first, then the newest) and how many the lead is in."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","workspace_id","name","first_name","last_name","ig_handle","fb_handle","profile_url","niche","followers","status","notes","email","phone","website","bio","company_name","last_contacted_at","tags","folder_id","custom_fields","external_id","assigned_rep_id","is_inbound","icp_verdict","setter_stage","setter_stall_reason","campaign","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"CUSTOM_FIELD_UNKNOWN_400: custom_fields names a key this workspace has not defined. Create it with POST /v1/custom-fields first.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"LEAD_NOT_FOUND_404: No lead with this id exists in this workspace.\nFOLDER_NOT_FOUND_404: No folder with this id exists in this workspace.\nREP_NOT_FOUND_404: No rep with this id or username that this API key may use.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"412":{"description":"LEAD_PRECONDITION_FAILED_412: If-Match does not match: the lead changed since you read it.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["LEAD_NOT_FOUND_404","FOLDER_NOT_FOUND_404","REP_NOT_FOUND_404","CUSTOM_FIELD_UNKNOWN_400","LEAD_PRECONDITION_FAILED_412"]}},"/v1/leads/{lead_id}/enrollments":{"get":{"operationId":"leads.enrollments.list","summary":"Every campaign enrollment of one lead, newest first.","tags":["Enrollments"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"Lead id (uuid)"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["campaigns:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"campaign_id":{"type":"string"},"lead_id":{"type":"string"},"rep_id":{"type":["string","null"]},"status":{"type":"string","enum":["active","paused","replied","completed","opted_out","failed"]},"current_step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"enrolled_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"next_action_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"completed_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["id","campaign_id","lead_id","rep_id","status","current_step","enrolled_at","next_action_at","completed_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"LEAD_NOT_FOUND_404: A lead id is not in the key's workspace. The answer names no id.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["LEAD_NOT_FOUND_404"]}},"/v1/leads/{lead_id}/tags":{"post":{"operationId":"leads.tags.add","summary":"Add tags to a lead. Tags it already has are left as they are.","tags":["Leads"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"description":"The lead id."}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["leads:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"minItems":1,"maxItems":20,"type":"array","items":{"type":"string"}}},"required":["tags"]}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"lead_id":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}},"required":["lead_id","tags"],"additionalProperties":false}}}},"400":{"description":"TAG_INVALID_400: A tag is empty or longer than the tag limit.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"LEAD_NOT_FOUND_404: No lead with this id exists in this workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["LEAD_NOT_FOUND_404","TAG_INVALID_400"]}},"/v1/leads/{lead_id}/tags/{tag}":{"delete":{"operationId":"leads.tags.remove","summary":"Remove one tag from a lead (URL-encode the tag). Removing a tag the lead does not have is not an error.","tags":["Leads"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"description":"The lead id."}},{"name":"tag","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"204":{"description":"No content","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"description":"TAG_INVALID_400: A tag is empty or longer than the tag limit.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"LEAD_NOT_FOUND_404: No lead with this id exists in this workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["LEAD_NOT_FOUND_404","TAG_INVALID_400"]}},"/v1/leads/bulk-actions":{"post":{"operationId":"leads.bulk.preview","summary":"Preview a bulk action on up to 30 000 leads; the target is frozen until you confirm.","description":"Resolves the target (lead ids, or a filter) in this workspace and freezes it. Answers 201 with the job awaiting confirmation, the matched count, a sample of 10 leads and a confirm_token valid for 15 minutes. delete, update_status and remove_tags also need leads:delete; enroll and unenroll need enrollments:write. set_custom_fields overwrites custom field values (params.values; null clears one): it also needs leads:delete, cannot be auto-confirmed, and a lead whose values would pass 4 KB is left unchanged and counted as failed. auto_confirm: true queues a non-destructive action (add_tags, set_folder, enroll) at once (202).","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["leads:write"],"x-dmhero-rate-class":"heavy","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"action":{"type":"string","enum":["update_status","add_tags","remove_tags","set_folder","delete","enroll","unenroll","set_custom_fields"]},"target":{"type":"object","properties":{"lead_ids":{"minItems":1,"type":"array","items":{"type":"string","minLength":1,"maxLength":200}},"filter":{"type":"object","properties":{"status":{"type":"string","enum":["new","contacted","replied","converted","not_interested","not_found"]},"tag":{"type":"string","minLength":1,"maxLength":100},"niche":{"type":"string","minLength":1,"maxLength":200},"folder_id":{"description":"A folder id, or none for leads in no folder.","type":"string","minLength":1,"maxLength":200},"search":{"description":"Case-insensitive match on name, handles and notes.","type":"string","minLength":1,"maxLength":200},"external_id":{"type":"string","minLength":1,"maxLength":255},"ig_handle":{"description":"Matched case-insensitively, a leading @ ignored.","type":"string","minLength":1,"maxLength":100},"created_after":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"created_before":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_after":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"exclude_inbound":{"type":"boolean"},"campaign_id":{"description":"Leads enrolled in this campaign.","type":"string","minLength":1,"maxLength":200},"enrollment":{"description":"Leads in at least one campaign (any) or in none.","type":"string","enum":["any","none"]},"custom_fields":{"description":"Custom field conditions, ANDed with each other and the filters above (at most 5): { key, op: equals | contains | present | missing, value? }. Each key must be one the workspace defines (GET /v1/custom-fields), else 400 CUSTOM_FIELD_UNKNOWN_400.","maxItems":5,"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":100,"description":"A custom field key the workspace defines (GET /v1/custom-fields)."},"op":{"type":"string","const":"equals"},"value":{"type":"string","minLength":1,"maxLength":500,"description":"Compared trimmed and ignoring case, as a whole value."}},"required":["key","op","value"]},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":100,"description":"A custom field key the workspace defines (GET /v1/custom-fields)."},"op":{"type":"string","const":"contains"},"value":{"type":"string","minLength":1,"maxLength":500,"description":"A substring, ignoring case. Every character is literal (% and _ included)."}},"required":["key","op","value"]},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":100,"description":"A custom field key the workspace defines (GET /v1/custom-fields)."},"op":{"type":"string","const":"present"}},"required":["key","op"]},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":100,"description":"A custom field key the workspace defines (GET /v1/custom-fields)."},"op":{"type":"string","const":"missing"}},"required":["key","op"]}],"description":"equals: the value, trimmed, equals this text ignoring case. contains: the value holds this text ignoring case. present: the lead has a non-blank value. missing: the lead has no value or a blank one."}}},"additionalProperties":false,"description":"Lead filter. An empty filter selects every lead of the workspace. A member not named here is refused (400 VALIDATION_FAILED_400 naming filter.<member>), never ignored: a misspelt member would otherwise widen the filter to every lead."}},"description":"Exactly one of lead_ids (1 to 30 000) and filter."},"params":{"default":{},"type":"object","properties":{"status":{"description":"update_status: the new status.","type":"string","enum":["new","contacted","replied","converted","not_interested","not_found"]},"tags":{"description":"add_tags, remove_tags: the tags.","minItems":1,"maxItems":20,"type":"array","items":{"type":"string"}},"folder_id":{"description":"set_folder: the folder, or null for no folder.","anyOf":[{"type":"string","minLength":1,"maxLength":200},{"type":"null"}]},"campaign_id":{"description":"enroll, unenroll: the campaign.","type":"string","minLength":1,"maxLength":200},"rep_id":{"description":"enroll: the one rep to assign; default every rep the key may use.","type":"string","minLength":1,"maxLength":200},"values":{"description":"set_custom_fields: { <key>: text | null } for custom fields the workspace defines. A text overwrites the lead's value (trimmed, at most 500 characters); null or an empty text clears it. Keys not named are left alone.","type":"object","propertyNames":{"type":"string","minLength":1,"maxLength":64},"additionalProperties":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]}}}},"auto_confirm":{"default":false,"type":"boolean"}},"required":["action","target"]}}}},"responses":{"201":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["leads_import","leads_export","leads_bulk"]},"action":{"anyOf":[{"type":"string","enum":["update_status","add_tags","remove_tags","set_folder","delete","enroll","unenroll","set_custom_fields"]},{"type":"null"}]},"status":{"type":"string","enum":["awaiting_confirmation","queued","running","succeeded","failed","cancelled","expired"]},"progress":{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total"],"additionalProperties":false},"queue_position":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"For a queued job, its place among this organization's queued jobs (1 runs next); null otherwise."},"preview":{"anyOf":[{"type":"object","properties":{"matched_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"warnings":{"type":"array","items":{"type":"string"}},"sample":{"description":"In the preview response only, never stored.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"ig_handle":{"type":["string","null"]},"fb_handle":{"type":["string","null"]},"profile_url":{"type":["string","null"]},"niche":{"type":["string","null"]},"followers":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["new","contacted","replied","converted","not_interested","not_found"]},"notes":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"bio":{"type":["string","null"]},"company_name":{"type":["string","null"]},"last_contacted_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"folder_id":{"type":["string","null"]},"custom_fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]},"description":"Every custom field the workspace defines, in its order, null when the lead has no value for it; then any other key stored on the lead, as stored (an integrations key may write keys the workspace never defined)."},"external_id":{"type":["string","null"]},"assigned_rep_id":{"type":["string","null"]},"is_inbound":{"type":"boolean"},"icp_verdict":{"type":["string","null"]},"setter_stage":{"description":"List only: the newest thread's stage, when the key holds conversations:read and may see that thread's rep; null otherwise, and null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stall_reason":{"description":"List only, under the same condition as setter_stage; null when the plan does not include the AI Setter.","type":["string","null"]},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","count"],"additionalProperties":false},{"type":"null"}],"description":"List only: the campaign that matters (a live enrollment first, then the newest) and how many the lead is in."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","workspace_id","name","first_name","last_name","ig_handle","fb_handle","profile_url","niche","followers","status","notes","email","phone","website","bio","company_name","last_contacted_at","tags","folder_id","custom_fields","external_id","assigned_rep_id","is_inbound","icp_verdict","setter_stage","setter_stall_reason","campaign","created_at","updated_at"],"additionalProperties":false}}},"required":["matched_count","warnings"],"additionalProperties":false},{"type":"null"}]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"},{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"code":{"type":"string"}},"required":["row","code"],"additionalProperties":false}}]}},{"type":"null"}],"description":"Counts and short codes only, never lead data. errors_sample names row numbers and codes."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"started_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"confirm_expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"result_url":{"description":"The export's CSV, once the job succeeded.","type":["string","null"]},"confirm_token":{"description":"Shown once, in the preview response. Send it to the confirm operation before confirm_expires_at.","type":"string"}},"required":["id","kind","action","status","progress","queue_position","preview","result","error","created_at","started_at","finished_at","confirm_expires_at","result_url"],"additionalProperties":false}}}},"400":{"description":"BULK_TOO_MANY_400: The target holds more than 30 000 leads.\nBULK_AUTO_CONFIRM_NOT_ALLOWED_400: auto_confirm on a destructive action.\nTAG_INVALID_400: A tag is empty or longer than the tag limit.\nCUSTOM_FIELD_UNKNOWN_400: A custom field key in the filter or in set_custom_fields' values is not one this workspace defines.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"LEAD_NOT_FOUND_404: None of lead_ids is a lead of this workspace.\nCAMPAIGN_NOT_FOUND_404: No campaign with this id exists in this workspace.\nFOLDER_NOT_FOUND_404: No folder with this id exists in this workspace.\nREP_NOT_FOUND_404: rep_id names no rep this API key may use.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"JOB_QUEUE_FULL_409: The organization already has 3 jobs waiting for confirmation, queued or running.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"JOB_PAYLOAD_QUOTA_413: The organization reached its daily quota of job payload bytes.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["BULK_TOO_MANY_400","BULK_AUTO_CONFIRM_NOT_ALLOWED_400","TAG_INVALID_400","CUSTOM_FIELD_UNKNOWN_400","LEAD_NOT_FOUND_404","CAMPAIGN_NOT_FOUND_404","FOLDER_NOT_FOUND_404","REP_NOT_FOUND_404","JOB_QUEUE_FULL_409","JOB_PAYLOAD_QUOTA_413"]}},"/v1/leads/bulk-actions/{job_id}/confirm":{"post":{"operationId":"leads.bulk.confirm","summary":"Confirm a previewed bulk action: the job is queued and runs on the frozen target.","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":200,"description":"The job id."}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKeyRequired"}],"x-dmhero-scopes":["leads:write"],"x-dmhero-rate-class":"heavy","x-dmhero-idempotency":"required","x-dmhero-destructive":true,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"confirm_token":{"type":"string","minLength":1,"maxLength":200},"expected_count":{"type":"integer","minimum":0,"maximum":9007199254740991,"description":"The preview's matched_count, as you read it."}},"required":["confirm_token","expected_count"]}}}},"responses":{"202":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["leads_import","leads_export","leads_bulk"]},"action":{"anyOf":[{"type":"string","enum":["update_status","add_tags","remove_tags","set_folder","delete","enroll","unenroll","set_custom_fields"]},{"type":"null"}]},"status":{"type":"string","enum":["awaiting_confirmation","queued","running","succeeded","failed","cancelled","expired"]},"progress":{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total"],"additionalProperties":false},"queue_position":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"For a queued job, its place among this organization's queued jobs (1 runs next); null otherwise."},"preview":{"anyOf":[{"type":"object","properties":{"matched_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"warnings":{"type":"array","items":{"type":"string"}},"sample":{"description":"In the preview response only, never stored.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"ig_handle":{"type":["string","null"]},"fb_handle":{"type":["string","null"]},"profile_url":{"type":["string","null"]},"niche":{"type":["string","null"]},"followers":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["new","contacted","replied","converted","not_interested","not_found"]},"notes":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"bio":{"type":["string","null"]},"company_name":{"type":["string","null"]},"last_contacted_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"folder_id":{"type":["string","null"]},"custom_fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]},"description":"Every custom field the workspace defines, in its order, null when the lead has no value for it; then any other key stored on the lead, as stored (an integrations key may write keys the workspace never defined)."},"external_id":{"type":["string","null"]},"assigned_rep_id":{"type":["string","null"]},"is_inbound":{"type":"boolean"},"icp_verdict":{"type":["string","null"]},"setter_stage":{"description":"List only: the newest thread's stage, when the key holds conversations:read and may see that thread's rep; null otherwise, and null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stall_reason":{"description":"List only, under the same condition as setter_stage; null when the plan does not include the AI Setter.","type":["string","null"]},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","count"],"additionalProperties":false},{"type":"null"}],"description":"List only: the campaign that matters (a live enrollment first, then the newest) and how many the lead is in."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","workspace_id","name","first_name","last_name","ig_handle","fb_handle","profile_url","niche","followers","status","notes","email","phone","website","bio","company_name","last_contacted_at","tags","folder_id","custom_fields","external_id","assigned_rep_id","is_inbound","icp_verdict","setter_stage","setter_stall_reason","campaign","created_at","updated_at"],"additionalProperties":false}}},"required":["matched_count","warnings"],"additionalProperties":false},{"type":"null"}]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"},{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"code":{"type":"string"}},"required":["row","code"],"additionalProperties":false}}]}},{"type":"null"}],"description":"Counts and short codes only, never lead data. errors_sample names row numbers and codes."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"started_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"confirm_expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"result_url":{"description":"The export's CSV, once the job succeeded.","type":["string","null"]}},"required":["id","kind","action","status","progress","queue_position","preview","result","error","created_at","started_at","finished_at","confirm_expires_at","result_url"],"additionalProperties":false}}}},"400":{"description":"API_IDEMPOTENCY_KEY_REQUIRED_400: The request carries no Idempotency-Key header.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"JOB_CONFIRM_TOKEN_INVALID_403: The confirmation token is not this job's.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"JOB_NOT_FOUND_404: No job with this id exists in this workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"JOB_NOT_AWAITING_CONFIRMATION_409: The job is not awaiting confirmation.\nJOB_CONFIRMATION_EXPIRED_409: The 15 minute confirmation window has passed.\nBULK_COUNT_CHANGED_409: expected_count differs from the preview's matched_count.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["JOB_NOT_FOUND_404","JOB_CONFIRM_TOKEN_INVALID_403","JOB_NOT_AWAITING_CONFIRMATION_409","JOB_CONFIRMATION_EXPIRED_409","BULK_COUNT_CHANGED_409","API_IDEMPOTENCY_KEY_REQUIRED_400"]}},"/v1/leads/exports":{"post":{"operationId":"leads.exports.create","summary":"Export the leads a filter selects as a CSV file, built by a job.","description":"The same file the app's CRM export writes for the same leads, plus one column per custom field the workspace defines, in their display order, headed custom_fields.<key>, so the file imports back through POST /v1/leads/imports unchanged. Poll GET /v1/jobs/{job_id}; once it succeeded, download result_url within 24 hours.","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKeyRequired"}],"x-dmhero-scopes":["leads:read"],"x-dmhero-rate-class":"heavy","x-dmhero-idempotency":"required","x-dmhero-destructive":false,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"filter":{"type":"object","properties":{"status":{"type":"string","enum":["new","contacted","replied","converted","not_interested","not_found"]},"tag":{"type":"string","minLength":1,"maxLength":100},"niche":{"type":"string","minLength":1,"maxLength":200},"folder_id":{"description":"A folder id, or none for leads in no folder.","type":"string","minLength":1,"maxLength":200},"search":{"description":"Case-insensitive match on name, handles and notes.","type":"string","minLength":1,"maxLength":200},"external_id":{"type":"string","minLength":1,"maxLength":255},"ig_handle":{"description":"Matched case-insensitively, a leading @ ignored.","type":"string","minLength":1,"maxLength":100},"created_after":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"created_before":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_after":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"exclude_inbound":{"type":"boolean"},"campaign_id":{"description":"Leads enrolled in this campaign.","type":"string","minLength":1,"maxLength":200},"enrollment":{"description":"Leads in at least one campaign (any) or in none.","type":"string","enum":["any","none"]},"custom_fields":{"description":"Custom field conditions, ANDed with each other and the filters above (at most 5): { key, op: equals | contains | present | missing, value? }. Each key must be one the workspace defines (GET /v1/custom-fields), else 400 CUSTOM_FIELD_UNKNOWN_400.","maxItems":5,"type":"array","items":{"oneOf":[{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":100,"description":"A custom field key the workspace defines (GET /v1/custom-fields)."},"op":{"type":"string","const":"equals"},"value":{"type":"string","minLength":1,"maxLength":500,"description":"Compared trimmed and ignoring case, as a whole value."}},"required":["key","op","value"]},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":100,"description":"A custom field key the workspace defines (GET /v1/custom-fields)."},"op":{"type":"string","const":"contains"},"value":{"type":"string","minLength":1,"maxLength":500,"description":"A substring, ignoring case. Every character is literal (% and _ included)."}},"required":["key","op","value"]},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":100,"description":"A custom field key the workspace defines (GET /v1/custom-fields)."},"op":{"type":"string","const":"present"}},"required":["key","op"]},{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":100,"description":"A custom field key the workspace defines (GET /v1/custom-fields)."},"op":{"type":"string","const":"missing"}},"required":["key","op"]}],"description":"equals: the value, trimmed, equals this text ignoring case. contains: the value holds this text ignoring case. present: the lead has a non-blank value. missing: the lead has no value or a blank one."}}},"additionalProperties":false,"description":"Lead filter. An empty filter selects every lead of the workspace. A member not named here is refused (400 VALIDATION_FAILED_400 naming filter.<member>), never ignored: a misspelt member would otherwise widen the filter to every lead."},"format":{"default":"csv","type":"string","enum":["csv"]}}}}}},"responses":{"202":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["leads_import","leads_export","leads_bulk"]},"action":{"anyOf":[{"type":"string","enum":["update_status","add_tags","remove_tags","set_folder","delete","enroll","unenroll","set_custom_fields"]},{"type":"null"}]},"status":{"type":"string","enum":["awaiting_confirmation","queued","running","succeeded","failed","cancelled","expired"]},"progress":{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total"],"additionalProperties":false},"queue_position":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"For a queued job, its place among this organization's queued jobs (1 runs next); null otherwise."},"preview":{"anyOf":[{"type":"object","properties":{"matched_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"warnings":{"type":"array","items":{"type":"string"}},"sample":{"description":"In the preview response only, never stored.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"ig_handle":{"type":["string","null"]},"fb_handle":{"type":["string","null"]},"profile_url":{"type":["string","null"]},"niche":{"type":["string","null"]},"followers":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["new","contacted","replied","converted","not_interested","not_found"]},"notes":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"bio":{"type":["string","null"]},"company_name":{"type":["string","null"]},"last_contacted_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"folder_id":{"type":["string","null"]},"custom_fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]},"description":"Every custom field the workspace defines, in its order, null when the lead has no value for it; then any other key stored on the lead, as stored (an integrations key may write keys the workspace never defined)."},"external_id":{"type":["string","null"]},"assigned_rep_id":{"type":["string","null"]},"is_inbound":{"type":"boolean"},"icp_verdict":{"type":["string","null"]},"setter_stage":{"description":"List only: the newest thread's stage, when the key holds conversations:read and may see that thread's rep; null otherwise, and null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stall_reason":{"description":"List only, under the same condition as setter_stage; null when the plan does not include the AI Setter.","type":["string","null"]},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","count"],"additionalProperties":false},{"type":"null"}],"description":"List only: the campaign that matters (a live enrollment first, then the newest) and how many the lead is in."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","workspace_id","name","first_name","last_name","ig_handle","fb_handle","profile_url","niche","followers","status","notes","email","phone","website","bio","company_name","last_contacted_at","tags","folder_id","custom_fields","external_id","assigned_rep_id","is_inbound","icp_verdict","setter_stage","setter_stall_reason","campaign","created_at","updated_at"],"additionalProperties":false}}},"required":["matched_count","warnings"],"additionalProperties":false},{"type":"null"}]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"},{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"code":{"type":"string"}},"required":["row","code"],"additionalProperties":false}}]}},{"type":"null"}],"description":"Counts and short codes only, never lead data. errors_sample names row numbers and codes."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"started_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"confirm_expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"result_url":{"description":"The export's CSV, once the job succeeded.","type":["string","null"]}},"required":["id","kind","action","status","progress","queue_position","preview","result","error","created_at","started_at","finished_at","confirm_expires_at","result_url"],"additionalProperties":false}}}},"400":{"description":"EXPORT_TOO_MANY_ROWS_400: The filter selects more than 30 000 leads. Narrow it.\nCUSTOM_FIELD_UNKNOWN_400: A custom field key in the filter or in set_custom_fields' values is not one this workspace defines.\nAPI_IDEMPOTENCY_KEY_REQUIRED_400: The request carries no Idempotency-Key header.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"CAMPAIGN_NOT_FOUND_404: No campaign with this id exists in this workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"JOB_QUEUE_FULL_409: The organization already has 3 jobs waiting for confirmation, queued or running.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["EXPORT_TOO_MANY_ROWS_400","CUSTOM_FIELD_UNKNOWN_400","CAMPAIGN_NOT_FOUND_404","API_IDEMPOTENCY_KEY_REQUIRED_400","JOB_QUEUE_FULL_409"]}},"/v1/leads/imports":{"post":{"operationId":"leads.imports.create","summary":"Import up to 30 000 leads as a job, from JSON or a CSV body.","description":"JSON: { leads: [...] } with the fields of POST /v1/leads (ig_handle required on every lead). CSV: send Content-Type: text/csv with on_conflict, folder and tags in the query; headers are the JSON field names, custom_fields.<key> for a custom field, or the headers of DM Hero's own lead export. A header that names no field is refused, except the export's derived columns, which are ignored. Every row is matched on external_id, then the Instagram handle; on_conflict says what a match does (skip, the default, or merge). Poll GET /v1/jobs/{job_id}.","tags":["Jobs"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"on_conflict","in":"query","required":false,"schema":{"default":"skip","description":"What a row matching an existing lead does.","type":"string","enum":["skip","merge"]}},{"name":"folder","in":"query","required":false,"schema":{"description":"Folder NAME for every row without one, created when missing.","type":"string","minLength":1,"maxLength":80}},{"name":"tags","in":"query","required":false,"schema":{"description":"Tags added to every row: an array, or one comma-separated string.","anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKeyRequired"}],"x-dmhero-scopes":["leads:write"],"x-dmhero-rate-class":"heavy","x-dmhero-idempotency":"required","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leads":{"description":"JSON import: 1 to 30 000 lead objects, the fields of POST /v1/leads.","type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}}},"text/csv":{"schema":{"type":"string","description":"The CSV file as the request body, header row first. Query parameters carry the other options."}}}},"responses":{"202":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["leads_import","leads_export","leads_bulk"]},"action":{"anyOf":[{"type":"string","enum":["update_status","add_tags","remove_tags","set_folder","delete","enroll","unenroll","set_custom_fields"]},{"type":"null"}]},"status":{"type":"string","enum":["awaiting_confirmation","queued","running","succeeded","failed","cancelled","expired"]},"progress":{"type":"object","properties":{"done":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["done","total"],"additionalProperties":false},"queue_position":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"For a queued job, its place among this organization's queued jobs (1 runs next); null otherwise."},"preview":{"anyOf":[{"type":"object","properties":{"matched_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"warnings":{"type":"array","items":{"type":"string"}},"sample":{"description":"In the preview response only, never stored.","type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"workspace_id":{"type":"string"},"name":{"type":"string"},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"ig_handle":{"type":["string","null"]},"fb_handle":{"type":["string","null"]},"profile_url":{"type":["string","null"]},"niche":{"type":["string","null"]},"followers":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"status":{"type":"string","enum":["new","contacted","replied","converted","not_interested","not_found"]},"notes":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"website":{"type":["string","null"]},"bio":{"type":["string","null"]},"company_name":{"type":["string","null"]},"last_contacted_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"folder_id":{"type":["string","null"]},"custom_fields":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":["string","null"]},"description":"Every custom field the workspace defines, in its order, null when the lead has no value for it; then any other key stored on the lead, as stored (an integrations key may write keys the workspace never defined)."},"external_id":{"type":["string","null"]},"assigned_rep_id":{"type":["string","null"]},"is_inbound":{"type":"boolean"},"icp_verdict":{"type":["string","null"]},"setter_stage":{"description":"List only: the newest thread's stage, when the key holds conversations:read and may see that thread's rep; null otherwise, and null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stall_reason":{"description":"List only, under the same condition as setter_stage; null when the plan does not include the AI Setter.","type":["string","null"]},"campaign":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","name","count"],"additionalProperties":false},{"type":"null"}],"description":"List only: the campaign that matters (a live enrollment first, then the newest) and how many the lead is in."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"}},"required":["id","workspace_id","name","first_name","last_name","ig_handle","fb_handle","profile_url","niche","followers","status","notes","email","phone","website","bio","company_name","last_contacted_at","tags","folder_id","custom_fields","external_id","assigned_rep_id","is_inbound","icp_verdict","setter_stage","setter_stall_reason","campaign","created_at","updated_at"],"additionalProperties":false}}},"required":["matched_count","warnings"],"additionalProperties":false},{"type":"null"}]},"result":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"anyOf":[{"type":"number"},{"type":"string"},{"type":"null"},{"type":"array","items":{"type":"object","properties":{"row":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"code":{"type":"string"}},"required":["row","code"],"additionalProperties":false}}]}},{"type":"null"}],"description":"Counts and short codes only, never lead data. errors_sample names row numbers and codes."},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},"started_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"finished_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"confirm_expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"result_url":{"description":"The export's CSV, once the job succeeded.","type":["string","null"]}},"required":["id","kind","action","status","progress","queue_position","preview","result","error","created_at","started_at","finished_at","confirm_expires_at","result_url"],"additionalProperties":false}}}},"400":{"description":"IMPORT_TOO_MANY_ROWS_400: The import holds more rows than one job takes (30 000; 5 000 for a new organization).\nIMPORT_EMPTY_400: The import holds no rows, or both or neither of leads and a CSV body.\nIMPORT_CSV_INVALID_400: The CSV cannot be read whole, or has no Instagram handle column.\nIMPORT_CSV_COLUMN_UNSUPPORTED_400: A CSV header names no lead field; the column is named in the body.\nTAG_INVALID_400: A tag in the tags parameter is empty or longer than the tag limit.\nAPI_IDEMPOTENCY_KEY_REQUIRED_400: The request carries no Idempotency-Key header.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"409":{"description":"JOB_QUEUE_FULL_409: The organization already has 3 jobs waiting for confirmation, queued or running.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"JOB_PAYLOAD_QUOTA_413: The organization reached its daily quota of job payload bytes.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"description":"LEADS_DAILY_LIMIT_429: The organization reached its daily limit of leads created through the API.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["IMPORT_TOO_MANY_ROWS_400","IMPORT_EMPTY_400","IMPORT_CSV_INVALID_400","IMPORT_CSV_COLUMN_UNSUPPORTED_400","TAG_INVALID_400","API_IDEMPOTENCY_KEY_REQUIRED_400","JOB_QUEUE_FULL_409","JOB_PAYLOAD_QUOTA_413","LEADS_DAILY_LIMIT_429"]}},"/v1/leads/lookup":{"get":{"operationId":"leads.lookup","summary":"Where the lead with this Instagram handle stands: status, setter stage, tags, campaign.","tags":["Leads"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"ig_handle","in":"query","required":false,"schema":{"description":"Required. At most 30 characters, a leading @ ignored."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"lead_id":{"type":"string"},"status":{"type":"string"},"setter_stage":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"setter_stall_reason":{"description":"Null when the plan does not include the AI Setter.","type":["string","null"]},"last_contacted_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"tags":{"type":"array","items":{"type":"string"}},"campaign_id":{"type":["string","null"]},"campaign_status":{"type":["string","null"]},"current_step":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["lead_id","status","setter_stage","setter_stall_reason","last_contacted_at","tags","campaign_id","campaign_status","current_step"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"LEAD_NOT_FOUND_404: No lead with that Instagram handle in this API key's workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"LEAD_AMBIGUOUS_409: More than one lead in this workspace has that Instagram handle.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["LEAD_NOT_FOUND_404","LEAD_AMBIGUOUS_409"]}},"/v1/me":{"get":{"operationId":"me.get","summary":"Who this API key is: its workspace, scopes, reps and limits.","description":"Any valid key may call it; it is the connection test of an integration. Never names the key's creator or anything of another workspace.","tags":["Me"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":[],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"workspace":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"],"additionalProperties":false},"api_key":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"},{"type":"null"}]},"allowed_cidrs":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"api_surface":{"type":"string","enum":["integrations","developer"]}},"required":["id","name","prefix","scopes","expires_at","allowed_cidrs","api_surface"],"additionalProperties":false},"reps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ig_username":{"type":"string"}},"required":["id","ig_username"],"additionalProperties":false}},"organization":{"type":"object","properties":{"id":{"type":"string"},"plan":{"type":"string"}},"required":["id","plan"],"additionalProperties":false},"limits":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"object","properties":{"per_minute":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["per_minute"],"additionalProperties":false},"description":"This key's requests per minute per rate class."},"developer_api_enabled":{"type":"boolean"}},"required":["workspace","api_key","reps","organization","limits","developer_api_enabled"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":[]}},"/v1/openapi.json":{"get":{"operationId":"meta.openapi","summary":"The OpenAPI 3.1 document of this API.","description":"Public: no API key needed. Without a key this is the public document, generated from the operation contracts on every deploy and cached for five minutes. A request that presents an API key gets that key's view instead: the operations, fields and errors that key may use, never cached. A key that does not authenticate is refused, not served the public document.","tags":["Meta"],"security":[],"parameters":[],"x-dmhero-scopes":[],"x-dmhero-rate-class":null,"x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}}}},"401":{"description":"API_KEY_INVALID_401: With an API key: the key presented is invalid, revoked or expired. A broken key is refused, never served the public document.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"API_ORG_DISABLED_403: With an API key: API access is disabled for the key's organization.\nAPI_KEY_SURFACE_403: With an API key: the key was created for the integrations endpoints only.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"API_RATE_LIMITED_429: With an API key: the key's or organization's rate limit is reached. Retry after the number of seconds in Retry-After.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"API_DISABLED_503: With an API key: the developer API is temporarily disabled. Retry later.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-dmhero-error-codes":["API_KEY_INVALID_401","API_ORG_DISABLED_403","API_KEY_SURFACE_403","API_RATE_LIMITED_429","API_DISABLED_503"]}},"/v1/reps":{"get":{"operationId":"reps.list","summary":"List the workspace's connected reps with their health and setter mode.","description":"Only live (not archived) reps, oldest connected first. A key restricted to reps lists only those reps.","tags":["Reps"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["reps:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ig_username":{"type":"string"},"full_name":{"type":["string","null"]},"profile_pic_url":{"type":["string","null"]},"followers_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"health":{"type":"object","properties":{"token":{"type":"string","enum":["ok","expired","rejected","missing"]},"token_expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"extension":{"type":"string","enum":["online","paused","offline","never"]},"extension_last_seen_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"extension_pause_code":{"type":["string","null"]},"dm_count_current_period":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dm_cap_current_period":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rate_limited_until":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["token","token_expires_at","extension","extension_last_seen_at","extension_pause_code","dm_count_current_period","dm_cap_current_period","rate_limited_until"],"additionalProperties":false},"setter_mode":{"anyOf":[{"type":"object","properties":{"outbound":{"type":"string","enum":["off","suggest","auto"]},"inbound":{"type":"string","enum":["off","suggest","auto"]}},"required":["outbound","inbound"],"additionalProperties":false},{"type":"null"}],"description":"Null when the plan does not include the AI Setter."},"connected_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","ig_username","full_name","profile_pic_url","followers_count","health","setter_mode","connected_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":[]}},"/v1/reps/{rep_id}":{"get":{"operationId":"reps.get","summary":"Read one rep with its health and setter mode.","tags":["Reps"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"rep_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["reps:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"ig_username":{"type":"string"},"full_name":{"type":["string","null"]},"profile_pic_url":{"type":["string","null"]},"followers_count":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"health":{"type":"object","properties":{"token":{"type":"string","enum":["ok","expired","rejected","missing"]},"token_expires_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"extension":{"type":"string","enum":["online","paused","offline","never"]},"extension_last_seen_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"extension_pause_code":{"type":["string","null"]},"dm_count_current_period":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dm_cap_current_period":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rate_limited_until":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["token","token_expires_at","extension","extension_last_seen_at","extension_pause_code","dm_count_current_period","dm_cap_current_period","rate_limited_until"],"additionalProperties":false},"setter_mode":{"anyOf":[{"type":"object","properties":{"outbound":{"type":"string","enum":["off","suggest","auto"]},"inbound":{"type":"string","enum":["off","suggest","auto"]}},"required":["outbound","inbound"],"additionalProperties":false},{"type":"null"}],"description":"Null when the plan does not include the AI Setter."},"connected_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","ig_username","full_name","profile_pic_url","followers_count","health","setter_mode","connected_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"REP_NOT_FOUND_404: The rep does not exist in this workspace, is archived, or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404"]}},"/v1/reps/{rep_id}/excluded-handles":{"get":{"operationId":"reps.excluded.list","summary":"List the handles a rep's inbound setter never engages and never adds to the CRM.","tags":["Reps"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"rep_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["reps:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"string"},"description":"Normalized handles: trimmed, no leading @, lowercase, in alphabetical order."}},"required":["data"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"REP_NOT_FOUND_404: The rep does not exist in this workspace, is archived, or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404"]},"post":{"operationId":"reps.excluded.add","summary":"Add handles to a rep's inbound exclusion list.","description":"Each item is one handle. Handles are normalized (trimmed, leading @ dropped, lowercased) and deduplicated; one already on the list is a no-op. An item that still holds whitespace or a comma after trimming is refused (400, naming `handles.<index>`). `added` counts the handles that were not on it before.","tags":["Reps"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"rep_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["reps:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"handles":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}}},"required":["handles"]}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"rep_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"added":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"data":{"type":"array","items":{"type":"string"},"description":"Normalized handles: trimmed, no leading @, lowercase, in alphabetical order."}},"required":["rep_id","added","data"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED_400: A field is missing or malformed.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"REP_NOT_FOUND_404: The rep does not exist in this workspace, is archived, or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404","VALIDATION_FAILED_400"]}},"/v1/reps/{rep_id}/excluded-handles/{handle}":{"delete":{"operationId":"reps.excluded.remove","summary":"Remove one handle from a rep's inbound exclusion list.","tags":["Reps"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"rep_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"handle","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["reps:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"204":{"description":"No content","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"REP_NOT_FOUND_404: The rep does not exist in this workspace, is archived, or is outside the key's rep restriction.\nEXCLUDED_HANDLE_NOT_FOUND_404: The handle is not on this rep's exclusion list.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404","EXCLUDED_HANDLE_NOT_FOUND_404"]}},"/v1/reps/{rep_id}/setter-mode":{"get":{"operationId":"reps.setter_mode.get","summary":"Read a rep's AI Setter mode for outbound replies and for inbound DMs.","tags":["Reps"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"rep_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["reps:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"outbound":{"type":"string","enum":["off","suggest","auto"]},"inbound":{"type":"string","enum":["off","suggest","auto"]}},"required":["outbound","inbound"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"REP_NOT_FOUND_404: The rep does not exist in this workspace, is archived, or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404"]},"put":{"operationId":"reps.setter_mode.set","summary":"Set a rep's AI Setter mode for outbound replies, inbound DMs, or both.","description":"`auto` lets the setter reply on its own through the Meta API. At least one of `outbound` and `inbound` is required; the other keeps its value. Every change is written to the audit log.","tags":["Reps"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"rep_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["reps:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"outbound":{"type":"string","enum":["off","suggest","auto"]},"inbound":{"type":"string","enum":["off","suggest","auto"]}}}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"outbound":{"type":"string","enum":["off","suggest","auto"]},"inbound":{"type":"string","enum":["off","suggest","auto"]}},"required":["outbound","inbound"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED_400: A field is missing or malformed.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"REP_NOT_FOUND_404: The rep does not exist in this workspace, is archived, or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404","VALIDATION_FAILED_400"]}},"/v1/reps/{rep_id}/setter/knowledge":{"get":{"operationId":"setter.knowledge.list","summary":"List a rep's AI Setter knowledge entries, oldest first.","tags":["AI Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"rep_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["setter:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rep_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"content":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","title","content","created_at","updated_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"REP_NOT_FOUND_404: A rep does not exist in this workspace, is archived, or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404"]},"post":{"operationId":"setter.knowledge.create","summary":"Add a knowledge entry the rep's AI Setter may answer from.","description":"The setter reads every entry of the rep on every reply. The same limits as the app's editor: a title of 1 to 120 characters after trimming, content up to 8000 characters.","tags":["AI Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"rep_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["setter:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"1 to 120 characters after trimming."},"content":{"type":"string","maxLength":8000,"description":"Up to 8000 characters."}},"required":["title","content"]}}}},"responses":{"201":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rep_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"content":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","title","content","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED_400: A field is missing or malformed; `fields` names each one.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"REP_NOT_FOUND_404: A rep does not exist in this workspace, is archived, or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404","VALIDATION_FAILED_400"]}},"/v1/reps/{rep_id}/setter/variants":{"get":{"operationId":"setter.variants.list","summary":"List a rep's AI Setter variants, newest first.","description":"Archived variants are left out, as in the app's editor; read one by id to see it.","tags":["Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"rep_id","in":"path","required":true,"schema":{"type":"string","description":"A rep (connected Instagram account) id."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["setter:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rep_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","testing","live","archived"]},"traffic_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Bumped by every change to a content field."},"name":{"type":"string"},"goal_text":{"type":"string"},"goal_link":{"type":["string","null"]},"goal_tool":{"type":"string","enum":["manual","calendly","cal_com","google_calendar"]},"goal_link_status":{"type":"string","enum":["none","connected"]},"key_elements_text":{"type":"string"},"avoid_text":{"type":"string"},"offer_text":{"type":"string"},"icp_text":{"type":"string"},"qualifying_text":{"type":"string"},"disqualify_text":{"type":"string"},"tone_text":{"type":"string"},"style_text":{"type":"string"},"language_text":{"type":"string"},"phrases_text":{"type":"string"},"rep_name":{"type":"string"},"rep_role":{"type":"string"},"reaction_frequency":{"type":"string","enum":["off","rare","normal","frequent"]},"reaction_emojis":{"type":"array","items":{"type":"string"}},"reaction_rules":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string","description":"One of the allowed reaction emoji."},"when":{"type":"string","description":"The moment it fits, in the operator's words. At most 200 characters."}},"required":["emoji","when"],"additionalProperties":false}},"message_style":{"type":"string","enum":["single","multi"]},"objection_mode":{"type":"string","enum":["stop","rebut"]},"handoff_text":{"type":"string"},"handoff_on_uncertain":{"type":"boolean"},"few_shot":{"type":"array","items":{"type":"object","properties":{"prospect":{"type":"string","description":"A prospect message. At most 600 characters."},"reply":{"type":"string","description":"The ideal reply. At most 600 characters."}},"required":["prospect","reply"],"additionalProperties":false}},"objections":{"type":"array","items":{"type":"object","properties":{"objection":{"type":"string","description":"A known objection. At most 600 characters."},"approach":{"type":"string","description":"How to handle it. At most 600 characters."}},"required":["objection","approach"],"additionalProperties":false}},"booking_config":{"type":"object","properties":{"duration_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"buffer_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working_hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}}},"required":["mon","tue","wed","thu","fri","sat","sun"],"additionalProperties":false},"min_notice_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allow_same_day":{"type":"boolean"},"horizon_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hard_cap_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Never offered or booked beyond it. Fixed at 60; read-only."},"max_per_day":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"meeting_form":{"type":"string","enum":["meet","phone"]},"event_title":{"type":"string"},"event_description":{"type":"string"},"prospect_tz_mode":{"type":"string","enum":["campaign","fixed"]},"prospect_tz":{"type":["string","null"]},"target_calendar_id":{"type":"string"},"busy_calendar_ids":{"type":"array","items":{"type":"string"}}},"required":["duration_min","buffer_min","working_hours","min_notice_min","allow_same_day","horizon_days","hard_cap_days","max_per_day","meeting_form","event_title","event_description","prospect_tz_mode","prospect_tz","target_calendar_id","busy_calendar_ids"],"additionalProperties":false},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","status","traffic_weight","version","name","goal_text","goal_link","goal_tool","goal_link_status","key_elements_text","avoid_text","offer_text","icp_text","qualifying_text","disqualify_text","tone_text","style_text","language_text","phrases_text","rep_name","rep_role","reaction_frequency","reaction_emojis","reaction_rules","message_style","objection_mode","handoff_text","handoff_on_uncertain","few_shot","objections","booking_config","created_at","updated_at"],"additionalProperties":false}}},"required":["data"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"API_SETTER_NOT_IN_PLAN_403: The organization's plan does not include the AI Setter.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"REP_NOT_FOUND_404: The rep does not exist in this workspace, is archived, or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404","API_SETTER_NOT_IN_PLAN_403"]},"post":{"operationId":"setter.variants.create","summary":"Create a draft AI Setter variant for a rep.","description":"The variant starts as a draft; publish it, or start an A/B test with it, to serve conversations. Fields left out take the editor's defaults.","tags":["Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"rep_id","in":"path","required":true,"schema":{"type":"string","description":"A rep (connected Instagram account) id."}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["setter:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Shown in the variant list. 1 to 80 characters."},"goal_text":{"type":"string","description":"Script: the goal. Every text field takes up to 4000 characters."},"goal_link":{"description":"The CTA link; null or empty clears it. At most 2000 characters.","type":["string","null"]},"goal_tool":{"type":"string","enum":["manual","calendly","cal_com","google_calendar"],"description":"How the CTA is fulfilled."},"goal_link_status":{"type":"string","enum":["none","connected"]},"key_elements_text":{"type":"string"},"avoid_text":{"type":"string"},"offer_text":{"type":"string"},"icp_text":{"type":"string"},"qualifying_text":{"type":"string"},"disqualify_text":{"type":"string"},"tone_text":{"type":"string"},"style_text":{"type":"string"},"language_text":{"type":"string"},"phrases_text":{"type":"string"},"rep_name":{"type":"string"},"rep_role":{"type":"string"},"reaction_frequency":{"type":"string","enum":["off","rare","normal","frequent"]},"reaction_emojis":{"type":"array","items":{"type":"string"},"description":"At most 4, from the allowed reaction emoji."},"reaction_rules":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string","description":"One of the allowed reaction emoji."},"when":{"type":"string","description":"The moment it fits, in the operator's words. At most 200 characters."}},"required":["emoji","when"]},"description":"At most 6."},"message_style":{"type":"string","enum":["single","multi"],"description":"One message, or several short bubbles."},"objection_mode":{"type":"string","enum":["stop","rebut"],"description":"On a soft objection: stop, or rebut and persuade."},"handoff_text":{"type":"string","description":"When to hand a live thread to a human."},"handoff_on_uncertain":{"type":"boolean","description":"Also hand off when the model is unsure."},"few_shot":{"type":"array","items":{"type":"object","properties":{"prospect":{"type":"string","description":"A prospect message. At most 600 characters."},"reply":{"type":"string","description":"The ideal reply. At most 600 characters."}},"required":["prospect","reply"]},"description":"At most 3; a fully blank row is dropped."},"objections":{"type":"array","items":{"type":"object","properties":{"objection":{"type":"string","description":"A known objection. At most 600 characters."},"approach":{"type":"string","description":"How to handle it. At most 600 characters."}},"required":["objection","approach"]},"description":"At most 6; a fully blank row is dropped."},"booking_config":{"type":"object","properties":{"duration_min":{"description":"Meeting length in minutes, 10 to 240. Default 45.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"buffer_min":{"description":"Minutes kept free around a meeting, 0 to 120. Default 0.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working_hours":{"description":"Up to 4 non-overlapping intervals per day; at least one day must have hours. Default Monday to Friday 09:00 to 17:00.","type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}}},"additionalProperties":false},"min_notice_min":{"description":"Minimum notice in minutes, 0 to 10080. Default 180.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allow_same_day":{"description":"Default true.","type":"boolean"},"horizon_days":{"description":"Days ahead offered first, 1 to 60. Default 14.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hard_cap_days":{"description":"Read-only. Accepted only as 60, so a config read back can be sent again unchanged.","type":"number","const":60},"max_per_day":{"description":"Bookings per day, 1 to 50; null for no limit. Default null.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"meeting_form":{"description":"Default meet.","type":"string","enum":["meet","phone"]},"event_title":{"description":"Prospect-visible event title, at most 200 characters.","type":"string"},"event_description":{"description":"Prospect-visible event description, at most 2000 characters.","type":"string"},"prospect_tz_mode":{"description":"campaign: the campaign's time zone; fixed: prospect_tz, which is then required.","type":"string","enum":["campaign","fixed"]},"prospect_tz":{"description":"An IANA time zone.","type":["string","null"]},"target_calendar_id":{"description":"The calendar events land in. Default primary.","type":"string"},"busy_calendar_ids":{"description":"Calendars checked for conflicts, at most 10 counting the target, which is always added.","type":"array","items":{"type":"string"}}},"additionalProperties":false,"description":"The Google Calendar booking rules, read only while goal_tool is google_calendar. Sent whole: a field left out takes its default."},"traffic_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"A/B share, 0 to 100. start_test is the usual way to set it. On a testing variant it must be at least 1 and keep the rep's testing weights within 100, else 400 traffic_weight_invalid or traffic_weight_sum_exceeded; on any other status it is stored and serves nothing until start_test sets it again."}},"required":["name"]}}}},"responses":{"201":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rep_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","testing","live","archived"]},"traffic_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Bumped by every change to a content field."},"name":{"type":"string"},"goal_text":{"type":"string"},"goal_link":{"type":["string","null"]},"goal_tool":{"type":"string","enum":["manual","calendly","cal_com","google_calendar"]},"goal_link_status":{"type":"string","enum":["none","connected"]},"key_elements_text":{"type":"string"},"avoid_text":{"type":"string"},"offer_text":{"type":"string"},"icp_text":{"type":"string"},"qualifying_text":{"type":"string"},"disqualify_text":{"type":"string"},"tone_text":{"type":"string"},"style_text":{"type":"string"},"language_text":{"type":"string"},"phrases_text":{"type":"string"},"rep_name":{"type":"string"},"rep_role":{"type":"string"},"reaction_frequency":{"type":"string","enum":["off","rare","normal","frequent"]},"reaction_emojis":{"type":"array","items":{"type":"string"}},"reaction_rules":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string","description":"One of the allowed reaction emoji."},"when":{"type":"string","description":"The moment it fits, in the operator's words. At most 200 characters."}},"required":["emoji","when"],"additionalProperties":false}},"message_style":{"type":"string","enum":["single","multi"]},"objection_mode":{"type":"string","enum":["stop","rebut"]},"handoff_text":{"type":"string"},"handoff_on_uncertain":{"type":"boolean"},"few_shot":{"type":"array","items":{"type":"object","properties":{"prospect":{"type":"string","description":"A prospect message. At most 600 characters."},"reply":{"type":"string","description":"The ideal reply. At most 600 characters."}},"required":["prospect","reply"],"additionalProperties":false}},"objections":{"type":"array","items":{"type":"object","properties":{"objection":{"type":"string","description":"A known objection. At most 600 characters."},"approach":{"type":"string","description":"How to handle it. At most 600 characters."}},"required":["objection","approach"],"additionalProperties":false}},"booking_config":{"type":"object","properties":{"duration_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"buffer_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working_hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}}},"required":["mon","tue","wed","thu","fri","sat","sun"],"additionalProperties":false},"min_notice_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allow_same_day":{"type":"boolean"},"horizon_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hard_cap_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Never offered or booked beyond it. Fixed at 60; read-only."},"max_per_day":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"meeting_form":{"type":"string","enum":["meet","phone"]},"event_title":{"type":"string"},"event_description":{"type":"string"},"prospect_tz_mode":{"type":"string","enum":["campaign","fixed"]},"prospect_tz":{"type":["string","null"]},"target_calendar_id":{"type":"string"},"busy_calendar_ids":{"type":"array","items":{"type":"string"}}},"required":["duration_min","buffer_min","working_hours","min_notice_min","allow_same_day","horizon_days","hard_cap_days","max_per_day","meeting_form","event_title","event_description","prospect_tz_mode","prospect_tz","target_calendar_id","busy_calendar_ids"],"additionalProperties":false},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","status","traffic_weight","version","name","goal_text","goal_link","goal_tool","goal_link_status","key_elements_text","avoid_text","offer_text","icp_text","qualifying_text","disqualify_text","tone_text","style_text","language_text","phrases_text","rep_name","rep_role","reaction_frequency","reaction_emojis","reaction_rules","message_style","objection_mode","handoff_text","handoff_on_uncertain","few_shot","objections","booking_config","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED_400: A field is missing or outside the editor's limits. `fields` maps each field path (booking_config.<field> for the booking rules) to the reason, e.g. text_too_long, out_of_range, traffic_weight_sum_exceeded.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"GOOGLE_CALENDAR_NOT_ENABLED_403: Booking in Google Calendar is not enabled for this organization, and the call would move the variant onto goal_tool google_calendar or change the booking rules of a variant on it.\nAPI_SETTER_NOT_IN_PLAN_403: The organization's plan does not include the AI Setter.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"REP_NOT_FOUND_404: The rep does not exist in this workspace, is archived, or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404","VALIDATION_FAILED_400","GOOGLE_CALENDAR_NOT_ENABLED_403","API_SETTER_NOT_IN_PLAN_403"]}},"/v1/setter/booking-preview":{"get":{"operationId":"setter.booking.preview","summary":"The free meeting times a variant's saved booking rules would offer a new prospect right now.","description":"Reads the workspace's Google Calendar free/busy under the variant's SAVED booking rules and writes nothing. `block` is the text the setter's model reads. A calendar that is not connected, revoked, or refused by Google is not an error: `available` is false and `reason` says why.","tags":["AI Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"variant_id","in":"query","required":true,"schema":{"type":"string"}},{"name":"lang","in":"query","required":false,"schema":{"description":"Language of `block`. Default pl.","type":"string","enum":["pl","en"]}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["setter:read"],"x-dmhero-rate-class":"heavy","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"available":{"type":"boolean"},"reason":{"description":"Why no times could be read, when `available` is false.","type":["string","null"]},"block":{"type":["string","null"]},"empty":{"type":["boolean","null"]},"beyond_horizon":{"type":["boolean","null"]},"first_available_date":{"type":["string","null"]},"owner_tz":{"type":["string","null"]},"prospect_tz":{"type":["string","null"]}},"required":["available","reason","block","empty","beyond_horizon","first_available_date","owner_tz","prospect_tz"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"GOOGLE_CALENDAR_NOT_ENABLED_403: Google Calendar booking is not enabled for this organization yet.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"SETTER_VARIANT_NOT_FOUND_404: The setter variant does not exist, or belongs to a rep outside the key's reps.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["SETTER_VARIANT_NOT_FOUND_404","GOOGLE_CALENDAR_NOT_ENABLED_403"]}},"/v1/setter/connections":{"get":{"operationId":"setter.connections.get","summary":"Whether the workspace's Google Calendar and Calendly are connected, for the setter's booking goal.","description":"Status only: the state of each connection, the Google account and its calendars (to pick a target calendar for a variant's booking rules), the Calendly scheduling link. Never a token.","tags":["AI Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["setter:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"google_calendar":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Google Calendar booking is available to this organization."},"connected":{"type":"boolean"},"status":{"anyOf":[{"type":"string","enum":["active","incomplete","revoked"]},{"type":"null"}]},"email":{"type":["string","null"]},"owner_timezone":{"type":["string","null"]},"missing_scopes":{"type":"array","items":{"type":"string"}},"calendars":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"summary":{"type":"string"},"primary":{"type":"boolean"},"time_zone":{"type":["string","null"]},"access_role":{"type":"string"}},"required":["id","summary","primary","time_zone","access_role"],"additionalProperties":false}},"calendars_fetched_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"connected_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]}},"required":["enabled","connected","status","email","owner_timezone","missing_scopes","calendars","calendars_fetched_at","connected_at"],"additionalProperties":false},"calendly":{"type":"object","properties":{"connected":{"type":"boolean"},"scheduling_url":{"type":["string","null"]},"has_webhook":{"type":"boolean"}},"required":["connected","scheduling_url","has_webhook"],"additionalProperties":false}},"required":["google_calendar","calendly"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":[]}},"/v1/setter/knowledge/{knowledge_id}":{"delete":{"operationId":"setter.knowledge.delete","summary":"Delete a knowledge entry.","tags":["AI Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"knowledge_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["setter:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":true,"responses":{"204":{"description":"No content","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"KNOWLEDGE_NOT_FOUND_404: The knowledge entry does not exist, or belongs to a rep outside the key's reps.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["KNOWLEDGE_NOT_FOUND_404"]},"patch":{"operationId":"setter.knowledge.update","summary":"Change a knowledge entry's title, content, or both.","description":"Only the fields sent change. At least one of `title` and `content` is required.","tags":["AI Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"knowledge_id","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["setter:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","description":"1 to 120 characters after trimming."},"content":{"type":"string","maxLength":8000,"description":"Up to 8000 characters."}}}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rep_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"title":{"type":"string"},"content":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","title","content","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED_400: A field is missing or malformed; `fields` names each one.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"KNOWLEDGE_NOT_FOUND_404: The knowledge entry does not exist, or belongs to a rep outside the key's reps.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["KNOWLEDGE_NOT_FOUND_404","VALIDATION_FAILED_400"]}},"/v1/setter/persona":{"get":{"operationId":"setter.persona.get","summary":"Read the persona (name, role, tone, style, language) of one or more reps.","description":"The persona lives on each rep's live setter variant, the same record the app's Settings and AI Setter editor show. With several reps, `mixed` lists the fields they disagree on.","tags":["AI Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"rep_ids","in":"query","required":true,"schema":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"},"description":"The reps in scope: repeated, or as one comma-separated value. Every id must be one of the key's reps."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["setter:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"rep_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"values":{"type":"object","properties":{"rep_name":{"type":"string"},"rep_role":{"type":"string"},"tone_text":{"type":"string"},"style_text":{"type":"string"},"language_text":{"type":"string"}},"required":["rep_name","rep_role","tone_text","style_text","language_text"],"additionalProperties":false,"description":"Per field: the value the reps share, or the first rep's value when they differ."},"mixed":{"type":"array","items":{"type":"string","enum":["rep_name","rep_role","tone_text","style_text","language_text"]},"description":"Fields whose value differs across the reps in scope."},"rep_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unconfigured_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Reps in scope with no live setter variant yet."}},"required":["rep_ids","values","mixed","rep_count","unconfigured_count"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED_400: A field is missing or malformed; `fields` names each one.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"REP_NOT_FOUND_404: A rep does not exist in this workspace, is archived, or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404","VALIDATION_FAILED_400"]},"put":{"operationId":"setter.persona.set","summary":"Write persona fields onto the live setter variant of each named rep.","description":"Only the fields sent are written, onto every rep in `rep_ids`, so a field left out keeps each rep's own value. A rep with no live variant gets one created and published, as in the app. Every rep id is checked before anything is written: one foreign id and nothing changes.","tags":["AI Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["setter:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rep_ids":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string"},"description":"The reps in scope: repeated, or as one comma-separated value. Every id must be one of the key's reps."},"rep_name":{"type":"string","description":"Up to 4000 characters."},"rep_role":{"type":"string","description":"Up to 4000 characters."},"tone_text":{"type":"string","description":"Up to 4000 characters."},"style_text":{"type":"string","description":"Up to 4000 characters."},"language_text":{"type":"string","description":"Up to 4000 characters."}},"required":["rep_ids"]}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"rep_ids":{"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"values":{"type":"object","properties":{"rep_name":{"type":"string"},"rep_role":{"type":"string"},"tone_text":{"type":"string"},"style_text":{"type":"string"},"language_text":{"type":"string"}},"required":["rep_name","rep_role","tone_text","style_text","language_text"],"additionalProperties":false,"description":"Per field: the value the reps share, or the first rep's value when they differ."},"mixed":{"type":"array","items":{"type":"string","enum":["rep_name","rep_role","tone_text","style_text","language_text"]},"description":"Fields whose value differs across the reps in scope."},"rep_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"unconfigured_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Reps in scope with no live setter variant yet."},"affected_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Reps that had no live variant and got a new published one."}},"required":["rep_ids","values","mixed","rep_count","unconfigured_count","affected_count","created_count"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED_400: A field is missing or malformed; `fields` names each one.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"REP_NOT_FOUND_404: A rep does not exist in this workspace, is archived, or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404","VALIDATION_FAILED_400"]}},"/v1/setter/test":{"post":{"operationId":"setter.test","summary":"Run the AI Setter on a typed thread with an inline configuration and get its next reply.","description":"The Test Chat sandbox: nothing is saved, nothing is sent, no DM limit is used. The reply runs through the same reaction gate as the live setter; with goal_tool google_calendar it reads the workspace's free/busy and answers what the reply's booking would have done, marked simulated (no event, no hold). Each call is one or two model calls and is metered like the app's Test Chat. At most 30 calls a minute per key. A thread needs at least one prospect message.","tags":["AI Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["setter:write"],"x-dmhero-rate-class":"heavy","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rep_id":{"type":"string","description":"The rep whose knowledge base and timezone the turn uses."},"config":{"type":"object","properties":{"goal_text":{"type":"string"},"goal_link":{"type":["string","null"]},"goal_tool":{"description":"manual, calendly, link or google_calendar.","type":"string"},"goal_link_status":{"type":"string"},"key_elements_text":{"type":"string"},"avoid_text":{"type":"string"},"offer_text":{"type":"string"},"icp_text":{"type":"string"},"qualifying_text":{"type":"string"},"disqualify_text":{"type":"string"},"tone_text":{"type":"string"},"style_text":{"type":"string"},"language_text":{"type":"string"},"phrases_text":{"type":"string"},"rep_name":{"type":"string"},"rep_role":{"type":"string"},"message_style":{"type":"string"},"objection_mode":{"type":"string"},"few_shot":{"type":"array","items":{"type":"object","properties":{"prospect":{"type":"string"},"reply":{"type":"string"}},"required":["prospect","reply"]}},"objections":{"type":"array","items":{"type":"object","properties":{"objection":{"type":"string"},"approach":{"type":"string"}},"required":["objection","approach"]}},"reaction_frequency":{"type":"string"},"reaction_emojis":{"type":"array","items":{"type":"string"}},"reaction_rules":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string"},"when":{"type":"string"}},"required":["emoji","when"]}},"booking_config":{"type":"object","properties":{"duration_min":{"type":"number"},"buffer_min":{"type":"number"},"working_hours":{"description":"Per weekday, up to 4 [\"HH:MM\", \"HH:MM\"] intervals.","type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2}}}},"min_notice_min":{"type":"number"},"allow_same_day":{"type":"boolean"},"horizon_days":{"type":"number"},"max_per_day":{"type":["number","null"]},"meeting_form":{"type":"string","enum":["meet","phone"]},"event_title":{"type":"string"},"event_description":{"type":"string"},"prospect_tz_mode":{"type":"string","enum":["campaign","fixed"]},"prospect_tz":{"type":["string","null"]},"target_calendar_id":{"type":"string"},"busy_calendar_ids":{"type":"array","items":{"type":"string"}}},"description":"Read only when goal_tool is google_calendar. Omitted fields take the defaults."}},"description":"The same fields as a setter variant, validated by the app's editor rules. Omitted fields take the defaults."},"thread":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"from_prospect":{"type":"boolean"},"text":{"type":"string","maxLength":4000},"our_reaction":{"description":"A reaction an earlier answer approved on this prospect bubble.","type":["string","null"]},"proposals":{"description":"On our bubble: the times an earlier answer proposed.","maxItems":5,"type":"array","items":{"type":"object","properties":{"starts_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"label":{"type":"string"}},"required":["starts_at","label"]}}},"required":["from_prospect","text"]}},"lead":{"type":"object","properties":{"name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"niche":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"handle":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]}}}},"required":["rep_id","thread"]}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"The reply text, exactly what the live setter would send."},"bubbles":{"type":"array","items":{"type":"string"}},"reaction":{"anyOf":[{"type":"object","properties":{"emoji":{"type":"string"},"target_index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["emoji","target_index"],"additionalProperties":false},{"type":"null"}]},"reaction_blocked_by":{"type":["string","null"]},"proposed_reaction":{"type":["string","null"]},"calendar":{"description":"Only with goal_tool google_calendar.","type":"object","properties":{"scheduling":{"type":"object","properties":{"phase":{"type":"string"},"tz":{"type":["string","null"]}},"required":["phase","tz"],"additionalProperties":false},"ranges_block":{"type":["string","null"]},"proposals":{"type":"array","items":{"type":"object","properties":{"starts_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"label":{"type":"string"},"valid":{"type":"boolean"}},"required":["starts_at","label","valid"],"additionalProperties":false}},"booking":{"anyOf":[{"type":"object","properties":{"label":{"type":"string"},"email":{"type":"string"},"simulated":{"type":"boolean","const":true},"valid":{"type":"boolean"},"reason":{"anyOf":[{"type":"string","enum":["outside_rules","invalid_email","calendar_unavailable"]},{"type":"null"}]}},"required":["label","email","simulated","valid","reason"],"additionalProperties":false},{"type":"null"}]},"directives_malformed":{"type":"boolean"},"calendar_unavailable":{"type":["string","null"]}},"required":["scheduling","ranges_block","proposals","booking","directives_malformed","calendar_unavailable"],"additionalProperties":false}},"required":["message","bubbles","reaction","reaction_blocked_by","proposed_reaction"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED_400: A field is missing or malformed; `fields` names each one.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"GOOGLE_CALENDAR_NOT_ENABLED_403: Google Calendar booking is not enabled for this organization yet.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"REP_NOT_FOUND_404: A rep does not exist in this workspace, is archived, or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"CALENDAR_NOT_CONNECTED_409: goal_tool is google_calendar and the workspace has no healthy Google Calendar connection.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"description":"SETTER_TEST_RATE_LIMITED_429: More than 30 Test Chat calls in a minute for this key (rotations share the count).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/Shared500"},"502":{"description":"SETTER_TEST_FAILED_502: The reply could not be generated: a model, calendar or storage call failed while answering the turn. Retry later.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["REP_NOT_FOUND_404","VALIDATION_FAILED_400","GOOGLE_CALENDAR_NOT_ENABLED_403","CALENDAR_NOT_CONNECTED_409","SETTER_TEST_RATE_LIMITED_429","SETTER_TEST_FAILED_502"]}},"/v1/setter/variants/{variant_id}":{"get":{"operationId":"setter.variants.get","summary":"Read one AI Setter variant, any status.","tags":["Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","description":"A setter variant id."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["setter:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rep_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","testing","live","archived"]},"traffic_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Bumped by every change to a content field."},"name":{"type":"string"},"goal_text":{"type":"string"},"goal_link":{"type":["string","null"]},"goal_tool":{"type":"string","enum":["manual","calendly","cal_com","google_calendar"]},"goal_link_status":{"type":"string","enum":["none","connected"]},"key_elements_text":{"type":"string"},"avoid_text":{"type":"string"},"offer_text":{"type":"string"},"icp_text":{"type":"string"},"qualifying_text":{"type":"string"},"disqualify_text":{"type":"string"},"tone_text":{"type":"string"},"style_text":{"type":"string"},"language_text":{"type":"string"},"phrases_text":{"type":"string"},"rep_name":{"type":"string"},"rep_role":{"type":"string"},"reaction_frequency":{"type":"string","enum":["off","rare","normal","frequent"]},"reaction_emojis":{"type":"array","items":{"type":"string"}},"reaction_rules":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string","description":"One of the allowed reaction emoji."},"when":{"type":"string","description":"The moment it fits, in the operator's words. At most 200 characters."}},"required":["emoji","when"],"additionalProperties":false}},"message_style":{"type":"string","enum":["single","multi"]},"objection_mode":{"type":"string","enum":["stop","rebut"]},"handoff_text":{"type":"string"},"handoff_on_uncertain":{"type":"boolean"},"few_shot":{"type":"array","items":{"type":"object","properties":{"prospect":{"type":"string","description":"A prospect message. At most 600 characters."},"reply":{"type":"string","description":"The ideal reply. At most 600 characters."}},"required":["prospect","reply"],"additionalProperties":false}},"objections":{"type":"array","items":{"type":"object","properties":{"objection":{"type":"string","description":"A known objection. At most 600 characters."},"approach":{"type":"string","description":"How to handle it. At most 600 characters."}},"required":["objection","approach"],"additionalProperties":false}},"booking_config":{"type":"object","properties":{"duration_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"buffer_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working_hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}}},"required":["mon","tue","wed","thu","fri","sat","sun"],"additionalProperties":false},"min_notice_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allow_same_day":{"type":"boolean"},"horizon_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hard_cap_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Never offered or booked beyond it. Fixed at 60; read-only."},"max_per_day":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"meeting_form":{"type":"string","enum":["meet","phone"]},"event_title":{"type":"string"},"event_description":{"type":"string"},"prospect_tz_mode":{"type":"string","enum":["campaign","fixed"]},"prospect_tz":{"type":["string","null"]},"target_calendar_id":{"type":"string"},"busy_calendar_ids":{"type":"array","items":{"type":"string"}}},"required":["duration_min","buffer_min","working_hours","min_notice_min","allow_same_day","horizon_days","hard_cap_days","max_per_day","meeting_form","event_title","event_description","prospect_tz_mode","prospect_tz","target_calendar_id","busy_calendar_ids"],"additionalProperties":false},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","status","traffic_weight","version","name","goal_text","goal_link","goal_tool","goal_link_status","key_elements_text","avoid_text","offer_text","icp_text","qualifying_text","disqualify_text","tone_text","style_text","language_text","phrases_text","rep_name","rep_role","reaction_frequency","reaction_emojis","reaction_rules","message_style","objection_mode","handoff_text","handoff_on_uncertain","few_shot","objections","booking_config","created_at","updated_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"API_SETTER_NOT_IN_PLAN_403: The organization's plan does not include the AI Setter.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"SETTER_VARIANT_NOT_FOUND_404: The variant does not exist, or its rep is not in this workspace or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["SETTER_VARIANT_NOT_FOUND_404","API_SETTER_NOT_IN_PLAN_403"]},"patch":{"operationId":"setter.variants.update","summary":"Change any field of an AI Setter variant.","description":"Send only the fields to change. A change to a content field snapshots the previous content into the version history and bumps version; a patch whose content equals the stored content cuts no version (updated_at still moves, and the change is audited). An empty patch, or a booking_config equal to the stored one alone, writes nothing. booking_config is replaced whole. A live variant serves its new content from its next reply.","tags":["Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","description":"A setter variant id."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["setter:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"Shown in the variant list. 1 to 80 characters."},"goal_text":{"type":"string","description":"Script: the goal. Every text field takes up to 4000 characters."},"goal_link":{"description":"The CTA link; null or empty clears it. At most 2000 characters.","type":["string","null"]},"goal_tool":{"type":"string","enum":["manual","calendly","cal_com","google_calendar"],"description":"How the CTA is fulfilled."},"goal_link_status":{"type":"string","enum":["none","connected"]},"key_elements_text":{"type":"string"},"avoid_text":{"type":"string"},"offer_text":{"type":"string"},"icp_text":{"type":"string"},"qualifying_text":{"type":"string"},"disqualify_text":{"type":"string"},"tone_text":{"type":"string"},"style_text":{"type":"string"},"language_text":{"type":"string"},"phrases_text":{"type":"string"},"rep_name":{"type":"string"},"rep_role":{"type":"string"},"reaction_frequency":{"type":"string","enum":["off","rare","normal","frequent"]},"reaction_emojis":{"type":"array","items":{"type":"string"},"description":"At most 4, from the allowed reaction emoji."},"reaction_rules":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string","description":"One of the allowed reaction emoji."},"when":{"type":"string","description":"The moment it fits, in the operator's words. At most 200 characters."}},"required":["emoji","when"]},"description":"At most 6."},"message_style":{"type":"string","enum":["single","multi"],"description":"One message, or several short bubbles."},"objection_mode":{"type":"string","enum":["stop","rebut"],"description":"On a soft objection: stop, or rebut and persuade."},"handoff_text":{"type":"string","description":"When to hand a live thread to a human."},"handoff_on_uncertain":{"type":"boolean","description":"Also hand off when the model is unsure."},"few_shot":{"type":"array","items":{"type":"object","properties":{"prospect":{"type":"string","description":"A prospect message. At most 600 characters."},"reply":{"type":"string","description":"The ideal reply. At most 600 characters."}},"required":["prospect","reply"]},"description":"At most 3; a fully blank row is dropped."},"objections":{"type":"array","items":{"type":"object","properties":{"objection":{"type":"string","description":"A known objection. At most 600 characters."},"approach":{"type":"string","description":"How to handle it. At most 600 characters."}},"required":["objection","approach"]},"description":"At most 6; a fully blank row is dropped."},"booking_config":{"type":"object","properties":{"duration_min":{"description":"Meeting length in minutes, 10 to 240. Default 45.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"buffer_min":{"description":"Minutes kept free around a meeting, 0 to 120. Default 0.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working_hours":{"description":"Up to 4 non-overlapping intervals per day; at least one day must have hours. Default Monday to Friday 09:00 to 17:00.","type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}}},"additionalProperties":false},"min_notice_min":{"description":"Minimum notice in minutes, 0 to 10080. Default 180.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allow_same_day":{"description":"Default true.","type":"boolean"},"horizon_days":{"description":"Days ahead offered first, 1 to 60. Default 14.","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hard_cap_days":{"description":"Read-only. Accepted only as 60, so a config read back can be sent again unchanged.","type":"number","const":60},"max_per_day":{"description":"Bookings per day, 1 to 50; null for no limit. Default null.","anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"meeting_form":{"description":"Default meet.","type":"string","enum":["meet","phone"]},"event_title":{"description":"Prospect-visible event title, at most 200 characters.","type":"string"},"event_description":{"description":"Prospect-visible event description, at most 2000 characters.","type":"string"},"prospect_tz_mode":{"description":"campaign: the campaign's time zone; fixed: prospect_tz, which is then required.","type":"string","enum":["campaign","fixed"]},"prospect_tz":{"description":"An IANA time zone.","type":["string","null"]},"target_calendar_id":{"description":"The calendar events land in. Default primary.","type":"string"},"busy_calendar_ids":{"description":"Calendars checked for conflicts, at most 10 counting the target, which is always added.","type":"array","items":{"type":"string"}}},"additionalProperties":false,"description":"The Google Calendar booking rules, read only while goal_tool is google_calendar. Sent whole: a field left out takes its default."},"traffic_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"A/B share, 0 to 100. start_test is the usual way to set it. On a testing variant it must be at least 1 and keep the rep's testing weights within 100, else 400 traffic_weight_invalid or traffic_weight_sum_exceeded; on any other status it is stored and serves nothing until start_test sets it again."}}}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rep_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","testing","live","archived"]},"traffic_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Bumped by every change to a content field."},"name":{"type":"string"},"goal_text":{"type":"string"},"goal_link":{"type":["string","null"]},"goal_tool":{"type":"string","enum":["manual","calendly","cal_com","google_calendar"]},"goal_link_status":{"type":"string","enum":["none","connected"]},"key_elements_text":{"type":"string"},"avoid_text":{"type":"string"},"offer_text":{"type":"string"},"icp_text":{"type":"string"},"qualifying_text":{"type":"string"},"disqualify_text":{"type":"string"},"tone_text":{"type":"string"},"style_text":{"type":"string"},"language_text":{"type":"string"},"phrases_text":{"type":"string"},"rep_name":{"type":"string"},"rep_role":{"type":"string"},"reaction_frequency":{"type":"string","enum":["off","rare","normal","frequent"]},"reaction_emojis":{"type":"array","items":{"type":"string"}},"reaction_rules":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string","description":"One of the allowed reaction emoji."},"when":{"type":"string","description":"The moment it fits, in the operator's words. At most 200 characters."}},"required":["emoji","when"],"additionalProperties":false}},"message_style":{"type":"string","enum":["single","multi"]},"objection_mode":{"type":"string","enum":["stop","rebut"]},"handoff_text":{"type":"string"},"handoff_on_uncertain":{"type":"boolean"},"few_shot":{"type":"array","items":{"type":"object","properties":{"prospect":{"type":"string","description":"A prospect message. At most 600 characters."},"reply":{"type":"string","description":"The ideal reply. At most 600 characters."}},"required":["prospect","reply"],"additionalProperties":false}},"objections":{"type":"array","items":{"type":"object","properties":{"objection":{"type":"string","description":"A known objection. At most 600 characters."},"approach":{"type":"string","description":"How to handle it. At most 600 characters."}},"required":["objection","approach"],"additionalProperties":false}},"booking_config":{"type":"object","properties":{"duration_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"buffer_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working_hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}}},"required":["mon","tue","wed","thu","fri","sat","sun"],"additionalProperties":false},"min_notice_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allow_same_day":{"type":"boolean"},"horizon_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hard_cap_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Never offered or booked beyond it. Fixed at 60; read-only."},"max_per_day":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"meeting_form":{"type":"string","enum":["meet","phone"]},"event_title":{"type":"string"},"event_description":{"type":"string"},"prospect_tz_mode":{"type":"string","enum":["campaign","fixed"]},"prospect_tz":{"type":["string","null"]},"target_calendar_id":{"type":"string"},"busy_calendar_ids":{"type":"array","items":{"type":"string"}}},"required":["duration_min","buffer_min","working_hours","min_notice_min","allow_same_day","horizon_days","hard_cap_days","max_per_day","meeting_form","event_title","event_description","prospect_tz_mode","prospect_tz","target_calendar_id","busy_calendar_ids"],"additionalProperties":false},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","status","traffic_weight","version","name","goal_text","goal_link","goal_tool","goal_link_status","key_elements_text","avoid_text","offer_text","icp_text","qualifying_text","disqualify_text","tone_text","style_text","language_text","phrases_text","rep_name","rep_role","reaction_frequency","reaction_emojis","reaction_rules","message_style","objection_mode","handoff_text","handoff_on_uncertain","few_shot","objections","booking_config","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED_400: A field is missing or outside the editor's limits. `fields` maps each field path (booking_config.<field> for the booking rules) to the reason, e.g. text_too_long, out_of_range, traffic_weight_sum_exceeded.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"GOOGLE_CALENDAR_NOT_ENABLED_403: Booking in Google Calendar is not enabled for this organization, and the call would move the variant onto goal_tool google_calendar or change the booking rules of a variant on it.\nAPI_SETTER_NOT_IN_PLAN_403: The organization's plan does not include the AI Setter.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"SETTER_VARIANT_NOT_FOUND_404: The variant does not exist, or its rep is not in this workspace or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["SETTER_VARIANT_NOT_FOUND_404","VALIDATION_FAILED_400","GOOGLE_CALENDAR_NOT_ENABLED_403","API_SETTER_NOT_IN_PLAN_403"]}},"/v1/setter/variants/{variant_id}/archive":{"post":{"operationId":"setter.variants.archive","summary":"Retire a variant, or stop its A/B test.","description":"The live variant cannot be archived: publish another one, or switch the rep's setter off, first.","tags":["Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","description":"A setter variant id."}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["setter:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rep_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","testing","live","archived"]},"traffic_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Bumped by every change to a content field."},"name":{"type":"string"},"goal_text":{"type":"string"},"goal_link":{"type":["string","null"]},"goal_tool":{"type":"string","enum":["manual","calendly","cal_com","google_calendar"]},"goal_link_status":{"type":"string","enum":["none","connected"]},"key_elements_text":{"type":"string"},"avoid_text":{"type":"string"},"offer_text":{"type":"string"},"icp_text":{"type":"string"},"qualifying_text":{"type":"string"},"disqualify_text":{"type":"string"},"tone_text":{"type":"string"},"style_text":{"type":"string"},"language_text":{"type":"string"},"phrases_text":{"type":"string"},"rep_name":{"type":"string"},"rep_role":{"type":"string"},"reaction_frequency":{"type":"string","enum":["off","rare","normal","frequent"]},"reaction_emojis":{"type":"array","items":{"type":"string"}},"reaction_rules":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string","description":"One of the allowed reaction emoji."},"when":{"type":"string","description":"The moment it fits, in the operator's words. At most 200 characters."}},"required":["emoji","when"],"additionalProperties":false}},"message_style":{"type":"string","enum":["single","multi"]},"objection_mode":{"type":"string","enum":["stop","rebut"]},"handoff_text":{"type":"string"},"handoff_on_uncertain":{"type":"boolean"},"few_shot":{"type":"array","items":{"type":"object","properties":{"prospect":{"type":"string","description":"A prospect message. At most 600 characters."},"reply":{"type":"string","description":"The ideal reply. At most 600 characters."}},"required":["prospect","reply"],"additionalProperties":false}},"objections":{"type":"array","items":{"type":"object","properties":{"objection":{"type":"string","description":"A known objection. At most 600 characters."},"approach":{"type":"string","description":"How to handle it. At most 600 characters."}},"required":["objection","approach"],"additionalProperties":false}},"booking_config":{"type":"object","properties":{"duration_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"buffer_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working_hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}}},"required":["mon","tue","wed","thu","fri","sat","sun"],"additionalProperties":false},"min_notice_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allow_same_day":{"type":"boolean"},"horizon_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hard_cap_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Never offered or booked beyond it. Fixed at 60; read-only."},"max_per_day":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"meeting_form":{"type":"string","enum":["meet","phone"]},"event_title":{"type":"string"},"event_description":{"type":"string"},"prospect_tz_mode":{"type":"string","enum":["campaign","fixed"]},"prospect_tz":{"type":["string","null"]},"target_calendar_id":{"type":"string"},"busy_calendar_ids":{"type":"array","items":{"type":"string"}}},"required":["duration_min","buffer_min","working_hours","min_notice_min","allow_same_day","horizon_days","hard_cap_days","max_per_day","meeting_form","event_title","event_description","prospect_tz_mode","prospect_tz","target_calendar_id","busy_calendar_ids"],"additionalProperties":false},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","status","traffic_weight","version","name","goal_text","goal_link","goal_tool","goal_link_status","key_elements_text","avoid_text","offer_text","icp_text","qualifying_text","disqualify_text","tone_text","style_text","language_text","phrases_text","rep_name","rep_role","reaction_frequency","reaction_emojis","reaction_rules","message_style","objection_mode","handoff_text","handoff_on_uncertain","few_shot","objections","booking_config","created_at","updated_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"API_SETTER_NOT_IN_PLAN_403: The organization's plan does not include the AI Setter.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"SETTER_VARIANT_NOT_FOUND_404: The variant does not exist, or its rep is not in this workspace or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"SETTER_VARIANT_LIVE_409: The variant is live. Publish another variant, or switch the rep's setter off, before archiving it.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["SETTER_VARIANT_NOT_FOUND_404","SETTER_VARIANT_LIVE_409","API_SETTER_NOT_IN_PLAN_403"]}},"/v1/setter/variants/{variant_id}/promote":{"post":{"operationId":"setter.variants.promote","summary":"End the rep's A/B test with this variant as the winner.","description":"The variant becomes the only live one; the previous live variant and the other challengers are archived. Conversations already assigned to a loser keep it.","tags":["Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","description":"A setter variant id."}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["setter:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rep_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","testing","live","archived"]},"traffic_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Bumped by every change to a content field."},"name":{"type":"string"},"goal_text":{"type":"string"},"goal_link":{"type":["string","null"]},"goal_tool":{"type":"string","enum":["manual","calendly","cal_com","google_calendar"]},"goal_link_status":{"type":"string","enum":["none","connected"]},"key_elements_text":{"type":"string"},"avoid_text":{"type":"string"},"offer_text":{"type":"string"},"icp_text":{"type":"string"},"qualifying_text":{"type":"string"},"disqualify_text":{"type":"string"},"tone_text":{"type":"string"},"style_text":{"type":"string"},"language_text":{"type":"string"},"phrases_text":{"type":"string"},"rep_name":{"type":"string"},"rep_role":{"type":"string"},"reaction_frequency":{"type":"string","enum":["off","rare","normal","frequent"]},"reaction_emojis":{"type":"array","items":{"type":"string"}},"reaction_rules":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string","description":"One of the allowed reaction emoji."},"when":{"type":"string","description":"The moment it fits, in the operator's words. At most 200 characters."}},"required":["emoji","when"],"additionalProperties":false}},"message_style":{"type":"string","enum":["single","multi"]},"objection_mode":{"type":"string","enum":["stop","rebut"]},"handoff_text":{"type":"string"},"handoff_on_uncertain":{"type":"boolean"},"few_shot":{"type":"array","items":{"type":"object","properties":{"prospect":{"type":"string","description":"A prospect message. At most 600 characters."},"reply":{"type":"string","description":"The ideal reply. At most 600 characters."}},"required":["prospect","reply"],"additionalProperties":false}},"objections":{"type":"array","items":{"type":"object","properties":{"objection":{"type":"string","description":"A known objection. At most 600 characters."},"approach":{"type":"string","description":"How to handle it. At most 600 characters."}},"required":["objection","approach"],"additionalProperties":false}},"booking_config":{"type":"object","properties":{"duration_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"buffer_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working_hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}}},"required":["mon","tue","wed","thu","fri","sat","sun"],"additionalProperties":false},"min_notice_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allow_same_day":{"type":"boolean"},"horizon_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hard_cap_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Never offered or booked beyond it. Fixed at 60; read-only."},"max_per_day":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"meeting_form":{"type":"string","enum":["meet","phone"]},"event_title":{"type":"string"},"event_description":{"type":"string"},"prospect_tz_mode":{"type":"string","enum":["campaign","fixed"]},"prospect_tz":{"type":["string","null"]},"target_calendar_id":{"type":"string"},"busy_calendar_ids":{"type":"array","items":{"type":"string"}}},"required":["duration_min","buffer_min","working_hours","min_notice_min","allow_same_day","horizon_days","hard_cap_days","max_per_day","meeting_form","event_title","event_description","prospect_tz_mode","prospect_tz","target_calendar_id","busy_calendar_ids"],"additionalProperties":false},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","status","traffic_weight","version","name","goal_text","goal_link","goal_tool","goal_link_status","key_elements_text","avoid_text","offer_text","icp_text","qualifying_text","disqualify_text","tone_text","style_text","language_text","phrases_text","rep_name","rep_role","reaction_frequency","reaction_emojis","reaction_rules","message_style","objection_mode","handoff_text","handoff_on_uncertain","few_shot","objections","booking_config","created_at","updated_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"API_SETTER_NOT_IN_PLAN_403: The organization's plan does not include the AI Setter.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"SETTER_VARIANT_NOT_FOUND_404: The variant does not exist, or its rep is not in this workspace or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["SETTER_VARIANT_NOT_FOUND_404","API_SETTER_NOT_IN_PLAN_403"]}},"/v1/setter/variants/{variant_id}/publish":{"post":{"operationId":"setter.variants.publish","summary":"Make a variant the rep's live variant.","description":"The rep's previous live variant is archived in the same transaction. Testing challengers keep running.","tags":["Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","description":"A setter variant id."}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["setter:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rep_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","testing","live","archived"]},"traffic_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Bumped by every change to a content field."},"name":{"type":"string"},"goal_text":{"type":"string"},"goal_link":{"type":["string","null"]},"goal_tool":{"type":"string","enum":["manual","calendly","cal_com","google_calendar"]},"goal_link_status":{"type":"string","enum":["none","connected"]},"key_elements_text":{"type":"string"},"avoid_text":{"type":"string"},"offer_text":{"type":"string"},"icp_text":{"type":"string"},"qualifying_text":{"type":"string"},"disqualify_text":{"type":"string"},"tone_text":{"type":"string"},"style_text":{"type":"string"},"language_text":{"type":"string"},"phrases_text":{"type":"string"},"rep_name":{"type":"string"},"rep_role":{"type":"string"},"reaction_frequency":{"type":"string","enum":["off","rare","normal","frequent"]},"reaction_emojis":{"type":"array","items":{"type":"string"}},"reaction_rules":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string","description":"One of the allowed reaction emoji."},"when":{"type":"string","description":"The moment it fits, in the operator's words. At most 200 characters."}},"required":["emoji","when"],"additionalProperties":false}},"message_style":{"type":"string","enum":["single","multi"]},"objection_mode":{"type":"string","enum":["stop","rebut"]},"handoff_text":{"type":"string"},"handoff_on_uncertain":{"type":"boolean"},"few_shot":{"type":"array","items":{"type":"object","properties":{"prospect":{"type":"string","description":"A prospect message. At most 600 characters."},"reply":{"type":"string","description":"The ideal reply. At most 600 characters."}},"required":["prospect","reply"],"additionalProperties":false}},"objections":{"type":"array","items":{"type":"object","properties":{"objection":{"type":"string","description":"A known objection. At most 600 characters."},"approach":{"type":"string","description":"How to handle it. At most 600 characters."}},"required":["objection","approach"],"additionalProperties":false}},"booking_config":{"type":"object","properties":{"duration_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"buffer_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working_hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}}},"required":["mon","tue","wed","thu","fri","sat","sun"],"additionalProperties":false},"min_notice_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allow_same_day":{"type":"boolean"},"horizon_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hard_cap_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Never offered or booked beyond it. Fixed at 60; read-only."},"max_per_day":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"meeting_form":{"type":"string","enum":["meet","phone"]},"event_title":{"type":"string"},"event_description":{"type":"string"},"prospect_tz_mode":{"type":"string","enum":["campaign","fixed"]},"prospect_tz":{"type":["string","null"]},"target_calendar_id":{"type":"string"},"busy_calendar_ids":{"type":"array","items":{"type":"string"}}},"required":["duration_min","buffer_min","working_hours","min_notice_min","allow_same_day","horizon_days","hard_cap_days","max_per_day","meeting_form","event_title","event_description","prospect_tz_mode","prospect_tz","target_calendar_id","busy_calendar_ids"],"additionalProperties":false},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","status","traffic_weight","version","name","goal_text","goal_link","goal_tool","goal_link_status","key_elements_text","avoid_text","offer_text","icp_text","qualifying_text","disqualify_text","tone_text","style_text","language_text","phrases_text","rep_name","rep_role","reaction_frequency","reaction_emojis","reaction_rules","message_style","objection_mode","handoff_text","handoff_on_uncertain","few_shot","objections","booking_config","created_at","updated_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"API_SETTER_NOT_IN_PLAN_403: The organization's plan does not include the AI Setter.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"SETTER_VARIANT_NOT_FOUND_404: The variant does not exist, or its rep is not in this workspace or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["SETTER_VARIANT_NOT_FOUND_404","API_SETTER_NOT_IN_PLAN_403"]}},"/v1/setter/variants/{variant_id}/start-test":{"post":{"operationId":"setter.variants.start_test","summary":"Put a variant into the rep's A/B test as a challenger.","description":"The variant serves traffic_weight percent of new conversations and the live variant takes the rest. Calling it again on a testing variant resets its weight. The live variant cannot be a challenger, and a rep's testing weights stay within 100. Archive the variant to stop its test.","tags":["Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","description":"A setter variant id."}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["setter:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"traffic_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The challenger's share, 1 to 100."}},"required":["traffic_weight"]}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"rep_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string","enum":["draft","testing","live","archived"]},"traffic_weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Bumped by every change to a content field."},"name":{"type":"string"},"goal_text":{"type":"string"},"goal_link":{"type":["string","null"]},"goal_tool":{"type":"string","enum":["manual","calendly","cal_com","google_calendar"]},"goal_link_status":{"type":"string","enum":["none","connected"]},"key_elements_text":{"type":"string"},"avoid_text":{"type":"string"},"offer_text":{"type":"string"},"icp_text":{"type":"string"},"qualifying_text":{"type":"string"},"disqualify_text":{"type":"string"},"tone_text":{"type":"string"},"style_text":{"type":"string"},"language_text":{"type":"string"},"phrases_text":{"type":"string"},"rep_name":{"type":"string"},"rep_role":{"type":"string"},"reaction_frequency":{"type":"string","enum":["off","rare","normal","frequent"]},"reaction_emojis":{"type":"array","items":{"type":"string"}},"reaction_rules":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string","description":"One of the allowed reaction emoji."},"when":{"type":"string","description":"The moment it fits, in the operator's words. At most 200 characters."}},"required":["emoji","when"],"additionalProperties":false}},"message_style":{"type":"string","enum":["single","multi"]},"objection_mode":{"type":"string","enum":["stop","rebut"]},"handoff_text":{"type":"string"},"handoff_on_uncertain":{"type":"boolean"},"few_shot":{"type":"array","items":{"type":"object","properties":{"prospect":{"type":"string","description":"A prospect message. At most 600 characters."},"reply":{"type":"string","description":"The ideal reply. At most 600 characters."}},"required":["prospect","reply"],"additionalProperties":false}},"objections":{"type":"array","items":{"type":"object","properties":{"objection":{"type":"string","description":"A known objection. At most 600 characters."},"approach":{"type":"string","description":"How to handle it. At most 600 characters."}},"required":["objection","approach"],"additionalProperties":false}},"booking_config":{"type":"object","properties":{"duration_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"buffer_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working_hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}}},"required":["mon","tue","wed","thu","fri","sat","sun"],"additionalProperties":false},"min_notice_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allow_same_day":{"type":"boolean"},"horizon_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hard_cap_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Never offered or booked beyond it. Fixed at 60; read-only."},"max_per_day":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"meeting_form":{"type":"string","enum":["meet","phone"]},"event_title":{"type":"string"},"event_description":{"type":"string"},"prospect_tz_mode":{"type":"string","enum":["campaign","fixed"]},"prospect_tz":{"type":["string","null"]},"target_calendar_id":{"type":"string"},"busy_calendar_ids":{"type":"array","items":{"type":"string"}}},"required":["duration_min","buffer_min","working_hours","min_notice_min","allow_same_day","horizon_days","hard_cap_days","max_per_day","meeting_form","event_title","event_description","prospect_tz_mode","prospect_tz","target_calendar_id","busy_calendar_ids"],"additionalProperties":false},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","rep_id","status","traffic_weight","version","name","goal_text","goal_link","goal_tool","goal_link_status","key_elements_text","avoid_text","offer_text","icp_text","qualifying_text","disqualify_text","tone_text","style_text","language_text","phrases_text","rep_name","rep_role","reaction_frequency","reaction_emojis","reaction_rules","message_style","objection_mode","handoff_text","handoff_on_uncertain","few_shot","objections","booking_config","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED_400: A field is missing or outside the editor's limits. `fields` maps each field path (booking_config.<field> for the booking rules) to the reason, e.g. text_too_long, out_of_range, traffic_weight_sum_exceeded.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"API_SETTER_NOT_IN_PLAN_403: The organization's plan does not include the AI Setter.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"SETTER_VARIANT_NOT_FOUND_404: The variant does not exist, or its rep is not in this workspace or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["SETTER_VARIANT_NOT_FOUND_404","VALIDATION_FAILED_400","API_SETTER_NOT_IN_PLAN_403"]}},"/v1/setter/variants/{variant_id}/versions":{"get":{"operationId":"setter.variants.versions.list","summary":"List a variant's earlier contents, newest version first.","description":"The current content is on the variant itself, not in this list.","tags":["Setter"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"variant_id","in":"path","required":true,"schema":{"type":"string","description":"A setter variant id."}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["setter:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"variant_id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The version the variant had before the edit."},"config":{"type":"object","properties":{"name":{"type":"string"},"goal_text":{"type":"string"},"goal_link":{"type":["string","null"]},"goal_tool":{"type":"string"},"goal_link_status":{"type":"string"},"key_elements_text":{"type":"string"},"avoid_text":{"type":"string"},"offer_text":{"type":"string"},"icp_text":{"type":"string"},"qualifying_text":{"type":"string"},"disqualify_text":{"type":"string"},"tone_text":{"type":"string"},"style_text":{"type":"string"},"language_text":{"type":"string"},"phrases_text":{"type":"string"},"rep_name":{"type":"string"},"rep_role":{"type":"string"},"reaction_frequency":{"type":"string"},"reaction_emojis":{"type":"array","items":{"type":"string"}},"reaction_rules":{"type":"array","items":{"type":"object","properties":{"emoji":{"type":"string","description":"One of the allowed reaction emoji."},"when":{"type":"string","description":"The moment it fits, in the operator's words. At most 200 characters."}},"required":["emoji","when"],"additionalProperties":false}},"message_style":{"type":"string"},"objection_mode":{"type":"string"},"handoff_text":{"type":"string"},"handoff_on_uncertain":{"type":"boolean"},"few_shot":{"type":"array","items":{"type":"object","properties":{"prospect":{"type":"string","description":"A prospect message. At most 600 characters."},"reply":{"type":"string","description":"The ideal reply. At most 600 characters."}},"required":["prospect","reply"],"additionalProperties":false}},"objections":{"type":"array","items":{"type":"object","properties":{"objection":{"type":"string","description":"A known objection. At most 600 characters."},"approach":{"type":"string","description":"How to handle it. At most 600 characters."}},"required":["objection","approach"],"additionalProperties":false}},"booking_config":{"type":"object","properties":{"duration_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"buffer_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"working_hours":{"type":"object","properties":{"mon":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"tue":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"wed":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"thu":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"fri":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sat":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}},"sun":{"type":"array","items":{"type":"array","prefixItems":[{"type":"string"},{"type":"string"}],"items":false,"minItems":2,"maxItems":2,"description":"[from, to] as HH:MM in the owner's (the target calendar's) time zone; to may be 24:00."}}},"required":["mon","tue","wed","thu","fri","sat","sun"],"additionalProperties":false},"min_notice_min":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"allow_same_day":{"type":"boolean"},"horizon_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hard_cap_days":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Never offered or booked beyond it. Fixed at 60; read-only."},"max_per_day":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"meeting_form":{"type":"string","enum":["meet","phone"]},"event_title":{"type":"string"},"event_description":{"type":"string"},"prospect_tz_mode":{"type":"string","enum":["campaign","fixed"]},"prospect_tz":{"type":["string","null"]},"target_calendar_id":{"type":"string"},"busy_calendar_ids":{"type":"array","items":{"type":"string"}}},"required":["duration_min","buffer_min","working_hours","min_notice_min","allow_same_day","horizon_days","hard_cap_days","max_per_day","meeting_form","event_title","event_description","prospect_tz_mode","prospect_tz","target_calendar_id","busy_calendar_ids"],"additionalProperties":false}},"additionalProperties":false,"description":"A field the snapshot predates is absent."},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","variant_id","version","config","created_at"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"API_SETTER_NOT_IN_PLAN_403: The organization's plan does not include the AI Setter.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"SETTER_VARIANT_NOT_FOUND_404: The variant does not exist, or its rep is not in this workspace or is outside the key's rep restriction.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["SETTER_VARIANT_NOT_FOUND_404","API_SETTER_NOT_IN_PLAN_403"]}},"/v1/suppressions":{"get":{"operationId":"suppressions.list","summary":"Leads marked not_interested: outreach never contacts them.","tags":["Suppressions"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"lead_id":{"type":"string"},"ig_handle":{"type":["string","null"]},"since":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"The lead's last update, which is when it was suppressed unless it changed since."}},"required":["lead_id","ig_handle","since"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":[]},"post":{"operationId":"suppressions.add","summary":"Suppress Instagram handles: every lead with the handle becomes not_interested, and an unknown handle becomes a suppressed lead.","tags":["Suppressions"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["leads:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ig_handles":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"string"}}},"required":["ig_handles"]}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"ig_handle":{"type":"string"},"lead_id":{"type":"string"},"result":{"type":"string","enum":["suppressed","already_suppressed","created_suppressed"]}},"required":["ig_handle","lead_id","result"],"additionalProperties":false}}},"required":["results"],"additionalProperties":false},{"type":"object","properties":{"replayed":{"type":"boolean","const":true},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"ids":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["replayed","status","ids"],"additionalProperties":false}]}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"description":"LEADS_DAILY_LIMIT_429: The organization reached its daily limit of leads created through the API.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["LEADS_DAILY_LIMIT_429"]}},"/v1/suppressions/{ig_handle}":{"delete":{"operationId":"suppressions.remove","summary":"Lift a suppression: the handle's not_interested leads go back to new.","tags":["Suppressions"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"ig_handle","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":100}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"lead_id":{"type":"string"},"status":{"type":"string","const":"new"}},"required":["lead_id","status"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"SUPPRESSION_NOT_FOUND_404: No suppressed lead with this handle in this workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["SUPPRESSION_NOT_FOUND_404"]}},"/v1/tags":{"get":{"operationId":"tags.list","summary":"Every tag used on the workspace's leads, alphabetical.","tags":["Leads"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["leads:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"string"}}},"required":["data"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":[]}},"/v1/templates":{"get":{"operationId":"templates.list","summary":"List the workspace's message templates, newest first.","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"category","in":"query","required":false,"schema":{"type":"string","enum":["first_touch","follow_up_1","follow_up_2","follow_up_3","breakup"]}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["templates:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"category":{"type":"string","enum":["first_touch","follow_up_1","follow_up_2","follow_up_3","breakup"]},"content":{"type":"string"},"variant":{"anyOf":[{"type":"string","enum":["A","B"]},{"type":"null"}]},"platform":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","category","content","variant","platform","version","created_at","updated_at"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":[]},"post":{"operationId":"templates.create","summary":"Create a message template.","description":"The content may carry placeholders ({{first_name}}, {{custom.<key>}}) and version groups ({{option|option}}); check it first with POST /v1/templates/validate. Every template targets Instagram.","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["templates:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"category":{"type":"string","enum":["first_touch","follow_up_1","follow_up_2","follow_up_3","breakup"]},"content":{"type":"string"},"variant":{"anyOf":[{"type":"string","enum":["A","B"]},{"type":"null"}]}},"required":["name","category","content"]}}}},"responses":{"201":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"category":{"type":"string","enum":["first_touch","follow_up_1","follow_up_2","follow_up_3","breakup"]},"content":{"type":"string"},"variant":{"anyOf":[{"type":"string","enum":["A","B"]},{"type":"null"}]},"platform":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","category","content","variant","platform","version","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED_400: A field is out of range: name 1 to 80 characters, content 1 to 2000 characters after trimming.\nTEMPLATE_SPINTAX_INVALID_400: A {{option|option}} group in the content does not parse (unclosed, nested or with an empty option).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["VALIDATION_FAILED_400","TEMPLATE_SPINTAX_INVALID_400"]}},"/v1/templates/{template_id}":{"delete":{"operationId":"templates.delete","summary":"Delete a template and its version history.","description":"Campaign steps that used the template keep their place with no template, and sent messages keep their text.","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["templates:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":true,"responses":{"204":{"description":"No content","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"TEMPLATE_NOT_FOUND_404: No template with this id exists in the key's workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["TEMPLATE_NOT_FOUND_404"]},"get":{"operationId":"templates.get","summary":"Read one template.","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["templates:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"category":{"type":"string","enum":["first_touch","follow_up_1","follow_up_2","follow_up_3","breakup"]},"content":{"type":"string"},"variant":{"anyOf":[{"type":"string","enum":["A","B"]},{"type":"null"}]},"platform":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","category","content","variant","platform","version","created_at","updated_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"TEMPLATE_NOT_FOUND_404: No template with this id exists in the key's workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["TEMPLATE_NOT_FOUND_404"]},"patch":{"operationId":"templates.update","summary":"Change a template's name, category, content or variant.","description":"Send only the fields to change; variant null clears it. A content change snapshots the previous content into the version history and bumps version.","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["templates:write"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"category":{"type":"string","enum":["first_touch","follow_up_1","follow_up_2","follow_up_3","breakup"]},"content":{"type":"string"},"variant":{"anyOf":[{"type":"string","enum":["A","B"]},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"category":{"type":"string","enum":["first_touch","follow_up_1","follow_up_2","follow_up_3","breakup"]},"content":{"type":"string"},"variant":{"anyOf":[{"type":"string","enum":["A","B"]},{"type":"null"}]},"platform":{"type":"string"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","category","content","variant","platform","version","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED_400: A field is out of range: name 1 to 80 characters, content 1 to 2000 characters after trimming.\nTEMPLATE_SPINTAX_INVALID_400: A {{option|option}} group in the content does not parse (unclosed, nested or with an empty option).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"TEMPLATE_NOT_FOUND_404: No template with this id exists in the key's workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["TEMPLATE_NOT_FOUND_404","VALIDATION_FAILED_400","TEMPLATE_SPINTAX_INVALID_400"]}},"/v1/templates/{template_id}/stats":{"get":{"operationId":"templates.stats","summary":"Sends and replies of one template.","description":"total_sent counts every DM sent through the template, follow-ups included; leads_reached the distinct leads they went to; total_replied those of them who answered after the first DM or were marked replied or converted. reply_rate is total_replied / leads_reached as a percentage with one decimal. Inbound leads are left out.","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["templates:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"template_id":{"type":"string"},"total_sent":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"leads_reached":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"total_replied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"reply_rate":{"type":"number"}},"required":["template_id","total_sent","leads_reached","total_replied","reply_rate"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"TEMPLATE_NOT_FOUND_404: No template with this id exists in the key's workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["TEMPLATE_NOT_FOUND_404"]}},"/v1/templates/{template_id}/versions":{"get":{"operationId":"templates.versions.list","summary":"List a template's earlier contents, newest version first.","description":"The current content is on the template itself, not in this list.","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["templates:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"content":{"type":"string"},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["version","content","created_at"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"TEMPLATE_NOT_FOUND_404: No template with this id exists in the key's workspace.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["TEMPLATE_NOT_FOUND_404"]}},"/v1/templates/spintax-proposals":{"post":{"operationId":"templates.spintax.propose","summary":"Propose version groups for a template body (AI).","description":"Returns the body with proposed {{option|option}} groups. Nothing is saved: send the content to templates.create or templates.update to keep it. Ten proposals per minute per key creator, shared with the app. A replay of an Idempotency-Key answers { replayed: true } without the proposal, which is never stored. A 422 is stored against its Idempotency-Key like every refusal of the handler, so a retry after it needs a new key; a 429 and a 502 release the key, so the same key may be retried after Retry-After.","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["templates:write"],"x-dmhero-rate-class":"heavy","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","maxLength":20000}},"required":["content"]}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string"},"groups":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"combinations":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["content","groups","combinations"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED_400: A field is out of range: name 1 to 80 characters, content 1 to 2000 characters after trimming.\nTEMPLATE_SPINTAX_INVALID_400: A {{option|option}} group in the content does not parse (unclosed, nested or with an empty option).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"422":{"description":"TEMPLATE_SPINTAX_EMPTY_422: Nothing in the body can be safely varied.\nTEMPLATE_SPINTAX_REFUSED_422: The model declined to vary this body.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"description":"TEMPLATE_SPINTAX_RATE_LIMITED_429: More than ten proposals in a minute for the key's creator, counted together with the app.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"$ref":"#/components/responses/Shared500"},"502":{"description":"TEMPLATE_SPINTAX_FAILED_502: The model call failed, ran past 110 seconds, or its answer could not be read. Retry later.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["VALIDATION_FAILED_400","TEMPLATE_SPINTAX_INVALID_400","TEMPLATE_SPINTAX_EMPTY_422","TEMPLATE_SPINTAX_REFUSED_422","TEMPLATE_SPINTAX_RATE_LIMITED_429","TEMPLATE_SPINTAX_FAILED_502"]}},"/v1/templates/validate":{"post":{"operationId":"templates.validate","summary":"Check a template body before saving it.","description":"valid says whether templates.create would accept the content. unknown_custom_fields lists {{custom.<key>}} tokens naming a field the workspace has not defined: such a template saves, but every lead is withheld from sending until the field exists and has a value. spintax is null when the body has no version groups or they do not parse.","tags":["Templates"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["templates:read"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"content":{"type":"string","maxLength":20000}},"required":["content"]}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"],"additionalProperties":false}},"placeholders":{"type":"array","items":{"type":"string"}},"custom_field_keys":{"type":"array","items":{"type":"string"}},"unknown_custom_fields":{"type":"array","items":{"type":"string"}},"spintax":{"anyOf":[{"type":"object","properties":{"groups":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"combinations":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["groups","combinations"],"additionalProperties":false},{"type":"null"}]}},"required":["valid","errors","placeholders","custom_field_keys","unknown_custom_fields","spintax"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":[]}},"/v1/webhook-deliveries/{delivery_id}/redeliver":{"post":{"operationId":"webhooks.deliveries.redeliver","summary":"Send a finished delivery again: the same delivery id, event id and payload.","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"delivery_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"The delivery id (uuid)."}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["webhooks:manage"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"202":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"delivery_id":{"type":"string"},"status":{"type":"string","enum":["pending","running","delivered","failed","cancelled"]}},"required":["delivery_id","status"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"WEBHOOK_DELIVERY_NOT_FOUND_404: No delivery with this id exists for an endpoint this key can see.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"WEBHOOK_ENDPOINT_INACTIVE_409: The endpoint is disabled; enable it first.\nWEBHOOK_DELIVERY_IN_FLIGHT_409: The delivery is still pending or being sent; only a finished one can be redelivered.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["WEBHOOK_DELIVERY_NOT_FOUND_404","WEBHOOK_ENDPOINT_INACTIVE_409","WEBHOOK_DELIVERY_IN_FLIGHT_409"]}},"/v1/webhook-endpoints":{"get":{"operationId":"webhooks.endpoints.list","summary":"The workspace's webhook endpoints (at most 15).","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["webhooks:manage"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url_host":{"type":"string","description":"The host of the endpoint's URL; the URL itself is never returned."},"preset":{"type":"string","enum":["clay","generic","slack"]},"schema_version":{"type":"string"},"event_types":{"type":"array","items":{"type":"string"}},"campaign_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"ig_account_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"include_bulk":{"type":"boolean"},"auth_header_name":{"type":["string","null"]},"is_active":{"type":"boolean"},"disabled_reason":{"type":["string","null"]},"paused_until":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"consecutive_failures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_success_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"last_failure_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"last_status_code":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"secret_rotated_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"queued_deliveries":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","url_host","preset","schema_version","event_types","campaign_ids","ig_account_ids","include_bulk","auth_header_name","is_active","disabled_reason","paused_until","consecutive_failures","last_success_at","last_failure_at","last_status_code","secret_rotated_at","queued_deliveries","created_at","updated_at"],"additionalProperties":false}},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["data","limit"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":[]},"post":{"operationId":"webhooks.endpoints.create","summary":"Create a webhook endpoint. The signing secret is returned once, in this response.","description":"Always a generic endpoint. A replay of the same Idempotency-Key answers the endpoint with signing_secret null: the secret is never shown twice.","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["webhooks:manage"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":100},"url":{"type":"string","maxLength":2048,"description":"https URL of your receiver. Never shown again: responses carry its host only."},"event_types":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"string","maxLength":100},"description":"Types from GET /v1/webhook-events."},"campaign_ids":{"description":"Only events about these campaigns (uuids); null or empty for every one.","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":64}},{"type":"null"}]},"ig_account_ids":{"description":"Only events about these reps (uuids); null or empty for every one. An event about no rep arrives only when it reports a job or a discovery run started by the API key that created this endpoint, or by a key rotated from it.","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":64}},{"type":"null"}]},"include_bulk":{"description":"Also receive events of mass operations (imports, bulk actions).","type":"boolean"},"auth_header":{"description":"A header the dispatcher sends with every delivery; null removes it.","anyOf":[{"type":"null"},{"type":"object","properties":{"name":{"description":"Header name, e.g. x-api-token.","type":"string","maxLength":64},"value":{"description":"Header value, stored encrypted and never returned.","type":"string","maxLength":1024}}}]}},"required":["name","url","event_types"]}}}},"responses":{"201":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"endpoint":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url_host":{"type":"string","description":"The host of the endpoint's URL; the URL itself is never returned."},"preset":{"type":"string","enum":["clay","generic","slack"]},"schema_version":{"type":"string"},"event_types":{"type":"array","items":{"type":"string"}},"campaign_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"ig_account_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"include_bulk":{"type":"boolean"},"auth_header_name":{"type":["string","null"]},"is_active":{"type":"boolean"},"disabled_reason":{"type":["string","null"]},"paused_until":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"consecutive_failures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_success_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"last_failure_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"last_status_code":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"secret_rotated_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"queued_deliveries":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","url_host","preset","schema_version","event_types","campaign_ids","ig_account_ids","include_bulk","auth_header_name","is_active","disabled_reason","paused_until","consecutive_failures","last_success_at","last_failure_at","last_status_code","secret_rotated_at","queued_deliveries","created_at","updated_at"],"additionalProperties":false},"signing_secret":{"type":["string","null"]}},"required":["endpoint","signing_secret"],"additionalProperties":false}}}},"400":{"description":"WEBHOOK_URL_INVALID_400: The url is not an https URL on the public internet (`reason` says why), or it points at DM Hero itself (`own_host`).\nWEBHOOK_REP_FILTER_REQUIRED_400: A rep-restricted key must filter the endpoint to a non-empty subset of its reps (`ig_account_ids`).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"WEBHOOK_TIER_NOT_INCLUDED_403: An event type the request adds, or a setting it switches on, is not included in the organization's API access; the message says what it needs. Removing event types, or changing the url or the auth header of an endpoint that still lists one, is always allowed. Contact the DM Hero team to extend the access.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"WEBHOOK_ENDPOINT_LIMIT_409: The workspace already has 15 endpoints.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["WEBHOOK_URL_INVALID_400","WEBHOOK_REP_FILTER_REQUIRED_400","WEBHOOK_TIER_NOT_INCLUDED_403","WEBHOOK_ENDPOINT_LIMIT_409"]}},"/v1/webhook-endpoints/{endpoint_id}":{"delete":{"operationId":"webhooks.endpoints.delete","summary":"Delete a webhook endpoint and its delivery log.","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"The endpoint id (uuid)."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["webhooks:manage"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":true,"responses":{"204":{"description":"No content","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"WEBHOOK_ENDPOINT_NOT_FOUND_404: No webhook endpoint with this id exists in this workspace (or, for a rep-restricted key, within its reps).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["WEBHOOK_ENDPOINT_NOT_FOUND_404"]},"get":{"operationId":"webhooks.endpoints.get","summary":"One webhook endpoint.","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"The endpoint id (uuid)."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["webhooks:manage"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url_host":{"type":"string","description":"The host of the endpoint's URL; the URL itself is never returned."},"preset":{"type":"string","enum":["clay","generic","slack"]},"schema_version":{"type":"string"},"event_types":{"type":"array","items":{"type":"string"}},"campaign_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"ig_account_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"include_bulk":{"type":"boolean"},"auth_header_name":{"type":["string","null"]},"is_active":{"type":"boolean"},"disabled_reason":{"type":["string","null"]},"paused_until":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"consecutive_failures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_success_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"last_failure_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"last_status_code":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"secret_rotated_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"queued_deliveries":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","url_host","preset","schema_version","event_types","campaign_ids","ig_account_ids","include_bulk","auth_header_name","is_active","disabled_reason","paused_until","consecutive_failures","last_success_at","last_failure_at","last_status_code","secret_rotated_at","queued_deliveries","created_at","updated_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"WEBHOOK_ENDPOINT_NOT_FOUND_404: No webhook endpoint with this id exists in this workspace (or, for a rep-restricted key, within its reps).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["WEBHOOK_ENDPOINT_NOT_FOUND_404"]},"patch":{"operationId":"webhooks.endpoints.update","summary":"Change a webhook endpoint. Only the fields sent change.","description":"is_active: true re-enables a disabled endpoint and clears its failure streak.","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"The endpoint id (uuid)."}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["webhooks:manage"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":100},"url":{"type":"string","maxLength":2048,"description":"https URL of your receiver. Never shown again: responses carry its host only."},"event_types":{"minItems":1,"maxItems":40,"type":"array","items":{"type":"string","maxLength":100},"description":"Types from GET /v1/webhook-events."},"campaign_ids":{"description":"Only events about these campaigns (uuids); null or empty for every one.","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":64}},{"type":"null"}]},"ig_account_ids":{"description":"Only events about these reps (uuids); null or empty for every one. An event about no rep arrives only when it reports a job or a discovery run started by the API key that created this endpoint, or by a key rotated from it.","anyOf":[{"maxItems":100,"type":"array","items":{"type":"string","maxLength":64}},{"type":"null"}]},"include_bulk":{"description":"Also receive events of mass operations (imports, bulk actions).","type":"boolean"},"auth_header":{"description":"A header the dispatcher sends with every delivery; null removes it.","anyOf":[{"type":"null"},{"type":"object","properties":{"name":{"description":"Header name, e.g. x-api-token.","type":"string","maxLength":64},"value":{"description":"Header value, stored encrypted and never returned.","type":"string","maxLength":1024}}}]},"is_active":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url_host":{"type":"string","description":"The host of the endpoint's URL; the URL itself is never returned."},"preset":{"type":"string","enum":["clay","generic","slack"]},"schema_version":{"type":"string"},"event_types":{"type":"array","items":{"type":"string"}},"campaign_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"ig_account_ids":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]},"include_bulk":{"type":"boolean"},"auth_header_name":{"type":["string","null"]},"is_active":{"type":"boolean"},"disabled_reason":{"type":["string","null"]},"paused_until":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"consecutive_failures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"last_success_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"last_failure_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"last_status_code":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"secret_rotated_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"queued_deliveries":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","name","url_host","preset","schema_version","event_types","campaign_ids","ig_account_ids","include_bulk","auth_header_name","is_active","disabled_reason","paused_until","consecutive_failures","last_success_at","last_failure_at","last_status_code","secret_rotated_at","queued_deliveries","created_at","updated_at"],"additionalProperties":false}}}},"400":{"description":"WEBHOOK_URL_INVALID_400: The url is not an https URL on the public internet (`reason` says why), or it points at DM Hero itself (`own_host`).\nWEBHOOK_REP_FILTER_REQUIRED_400: A rep-restricted key must filter the endpoint to a non-empty subset of its reps (`ig_account_ids`).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"description":"WEBHOOK_TIER_NOT_INCLUDED_403: An event type the request adds, or a setting it switches on, is not included in the organization's API access; the message says what it needs. Removing event types, or changing the url or the auth header of an endpoint that still lists one, is always allowed. Contact the DM Hero team to extend the access.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"WEBHOOK_ENDPOINT_NOT_FOUND_404: No webhook endpoint with this id exists in this workspace (or, for a rep-restricted key, within its reps).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["WEBHOOK_ENDPOINT_NOT_FOUND_404","WEBHOOK_URL_INVALID_400","WEBHOOK_REP_FILTER_REQUIRED_400","WEBHOOK_TIER_NOT_INCLUDED_403"]}},"/v1/webhook-endpoints/{endpoint_id}/deliveries":{"get":{"operationId":"webhooks.deliveries.list","summary":"One endpoint's deliveries, newest first. No payloads.","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"The endpoint id (uuid)."}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":2048}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["pending","running","delivered","failed","cancelled"]}},{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["webhooks:manage"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"event_id":{"type":"string"},"endpoint_id":{"type":"string"},"endpoint_name":{"type":"string"},"event_type":{"type":"string"},"source":{"type":"string"},"status":{"type":"string","enum":["pending","running","delivered","failed","cancelled"]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"run_after":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"last_status_code":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"last_error":{"type":["string","null"]},"delivered_at":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},{"type":"null"}]},"created_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"updated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["id","event_id","endpoint_id","endpoint_name","event_type","source","status","attempts","run_after","last_status_code","last_error","delivered_at","created_at","updated_at"],"additionalProperties":false}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["data","has_more","next_cursor"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"WEBHOOK_ENDPOINT_NOT_FOUND_404: No webhook endpoint with this id exists in this workspace (or, for a rep-restricted key, within its reps).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["WEBHOOK_ENDPOINT_NOT_FOUND_404"]}},"/v1/webhook-endpoints/{endpoint_id}/rotate-secret":{"post":{"operationId":"webhooks.endpoints.rotate_secret","summary":"A new signing secret, returned once. The previous one keeps co-signing for 24 hours.","description":"A replay of the same Idempotency-Key answers signing_secret null: the secret is never shown twice.","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"The endpoint id (uuid)."}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["webhooks:manage"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"endpoint_id":{"type":"string"},"signing_secret":{"type":["string","null"]},"secret_rotated_at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["endpoint_id","signing_secret","secret_rotated_at"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"WEBHOOK_ENDPOINT_NOT_FOUND_404: No webhook endpoint with this id exists in this workspace (or, for a rep-restricted key, within its reps).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"WEBHOOK_SECRET_IN_GRACE_409: The previous secret still signs for 24 hours after a rotation; `rotatable_at` says when the next one is possible.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":["WEBHOOK_ENDPOINT_NOT_FOUND_404","WEBHOOK_SECRET_IN_GRACE_409"]}},"/v1/webhook-endpoints/{endpoint_id}/test":{"post":{"operationId":"webhooks.endpoints.test","summary":"Queue one test.ping to this endpoint, whatever it subscribes to.","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","maxLength":64,"description":"The endpoint id (uuid)."}},{"$ref":"#/components/parameters/DMHeroVersion"},{"$ref":"#/components/parameters/IdempotencyKey"}],"x-dmhero-scopes":["webhooks:manage"],"x-dmhero-rate-class":"write","x-dmhero-idempotency":"optional","x-dmhero-destructive":false,"responses":{"202":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"endpoint_id":{"type":"string"},"enqueued":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["endpoint_id","enqueued"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"404":{"description":"WEBHOOK_ENDPOINT_NOT_FOUND_404: No webhook endpoint with this id exists in this workspace (or, for a rep-restricted key, within its reps).","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"WEBHOOK_TEST_PENDING_409: A test event for this endpoint is still queued or being sent.\nWEBHOOK_ENDPOINT_INACTIVE_409: The endpoint is disabled; enable it first.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"description":"WEBHOOK_TEST_NOT_ENQUEUED_503: The test event could not be queued (outbound webhooks are switched off). Retry later.","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-dmhero-error-codes":["WEBHOOK_ENDPOINT_NOT_FOUND_404","WEBHOOK_TEST_PENDING_409","WEBHOOK_ENDPOINT_INACTIVE_409","WEBHOOK_TEST_NOT_ENQUEUED_503"]}},"/v1/webhook-events":{"get":{"operationId":"webhooks.events.list","summary":"Every event type an endpoint can subscribe to.","tags":["Webhooks"],"security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/DMHeroVersion"}],"x-dmhero-scopes":["webhooks:manage"],"x-dmhero-rate-class":"read","x-dmhero-idempotency":"none","x-dmhero-destructive":false,"responses":{"200":{"description":"Success","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"RateLimit-Limit":{"$ref":"#/components/headers/RateLimit-Limit"},"RateLimit-Remaining":{"$ref":"#/components/headers/RateLimit-Remaining"},"RateLimit-Reset":{"$ref":"#/components/headers/RateLimit-Reset"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","properties":{"schema_version":{"type":"string"},"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"description":{"type":"string"},"carries_lead":{"type":"boolean"},"high_volume":{"type":"boolean","description":"Can arrive by the thousand; no preset subscribes to it."}},"required":["type","description","carries_lead","high_volume"],"additionalProperties":false}}},"required":["schema_version","data"],"additionalProperties":false}}}},"400":{"$ref":"#/components/responses/Shared400"},"401":{"$ref":"#/components/responses/Shared401"},"402":{"$ref":"#/components/responses/Shared402"},"403":{"$ref":"#/components/responses/Shared403"},"423":{"$ref":"#/components/responses/Shared423"},"429":{"$ref":"#/components/responses/Shared429"},"500":{"$ref":"#/components/responses/Shared500"},"503":{"$ref":"#/components/responses/Shared503"}},"x-dmhero-error-codes":[]}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"dmh_live_... key, also accepted as X-API-Key"}},"schemas":{"Error":{"type":"object","required":["error","message","code","request_id","doc_url"],"properties":{"error":{"type":"string","description":"snake_case discriminator, stable across releases"},"message":{"type":"string","description":"User-readable sentence"},"code":{"type":"string","description":"<DOMAIN>_<KIND>_<STATUS>, stable identifier"},"request_id":{"type":"string","description":"Our id of the request, also in DMHero-Request-Id"},"doc_url":{"type":"string","format":"uri"},"fields":{"type":"object","additionalProperties":{"type":"string"},"description":"Validation errors by field"}},"additionalProperties":true}},"headers":{"DMHero-Request-Id":{"description":"Our id of the request","schema":{"type":"string"}},"RateLimit-Limit":{"description":"Limit of the most constrained bucket","schema":{"type":"integer"}},"RateLimit-Remaining":{"description":"Remaining in that bucket","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until that bucket's window ends","schema":{"type":"integer"}},"RateLimit-Policy":{"description":"\"<scope>-<class>\";q=<limit>;w=<window>","schema":{"type":"string"}},"Retry-After":{"description":"Seconds to wait (429 and 503)","schema":{"type":"integer"}}},"parameters":{"DMHeroVersion":{"name":"DMHero-Version","in":"header","required":false,"schema":{"type":"string","enum":["2026-10-08"]}},"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","minLength":1,"maxLength":255}},"IdempotencyKeyRequired":{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":1,"maxLength":255}}},"responses":{"Shared400":{"description":"VALIDATION_FAILED_400: a parameter or body field is missing or invalid (`fields` names each); on every operation, a string or key holding U+0000 or an unpaired UTF-16 surrogate is refused with the reason `text_invalid`\nVALIDATION_INVALID_JSON_400: the body is not a JSON object\nAPI_VERSION_UNSUPPORTED_400: the DMHero-Version header names a version this API does not serve","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Shared401":{"description":"API_KEY_INVALID_401: the key is missing, invalid, revoked or expired","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Shared402":{"description":"SUBSCRIPTION_REQUIRED_402: the organization has no active subscription","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Shared403":{"description":"API_SCOPE_MISSING_403 and the gate refusals of section 2.3 step 7\nONBOARDING_REQUIRED_403: the organization has not finished setting up its DM Hero account; finish setting it up in the app, then retry","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Shared423":{"description":"PENDING_ARCHIVE_SELECTION_423: the organization must choose which workspaces to keep, in the app","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Shared429":{"description":"API_RATE_LIMITED_429: the key's or organization's rate limit","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Shared500":{"description":"API_INTERNAL_500: something failed on our side; quote the request_id","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Shared503":{"description":"API_OVERLOADED_503: our capacity refused the request; wait Retry-After seconds\nAPI_DISABLED_503: the developer API is switched off for maintenance (never the five original endpoints)","headers":{"DMHero-Request-Id":{"$ref":"#/components/headers/DMHero-Request-Id"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"tags":[{"name":"AI Setter"},{"name":"Analytics"},{"name":"Campaigns"},{"name":"Conversations"},{"name":"Custom fields"},{"name":"Discovery"},{"name":"Enrollments"},{"name":"Folders"},{"name":"Jobs"},{"name":"Leads"},{"name":"Me"},{"name":"Meta"},{"name":"Reps"},{"name":"Setter"},{"name":"Suppressions"},{"name":"Templates"},{"name":"Webhooks"}]}