{"openapi":"3.0.0","info":{"title":"CazVid Integrations Public API","version":"1.0.0","description":"Read Smartlead and HeyReach campaigns, enroll contacts and track outreach. Platinum, Diamond or Enterprise required. Scopes: integrations:read and integrations:manage. Every request is restricted to the API key's selected workspace. Limits: 60/minute per IP, 30/minute and 500/UTC-day per organization. Failed handlers refund the daily allowance. Guide: https://cazvid.com/api/integrations/v1"},"servers":[{"url":"https://aio-backend-prod.cazvid.app"}],"paths":{"/api/v3.0/integrations/public/usage":{"get":{"description":"Requires selected-workspace access; spends IP/minute allowance but does not reserve a daily request.","operationId":"integrationsGetUsage","parameters":[{"name":"x-api-key","in":"header","description":"Developer API key; Authorization: Bearer is also accepted.","required":false,"schema":{"type":"string"}},{"name":"workspaceId","required":false,"in":"query","schema":{"type":"string"}},{"name":"organizationId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicIntegrationsUsageDto"}}}},"400":{"description":"VALIDATION_ERROR: invalid or unsupported input."},"401":{"description":"Missing, invalid, expired or revoked API key."},"403":{"description":"PLAN_REQUIRED, missing scope or denied workspace membership."},"404":{"description":"Resource not found within the selected API workspace."},"429":{"description":"RATE_LIMIT_EXCEEDED or PROVIDER_BUSY; respect Retry-After."}},"summary":"Read organization request allowance (integrations:read).","tags":["Integrations Public API V3.0"],"security":[{"apiKey":[]},{"bearer":[]}]}},"/api/v3.0/integrations/public/campaigns":{"get":{"operationId":"integrationsListCampaigns","parameters":[{"name":"x-api-key","in":"header","description":"Developer API key; Authorization: Bearer is also accepted.","required":false,"schema":{"type":"string"}},{"name":"workspaceId","required":false,"in":"query","schema":{"type":"string"}},{"name":"organizationId","required":false,"in":"query","schema":{"type":"string"}},{"name":"provider","required":true,"in":"query","schema":{"type":"string","enum":["smartlead","heyreach"]}},{"name":"search","required":false,"in":"query","schema":{"type":"string"}},{"name":"status","required":false,"in":"query","schema":{"type":"string","enum":["active","paused","draft","completed","stopped"]}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationCampaignsResponseDto"}}}},"400":{"description":"VALIDATION_ERROR: invalid or unsupported input."},"401":{"description":"Missing, invalid, expired or revoked API key."},"403":{"description":"PLAN_REQUIRED, missing scope or denied workspace membership."},"404":{"description":"Resource not found within the selected API workspace."},"429":{"description":"RATE_LIMIT_EXCEEDED or PROVIDER_BUSY; respect Retry-After."}},"summary":"Read cached campaigns for a connected provider (integrations:read).","tags":["Integrations Public API V3.0"],"security":[{"apiKey":[]},{"bearer":[]}]}},"/api/v3.0/integrations/public/enrollments/preview":{"post":{"operationId":"integrationsPreviewEnrollment","parameters":[{"name":"x-api-key","in":"header","description":"Developer API key; Authorization: Bearer is also accepted.","required":false,"schema":{"type":"string"}},{"name":"workspaceId","required":false,"in":"query","schema":{"type":"string"}},{"name":"organizationId","required":false,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicEnrollDto"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationEnrollmentPreviewDto"}}}},"400":{"description":"VALIDATION_ERROR: invalid or unsupported input."},"401":{"description":"Missing, invalid, expired or revoked API key."},"403":{"description":"PLAN_REQUIRED, missing scope or denied workspace membership."},"404":{"description":"Resource not found within the selected API workspace."},"429":{"description":"RATE_LIMIT_EXCEEDED or PROVIDER_BUSY; respect Retry-After."}},"summary":"Preview eligibility without enrolling contacts (integrations:read).","tags":["Integrations Public API V3.0"],"security":[{"apiKey":[]},{"bearer":[]}]}},"/api/v3.0/integrations/public/enrollments":{"post":{"description":"202 means accepted, not enrolled. Poll the returned batchId. Do not automatically replay POST after ambiguous transport failure.","operationId":"integrationsEnrollContacts","parameters":[{"name":"x-api-key","in":"header","description":"Developer API key; Authorization: Bearer is also accepted.","required":false,"schema":{"type":"string"}},{"name":"workspaceId","required":false,"in":"query","schema":{"type":"string"}},{"name":"organizationId","required":false,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicEnrollDto"}}}},"responses":{"202":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationEnrollmentAcceptedDto"}}}},"400":{"description":"VALIDATION_ERROR: invalid or unsupported input."},"401":{"description":"Missing, invalid, expired or revoked API key."},"403":{"description":"PLAN_REQUIRED, missing scope or denied workspace membership."},"404":{"description":"Resource not found within the selected API workspace."},"429":{"description":"RATE_LIMIT_EXCEEDED or PROVIDER_BUSY; respect Retry-After."}},"summary":"Queue enrollment (integrations:manage).","tags":["Integrations Public API V3.0"],"security":[{"apiKey":[]},{"bearer":[]}]},"get":{"operationId":"integrationsGetEnrollments","parameters":[{"name":"x-api-key","in":"header","description":"Developer API key; Authorization: Bearer is also accepted.","required":false,"schema":{"type":"string"}},{"name":"workspaceId","required":false,"in":"query","schema":{"type":"string"}},{"name":"organizationId","required":false,"in":"query","schema":{"type":"string"}},{"name":"contactId","required":false,"in":"query","schema":{"type":"string"}},{"name":"contactIds","required":false,"in":"query","description":"Comma-separated contact ids, at most 200.","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationEnrollmentsResponseDto"}}}},"400":{"description":"VALIDATION_ERROR: invalid or unsupported input."},"401":{"description":"Missing, invalid, expired or revoked API key."},"403":{"description":"PLAN_REQUIRED, missing scope or denied workspace membership."},"404":{"description":"Resource not found within the selected API workspace."},"429":{"description":"RATE_LIMIT_EXCEEDED or PROVIDER_BUSY; respect Retry-After."}},"summary":"Read selected workspace contacts' enrollment history (integrations:read).","tags":["Integrations Public API V3.0"],"security":[{"apiKey":[]},{"bearer":[]}]}},"/api/v3.0/integrations/public/enrollments/batches/{id}":{"get":{"operationId":"integrationsGetEnrollmentBatch","parameters":[{"name":"x-api-key","in":"header","description":"Developer API key; Authorization: Bearer is also accepted.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"workspaceId","required":false,"in":"query","schema":{"type":"string"}},{"name":"organizationId","required":false,"in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationEnrollmentBatchDto"}}}},"400":{"description":"VALIDATION_ERROR: invalid or unsupported input."},"401":{"description":"Missing, invalid, expired or revoked API key."},"403":{"description":"PLAN_REQUIRED, missing scope or denied workspace membership."},"404":{"description":"Resource not found within the selected API workspace."},"429":{"description":"RATE_LIMIT_EXCEEDED or PROVIDER_BUSY; respect Retry-After."}},"summary":"Read a public batch belonging to the selected workspace (integrations:read).","tags":["Integrations Public API V3.0"],"security":[{"apiKey":[]},{"bearer":[]}]}},"/api/v3.0/integrations/public/enrollments/{id}/stop":{"post":{"operationId":"integrationsStopEnrollment","parameters":[{"name":"x-api-key","in":"header","description":"Developer API key; Authorization: Bearer is also accepted.","required":false,"schema":{"type":"string"}},{"name":"id","required":true,"in":"path","schema":{"type":"string"}},{"name":"workspaceId","required":false,"in":"query","schema":{"type":"string"}},{"name":"organizationId","required":false,"in":"query","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicWorkspaceQuery"}}}},"responses":{"200":{"description":"","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationEnrollmentDto"}}}},"400":{"description":"VALIDATION_ERROR: invalid or unsupported input."},"401":{"description":"Missing, invalid, expired or revoked API key."},"403":{"description":"PLAN_REQUIRED, missing scope or denied workspace membership."},"404":{"description":"Resource not found within the selected API workspace."},"429":{"description":"RATE_LIMIT_EXCEEDED or PROVIDER_BUSY; respect Retry-After."}},"summary":"Stop one selected-workspace enrollment (integrations:manage).","tags":["Integrations Public API V3.0"],"security":[{"apiKey":[]},{"bearer":[]}]}},"/api/v3.0/integrations/public/activity":{"get":{"description":"No raw provider payloads, connection secrets or unresolved contacts outside the selected workspace are exposed.","operationId":"integrationsGetActivity","parameters":[{"name":"x-api-key","in":"header","description":"Developer API key; Authorization: Bearer is also accepted.","required":false,"schema":{"type":"string"}},{"name":"workspaceId","required":false,"in":"query","schema":{"type":"string"}},{"name":"organizationId","required":false,"in":"query","schema":{"type":"string"}},{"name":"provider","required":false,"in":"query","schema":{"type":"string","enum":["smartlead","heyreach"]}},{"name":"type","required":false,"in":"query","schema":{"type":"string","enum":["all","replies","unmatched"]}},{"name":"contactId","required":false,"in":"query","schema":{"type":"string"}},{"name":"cursor","required":false,"in":"query","schema":{"type":"string"}},{"name":"limit","required":false,"in":"query","schema":{"minimum":1,"maximum":100,"default":25,"type":"number"}}],"responses":{"200":{"description":"","content":{"application/json":{"schema":{"type":"object","required":["events","nextCursor","unmatchedCount"],"properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"normalizedType":{"type":"string"},"contactId":{"type":"string","nullable":true},"receivedAt":{"type":"string","format":"date-time"},"summary":{"type":"string","nullable":true},"result":{"type":"string"}}}},"nextCursor":{"type":"string","nullable":true},"unmatchedCount":{"type":"integer"}}}}}},"400":{"description":"VALIDATION_ERROR: invalid or unsupported input."},"401":{"description":"Missing, invalid, expired or revoked API key."},"403":{"description":"PLAN_REQUIRED, missing scope or denied workspace membership."},"404":{"description":"Resource not found within the selected API workspace."},"429":{"description":"RATE_LIMIT_EXCEEDED or PROVIDER_BUSY; respect Retry-After."}},"summary":"Read normalized activity for the selected workspace (integrations:read).","tags":["Integrations Public API V3.0"],"security":[{"apiKey":[]},{"bearer":[]}]}}},"components":{"schemas":{"PublicIntegrationsUsageDto":{"type":"object","properties":{"requestsToday":{"type":"number","minimum":0},"dailyCap":{"type":"number","enum":[500]},"resetsAt":{"type":"string","format":"date-time","description":"Next UTC midnight (ISO 8601)."},"requestsThisMinute":{"type":"number","minimum":0,"description":"Includes this usage request, which spends only the minute/IP allowance."},"minuteCap":{"type":"number","enum":[30]}},"required":["requestsToday","dailyCap","resetsAt","requestsThisMinute","minuteCap"]},"IntegrationCampaignsResponseDto":{"type":"object","properties":{"campaigns":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationCampaignDto"}},"lastSyncedAt":{"type":"string","nullable":true}},"required":["campaigns","lastSyncedAt"]},"PublicEnrollDto":{"type":"object","properties":{"workspaceId":{"type":"string"},"organizationId":{"type":"string"},"provider":{"type":"string","enum":["smartlead","heyreach"]},"campaignId":{"type":"string"},"contactIds":{"maxItems":500,"description":"Choose either contactIds or listId; never both.","type":"array","items":{"type":"string"}},"listId":{"type":"string"},"stageId":{"type":"string"}},"required":["provider","campaignId"]},"IntegrationEnrollmentPreviewDto":{"type":"object","properties":{"eligible":{"type":"number"},"skipped":{"$ref":"#/components/schemas/IntegrationSkipCountersDto"},"skippedContacts":{"description":"At most 50 named skips, for the dialog's eligibility strip.","type":"array","items":{"$ref":"#/components/schemas/IntegrationSkippedContactDto"}}},"required":["eligible","skipped","skippedContacts"]},"IntegrationEnrollmentAcceptedDto":{"type":"object","properties":{"batchId":{"type":"string"},"requested":{"type":"number"},"eligible":{"type":"number"},"skipped":{"$ref":"#/components/schemas/IntegrationSkipCountersDto"}},"required":["batchId","requested","eligible","skipped"]},"IntegrationEnrollmentsResponseDto":{"type":"object","properties":{"enrollments":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationEnrollmentDto"}}},"required":["enrollments"]},"IntegrationEnrollmentBatchDto":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["smartlead","heyreach"]},"connectionId":{"type":"string"},"campaignId":{"type":"string"},"campaignName":{"type":"string"},"requested":{"type":"number"},"eligible":{"type":"number"},"skipped":{"$ref":"#/components/schemas/IntegrationSkipCountersDto"},"added":{"type":"number"},"updated":{"type":"number"},"failed":{"type":"number"},"status":{"type":"string","enum":["queued","running","done","partial","failed"]},"error":{"type":"string","nullable":true},"source":{"type":"string","enum":["contacts","drawer","list-card","list-bulk"]},"createdBy":{"type":"string","nullable":true},"createdAt":{"type":"string"},"startedAt":{"type":"string","nullable":true},"finishedAt":{"type":"string","nullable":true}},"required":["id","provider","connectionId","campaignId","campaignName","requested","eligible","skipped","added","updated","failed","status","error","source","createdBy","createdAt","startedAt","finishedAt"]},"PublicWorkspaceQuery":{"type":"object","properties":{"workspaceId":{"type":"string"},"organizationId":{"type":"string"}}},"IntegrationEnrollmentDto":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["smartlead","heyreach"]},"campaignId":{"type":"string"},"campaignName":{"type":"string"},"contactId":{"type":"string","description":"The CazVid contact this enrolment belongs to. ALWAYS present, on both query forms: the list-card badge feed (?contactIds=<csv>) keys its rows by it, and a response that only sometimes carried it would be two shapes for one endpoint."},"status":{"type":"string","enum":["sending","enrolled","failed","stopped","in_sequence","connected","replied","positive","negative","bounced","unsubscribed","completed"]},"source":{"type":"string","enum":["contacts","drawer","list-card","list-bulk"]},"enrolledBy":{"nullable":true,"type":"object","allOf":[{"$ref":"#/components/schemas/IntegrationEnrolledByDto"}]},"createdAt":{"type":"string"},"lastEventAt":{"type":"string","nullable":true},"counters":{"$ref":"#/components/schemas/IntegrationEnrollmentCountersDto"}},"required":["id","provider","campaignId","campaignName","contactId","status","source","enrolledBy","createdAt","lastEventAt","counters"]},"IntegrationCampaignDto":{"type":"object","properties":{"id":{"type":"string","description":"Provider campaign id, always a string."},"provider":{"type":"string","enum":["smartlead","heyreach"]},"name":{"type":"string"},"status":{"type":"string","enum":["active","paused","draft","completed","stopped"]},"providerStatus":{"type":"string"},"enrollTarget":{"type":"boolean"},"senders":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationCampaignSenderDto"}},"stats":{"$ref":"#/components/schemas/IntegrationCampaignStatsDto"},"isDefault":{"type":"boolean"},"lastSyncedAt":{"type":"string","nullable":true}},"required":["id","provider","name","status","providerStatus","enrollTarget","senders","stats","isDefault","lastSyncedAt"]},"IntegrationSkipCountersDto":{"type":"object","properties":{"noEmail":{"type":"number"},"noLinkedin":{"type":"number"},"alreadyEnrolled":{"type":"number"},"doNotContact":{"type":"number"},"bounced":{"type":"number"},"unsubscribed":{"type":"number"},"invalid":{"type":"number"}},"required":["noEmail","noLinkedin","alreadyEnrolled","doNotContact","bounced","unsubscribed","invalid"]},"IntegrationSkippedContactDto":{"type":"object","properties":{"contactId":{"type":"string"},"name":{"type":"string"},"reason":{"type":"string","enum":["noEmail","noLinkedin","alreadyEnrolled","doNotContact","bounced","unsubscribed","invalid"]},"duplicateOf":{"type":"string","description":"Only on a same-identity duplicate (reason `invalid`): the contactId of the earlier contact in this request that already claimed this provider lead key."}},"required":["contactId","name","reason"]},"IntegrationEnrolledByDto":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"]},"IntegrationEnrollmentCountersDto":{"type":"object","properties":{"sent":{"type":"number"},"replies":{"type":"number"}},"required":["sent","replies"]},"IntegrationCampaignSenderDto":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"IntegrationCampaignStatsDto":{"type":"object","properties":{"leads":{"type":"number"},"sent":{"type":"number"},"replied":{"type":"number"},"bounced":{"type":"number"},"connectionsSent":{"type":"number"},"connectionsAccepted":{"type":"number"}},"required":["leads","sent","replied","bounced","connectionsSent","connectionsAccepted"]}},"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key"},"bearer":{"type":"http","scheme":"bearer"}}}}