{"openapi":"3.1.0","info":{"title":"Needle API","version":"1.0.0","description":"Public REST API for Needle Agents. Authenticate every request with `Authorization: Bearer sk-ndl-…`. Each API key is bound to one user and one organization."},"servers":[{"url":"/","description":"This server"}],"tags":[{"name":"Me"},{"name":"Connected accounts"},{"name":"Leads"},{"name":"Campaigns"},{"name":"Events"},{"name":"LinkedIn"},{"name":"Instagram"},{"name":"Places"},{"name":"Compose"},{"name":"Suppressions"}],"security":[{"bearerAuth":[]}],"paths":{"/api/v1/me":{"get":{"tags":["Me"],"operationId":"getMe","summary":"Get the authenticated user","description":"Returns the user and organization this API key is bound to.","responses":{"200":{"description":"The authenticated user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/connected-accounts":{"get":{"tags":["Connected accounts"],"operationId":"listConnectedAccounts","summary":"List connected accounts","parameters":[{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of connected accounts, newest first. Pass nextCursor as cursor for the next page.","content":{"application/json":{"schema":{"type":"object","properties":{"connectedAccounts":{"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)$"},"ownerUserId":{"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)$"},"ownerOrgId":{"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)$"},"channel":{"type":"string","enum":["linkedin","instagram"]},"status":{"type":"string","enum":["active","paused","auth_required","disconnected"]},"properties":{"oneOf":[{"type":"object","properties":{"channel":{"type":"string","const":"linkedin"},"tier":{"type":"string","enum":["classic","premium","recruiter","sales_navigator"]},"inMailBalance":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["channel","tier"],"additionalProperties":false},{"type":"object","properties":{"channel":{"type":"string","const":"instagram"}},"required":["channel"],"additionalProperties":false}],"type":"object"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"channelIdentity":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"quotaOverrides":{"anyOf":[{"type":"object","propertyNames":{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},"additionalProperties":{"type":"object","properties":{"hour":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]},"day":{"type":"integer","minimum":1,"maximum":1000},"week":{"anyOf":[{"type":"integer","minimum":1,"maximum":5000},{"type":"null"}]}},"required":["hour","day","week"],"additionalProperties":false}},{"type":"null"}]},"nextActionAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"pausedUntil":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"consecutiveFailures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastErrorKind":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"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":"null"}]},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"deletedBy":{"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":"null"}]}},"required":["id","ownerUserId","ownerOrgId","channel","status","properties","displayName","channelIdentity","imageUrl","quotaOverrides","nextActionAt","pausedUntil","consecutiveFailures","lastErrorKind","createdAt","updatedAt","updatedBy","deletedAt","deletedBy"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["connectedAccounts","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/connected-accounts/{connectedAccountId}":{"get":{"tags":["Connected accounts"],"operationId":"getConnectedAccount","summary":"Get a connected account","parameters":[{"in":"path","name":"connectedAccountId","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":"Connected account id"},"required":true,"description":"Connected account id"}],"responses":{"200":{"description":"Account and usage.","content":{"application/json":{"schema":{"type":"object","properties":{"connectedAccount":{"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)$"},"ownerUserId":{"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)$"},"ownerOrgId":{"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)$"},"channel":{"type":"string","enum":["linkedin","instagram"]},"status":{"type":"string","enum":["active","paused","auth_required","disconnected"]},"properties":{"oneOf":[{"type":"object","properties":{"channel":{"type":"string","const":"linkedin"},"tier":{"type":"string","enum":["classic","premium","recruiter","sales_navigator"]},"inMailBalance":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["channel","tier"],"additionalProperties":false},{"type":"object","properties":{"channel":{"type":"string","const":"instagram"}},"required":["channel"],"additionalProperties":false}],"type":"object"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"channelIdentity":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"quotaOverrides":{"anyOf":[{"type":"object","propertyNames":{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},"additionalProperties":{"type":"object","properties":{"hour":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]},"day":{"type":"integer","minimum":1,"maximum":1000},"week":{"anyOf":[{"type":"integer","minimum":1,"maximum":5000},{"type":"null"}]}},"required":["hour","day","week"],"additionalProperties":false}},{"type":"null"}]},"nextActionAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"pausedUntil":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"consecutiveFailures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastErrorKind":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"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":"null"}]},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"deletedBy":{"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":"null"}]}},"required":["id","ownerUserId","ownerOrgId","channel","status","properties","displayName","channelIdentity","imageUrl","quotaOverrides","nextActionAt","pausedUntil","consecutiveFailures","lastErrorKind","createdAt","updatedAt","updatedBy","deletedAt","deletedBy"],"additionalProperties":false},"usage":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},"hourUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hourLimit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"dayUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dayLimit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weekUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weekLimit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["action","hourUsed","hourLimit","dayUsed","dayLimit","weekUsed","weekLimit"],"additionalProperties":false}}},"required":["connectedAccount","usage"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"tags":["Connected accounts"],"operationId":"updateConnectedAccount","summary":"Update a connected account","parameters":[{"in":"path","name":"connectedAccountId","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":"Connected account id"},"required":true,"description":"Connected account id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"paused":{"type":"boolean"},"quotaOverrides":{"anyOf":[{"type":"object","propertyNames":{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},"additionalProperties":{"anyOf":[{"type":"object","properties":{"hour":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]},"day":{"type":"integer","minimum":1,"maximum":1000},"week":{"anyOf":[{"type":"integer","minimum":1,"maximum":5000},{"type":"null"}]}},"required":["hour","day","week"]},{"type":"null"}]}},{"type":"null"}]}}}}}},"responses":{"200":{"description":"Updated account.","content":{"application/json":{"schema":{"type":"object","properties":{"connectedAccount":{"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)$"},"ownerUserId":{"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)$"},"ownerOrgId":{"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)$"},"channel":{"type":"string","enum":["linkedin","instagram"]},"status":{"type":"string","enum":["active","paused","auth_required","disconnected"]},"properties":{"oneOf":[{"type":"object","properties":{"channel":{"type":"string","const":"linkedin"},"tier":{"type":"string","enum":["classic","premium","recruiter","sales_navigator"]},"inMailBalance":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["channel","tier"],"additionalProperties":false},{"type":"object","properties":{"channel":{"type":"string","const":"instagram"}},"required":["channel"],"additionalProperties":false}],"type":"object"},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"channelIdentity":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"quotaOverrides":{"anyOf":[{"type":"object","propertyNames":{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},"additionalProperties":{"type":"object","properties":{"hour":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]},"day":{"type":"integer","minimum":1,"maximum":1000},"week":{"anyOf":[{"type":"integer","minimum":1,"maximum":5000},{"type":"null"}]}},"required":["hour","day","week"],"additionalProperties":false}},{"type":"null"}]},"nextActionAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"pausedUntil":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"consecutiveFailures":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"lastErrorKind":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"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":"null"}]},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"deletedBy":{"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":"null"}]}},"required":["id","ownerUserId","ownerOrgId","channel","status","properties","displayName","channelIdentity","imageUrl","quotaOverrides","nextActionAt","pausedUntil","consecutiveFailures","lastErrorKind","createdAt","updatedAt","updatedBy","deletedAt","deletedBy"],"additionalProperties":false}},"required":["connectedAccount"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Connected accounts"],"operationId":"deleteConnectedAccount","summary":"Delete a connected account","parameters":[{"in":"path","name":"connectedAccountId","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":"Connected account id"},"required":true,"description":"Connected account id"}],"responses":{"200":{"description":"Account deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/connected-accounts/{connectedAccountId}/events":{"get":{"tags":["Connected accounts"],"operationId":"listConnectedAccountEvents","summary":"List connected account events","parameters":[{"in":"path","name":"connectedAccountId","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":"Connected account id"},"required":true,"description":"Connected account id"},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of events for this connected account, newest first. Pass nextCursor as cursor for the next page.","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"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)$"},"type":{"type":"string","enum":["lead_enrolled","lead_skipped","message_generated","task_skipped","task_failed","enrollment_completed","enrollment_stopped","lead_suppressed","account_paused","campaign_status_changed","linkedin_profile_visited","linkedin_invite_sent","linkedin_invite_withdrawn","linkedin_message_sent","linkedin_follow_sent","linkedin_unfollowed","linkedin_invite_accepted","linkedin_message_received","linkedin_account_status_changed","instagram_message_sent","instagram_profile_visited","instagram_follow_sent","instagram_unfollowed","instagram_message_received","instagram_account_status_changed"]},"label":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"channel":{"anyOf":[{"type":"string","enum":["linkedin","instagram"]},{"type":"null"}]},"nodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"leadId":{"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":"null"}]},"leadName":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignId":{"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":"null"}]},"campaignName":{"anyOf":[{"type":"string"},{"type":"null"}]},"enrollmentId":{"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":"null"}]},"connectedAccountId":{"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":"null"}]},"accountName":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"anyOf":[{"type":"object","properties":{"nodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"anyOf":[{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},{"type":"null"}]},"skipReason":{"anyOf":[{"type":"string","enum":["duplicate_in_batch","enrolled_elsewhere","suppressed","daily_limit_reached","missing_identity","missing_personalization","already_connected","already_invited","already_following","follow_request_pending","not_first_degree","invalid_recipient","generation_failed"]},{"type":"null"}]},"exitReason":{"anyOf":[{"type":"string","enum":["finished","replied","timeout","manual","suppressed","dead_end","error","account_disconnected","campaign_archived"]},{"type":"null"}]},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorKind":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]},"suppressionReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyword":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","type","label","occurredAt","channel","nodeId","leadId","leadName","campaignId","campaignName","enrollmentId","connectedAccountId","accountName","data"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["events","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/leads":{"get":{"tags":["Leads"],"operationId":"listLeads","summary":"List leads","parameters":[{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of leads in this organization, newest first. Pass nextCursor as cursor for the next page.","content":{"application/json":{"schema":{"type":"object","properties":{"leads":{"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)$"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"type":"string"},"identities":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["linkedin","instagram"]},"channelIdentity":{"type":"string"}},"required":["channel","channelIdentity"],"additionalProperties":false}},"liveEnrollment":{"anyOf":[{"type":"object","properties":{"campaignId":{"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)$"},"campaignName":{"type":"string"},"status":{"type":"string","enum":["active","waiting","completed","stopped","failed"]}},"required":["campaignId","campaignName","status"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","firstName","lastName","companyName","companyDomain","jobTitle","email","imageUrl","timezone","identities","liveEnrollment","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["leads","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Leads"],"operationId":"createLead","summary":"Create a lead","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"identities":{"type":"object","properties":{"linkedin":{"type":"string","minLength":1},"instagram":{"type":"string","minLength":1}}},"timezone":{"type":"string"},"firstName":{"type":"string","maxLength":256},"lastName":{"type":"string","maxLength":256},"companyName":{"type":"string","maxLength":256},"companyDomain":{"type":"string","maxLength":256},"jobTitle":{"type":"string","maxLength":256},"email":{"type":"string","maxLength":256},"imageUrl":{"type":"string","maxLength":2048},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["identities","timezone"]}}}},"responses":{"201":{"description":"Created lead.","content":{"application/json":{"schema":{"type":"object","properties":{"lead":{"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)$"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"type":"string"},"identities":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["linkedin","instagram"]},"channelIdentity":{"type":"string"}},"required":["channel","channelIdentity"],"additionalProperties":false}},"liveEnrollment":{"anyOf":[{"type":"object","properties":{"campaignId":{"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)$"},"campaignName":{"type":"string"},"status":{"type":"string","enum":["active","waiting","completed","stopped","failed"]}},"required":["campaignId","campaignName","status"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"enrollments":{"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)$"},"campaignId":{"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)$"},"campaignName":{"type":"string"},"campaignStatus":{"type":"string","enum":["draft","active","paused","completed","archived"]},"status":{"type":"string","enum":["active","waiting","completed","stopped","failed"]},"exitReason":{"anyOf":[{"type":"string","enum":["finished","replied","timeout","manual","suppressed","dead_end","error","account_disconnected","campaign_archived"]},{"type":"null"}]},"currentNodeId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","campaignId","campaignName","campaignStatus","status","exitReason","currentNodeId","createdAt","completedAt"],"additionalProperties":false}}},"required":["id","firstName","lastName","companyName","companyDomain","jobTitle","email","imageUrl","timezone","identities","liveEnrollment","createdAt","updatedAt","properties","enrollments"],"additionalProperties":false}},"required":["lead"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/leads/{leadId}":{"get":{"tags":["Leads"],"operationId":"getLead","summary":"Get a lead","parameters":[{"in":"path","name":"leadId","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":"Lead id"},"required":true,"description":"Lead id"}],"responses":{"200":{"description":"Lead, identities, and enrollments.","content":{"application/json":{"schema":{"type":"object","properties":{"lead":{"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)$"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"type":"string"},"identities":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["linkedin","instagram"]},"channelIdentity":{"type":"string"}},"required":["channel","channelIdentity"],"additionalProperties":false}},"liveEnrollment":{"anyOf":[{"type":"object","properties":{"campaignId":{"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)$"},"campaignName":{"type":"string"},"status":{"type":"string","enum":["active","waiting","completed","stopped","failed"]}},"required":["campaignId","campaignName","status"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"enrollments":{"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)$"},"campaignId":{"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)$"},"campaignName":{"type":"string"},"campaignStatus":{"type":"string","enum":["draft","active","paused","completed","archived"]},"status":{"type":"string","enum":["active","waiting","completed","stopped","failed"]},"exitReason":{"anyOf":[{"type":"string","enum":["finished","replied","timeout","manual","suppressed","dead_end","error","account_disconnected","campaign_archived"]},{"type":"null"}]},"currentNodeId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","campaignId","campaignName","campaignStatus","status","exitReason","currentNodeId","createdAt","completedAt"],"additionalProperties":false}}},"required":["id","firstName","lastName","companyName","companyDomain","jobTitle","email","imageUrl","timezone","identities","liveEnrollment","createdAt","updatedAt","properties","enrollments"],"additionalProperties":false}},"required":["lead"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"tags":["Leads"],"operationId":"updateLead","summary":"Update a lead","parameters":[{"in":"path","name":"leadId","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":"Lead id"},"required":true,"description":"Lead id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"identities":{"type":"object","properties":{"linkedin":{"type":"string","minLength":1},"instagram":{"type":"string","minLength":1}}},"timezone":{"type":"string"},"firstName":{"type":"string","maxLength":256},"lastName":{"type":"string","maxLength":256},"companyName":{"type":"string","maxLength":256},"companyDomain":{"type":"string","maxLength":256},"jobTitle":{"type":"string","maxLength":256},"email":{"type":"string","maxLength":256},"imageUrl":{"type":"string","maxLength":2048},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}}}}}},"responses":{"200":{"description":"Updated lead.","content":{"application/json":{"schema":{"type":"object","properties":{"lead":{"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)$"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"type":"string"},"identities":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["linkedin","instagram"]},"channelIdentity":{"type":"string"}},"required":["channel","channelIdentity"],"additionalProperties":false}},"liveEnrollment":{"anyOf":[{"type":"object","properties":{"campaignId":{"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)$"},"campaignName":{"type":"string"},"status":{"type":"string","enum":["active","waiting","completed","stopped","failed"]}},"required":["campaignId","campaignName","status"],"additionalProperties":false},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}},"enrollments":{"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)$"},"campaignId":{"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)$"},"campaignName":{"type":"string"},"campaignStatus":{"type":"string","enum":["draft","active","paused","completed","archived"]},"status":{"type":"string","enum":["active","waiting","completed","stopped","failed"]},"exitReason":{"anyOf":[{"type":"string","enum":["finished","replied","timeout","manual","suppressed","dead_end","error","account_disconnected","campaign_archived"]},{"type":"null"}]},"currentNodeId":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","campaignId","campaignName","campaignStatus","status","exitReason","currentNodeId","createdAt","completedAt"],"additionalProperties":false}}},"required":["id","firstName","lastName","companyName","companyDomain","jobTitle","email","imageUrl","timezone","identities","liveEnrollment","createdAt","updatedAt","properties","enrollments"],"additionalProperties":false}},"required":["lead"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Leads"],"operationId":"deleteLead","summary":"Delete a lead","parameters":[{"in":"path","name":"leadId","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":"Lead id"},"required":true,"description":"Lead id"}],"responses":{"200":{"description":"Lead deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/leads/{leadId}/events":{"get":{"tags":["Leads"],"operationId":"listLeadEvents","summary":"List lead events","parameters":[{"in":"path","name":"leadId","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":"Lead id"},"required":true,"description":"Lead id"},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of events for this lead, newest first. Pass nextCursor as cursor for the next page.","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"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)$"},"type":{"type":"string","enum":["lead_enrolled","lead_skipped","message_generated","task_skipped","task_failed","enrollment_completed","enrollment_stopped","lead_suppressed","account_paused","campaign_status_changed","linkedin_profile_visited","linkedin_invite_sent","linkedin_invite_withdrawn","linkedin_message_sent","linkedin_follow_sent","linkedin_unfollowed","linkedin_invite_accepted","linkedin_message_received","linkedin_account_status_changed","instagram_message_sent","instagram_profile_visited","instagram_follow_sent","instagram_unfollowed","instagram_message_received","instagram_account_status_changed"]},"label":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"channel":{"anyOf":[{"type":"string","enum":["linkedin","instagram"]},{"type":"null"}]},"nodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"leadId":{"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":"null"}]},"leadName":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignId":{"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":"null"}]},"campaignName":{"anyOf":[{"type":"string"},{"type":"null"}]},"enrollmentId":{"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":"null"}]},"connectedAccountId":{"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":"null"}]},"accountName":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"anyOf":[{"type":"object","properties":{"nodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"anyOf":[{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},{"type":"null"}]},"skipReason":{"anyOf":[{"type":"string","enum":["duplicate_in_batch","enrolled_elsewhere","suppressed","daily_limit_reached","missing_identity","missing_personalization","already_connected","already_invited","already_following","follow_request_pending","not_first_degree","invalid_recipient","generation_failed"]},{"type":"null"}]},"exitReason":{"anyOf":[{"type":"string","enum":["finished","replied","timeout","manual","suppressed","dead_end","error","account_disconnected","campaign_archived"]},{"type":"null"}]},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorKind":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]},"suppressionReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyword":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","type","label","occurredAt","channel","nodeId","leadId","leadName","campaignId","campaignName","enrollmentId","connectedAccountId","accountName","data"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["events","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/campaigns":{"get":{"tags":["Campaigns"],"operationId":"listCampaigns","summary":"List campaigns","parameters":[{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"status","schema":{"type":"string","enum":["draft","active","paused","completed","archived"]}}],"responses":{"200":{"description":"A page of campaigns, newest first. Pass nextCursor as cursor for the next page.","content":{"application/json":{"schema":{"type":"object","properties":{"campaigns":{"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)$"},"ownerOrgId":{"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":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","completed","archived"]},"graph":{"type":"object","properties":{"nodes":{"minItems":2,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"start"},"label":{"type":"string","maxLength":120}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"end"},"label":{"type":"string","maxLength":120}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"delay"},"label":{"type":"string","maxLength":120},"duration":{"type":"object","properties":{"days":{"default":0,"type":"integer","minimum":0,"maximum":90},"hours":{"default":0,"type":"integer","minimum":0,"maximum":23},"minutes":{"default":0,"type":"integer","minimum":0,"maximum":59}},"required":["days","hours","minutes"],"additionalProperties":false}},"required":["id","kind","duration"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"action"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"action":{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},"content":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"template"},"text":{"type":"string","minLength":1}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"ai"},"prompt":{"type":"string","minLength":1},"context":{"default":["profile"],"type":"array","items":{"type":"string","enum":["profile","posts","conversation","lead_properties"]}},"model":{"type":"string"},"maxChars":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"fallbackText":{"type":"string"},"requiresApproval":{"default":false,"type":"boolean"}},"required":["kind","prompt","context","requiresApproval"],"additionalProperties":false}],"type":"object"}},"required":["id","kind","channel","action"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"condition"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"test":{"oneOf":[{"type":"object","properties":{"predicate":{"type":"string","const":"is_connection"}},"required":["predicate"],"additionalProperties":false},{"type":"object","properties":{"predicate":{"type":"string","const":"has_attribute"},"attribute":{"type":"string","minLength":1,"maxLength":64},"equals":{"type":"string","maxLength":256}},"required":["predicate","attribute"],"additionalProperties":false}],"type":"object"}},"required":["id","kind","channel","test"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"wait_until"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"event":{"type":"string","enum":["linkedin_invite_accepted","linkedin_message_received","instagram_message_received"]},"timeout":{"type":"object","properties":{"days":{"default":0,"type":"integer","minimum":0,"maximum":90},"hours":{"default":0,"type":"integer","minimum":0,"maximum":23},"minutes":{"default":0,"type":"integer","minimum":0,"maximum":59}},"required":["days","hours","minutes"],"additionalProperties":false}},"required":["id","kind","channel","event","timeout"],"additionalProperties":false}],"type":"object"}},"edges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"to":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"label":{"default":"next","type":"string","enum":["next","yes","no","on_event","on_timeout"]}},"required":["from","to","label"],"additionalProperties":false}}},"required":["nodes","edges"],"additionalProperties":false},"schedule":{"type":"object","properties":{"workingDays":{"default":[1,2,3,4,5],"minItems":1,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"startTime":{"default":"09:00","type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"default":"17:00","type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["workingDays","startTime","endTime"],"additionalProperties":false},"limits":{"type":"object","properties":{"minGapSeconds":{"default":60,"type":"integer","minimum":30,"maximum":86400},"maxGapSeconds":{"default":120,"type":"integer","minimum":30,"maximum":86400},"maxNewLeadsPerDay":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":1000},{"type":"null"}]}},"required":["minGapSeconds","maxGapSeconds"],"additionalProperties":false},"suppressionPolicy":{"type":"object","properties":{"bypassSuppressionReasons":{"default":[],"type":"array","items":{"type":"string","enum":["manual","unsubscribed","not_interested","existing_customer","open_opportunity","competitor","employee","invalid_recipient","complained","recently_contacted","unresponsive"]}},"cooldownDays":{"default":30,"type":"integer","minimum":0,"maximum":365},"unresponsiveAfterTouches":{"default":3,"type":"integer","minimum":0,"maximum":50},"autoSuppressKeywords":{"default":["unsubscribe","stop contacting","do not contact","remove me","take me off","not interested"],"type":"array","items":{"type":"string"}}},"required":["bypassSuppressionReasons","cooldownDays","unresponsiveAfterTouches","autoSuppressKeywords"],"additionalProperties":false},"dryRun":{"type":"boolean"},"startedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"startedBy":{"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":"null"}]},"pausedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"pausedBy":{"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":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"archivedBy":{"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":"null"}]},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"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":"null"}]},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"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":"null"}]},"connectedAccounts":{"type":"array","items":{"type":"object","properties":{"connectedAccountId":{"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)$"},"channel":{"type":"string","enum":["linkedin","instagram"]}},"required":["connectedAccountId","channel"],"additionalProperties":false}}},"required":["id","ownerOrgId","name","status","graph","schedule","limits","suppressionPolicy","dryRun","startedAt","startedBy","pausedAt","pausedBy","completedAt","archivedAt","archivedBy","createdAt","createdBy","updatedAt","updatedBy","connectedAccounts"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["campaigns","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Campaigns"],"operationId":"createCampaign","summary":"Create a campaign","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256},"graph":{"type":"object","properties":{"nodes":{"minItems":2,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"start"},"label":{"type":"string","maxLength":120}},"required":["id","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"end"},"label":{"type":"string","maxLength":120}},"required":["id","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"delay"},"label":{"type":"string","maxLength":120},"duration":{"type":"object","properties":{"days":{"default":0,"type":"integer","minimum":0,"maximum":90},"hours":{"default":0,"type":"integer","minimum":0,"maximum":23},"minutes":{"default":0,"type":"integer","minimum":0,"maximum":59}}}},"required":["id","kind","duration"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"action"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"action":{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},"content":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"template"},"text":{"type":"string","minLength":1}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"ai"},"prompt":{"type":"string","minLength":1},"context":{"default":["profile"],"type":"array","items":{"type":"string","enum":["profile","posts","conversation","lead_properties"]}},"model":{"type":"string"},"maxChars":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"fallbackText":{"type":"string"},"requiresApproval":{"default":false,"type":"boolean"}},"required":["kind","prompt"]}],"type":"object"}},"required":["id","kind","channel","action"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"condition"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"test":{"oneOf":[{"type":"object","properties":{"predicate":{"type":"string","const":"is_connection"}},"required":["predicate"]},{"type":"object","properties":{"predicate":{"type":"string","const":"has_attribute"},"attribute":{"type":"string","minLength":1,"maxLength":64},"equals":{"type":"string","maxLength":256}},"required":["predicate","attribute"]}],"type":"object"}},"required":["id","kind","channel","test"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"wait_until"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"event":{"type":"string","enum":["linkedin_invite_accepted","linkedin_message_received","instagram_message_received"]},"timeout":{"type":"object","properties":{"days":{"default":0,"type":"integer","minimum":0,"maximum":90},"hours":{"default":0,"type":"integer","minimum":0,"maximum":23},"minutes":{"default":0,"type":"integer","minimum":0,"maximum":59}}}},"required":["id","kind","channel","event","timeout"]}],"type":"object"}},"edges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"to":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"label":{"default":"next","type":"string","enum":["next","yes","no","on_event","on_timeout"]}},"required":["from","to"]}}},"required":["nodes","edges"]},"schedule":{"type":"object","properties":{"workingDays":{"default":[1,2,3,4,5],"minItems":1,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"startTime":{"default":"09:00","type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"default":"17:00","type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}}},"limits":{"type":"object","properties":{"minGapSeconds":{"default":60,"type":"integer","minimum":30,"maximum":86400},"maxGapSeconds":{"default":120,"type":"integer","minimum":30,"maximum":86400},"maxNewLeadsPerDay":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":1000},{"type":"null"}]}}},"suppressionPolicy":{"type":"object","properties":{"bypassSuppressionReasons":{"default":[],"type":"array","items":{"type":"string","enum":["manual","unsubscribed","not_interested","existing_customer","open_opportunity","competitor","employee","invalid_recipient","complained","recently_contacted","unresponsive"]}},"cooldownDays":{"default":30,"type":"integer","minimum":0,"maximum":365},"unresponsiveAfterTouches":{"default":3,"type":"integer","minimum":0,"maximum":50},"autoSuppressKeywords":{"default":["unsubscribe","stop contacting","do not contact","remove me","take me off","not interested"],"type":"array","items":{"type":"string"}}}}},"required":["name","graph"]}}}},"responses":{"201":{"description":"Created campaign.","content":{"application/json":{"schema":{"type":"object","properties":{"campaign":{"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)$"},"ownerOrgId":{"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":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","completed","archived"]},"graph":{"type":"object","properties":{"nodes":{"minItems":2,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"start"},"label":{"type":"string","maxLength":120}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"end"},"label":{"type":"string","maxLength":120}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"delay"},"label":{"type":"string","maxLength":120},"duration":{"type":"object","properties":{"days":{"default":0,"type":"integer","minimum":0,"maximum":90},"hours":{"default":0,"type":"integer","minimum":0,"maximum":23},"minutes":{"default":0,"type":"integer","minimum":0,"maximum":59}},"required":["days","hours","minutes"],"additionalProperties":false}},"required":["id","kind","duration"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"action"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"action":{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},"content":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"template"},"text":{"type":"string","minLength":1}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"ai"},"prompt":{"type":"string","minLength":1},"context":{"default":["profile"],"type":"array","items":{"type":"string","enum":["profile","posts","conversation","lead_properties"]}},"model":{"type":"string"},"maxChars":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"fallbackText":{"type":"string"},"requiresApproval":{"default":false,"type":"boolean"}},"required":["kind","prompt","context","requiresApproval"],"additionalProperties":false}],"type":"object"}},"required":["id","kind","channel","action"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"condition"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"test":{"oneOf":[{"type":"object","properties":{"predicate":{"type":"string","const":"is_connection"}},"required":["predicate"],"additionalProperties":false},{"type":"object","properties":{"predicate":{"type":"string","const":"has_attribute"},"attribute":{"type":"string","minLength":1,"maxLength":64},"equals":{"type":"string","maxLength":256}},"required":["predicate","attribute"],"additionalProperties":false}],"type":"object"}},"required":["id","kind","channel","test"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"wait_until"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"event":{"type":"string","enum":["linkedin_invite_accepted","linkedin_message_received","instagram_message_received"]},"timeout":{"type":"object","properties":{"days":{"default":0,"type":"integer","minimum":0,"maximum":90},"hours":{"default":0,"type":"integer","minimum":0,"maximum":23},"minutes":{"default":0,"type":"integer","minimum":0,"maximum":59}},"required":["days","hours","minutes"],"additionalProperties":false}},"required":["id","kind","channel","event","timeout"],"additionalProperties":false}],"type":"object"}},"edges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"to":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"label":{"default":"next","type":"string","enum":["next","yes","no","on_event","on_timeout"]}},"required":["from","to","label"],"additionalProperties":false}}},"required":["nodes","edges"],"additionalProperties":false},"schedule":{"type":"object","properties":{"workingDays":{"default":[1,2,3,4,5],"minItems":1,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"startTime":{"default":"09:00","type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"default":"17:00","type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["workingDays","startTime","endTime"],"additionalProperties":false},"limits":{"type":"object","properties":{"minGapSeconds":{"default":60,"type":"integer","minimum":30,"maximum":86400},"maxGapSeconds":{"default":120,"type":"integer","minimum":30,"maximum":86400},"maxNewLeadsPerDay":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":1000},{"type":"null"}]}},"required":["minGapSeconds","maxGapSeconds"],"additionalProperties":false},"suppressionPolicy":{"type":"object","properties":{"bypassSuppressionReasons":{"default":[],"type":"array","items":{"type":"string","enum":["manual","unsubscribed","not_interested","existing_customer","open_opportunity","competitor","employee","invalid_recipient","complained","recently_contacted","unresponsive"]}},"cooldownDays":{"default":30,"type":"integer","minimum":0,"maximum":365},"unresponsiveAfterTouches":{"default":3,"type":"integer","minimum":0,"maximum":50},"autoSuppressKeywords":{"default":["unsubscribe","stop contacting","do not contact","remove me","take me off","not interested"],"type":"array","items":{"type":"string"}}},"required":["bypassSuppressionReasons","cooldownDays","unresponsiveAfterTouches","autoSuppressKeywords"],"additionalProperties":false},"dryRun":{"type":"boolean"},"startedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"startedBy":{"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":"null"}]},"pausedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"pausedBy":{"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":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"archivedBy":{"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":"null"}]},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"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":"null"}]},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"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":"null"}]},"connectedAccounts":{"type":"array","items":{"type":"object","properties":{"connectedAccountId":{"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)$"},"channel":{"type":"string","enum":["linkedin","instagram"]}},"required":["connectedAccountId","channel"],"additionalProperties":false}}},"required":["id","ownerOrgId","name","status","graph","schedule","limits","suppressionPolicy","dryRun","startedAt","startedBy","pausedAt","pausedBy","completedAt","archivedAt","archivedBy","createdAt","createdBy","updatedAt","updatedBy","connectedAccounts"],"additionalProperties":false}},"required":["campaign"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/campaigns/{campaignId}":{"get":{"tags":["Campaigns"],"operationId":"getCampaign","summary":"Get a campaign","parameters":[{"in":"path","name":"campaignId","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":"Campaign id"},"required":true,"description":"Campaign id"}],"responses":{"200":{"description":"The campaign.","content":{"application/json":{"schema":{"type":"object","properties":{"campaign":{"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)$"},"ownerOrgId":{"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":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","completed","archived"]},"graph":{"type":"object","properties":{"nodes":{"minItems":2,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"start"},"label":{"type":"string","maxLength":120}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"end"},"label":{"type":"string","maxLength":120}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"delay"},"label":{"type":"string","maxLength":120},"duration":{"type":"object","properties":{"days":{"default":0,"type":"integer","minimum":0,"maximum":90},"hours":{"default":0,"type":"integer","minimum":0,"maximum":23},"minutes":{"default":0,"type":"integer","minimum":0,"maximum":59}},"required":["days","hours","minutes"],"additionalProperties":false}},"required":["id","kind","duration"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"action"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"action":{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},"content":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"template"},"text":{"type":"string","minLength":1}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"ai"},"prompt":{"type":"string","minLength":1},"context":{"default":["profile"],"type":"array","items":{"type":"string","enum":["profile","posts","conversation","lead_properties"]}},"model":{"type":"string"},"maxChars":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"fallbackText":{"type":"string"},"requiresApproval":{"default":false,"type":"boolean"}},"required":["kind","prompt","context","requiresApproval"],"additionalProperties":false}],"type":"object"}},"required":["id","kind","channel","action"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"condition"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"test":{"oneOf":[{"type":"object","properties":{"predicate":{"type":"string","const":"is_connection"}},"required":["predicate"],"additionalProperties":false},{"type":"object","properties":{"predicate":{"type":"string","const":"has_attribute"},"attribute":{"type":"string","minLength":1,"maxLength":64},"equals":{"type":"string","maxLength":256}},"required":["predicate","attribute"],"additionalProperties":false}],"type":"object"}},"required":["id","kind","channel","test"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"wait_until"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"event":{"type":"string","enum":["linkedin_invite_accepted","linkedin_message_received","instagram_message_received"]},"timeout":{"type":"object","properties":{"days":{"default":0,"type":"integer","minimum":0,"maximum":90},"hours":{"default":0,"type":"integer","minimum":0,"maximum":23},"minutes":{"default":0,"type":"integer","minimum":0,"maximum":59}},"required":["days","hours","minutes"],"additionalProperties":false}},"required":["id","kind","channel","event","timeout"],"additionalProperties":false}],"type":"object"}},"edges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"to":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"label":{"default":"next","type":"string","enum":["next","yes","no","on_event","on_timeout"]}},"required":["from","to","label"],"additionalProperties":false}}},"required":["nodes","edges"],"additionalProperties":false},"schedule":{"type":"object","properties":{"workingDays":{"default":[1,2,3,4,5],"minItems":1,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"startTime":{"default":"09:00","type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"default":"17:00","type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["workingDays","startTime","endTime"],"additionalProperties":false},"limits":{"type":"object","properties":{"minGapSeconds":{"default":60,"type":"integer","minimum":30,"maximum":86400},"maxGapSeconds":{"default":120,"type":"integer","minimum":30,"maximum":86400},"maxNewLeadsPerDay":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":1000},{"type":"null"}]}},"required":["minGapSeconds","maxGapSeconds"],"additionalProperties":false},"suppressionPolicy":{"type":"object","properties":{"bypassSuppressionReasons":{"default":[],"type":"array","items":{"type":"string","enum":["manual","unsubscribed","not_interested","existing_customer","open_opportunity","competitor","employee","invalid_recipient","complained","recently_contacted","unresponsive"]}},"cooldownDays":{"default":30,"type":"integer","minimum":0,"maximum":365},"unresponsiveAfterTouches":{"default":3,"type":"integer","minimum":0,"maximum":50},"autoSuppressKeywords":{"default":["unsubscribe","stop contacting","do not contact","remove me","take me off","not interested"],"type":"array","items":{"type":"string"}}},"required":["bypassSuppressionReasons","cooldownDays","unresponsiveAfterTouches","autoSuppressKeywords"],"additionalProperties":false},"dryRun":{"type":"boolean"},"startedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"startedBy":{"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":"null"}]},"pausedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"pausedBy":{"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":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"archivedBy":{"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":"null"}]},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"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":"null"}]},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"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":"null"}]},"connectedAccounts":{"type":"array","items":{"type":"object","properties":{"connectedAccountId":{"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)$"},"channel":{"type":"string","enum":["linkedin","instagram"]}},"required":["connectedAccountId","channel"],"additionalProperties":false}}},"required":["id","ownerOrgId","name","status","graph","schedule","limits","suppressionPolicy","dryRun","startedAt","startedBy","pausedAt","pausedBy","completedAt","archivedAt","archivedBy","createdAt","createdBy","updatedAt","updatedBy","connectedAccounts"],"additionalProperties":false}},"required":["campaign"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"tags":["Campaigns"],"operationId":"updateCampaign","summary":"Update a campaign","parameters":[{"in":"path","name":"campaignId","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":"Campaign id"},"required":true,"description":"Campaign id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256},"status":{"type":"string","enum":["active","paused"]},"graph":{"type":"object","properties":{"nodes":{"minItems":2,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"start"},"label":{"type":"string","maxLength":120}},"required":["id","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"end"},"label":{"type":"string","maxLength":120}},"required":["id","kind"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"delay"},"label":{"type":"string","maxLength":120},"duration":{"type":"object","properties":{"days":{"default":0,"type":"integer","minimum":0,"maximum":90},"hours":{"default":0,"type":"integer","minimum":0,"maximum":23},"minutes":{"default":0,"type":"integer","minimum":0,"maximum":59}}}},"required":["id","kind","duration"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"action"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"action":{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},"content":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"template"},"text":{"type":"string","minLength":1}},"required":["kind","text"]},{"type":"object","properties":{"kind":{"type":"string","const":"ai"},"prompt":{"type":"string","minLength":1},"context":{"default":["profile"],"type":"array","items":{"type":"string","enum":["profile","posts","conversation","lead_properties"]}},"model":{"type":"string"},"maxChars":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"fallbackText":{"type":"string"},"requiresApproval":{"default":false,"type":"boolean"}},"required":["kind","prompt"]}],"type":"object"}},"required":["id","kind","channel","action"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"condition"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"test":{"oneOf":[{"type":"object","properties":{"predicate":{"type":"string","const":"is_connection"}},"required":["predicate"]},{"type":"object","properties":{"predicate":{"type":"string","const":"has_attribute"},"attribute":{"type":"string","minLength":1,"maxLength":64},"equals":{"type":"string","maxLength":256}},"required":["predicate","attribute"]}],"type":"object"}},"required":["id","kind","channel","test"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"wait_until"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"event":{"type":"string","enum":["linkedin_invite_accepted","linkedin_message_received","instagram_message_received"]},"timeout":{"type":"object","properties":{"days":{"default":0,"type":"integer","minimum":0,"maximum":90},"hours":{"default":0,"type":"integer","minimum":0,"maximum":23},"minutes":{"default":0,"type":"integer","minimum":0,"maximum":59}}}},"required":["id","kind","channel","event","timeout"]}],"type":"object"}},"edges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"to":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"label":{"default":"next","type":"string","enum":["next","yes","no","on_event","on_timeout"]}},"required":["from","to"]}}},"required":["nodes","edges"]},"schedule":{"type":"object","properties":{"workingDays":{"default":[1,2,3,4,5],"minItems":1,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"startTime":{"default":"09:00","type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"default":"17:00","type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}}},"limits":{"type":"object","properties":{"minGapSeconds":{"default":60,"type":"integer","minimum":30,"maximum":86400},"maxGapSeconds":{"default":120,"type":"integer","minimum":30,"maximum":86400},"maxNewLeadsPerDay":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":1000},{"type":"null"}]}}},"suppressionPolicy":{"type":"object","properties":{"bypassSuppressionReasons":{"default":[],"type":"array","items":{"type":"string","enum":["manual","unsubscribed","not_interested","existing_customer","open_opportunity","competitor","employee","invalid_recipient","complained","recently_contacted","unresponsive"]}},"cooldownDays":{"default":30,"type":"integer","minimum":0,"maximum":365},"unresponsiveAfterTouches":{"default":3,"type":"integer","minimum":0,"maximum":50},"autoSuppressKeywords":{"default":["unsubscribe","stop contacting","do not contact","remove me","take me off","not interested"],"type":"array","items":{"type":"string"}}}},"dryRun":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Updated campaign.","content":{"application/json":{"schema":{"type":"object","properties":{"campaign":{"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)$"},"ownerOrgId":{"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":{"type":"string"},"status":{"type":"string","enum":["draft","active","paused","completed","archived"]},"graph":{"type":"object","properties":{"nodes":{"minItems":2,"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"start"},"label":{"type":"string","maxLength":120}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"end"},"label":{"type":"string","maxLength":120}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"delay"},"label":{"type":"string","maxLength":120},"duration":{"type":"object","properties":{"days":{"default":0,"type":"integer","minimum":0,"maximum":90},"hours":{"default":0,"type":"integer","minimum":0,"maximum":23},"minutes":{"default":0,"type":"integer","minimum":0,"maximum":59}},"required":["days","hours","minutes"],"additionalProperties":false}},"required":["id","kind","duration"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"action"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"action":{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},"content":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","const":"template"},"text":{"type":"string","minLength":1}},"required":["kind","text"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"ai"},"prompt":{"type":"string","minLength":1},"context":{"default":["profile"],"type":"array","items":{"type":"string","enum":["profile","posts","conversation","lead_properties"]}},"model":{"type":"string"},"maxChars":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"fallbackText":{"type":"string"},"requiresApproval":{"default":false,"type":"boolean"}},"required":["kind","prompt","context","requiresApproval"],"additionalProperties":false}],"type":"object"}},"required":["id","kind","channel","action"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"condition"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"test":{"oneOf":[{"type":"object","properties":{"predicate":{"type":"string","const":"is_connection"}},"required":["predicate"],"additionalProperties":false},{"type":"object","properties":{"predicate":{"type":"string","const":"has_attribute"},"attribute":{"type":"string","minLength":1,"maxLength":64},"equals":{"type":"string","maxLength":256}},"required":["predicate","attribute"],"additionalProperties":false}],"type":"object"}},"required":["id","kind","channel","test"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"kind":{"type":"string","const":"wait_until"},"label":{"type":"string","maxLength":120},"channel":{"type":"string","enum":["linkedin","instagram"]},"event":{"type":"string","enum":["linkedin_invite_accepted","linkedin_message_received","instagram_message_received"]},"timeout":{"type":"object","properties":{"days":{"default":0,"type":"integer","minimum":0,"maximum":90},"hours":{"default":0,"type":"integer","minimum":0,"maximum":23},"minutes":{"default":0,"type":"integer","minimum":0,"maximum":59}},"required":["days","hours","minutes"],"additionalProperties":false}},"required":["id","kind","channel","event","timeout"],"additionalProperties":false}],"type":"object"}},"edges":{"type":"array","items":{"type":"object","properties":{"from":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"to":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9_-]+$"},"label":{"default":"next","type":"string","enum":["next","yes","no","on_event","on_timeout"]}},"required":["from","to","label"],"additionalProperties":false}}},"required":["nodes","edges"],"additionalProperties":false},"schedule":{"type":"object","properties":{"workingDays":{"default":[1,2,3,4,5],"minItems":1,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"startTime":{"default":"09:00","type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"endTime":{"default":"17:00","type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"}},"required":["workingDays","startTime","endTime"],"additionalProperties":false},"limits":{"type":"object","properties":{"minGapSeconds":{"default":60,"type":"integer","minimum":30,"maximum":86400},"maxGapSeconds":{"default":120,"type":"integer","minimum":30,"maximum":86400},"maxNewLeadsPerDay":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":1000},{"type":"null"}]}},"required":["minGapSeconds","maxGapSeconds"],"additionalProperties":false},"suppressionPolicy":{"type":"object","properties":{"bypassSuppressionReasons":{"default":[],"type":"array","items":{"type":"string","enum":["manual","unsubscribed","not_interested","existing_customer","open_opportunity","competitor","employee","invalid_recipient","complained","recently_contacted","unresponsive"]}},"cooldownDays":{"default":30,"type":"integer","minimum":0,"maximum":365},"unresponsiveAfterTouches":{"default":3,"type":"integer","minimum":0,"maximum":50},"autoSuppressKeywords":{"default":["unsubscribe","stop contacting","do not contact","remove me","take me off","not interested"],"type":"array","items":{"type":"string"}}},"required":["bypassSuppressionReasons","cooldownDays","unresponsiveAfterTouches","autoSuppressKeywords"],"additionalProperties":false},"dryRun":{"type":"boolean"},"startedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"startedBy":{"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":"null"}]},"pausedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"pausedBy":{"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":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"archivedBy":{"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":"null"}]},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"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":"null"}]},"updatedAt":{"type":"string","format":"date-time"},"updatedBy":{"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":"null"}]},"connectedAccounts":{"type":"array","items":{"type":"object","properties":{"connectedAccountId":{"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)$"},"channel":{"type":"string","enum":["linkedin","instagram"]}},"required":["connectedAccountId","channel"],"additionalProperties":false}}},"required":["id","ownerOrgId","name","status","graph","schedule","limits","suppressionPolicy","dryRun","startedAt","startedBy","pausedAt","pausedBy","completedAt","archivedAt","archivedBy","createdAt","createdBy","updatedAt","updatedBy","connectedAccounts"],"additionalProperties":false}},"required":["campaign"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"tags":["Campaigns"],"operationId":"archiveCampaign","summary":"Archive a campaign","parameters":[{"in":"path","name":"campaignId","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":"Campaign id"},"required":true,"description":"Campaign id"}],"responses":{"200":{"description":"Campaign archived.","content":{"application/json":{"schema":{"type":"object","properties":{"archived":{"type":"boolean","const":true}},"required":["archived"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/campaigns/{campaignId}/stats":{"get":{"tags":["Campaigns"],"operationId":"getCampaignStats","summary":"Get campaign stats","parameters":[{"in":"path","name":"campaignId","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":"Campaign id"},"required":true,"description":"Campaign id"}],"responses":{"200":{"description":"Funnel, enrollments, steps, and account health.","content":{"application/json":{"schema":{"type":"object","properties":{"stats":{"type":"object","properties":{"funnel":{"type":"object","properties":{"submitted":{"type":"number"},"enrolled":{"type":"number"},"skippedByReason":{"type":"object","propertyNames":{"type":"string","enum":["duplicate_in_batch","enrolled_elsewhere","suppressed","daily_limit_reached","missing_identity","missing_personalization","already_connected","already_invited","already_following","follow_request_pending","not_first_degree","invalid_recipient","generation_failed"]},"additionalProperties":{"type":"number"}},"invitesSent":{"type":"number"},"invitesAccepted":{"type":"number"},"acceptanceRate":{"anyOf":[{"type":"number"},{"type":"null"}]},"messagesSent":{"type":"number"},"repliedLeads":{"type":"number"},"replyRate":{"anyOf":[{"type":"number"},{"type":"null"}]}},"required":["submitted","enrolled","skippedByReason","invitesSent","invitesAccepted","acceptanceRate","messagesSent","repliedLeads","replyRate"],"additionalProperties":false},"enrollments":{"type":"object","properties":{"active":{"type":"number"},"waiting":{"type":"number"},"completed":{"type":"number"},"stopped":{"type":"number"},"failed":{"type":"number"},"byExitReason":{"type":"object","propertyNames":{"type":"string","enum":["finished","replied","timeout","manual","suppressed","dead_end","error","account_disconnected","campaign_archived"]},"additionalProperties":{"type":"number"}}},"required":["active","waiting","completed","stopped","failed","byExitReason"],"additionalProperties":false},"steps":{"type":"array","items":{"type":"object","properties":{"nodeId":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string","enum":["start","end","delay","action","condition","wait_until"]},"channel":{"anyOf":[{"type":"string","enum":["linkedin","instagram"]},{"type":"null"}]},"action":{"anyOf":[{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},{"type":"null"}]},"reachedLeads":{"type":"number"},"sent":{"type":"number"},"accepted":{"type":"number"},"replied":{"type":"number"},"skipped":{"type":"number"},"failed":{"type":"number"}},"required":["nodeId","label","kind","channel","action","reachedLeads","sent","accepted","replied","skipped","failed"],"additionalProperties":false}},"channels":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["linkedin","instagram"]},"invitesSent":{"type":"number"},"invitesAccepted":{"type":"number"},"messagesSent":{"type":"number"},"replies":{"type":"number"}},"required":["channel","invitesSent","invitesAccepted","messagesSent","replies"],"additionalProperties":false}},"timeSeries":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"counts":{"type":"object","propertyNames":{"type":"string","enum":["lead_enrolled","lead_skipped","message_generated","task_skipped","task_failed","enrollment_completed","enrollment_stopped","lead_suppressed","account_paused","campaign_status_changed","linkedin_profile_visited","linkedin_invite_sent","linkedin_invite_withdrawn","linkedin_message_sent","linkedin_follow_sent","linkedin_unfollowed","linkedin_invite_accepted","linkedin_message_received","linkedin_account_status_changed","instagram_message_sent","instagram_profile_visited","instagram_follow_sent","instagram_unfollowed","instagram_message_received","instagram_account_status_changed"]},"additionalProperties":{"type":"number"}}},"required":["day","counts"],"additionalProperties":false}},"connectedAccounts":{"type":"array","items":{"type":"object","properties":{"connectedAccountId":{"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)$"},"channel":{"type":"string","enum":["linkedin","instagram"]},"displayName":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["active","paused","auth_required","disconnected"]},"pausedUntil":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"usage":{"type":"array","items":{"type":"object","properties":{"action":{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},"hourUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hourLimit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"dayUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"dayLimit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weekUsed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weekLimit":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]}},"required":["action","hourUsed","hourLimit","dayUsed","dayLimit","weekUsed","weekLimit"],"additionalProperties":false}}},"required":["connectedAccountId","channel","displayName","status","pausedUntil","usage"],"additionalProperties":false}}},"required":["funnel","enrollments","steps","channels","timeSeries","connectedAccounts"],"additionalProperties":false}},"required":["stats"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/campaigns/{campaignId}/events":{"get":{"tags":["Campaigns"],"operationId":"listCampaignEvents","summary":"List campaign events","parameters":[{"in":"path","name":"campaignId","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":"Campaign id"},"required":true,"description":"Campaign id"},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of campaign events, newest first. Pass nextCursor as cursor for the next page.","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"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)$"},"type":{"type":"string","enum":["lead_enrolled","lead_skipped","message_generated","task_skipped","task_failed","enrollment_completed","enrollment_stopped","lead_suppressed","account_paused","campaign_status_changed","linkedin_profile_visited","linkedin_invite_sent","linkedin_invite_withdrawn","linkedin_message_sent","linkedin_follow_sent","linkedin_unfollowed","linkedin_invite_accepted","linkedin_message_received","linkedin_account_status_changed","instagram_message_sent","instagram_profile_visited","instagram_follow_sent","instagram_unfollowed","instagram_message_received","instagram_account_status_changed"]},"label":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"channel":{"anyOf":[{"type":"string","enum":["linkedin","instagram"]},{"type":"null"}]},"nodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"leadId":{"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":"null"}]},"leadName":{"anyOf":[{"type":"string"},{"type":"null"}]},"enrollmentId":{"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":"null"}]},"connectedAccountId":{"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":"null"}]},"data":{"anyOf":[{"type":"object","properties":{"nodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"anyOf":[{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},{"type":"null"}]},"skipReason":{"anyOf":[{"type":"string","enum":["duplicate_in_batch","enrolled_elsewhere","suppressed","daily_limit_reached","missing_identity","missing_personalization","already_connected","already_invited","already_following","follow_request_pending","not_first_degree","invalid_recipient","generation_failed"]},{"type":"null"}]},"exitReason":{"anyOf":[{"type":"string","enum":["finished","replied","timeout","manual","suppressed","dead_end","error","account_disconnected","campaign_archived"]},{"type":"null"}]},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorKind":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]},"suppressionReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyword":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","type","label","occurredAt","channel","nodeId","leadId","leadName","enrollmentId","connectedAccountId","data"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["events","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/campaigns/{campaignId}/leads":{"get":{"tags":["Campaigns"],"operationId":"listCampaignLeads","summary":"List campaign leads","parameters":[{"in":"path","name":"campaignId","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":"Campaign id"},"required":true,"description":"Campaign id"},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of leads in the campaign, newest first. Pass nextCursor as cursor for the next page.","content":{"application/json":{"schema":{"type":"object","properties":{"leads":{"type":"array","items":{"type":"object","properties":{"leadId":{"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)$"},"enrollmentId":{"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)$"},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"email":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}]},"status":{"type":"string","enum":["active","waiting","completed","stopped","failed"]},"exitReason":{"anyOf":[{"type":"string","enum":["finished","replied","timeout","manual","suppressed","dead_end","error","account_disconnected","campaign_archived"]},{"type":"null"}]},"currentNodeId":{"type":"string"},"waitingFor":{"anyOf":[{"type":"string","enum":["linkedin_invite_accepted","linkedin_message_received","instagram_message_received"]},{"type":"null"}]},"waitingUntil":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"lastEventAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"completedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["leadId","enrollmentId","firstName","lastName","companyName","companyDomain","jobTitle","email","imageUrl","timezone","status","exitReason","currentNodeId","waitingFor","waitingUntil","lastEventAt","completedAt","createdAt","updatedAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["leads","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Campaigns"],"operationId":"enrollCampaignLeads","summary":"Enroll leads","parameters":[{"in":"path","name":"campaignId","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":"Campaign id"},"required":true,"description":"Campaign id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"leads":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"identities":{"type":"object","properties":{"linkedin":{"type":"string","minLength":1},"instagram":{"type":"string","minLength":1}}},"firstName":{"type":"string","maxLength":256},"lastName":{"type":"string","maxLength":256},"companyName":{"type":"string","maxLength":256},"companyDomain":{"type":"string","maxLength":256},"jobTitle":{"type":"string","maxLength":256},"email":{"type":"string","maxLength":256},"imageUrl":{"type":"string","maxLength":2048},"timezone":{"type":"string"},"properties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["identities","timezone"]}}},"required":["leads"]}}}},"responses":{"201":{"description":"Enrollment results per lead.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","const":"accepted"},"leadId":{"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)$"},"enrollmentId":{"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)$"}},"required":["index","status","leadId","enrollmentId"],"additionalProperties":false},{"type":"object","properties":{"index":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"status":{"type":"string","const":"skipped"},"reason":{"type":"string","enum":["duplicate_in_batch","enrolled_elsewhere","suppressed","daily_limit_reached","missing_identity","missing_personalization","already_connected","already_invited","already_following","follow_request_pending","not_first_degree","invalid_recipient","generation_failed"]}},"required":["index","status","reason"],"additionalProperties":false}],"type":"object"}}},"required":["results"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/campaigns/{campaignId}/leads/{leadId}":{"delete":{"tags":["Campaigns"],"operationId":"removeCampaignLead","summary":"Stop a lead in a campaign","parameters":[{"in":"path","name":"campaignId","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":"Campaign id"},"required":true,"description":"Campaign id"},{"in":"path","name":"leadId","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":"Lead id"},"required":true,"description":"Lead id"}],"responses":{"200":{"description":"Lead enrollment stopped.","content":{"application/json":{"schema":{"type":"object","properties":{"stopped":{"type":"boolean","const":true}},"required":["stopped"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/campaigns/{campaignId}/pending":{"get":{"tags":["Campaigns"],"operationId":"listPendingApprovals","summary":"List pending approvals","parameters":[{"in":"path","name":"campaignId","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":"Campaign id"},"required":true,"description":"Campaign id"},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"A page of tasks waiting for human approval, newest first. Pass nextCursor as cursor for the next page.","content":{"application/json":{"schema":{"type":"object","properties":{"pending":{"type":"array","items":{"type":"object","properties":{"taskId":{"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)$"},"nodeId":{"type":"string"},"leadId":{"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)$"},"leadName":{"anyOf":[{"type":"string"},{"type":"null"}]},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"generatedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"scheduledAt":{"type":"string","format":"date-time"}},"required":["taskId","nodeId","leadId","leadName","text","generatedAt","scheduledAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["pending","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/campaigns/{campaignId}/pending/{taskId}":{"patch":{"tags":["Campaigns"],"operationId":"approvePendingTask","summary":"Approve a pending send","parameters":[{"in":"path","name":"campaignId","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":"Campaign id"},"required":true,"description":"Campaign id"},{"in":"path","name":"taskId","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":"Pending task id"},"required":true,"description":"Pending task id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":8000}}}}}},"responses":{"200":{"description":"Task approved.","content":{"application/json":{"schema":{"type":"object","properties":{"approved":{"type":"boolean","const":true}},"required":["approved"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/events/search":{"post":{"tags":["Events"],"operationId":"searchEvents","summary":"Search events","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"types":{"type":"array","items":{"type":"string","enum":["lead_enrolled","lead_skipped","message_generated","task_skipped","task_failed","enrollment_completed","enrollment_stopped","lead_suppressed","account_paused","campaign_status_changed","linkedin_profile_visited","linkedin_invite_sent","linkedin_invite_withdrawn","linkedin_message_sent","linkedin_follow_sent","linkedin_unfollowed","linkedin_invite_accepted","linkedin_message_received","linkedin_account_status_changed","instagram_message_sent","instagram_profile_visited","instagram_follow_sent","instagram_unfollowed","instagram_message_received","instagram_account_status_changed"]}},"channel":{"type":"string","enum":["linkedin","instagram"]},"campaignId":{"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)$"},"leadId":{"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)$"},"accountId":{"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)$"},"from":{"type":"string","format":"date","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])))$"},"to":{"type":"string","format":"date","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])))$"},"cursor":{"type":"string","minLength":1},"limit":{"type":"integer","minimum":1,"maximum":100}}}}}},"responses":{"200":{"description":"A page of events, newest first. Filter by campaign, lead, account, type, channel, or date. Pass nextCursor as cursor for the next page.","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"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)$"},"type":{"type":"string","enum":["lead_enrolled","lead_skipped","message_generated","task_skipped","task_failed","enrollment_completed","enrollment_stopped","lead_suppressed","account_paused","campaign_status_changed","linkedin_profile_visited","linkedin_invite_sent","linkedin_invite_withdrawn","linkedin_message_sent","linkedin_follow_sent","linkedin_unfollowed","linkedin_invite_accepted","linkedin_message_received","linkedin_account_status_changed","instagram_message_sent","instagram_profile_visited","instagram_follow_sent","instagram_unfollowed","instagram_message_received","instagram_account_status_changed"]},"label":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"channel":{"anyOf":[{"type":"string","enum":["linkedin","instagram"]},{"type":"null"}]},"nodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"leadId":{"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":"null"}]},"leadName":{"anyOf":[{"type":"string"},{"type":"null"}]},"campaignId":{"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":"null"}]},"campaignName":{"anyOf":[{"type":"string"},{"type":"null"}]},"enrollmentId":{"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":"null"}]},"connectedAccountId":{"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":"null"}]},"accountName":{"anyOf":[{"type":"string"},{"type":"null"}]},"data":{"anyOf":[{"type":"object","properties":{"nodeId":{"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"anyOf":[{"type":"string","enum":["linkedin_invitation","linkedin_cancel_invitation","linkedin_message","linkedin_inmail","linkedin_profile_view","instagram_message","instagram_profile_view","instagram_follow","instagram_unfollow"]},{"type":"null"}]},"skipReason":{"anyOf":[{"type":"string","enum":["duplicate_in_batch","enrolled_elsewhere","suppressed","daily_limit_reached","missing_identity","missing_personalization","already_connected","already_invited","already_following","follow_request_pending","not_first_degree","invalid_recipient","generation_failed"]},{"type":"null"}]},"exitReason":{"anyOf":[{"type":"string","enum":["finished","replied","timeout","manual","suppressed","dead_end","error","account_disconnected","campaign_archived"]},{"type":"null"}]},"text":{"anyOf":[{"type":"string"},{"type":"null"}]},"errorKind":{"anyOf":[{"type":"string"},{"type":"null"}]},"message":{"anyOf":[{"type":"string"},{"type":"null"}]},"suppressionReason":{"anyOf":[{"type":"string"},{"type":"null"}]},"keyword":{"anyOf":[{"type":"string"},{"type":"null"}]}},"additionalProperties":false},{"type":"null"}]}},"required":["id","type","label","occurredAt","channel","nodeId","leadId","leadName","campaignId","campaignName","enrollmentId","connectedAccountId","accountName","data"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["events","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/linkedin/profiles/{identity}":{"get":{"tags":["LinkedIn"],"operationId":"getLinkedinProfile","summary":"Get a LinkedIn profile","parameters":[{"in":"path","name":"identity","schema":{"type":"string","minLength":1,"description":"Public identifier, provider id, or profile URL"},"required":true,"description":"Public identifier, provider id, or profile URL"},{"in":"query","name":"connectedAccountId","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":"Connected account to act as"},"required":true,"description":"Connected account to act as"}],"responses":{"200":{"description":"LinkedIn profile.","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"type":"object","properties":{"publicIdentifier":{"anyOf":[{"type":"string"},{"type":"null"}]},"profileUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"anyOf":[{"type":"string"},{"type":"null"}]},"headline":{"anyOf":[{"type":"string"},{"type":"null"}]},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrlLarge":{"anyOf":[{"type":"string"},{"type":"null"}]},"backgroundImageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"followerCount":{"anyOf":[{"type":"number"},{"type":"null"}]},"degree":{"type":"string","enum":["self","first","second","third_plus","out_of_network","unknown"]},"invitationPending":{"type":"boolean","description":"An invitation from this account is awaiting an answer."},"isConnected":{"type":"boolean","description":"A first-degree connection, so a plain message will be delivered."}},"required":["publicIdentifier","profileUrl","firstName","lastName","fullName","headline","summary","location","companyName","jobTitle","imageUrl","imageUrlLarge","backgroundImageUrl","followerCount","degree","invitationPending","isConnected"],"additionalProperties":false},"remainingToday":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["profile","remainingToday"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/linkedin/search":{"post":{"tags":["LinkedIn"],"operationId":"searchLinkedinPeople","summary":"Search LinkedIn people","description":"Provide either `keywords` or a LinkedIn/Sales Navigator `searchUrl`, not both.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connectedAccountId":{"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":"Connected account to act as"},"keywords":{"type":"string","minLength":1,"maxLength":512},"searchUrl":{"type":"string","maxLength":4096,"format":"uri"},"cursor":{"type":"string","minLength":1,"maxLength":8192},"limit":{"type":"integer","minimum":1,"maximum":100}},"required":["connectedAccountId"]}}}},"responses":{"200":{"description":"Search hits and an optional cursor.","content":{"application/json":{"schema":{"type":"object","properties":{"hits":{"type":"array","items":{"type":"object","properties":{"publicIdentifier":{"anyOf":[{"type":"string"},{"type":"null"}]},"profileUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"anyOf":[{"type":"string"},{"type":"null"}]},"headline":{"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"anyOf":[{"type":"string"},{"type":"null"}]},"companyName":{"anyOf":[{"type":"string"},{"type":"null"}]},"jobTitle":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrlLarge":{"anyOf":[{"type":"string"},{"type":"null"}]},"degree":{"type":"string","enum":["self","first","second","third_plus","out_of_network","unknown"]},"invitationPending":{"type":"boolean"}},"required":["publicIdentifier","profileUrl","fullName","headline","location","companyName","jobTitle","imageUrl","imageUrlLarge","degree","invitationPending"],"additionalProperties":false}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["hits","cursor"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/linkedin/messages":{"post":{"tags":["LinkedIn"],"operationId":"sendLinkedinMessage","summary":"Send a LinkedIn message","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connectedAccountId":{"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":"Connected account to act as"},"identity":{"type":"string","minLength":1,"description":"Public identifier, provider id, or profile URL"},"text":{"type":"string","minLength":1,"maxLength":8000},"dryRun":{"default":false,"type":"boolean"}},"required":["connectedAccountId","identity","text"]}}}},"responses":{"201":{"description":"Send result.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"anyOf":[{"type":"object","properties":{"providerMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"conversationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"type":"string","format":"date-time"}},"required":["providerMessageId","conversationId","sentAt"],"additionalProperties":false},{"type":"null"}]},"remainingToday":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["result","remainingToday"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/linkedin/conversations/{conversationId}/messages":{"get":{"tags":["LinkedIn"],"operationId":"listLinkedinConversationMessages","summary":"List messages in a conversation","parameters":[{"in":"path","name":"conversationId","schema":{"type":"string","minLength":1,"description":"Conversation id"},"required":true,"description":"Conversation id"},{"in":"query","name":"connectedAccountId","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":"Connected account to act as"},"required":true,"description":"Connected account to act as"},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Conversation messages.","content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","properties":{"providerMessageId":{"type":"string"},"conversationId":{"type":"string"},"direction":{"type":"string","enum":["outbound","inbound"]},"text":{"type":"string"},"sentAt":{"type":"string","format":"date-time"}},"required":["providerMessageId","conversationId","direction","text","sentAt"],"additionalProperties":false}}},"required":["messages"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/linkedin/invitations":{"get":{"tags":["LinkedIn"],"operationId":"listLinkedinInvitations","summary":"List pending invitations","parameters":[{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"connectedAccountId","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":"Connected account to act as"},"required":true,"description":"Connected account to act as"}],"responses":{"200":{"description":"A page of pending invitations. Pass nextCursor as cursor for the next page.","content":{"application/json":{"schema":{"type":"object","properties":{"invitations":{"type":"array","items":{"type":"object","properties":{"providerInvitationId":{"type":"string"},"publicIdentifier":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["providerInvitationId","publicIdentifier","sentAt"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["invitations","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["LinkedIn"],"operationId":"sendLinkedinInvitation","summary":"Send a connection invitation","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connectedAccountId":{"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":"Connected account to act as"},"identity":{"type":"string","minLength":1,"description":"Public identifier, provider id, or profile URL"},"note":{"type":"string","maxLength":300},"dryRun":{"default":false,"type":"boolean"}},"required":["connectedAccountId","identity"]}}}},"responses":{"201":{"description":"Invitation result.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"anyOf":[{"type":"object","properties":{"providerInvitationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"type":"string","format":"date-time"}},"required":["providerInvitationId","sentAt"],"additionalProperties":false},{"type":"null"}]},"remainingToday":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["result","remainingToday"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/linkedin/invitations/{invitationId}":{"delete":{"tags":["LinkedIn"],"operationId":"withdrawLinkedinInvitation","summary":"Withdraw an invitation","parameters":[{"in":"path","name":"invitationId","schema":{"type":"string","minLength":1,"description":"Provider invitation id"},"required":true,"description":"Provider invitation id"},{"in":"query","name":"connectedAccountId","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":"Connected account to act as"},"required":true,"description":"Connected account to act as"}],"responses":{"200":{"description":"Invitation withdrawn.","content":{"application/json":{"schema":{"type":"object","properties":{"withdrawn":{"type":"boolean","const":true}},"required":["withdrawn"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/linkedin/relations":{"get":{"tags":["LinkedIn"],"operationId":"listLinkedinRelations","summary":"List first-degree connections","parameters":[{"in":"query","name":"connectedAccountId","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":"Connected account to act as"},"required":true,"description":"Connected account to act as"},{"in":"query","name":"cursor","schema":{"type":"string","minLength":1,"maxLength":8192}}],"responses":{"200":{"description":"Relations and an optional cursor.","content":{"application/json":{"schema":{"type":"object","properties":{"relations":{"type":"array","items":{"type":"object","properties":{"publicIdentifier":{"anyOf":[{"type":"string"},{"type":"null"}]},"connectedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["publicIdentifier","connectedAt"],"additionalProperties":false}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["relations","cursor"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/instagram/profiles/{identity}":{"get":{"tags":["Instagram"],"operationId":"getInstagramProfile","summary":"Get an Instagram profile","parameters":[{"in":"path","name":"identity","schema":{"type":"string","minLength":1,"description":"Username, provider id, or profile URL"},"required":true,"description":"Username, provider id, or profile URL"},{"in":"query","name":"connectedAccountId","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":"Connected account to act as"},"required":true,"description":"Connected account to act as"}],"responses":{"200":{"description":"Instagram profile.","content":{"application/json":{"schema":{"type":"object","properties":{"profile":{"type":"object","properties":{"username":{"anyOf":[{"type":"string"},{"type":"null"}]},"profileUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"firstName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastName":{"anyOf":[{"type":"string"},{"type":"null"}]},"fullName":{"anyOf":[{"type":"string"},{"type":"null"}]},"biography":{"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrlLarge":{"anyOf":[{"type":"string"},{"type":"null"}]},"backgroundImageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"followerCount":{"anyOf":[{"type":"number"},{"type":"null"}]},"followRequestPending":{"type":"boolean","description":"A follow request awaiting an answer; only private accounts can be in this state."},"isFollowing":{"type":"boolean","description":"This account already follows them."}},"required":["username","profileUrl","firstName","lastName","fullName","biography","location","imageUrl","imageUrlLarge","backgroundImageUrl","followerCount","followRequestPending","isFollowing"],"additionalProperties":false},"remainingToday":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["profile","remainingToday"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/instagram/messages":{"post":{"tags":["Instagram"],"operationId":"sendInstagramMessage","summary":"Send an Instagram message","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connectedAccountId":{"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":"Connected account to act as"},"identity":{"type":"string","minLength":1,"description":"Username, provider id, or profile URL"},"text":{"type":"string","minLength":1,"maxLength":8000},"dryRun":{"default":false,"type":"boolean"}},"required":["connectedAccountId","identity","text"]}}}},"responses":{"201":{"description":"Send result.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"anyOf":[{"type":"object","properties":{"providerMessageId":{"anyOf":[{"type":"string"},{"type":"null"}]},"conversationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"type":"string","format":"date-time"}},"required":["providerMessageId","conversationId","sentAt"],"additionalProperties":false},{"type":"null"}]},"remainingToday":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["result","remainingToday"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/instagram/conversations/{conversationId}/messages":{"get":{"tags":["Instagram"],"operationId":"listInstagramConversationMessages","summary":"List messages in a conversation","parameters":[{"in":"path","name":"conversationId","schema":{"type":"string","minLength":1,"description":"Conversation id"},"required":true,"description":"Conversation id"},{"in":"query","name":"connectedAccountId","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":"Connected account to act as"},"required":true,"description":"Connected account to act as"},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Conversation messages.","content":{"application/json":{"schema":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"object","properties":{"providerMessageId":{"type":"string"},"conversationId":{"type":"string"},"direction":{"type":"string","enum":["outbound","inbound"]},"text":{"type":"string"},"sentAt":{"type":"string","format":"date-time"}},"required":["providerMessageId","conversationId","direction","text","sentAt"],"additionalProperties":false}}},"required":["messages"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/instagram/follows":{"post":{"tags":["Instagram"],"operationId":"followInstagramUser","summary":"Follow an Instagram user","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connectedAccountId":{"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":"Connected account to act as"},"identity":{"type":"string","minLength":1,"description":"Username, provider id, or profile URL"},"dryRun":{"default":false,"type":"boolean"}},"required":["connectedAccountId","identity"]}}}},"responses":{"201":{"description":"Follow result.","content":{"application/json":{"schema":{"type":"object","properties":{"result":{"anyOf":[{"type":"object","properties":{"providerInvitationId":{"anyOf":[{"type":"string"},{"type":"null"}]},"sentAt":{"type":"string","format":"date-time"}},"required":["providerInvitationId","sentAt"],"additionalProperties":false},{"type":"null"}]},"remainingToday":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["result","remainingToday"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/instagram/follows/{identity}":{"delete":{"tags":["Instagram"],"operationId":"unfollowInstagramUser","summary":"Unfollow an Instagram user","parameters":[{"in":"path","name":"identity","schema":{"type":"string","minLength":1,"description":"Username, provider id, or profile URL"},"required":true,"description":"Username, provider id, or profile URL"},{"in":"query","name":"connectedAccountId","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":"Connected account to act as"},"required":true,"description":"Connected account to act as"}],"responses":{"200":{"description":"Unfollowed.","content":{"application/json":{"schema":{"type":"object","properties":{"unfollowed":{"type":"boolean","const":true}},"required":["unfollowed"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/places/search":{"post":{"tags":["Places"],"operationId":"searchPlaces","summary":"Search places","description":"Build a list of businesses and locations. Pass a query for text search, or a location (and optional type) for nearby search. Page text-search results with the returned cursor.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"query":{"description":"Free-text query, e.g. \"dentists in Munich\". Required unless `location` is set.","type":"string","minLength":1,"maxLength":1024},"location":{"description":"Center point. Required unless `query` is set. Without a query this is a nearby search inside the radius.","type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180}},"required":["latitude","longitude"]},"radiusMeters":{"description":"Radius when `location` is set. Defaults to 50 km. Nearby search stays inside this circle; text search is biased toward it.","type":"integer","minimum":1,"maximum":50000},"type":{"description":"A Google Places type such as `restaurant` or `dentist`.","type":"string","minLength":1,"maxLength":64},"language":{"description":"BCP-47 language code for names and addresses.","type":"string","minLength":2,"maxLength":16},"region":{"description":"CLDR region code that biases results, e.g. `DE`.","type":"string","minLength":2,"maxLength":2},"cursor":{"description":"Text-search pagination cursor. Nearby search does not page.","type":"string","minLength":1,"maxLength":8192},"limit":{"type":"integer","minimum":1,"maximum":20}}}}}},"responses":{"200":{"description":"Place hits and an optional cursor.","content":{"application/json":{"schema":{"type":"object","properties":{"hits":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"formattedAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}]},"googleMapsUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"websiteUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"websiteDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"types":{"type":"array","items":{"type":"string"}},"primaryType":{"anyOf":[{"type":"string"},{"type":"null"}]},"businessStatus":{"type":"string","enum":["operational","temporarily_closed","permanently_closed","unknown"]},"rating":{"anyOf":[{"type":"number"},{"type":"null"}]},"ratingCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"weekdayHours":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["id","name","formattedAddress","city","region","country","postalCode","location","googleMapsUrl","websiteUrl","websiteDomain","phone","types","primaryType","businessStatus","rating","ratingCount","weekdayHours"],"additionalProperties":false}},"cursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["hits","cursor"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/places/{placeId}":{"get":{"tags":["Places"],"operationId":"getPlace","summary":"Get a place","parameters":[{"in":"path","name":"placeId","schema":{"type":"string","minLength":1,"description":"Google Place id"},"required":true,"description":"Google Place id"}],"responses":{"200":{"description":"Place details.","content":{"application/json":{"schema":{"type":"object","properties":{"place":{"type":"object","properties":{"id":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"formattedAddress":{"anyOf":[{"type":"string"},{"type":"null"}]},"city":{"anyOf":[{"type":"string"},{"type":"null"}]},"region":{"anyOf":[{"type":"string"},{"type":"null"}]},"country":{"anyOf":[{"type":"string"},{"type":"null"}]},"postalCode":{"anyOf":[{"type":"string"},{"type":"null"}]},"location":{"anyOf":[{"type":"object","properties":{"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180}},"required":["latitude","longitude"],"additionalProperties":false},{"type":"null"}]},"googleMapsUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"websiteUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"websiteDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"phone":{"anyOf":[{"type":"string"},{"type":"null"}]},"types":{"type":"array","items":{"type":"string"}},"primaryType":{"anyOf":[{"type":"string"},{"type":"null"}]},"businessStatus":{"type":"string","enum":["operational","temporarily_closed","permanently_closed","unknown"]},"rating":{"anyOf":[{"type":"number"},{"type":"null"}]},"ratingCount":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}]},"weekdayHours":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["id","name","formattedAddress","city","region","country","postalCode","location","googleMapsUrl","websiteUrl","websiteDomain","phone","types","primaryType","businessStatus","rating","ratingCount","weekdayHours"],"additionalProperties":false}},"required":["place"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/compose":{"post":{"tags":["Compose"],"operationId":"composePreview","summary":"Preview an AI-composed message","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["linkedin","instagram"]},"connectedAccountId":{"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)$"},"identity":{"type":"string","minLength":1},"prompt":{"type":"string","minLength":1},"context":{"default":["profile"],"type":"array","items":{"type":"string","enum":["profile","posts","conversation","lead_properties"]}},"model":{"type":"string"},"maxChars":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"leadProperties":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string"}}},"required":["channel","connectedAccountId","identity","prompt"]}}}},"responses":{"200":{"description":"Generated text and compose metadata.","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"meta":{"type":"object","properties":{"model":{"type":"string"},"contextUsed":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["profile","posts","conversation","lead_properties"]},"cached":{"type":"boolean"},"itemCount":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["source","cached","itemCount"],"additionalProperties":false}},"usedFallback":{"type":"boolean"},"generatedAt":{"type":"string","format":"date-time"}},"required":["model","contextUsed","usedFallback","generatedAt"],"additionalProperties":false},"providerCalls":{"type":"integer","minimum":0,"maximum":9007199254740991},"remainingBudget":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"number"}}},"required":["text","meta","providerCalls","remainingBudget"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/suppressions":{"get":{"tags":["Suppressions"],"operationId":"listSuppressions","summary":"List suppressions","parameters":[{"in":"query","name":"cursor","schema":{"type":"string","minLength":1}},{"in":"query","name":"limit","schema":{"type":"integer","minimum":1,"maximum":100}},{"in":"query","name":"reason","schema":{"type":"string","enum":["manual","unsubscribed","not_interested","existing_customer","open_opportunity","competitor","employee","invalid_recipient","complained","recently_contacted","unresponsive"]}}],"responses":{"200":{"description":"A page of suppression entries, newest first. Pass nextCursor as cursor for the next page.","content":{"application/json":{"schema":{"type":"object","properties":{"suppressions":{"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)$"},"ownerOrgId":{"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)$"},"scope":{"type":"string","enum":["lead","company"]},"leadId":{"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":"null"}]},"companyDomain":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"type":"string","enum":["manual","unsubscribed","not_interested","existing_customer","open_opportunity","competitor","employee","invalid_recipient","complained","recently_contacted","unresponsive"]},"note":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"createdBy":{"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":"null"}]},"createdAt":{"type":"string","format":"date-time"},"deletedAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"deletedBy":{"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":"null"}]}},"required":["id","ownerOrgId","scope","leadId","companyDomain","reason","note","expiresAt","createdBy","createdAt","deletedAt","deletedBy"],"additionalProperties":false}},"nextCursor":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["suppressions","nextCursor"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"tags":["Suppressions"],"operationId":"createSuppressions","summary":"Create suppressions","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"entries":{"minItems":1,"maxItems":1000,"type":"array","items":{"oneOf":[{"type":"object","properties":{"scope":{"type":"string","const":"lead"},"leadId":{"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)$"},"reason":{"type":"string","enum":["manual","unsubscribed","not_interested","existing_customer","open_opportunity","competitor","employee","invalid_recipient","complained","recently_contacted","unresponsive"]},"note":{"type":"string","maxLength":500},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["scope","leadId","reason"]},{"type":"object","properties":{"scope":{"type":"string","const":"company"},"companyDomain":{"type":"string","minLength":1,"maxLength":256},"reason":{"type":"string","enum":["manual","unsubscribed","not_interested","existing_customer","open_opportunity","competitor","employee","invalid_recipient","complained","recently_contacted","unresponsive"]},"note":{"type":"string","maxLength":500},"expiresAt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["scope","companyDomain","reason"]}],"type":"object"}}},"required":["entries"]}}}},"responses":{"201":{"description":"Created entries.","content":{"application/json":{"schema":{"type":"object","properties":{"created":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"alreadyListed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["created","alreadyListed"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/suppressions/check":{"post":{"tags":["Suppressions"],"operationId":"checkSuppressions","summary":"Check people and companies against the suppression list","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"identities":{"minItems":1,"maxItems":1000,"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["linkedin","instagram"]},"identity":{"type":"string","minLength":1,"maxLength":512},"companyDomain":{"type":"string","maxLength":256},"campaignId":{"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)$"}},"required":["channel","identity"]}}},"required":["identities"]}}}},"responses":{"200":{"description":"Match results.","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["linkedin","instagram"]},"identity":{"type":"string"},"decision":{"oneOf":[{"type":"object","properties":{"contactable":{"type":"boolean","const":true}},"required":["contactable"],"additionalProperties":false},{"type":"object","properties":{"contactable":{"type":"boolean","const":false},"reason":{"type":"string","enum":["manual","unsubscribed","not_interested","existing_customer","open_opportunity","competitor","employee","invalid_recipient","complained","recently_contacted","unresponsive"]},"source":{"type":"string","enum":["list","cooldown","unresponsive"]},"detail":{"type":"string"}},"required":["contactable","reason","source","detail"],"additionalProperties":false}],"type":"object"}},"required":["channel","identity","decision"],"additionalProperties":false}}},"required":["results"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/suppressions/{suppressionId}":{"delete":{"tags":["Suppressions"],"operationId":"deleteSuppression","summary":"Delete a suppression","parameters":[{"in":"path","name":"suppressionId","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":"Suppression id"},"required":true,"description":"Suppression id"}],"responses":{"200":{"description":"Suppression deleted.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","const":true}},"required":["deleted"],"additionalProperties":false}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Unauthorized: missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"Invalid request payload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"components":{"schemas":{"MeResponse":{"type":"object","properties":{"user":{"$ref":"#/components/schemas/MeUser"}},"required":["user"],"additionalProperties":false},"MeUser":{"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)$"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"organization":{"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)$"},"name":{"type":"string"},"domain":{"anyOf":[{"type":"string"},{"type":"null"}]},"imageUrl":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string","enum":["member","admin","owner"]}},"required":["id","name","domain","imageUrl","role"],"additionalProperties":false}},"required":["id","email","name","imageUrl","organization"],"additionalProperties":false},"ApiError":{"type":"object","properties":{"error":{"type":"string","description":"Human-readable error message"},"data":{"description":"Optional extra details"}},"required":["error"],"additionalProperties":false}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"sk-ndl-<id>.<secret>"}}}}