{"openapi":"3.1.0","info":{"title":"Xsender Public API","version":"1.1.0","description":"Scale and Enterprise API for campaigns, target lists, per-lead send outcomes, connected account pause state, and workspace settings. Version 1.1 adds lead outcomes (GET /campaigns/{campaign_id}/leads), appending leads to a list (POST /target-lists/{target_list_id}/leads), the campaign progress fields, and returns the connected account itself from the pause call.","license":{"name":"Proprietary","identifier":"LicenseRef-Proprietary"}},"servers":[{"url":"https://api.xsenderapp.com/v1/public","description":"Production"}],"security":[{"apiKey":[]}],"tags":[{"name":"Campaigns","description":"Create, configure, activate, pause, and inspect outreach campaigns."},{"name":"Target lists","description":"Manage lead lists and cursor-paginated lead variables."},{"name":"Accounts","description":"Inspect connected X accounts and update pause state."},{"name":"Settings","description":"Read and update user-editable General settings."},{"name":"Specification","description":"The machine-readable OpenAPI 3.1 document this reference is generated from."}],"paths":{"/openapi.json":{"get":{"security":[],"operationId":"getPublicOpenApi","summary":"Download the public OpenAPI document","responses":{"200":{"description":"OpenAPI 3.1 document"}},"tags":["Specification"]}},"/campaigns":{"get":{"tags":["Campaigns"],"operationId":"listCampaigns","summary":"List campaigns","x-xsender-scope":"campaigns:read","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"$ref":"#/components/responses/CampaignList"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Campaigns"],"operationId":"createCampaign","summary":"Create a draft campaign","x-xsender-scope":"campaigns:write","requestBody":{"$ref":"#/components/requestBodies/CampaignCreateInput"},"responses":{"201":{"$ref":"#/components/responses/Campaign"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/PayloadTooLarge256KB"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/campaigns/{campaign_id}":{"parameters":[{"$ref":"#/components/parameters/CampaignId"}],"get":{"tags":["Campaigns"],"operationId":"getCampaign","summary":"Get a campaign","x-xsender-scope":"campaigns:read","responses":{"200":{"$ref":"#/components/responses/Campaign"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Campaigns"],"operationId":"updateCampaign","summary":"Update a campaign","x-xsender-scope":"campaigns:write","requestBody":{"$ref":"#/components/requestBodies/CampaignUpdateInput"},"responses":{"200":{"$ref":"#/components/responses/Campaign"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/PayloadTooLarge256KB"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Campaigns"],"operationId":"deleteCampaign","summary":"Delete a campaign","x-xsender-scope":"campaigns:write","responses":{"200":{"$ref":"#/components/responses/Ok"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/campaigns/{campaign_id}/activate":{"post":{"tags":["Campaigns"],"operationId":"activateCampaign","summary":"Activate a confirmed campaign","x-xsender-scope":"campaigns:write","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"confirmed":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"$ref":"#/components/responses/Campaign"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/PayloadTooLarge256KB"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/campaigns/{campaign_id}/pause":{"post":{"tags":["Campaigns"],"operationId":"pauseCampaign","summary":"Pause a campaign","x-xsender-scope":"campaigns:write","parameters":[{"$ref":"#/components/parameters/CampaignId"}],"responses":{"200":{"$ref":"#/components/responses/Campaign"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/campaigns/{campaign_id}/leads":{"get":{"tags":["Campaigns"],"operationId":"listCampaignLeadOutcomes","summary":"List who a campaign has messaged","description":"One row per finished send attempt, newest first, from the same ledger the dashboard counts. Use outcome=sent for successful sends only.","x-xsender-scope":"campaigns:read","parameters":[{"$ref":"#/components/parameters/CampaignId"},{"$ref":"#/components/parameters/Outcome"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"$ref":"#/components/responses/LeadOutcomeList"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/target-lists":{"get":{"tags":["Target lists"],"operationId":"listTargetLists","summary":"List target lists","x-xsender-scope":"targets:read","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"$ref":"#/components/responses/TargetListList"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Target lists"],"operationId":"createTargetList","summary":"Create a target list","x-xsender-scope":"targets:write","requestBody":{"$ref":"#/components/requestBodies/TargetListCreateInput"},"responses":{"201":{"$ref":"#/components/responses/TargetList"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/PayloadTooLarge24MB"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/target-lists/{target_list_id}":{"parameters":[{"$ref":"#/components/parameters/TargetListId"}],"get":{"tags":["Target lists"],"operationId":"getTargetList","summary":"Get a target list","x-xsender-scope":"targets:read","responses":{"200":{"$ref":"#/components/responses/TargetList"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Target lists"],"operationId":"updateTargetList","summary":"Update a target list","x-xsender-scope":"targets:write","requestBody":{"$ref":"#/components/requestBodies/TargetListUpdateInput"},"responses":{"200":{"$ref":"#/components/responses/TargetList"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/PayloadTooLarge24MB"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Target lists"],"operationId":"deleteTargetList","summary":"Delete a target list","x-xsender-scope":"targets:write","responses":{"200":{"$ref":"#/components/responses/Ok"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/target-lists/{target_list_id}/leads":{"get":{"tags":["Target lists"],"operationId":"listTargetListLeads","summary":"List target-list leads and custom variables","x-xsender-scope":"targets:read","parameters":[{"$ref":"#/components/parameters/TargetListId"},{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"$ref":"#/components/responses/LeadList"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Target lists"],"operationId":"appendTargetListLeads","summary":"Add leads to a target list","description":"Adds new usernames to the end of the list. Usernames already on the list and leads this workspace has already messaged are skipped and counted in the result. Campaigns using the list keep running. Send one append at a time per list: two appends that overlap in time can each miss the other’s leads.","x-xsender-scope":"targets:write","parameters":[{"$ref":"#/components/parameters/TargetListId"}],"requestBody":{"$ref":"#/components/requestBodies/TargetListLeadsAppendInput"},"responses":{"200":{"$ref":"#/components/responses/TargetListLeadsAppendResult"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/PayloadTooLarge24MB"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/accounts":{"get":{"tags":["Accounts"],"operationId":"listConnectedAccounts","summary":"List connected X accounts","x-xsender-scope":"accounts:read","parameters":[{"$ref":"#/components/parameters/Limit"},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"$ref":"#/components/responses/ConnectedAccountList"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/accounts/{account_id}":{"patch":{"tags":["Accounts"],"operationId":"updateConnectedAccount","summary":"Pause or resume a connected X account","x-xsender-scope":"accounts:write","parameters":[{"name":"account_id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/AccountPause"},"responses":{"200":{"$ref":"#/components/responses/ConnectedAccount"},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/PayloadTooLarge256KB"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"429":{"$ref":"#/components/responses/RateLimited"}},"description":"Returns the account with its new pause state, the same shape as the list."}},"/settings":{"get":{"tags":["Settings"],"operationId":"getSettings","summary":"Get workspace settings","x-xsender-scope":"settings:read","responses":{"200":{"description":"Settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Settings"}}}},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"tags":["Settings"],"operationId":"updateSettings","summary":"Update user-editable workspace settings","x-xsender-scope":"settings:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SettingsUpdate"},"example":{"timezone":"Europe/Vilnius"}}}},"responses":{"200":{"description":"Settings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Settings"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"413":{"$ref":"#/components/responses/PayloadTooLarge2MB"},"415":{"$ref":"#/components/responses/UnsupportedMediaType"},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"xsk_live_..."}},"parameters":{"Limit":{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},"Cursor":{"name":"cursor","in":"query","schema":{"type":"string"}},"CampaignId":{"name":"campaign_id","in":"path","required":true,"schema":{"type":"string"}},"TargetListId":{"name":"target_list_id","in":"path","required":true,"schema":{"type":"string"}},"ConversationId":{"name":"conversation_id","in":"path","required":true,"schema":{"type":"string"}},"TagId":{"name":"tag_id","in":"path","required":true,"schema":{"type":"string"}},"SnippetId":{"name":"snippet_id","in":"path","required":true,"schema":{"type":"string"}},"Outcome":{"name":"outcome","in":"query","required":false,"schema":{"type":"string","enum":["sent","skipped","rate_limited","blocked","account_locked","failed","expired","auth_required","cancelled"]},"description":"Only outcomes of this kind."}},"requestBodies":{"CampaignCreateInput":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignCreateInput"},"example":{"name":"New campaign","targetListIds":[],"accountIds":[]}}}},"CampaignUpdateInput":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignUpdateInput"},"example":{"name":"Updated campaign name"}}}},"TargetListCreateInput":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TargetListCreateInput"},"example":{"name":"Prospects","variableSchema":[{"key":"company","label":"Company"}],"leads":[{"username":"example","variables":{"company":"Acme"}}]}}}},"TargetListUpdateInput":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TargetListUpdateInput"},"example":{"name":"Qualified prospects"}}}},"AccountPause":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountPauseInput"},"example":{"paused":true}}}},"TargetListLeadsAppendInput":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TargetListLeadsAppendInput"},"example":{"variableSchema":[{"key":"company","label":"Company"}],"leads":[{"username":"new_lead","variables":{"company":"Globex"}}]}}}}},"responses":{"Campaign":{"description":"Campaign","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Campaign"}}}},"CampaignList":{"description":"Campaign page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignPage"}}}},"TargetList":{"description":"Target list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TargetList"}}}},"TargetListList":{"description":"Target-list page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TargetListPage"}}}},"LeadList":{"description":"Lead page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadPage"}}}},"ConnectedAccountList":{"description":"Connected X account page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectedAccountPage"}}}},"Ok":{"description":"Action accepted","content":{"application/json":{"schema":{"type":"object"}}}},"Error":{"description":"API error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"examples":{"invalid":{"value":{"code":"invalid_request","message":"The request is invalid."}},"scope":{"value":{"code":"insufficient_scope","message":"This API key requires another scope."}},"plan":{"value":{"code":"scale_plan_required","message":"Scale or Enterprise is required to use integrations."}}}}}},"PayloadTooLarge256KB":{"description":"Request body exceeds the 256 KB limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"request_body_too_large","message":"Request body is too large."}}}},"PayloadTooLarge2MB":{"description":"Request body exceeds the 2 MB limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"request_body_too_large","message":"Request body is too large."}}}},"PayloadTooLarge24MB":{"description":"Request body exceeds the 24 MB limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"request_body_too_large","message":"Request body is too large."}}}},"UnsupportedMediaType":{"description":"Content-Type must be application/json for requests with a body.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"unsupported_media_type","message":"Use application/json for this endpoint."}}}},"RateLimited":{"description":"Per-key rate limit exceeded. Retry-After contains seconds.","headers":{"Retry-After":{"schema":{"type":"integer","minimum":1}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"code":"rate_limited","message":"Too many requests. Try again shortly."}}}},"LeadOutcomeList":{"description":"Lead outcome page","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadOutcomePage"}}}},"TargetListLeadsAppendResult":{"description":"Leads appended","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TargetListLeadsAppendResult"}}}},"ConnectedAccount":{"description":"Connected account","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectedAccount"}}}}},"schemas":{"Error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"}}},"Settings":{"type":"object","required":["timezone","blacklist"],"properties":{"timezone":{"type":"string","examples":["Europe/Vilnius"]},"blacklist":{"type":"string","description":"Newline-delimited X usernames."}},"additionalProperties":false},"SettingsUpdate":{"type":"object","minProperties":1,"properties":{"timezone":{"type":"string","examples":["Europe/Vilnius"]},"blacklist":{"type":"string"}},"additionalProperties":false},"Campaign":{"type":"object","required":["id","name","status","createdAt","targetListIds","accountIds","sequence","messagesSent","contactedCount"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","completed"]},"statusReason":{"type":["string","null"],"description":"Why the campaign is in its current status, e.g. user_paused, completed_all_leads."},"statusChangedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"targetListIds":{"type":"array","items":{"type":"string"}},"accountIds":{"type":"array","items":{"type":"string"},"description":"X user ids of the sending accounts."},"sequence":{"type":"array","items":{"$ref":"#/components/schemas/SequenceStep"}},"workMins":{"type":"integer","description":"Minutes per day the campaign sends."},"perDay":{"type":"integer","minimum":0,"maximum":500,"description":"Daily send target across all accounts. Ignored when volumeMode is managed."},"sendDays":{"type":"array","items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]}},"volumeMode":{"type":"string","enum":["manual","managed"],"description":"managed lets Xsender pace sends within each account’s safe limit."},"messagesSent":{"type":"integer","description":"Successful sends so far, all time."},"contactedCount":{"type":"integer","description":"Leads the campaign has claimed or messaged."},"nextSendAt":{"type":["string","null"],"format":"date-time","description":"Next planned send, null when nothing is scheduled."},"confirmationRequired":{"type":"boolean","description":"true until the current content revision has been activated with confirmed: true."}},"additionalProperties":false},"CampaignUpdateInput":{"type":"object","minProperties":1,"properties":{"name":{"type":"string"},"description":{"type":"string"},"workMins":{"type":"array","prefixItems":[{"type":"integer"},{"type":"integer"}],"minItems":2,"maxItems":2},"perDay":{"type":"integer","minimum":0,"maximum":500},"sendDays":{"type":"array","items":{"type":"string"}},"targetListIds":{"type":"array","items":{"type":"string"}},"accountIds":{"type":"array","items":{"type":"string"}},"sequence":{"type":"array","items":{"type":"object"}}},"additionalProperties":false},"CampaignCreateInput":{"allOf":[{"$ref":"#/components/schemas/CampaignUpdateInput"},{"type":"object","required":["name"]}]},"TargetList":{"type":"object","required":["id","name","count","variableSchema","createdAt"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer","description":"Usable leads on the list."},"handles":{"type":"array","items":{"type":"string"},"description":"Lead usernames. Present on single-list reads and writes; use /leads to page through variables."},"variableSchema":{"type":"array","items":{"$ref":"#/components/schemas/TargetVariableField"}},"createdAt":{"type":"string","format":"date-time"}},"additionalProperties":false,"description":"A campaign uses a list when its targetListIds include the list id."},"TargetVariableField":{"type":"object","required":["key","label"],"properties":{"key":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9]*$"},"label":{"type":"string","maxLength":200}},"additionalProperties":false},"TargetListUpdateInput":{"type":"object","minProperties":1,"dependentRequired":{"variableSchema":["leads"]},"allOf":[{"if":{"required":["leads"],"properties":{"leads":{"contains":{"type":"object","required":["variables"],"properties":{"variables":{"type":"object","minProperties":1}}}}}},"then":{"required":["variableSchema"],"properties":{"variableSchema":{"minItems":1}}}}],"anyOf":[{"required":["name"]},{"required":["handles"]},{"required":["leads"]}],"properties":{"name":{"type":"string"},"handles":{"type":"array","items":{"type":"string"}},"leads":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}},"variableSchema":{"type":"array","items":{"$ref":"#/components/schemas/TargetVariableField"}}},"additionalProperties":false},"TargetListCreateInput":{"allOf":[{"$ref":"#/components/schemas/TargetListUpdateInput"},{"type":"object","required":["name"],"anyOf":[{"required":["handles"]},{"required":["leads"]}]}]},"Lead":{"type":"object","required":["username","variables"],"properties":{"username":{"type":"string"},"variables":{"type":"object","additionalProperties":{"type":"string"}}}},"AccountPauseInput":{"type":"object","required":["paused"],"properties":{"paused":{"type":"boolean"}},"additionalProperties":false},"ConnectedAccount":{"type":"object","required":["user_id","username","installation_id","online","paused","busy","login_state","safety_cooldown_until"],"properties":{"user_id":{"type":"string"},"username":{"type":["string","null"]},"installation_id":{"type":"string"},"online":{"type":"boolean","description":"true while the extension for this account has checked in during the last two minutes."},"paused":{"type":"boolean"},"busy":{"type":"boolean","description":"true while a send is in progress on this account."},"login_state":{"type":"string","description":"logged_in, logged_out or unknown as last reported by the extension."},"safety_cooldown_until":{"type":["string","null"],"format":"date-time","description":"Set while X asked this account to slow down; sends resume after it."}},"additionalProperties":false},"ConnectedAccountPage":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ConnectedAccount"}},"next_cursor":{"type":["string","null"]}}},"CampaignPage":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}},"next_cursor":{"type":["string","null"]}}},"TargetListPage":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TargetList"}},"next_cursor":{"type":["string","null"]}}},"LeadPage":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}},"next_cursor":{"type":["string","null"]}}},"SequenceVariant":{"type":"object","required":["text"],"properties":{"text":{"type":"string","description":"Message text. Placeholders like {{company}} are filled from the lead’s custom fields."}},"additionalProperties":false},"SequenceStep":{"type":"object","required":["label","variants"],"properties":{"id":{"type":"string"},"label":{"type":"string","description":"\"First message\" or \"Follow-up N\"; assigned by position."},"delay":{"type":"object","description":"Follow-up wait after the previous step (follow-ups only)."},"variants":{"type":"array","items":{"$ref":"#/components/schemas/SequenceVariant"},"description":"A/B variants for this step; one is picked per lead."}},"additionalProperties":false},"LeadOutcome":{"type":"object","required":["username","outcome","at","message_index","variant_index","attempts"],"properties":{"username":{"type":"string"},"outcome":{"type":"string","enum":["sent","skipped","rate_limited","blocked","account_locked","failed","expired","auth_required","cancelled"],"description":"sent is the only success. skipped means X reported the lead cannot be messaged."},"error_code":{"type":["string","null"],"description":"Machine-readable reason for a non-sent outcome."},"at":{"type":"string","format":"date-time","description":"When the attempt finished."},"account_id":{"type":["string","null"],"description":"X user id of the sending account (matches ConnectedAccount.user_id)."},"message_index":{"type":"integer","description":"0 for the first message, 1 for the first follow-up, and so on."},"variant_index":{"type":"integer"},"attempts":{"type":"integer","minimum":1}},"additionalProperties":false},"LeadOutcomePage":{"type":"object","required":["data","next_cursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LeadOutcome"}},"next_cursor":{"type":["string","null"]}}},"TargetListLeadsAppendInput":{"type":"object","minProperties":1,"dependentRequired":{"variableSchema":["leads"]},"anyOf":[{"required":["handles"]},{"required":["leads"]}],"properties":{"handles":{"type":"array","items":{"type":"string"}},"leads":{"type":"array","items":{"$ref":"#/components/schemas/Lead"}},"variableSchema":{"type":"array","items":{"$ref":"#/components/schemas/TargetVariableField"},"description":"Declares the variable keys used in leads[].variables. New keys are added to the list’s existing schema."}},"additionalProperties":false},"TargetListLeadsAppendResult":{"type":"object","required":["target_list","added","skipped_duplicates","skipped_contacted"],"properties":{"target_list":{"oneOf":[{"$ref":"#/components/schemas/TargetList"},{"type":"null"}],"description":"The list after the change; null when nothing was added."},"added":{"type":"integer"},"skipped_duplicates":{"type":"integer","description":"Usernames already on the list."},"skipped_contacted":{"type":"integer","description":"Usernames this workspace has already messaged from any campaign."}},"additionalProperties":false}}}}