openapi: 3.2.0 info: title: PersistIQ API V1 Campaign Leads API version: v1 description: Public REST API for PersistIQ. Authenticate with your API key in the `x-api-key` header. servers: - url: https://api.persistiq.com description: Production security: - api_key: [] tags: - name: Campaign Leads paths: /v1/campaigns/{campaign_id}/leads: get: summary: List leads in a campaign tags: - Campaign Leads parameters: - name: campaign_id in: path required: true description: Campaign hashed ID schema: type: string - name: page in: query required: false description: Page number for pagination schema: type: integer responses: '200': description: campaign leads listed content: application/json: schema: type: object properties: has_more: type: boolean next_page: type: - string - 'null' status: type: string errors: type: array items: type: string campaign_leads: type: array items: $ref: '#/components/schemas/campaign_lead_type' post: summary: Add a lead to a campaign tags: - Campaign Leads parameters: - name: campaign_id in: path required: true description: Campaign hashed ID schema: type: string responses: '200': description: lead added to campaign content: application/json: schema: type: object properties: status: type: string error: type: - object - 'null' campaign_lead: $ref: '#/components/schemas/campaign_lead_type' requestBody: content: application/json: schema: type: object properties: lead_id: type: string description: Hashed ID of the lead to add mailbox_id: type: string description: Hashed ID of the mailbox to use (optional, defaults to campaign owner mailbox) skip_if_exists: type: boolean description: If true, return existing campaign lead instead of error override_lead_limit: type: boolean description: Override campaign lead limit leads: type: array description: 'Bulk add: array of lead IDs (up to 100)' items: type: string /v1/campaigns/{campaign_id}/leads/{id}: delete: summary: Remove a lead from a campaign tags: - Campaign Leads parameters: - name: campaign_id in: path required: true description: Campaign hashed ID schema: type: string - name: id in: path required: true description: Lead hashed ID to remove schema: type: string responses: '200': description: lead removed from campaign '400': description: lead not in campaign content: application/json: schema: $ref: '#/components/schemas/error_response' components: schemas: campaign_lead_type: type: object properties: id: type: string campaign_id: type: string mailbox_id: type: string lead: $ref: '#/components/schemas/lead_type' lead_type: type: object properties: id: type: string status: type: - string - 'null' data: type: object additionalProperties: {} creator_id: type: - string - 'null' owner_id: type: - string - 'null' bounced: type: boolean optedout: type: boolean sent_count: type: integer replied_count: type: integer last_sent_at: type: - string - 'null' error_response: type: object properties: status: type: string example: error error: type: object properties: reason: type: string message: type: string securitySchemes: api_key: type: apiKey name: x-api-key in: header description: API key found in Settings > Integrations > API Key