openapi: 3.2.0 info: title: GPT Backend CRM B2b Leads API version: 0.1.0 servers: - url: https://api.usepomo.ai description: Base URL declared by the provider in apis.yml (roadmap#122). tags: - name: crm-b2b-leads paths: /api/crm/b2b-leads/searches: post: tags: - crm-b2b-leads summary: Search B2B Leads operationId: search_b2b_leads_api_crm_b2b_leads_searches_post security: - HTTPBearer: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/B2BLeadSearchRequest' responses: '202': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/B2BLeadSearchJobResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' get: tags: - crm-b2b-leads summary: List B2B Lead Searches operationId: list_b2b_lead_searches_api_crm_b2b_leads_searches_get security: - HTTPBearer: [] parameters: - name: limit in: query required: false schema: type: integer maximum: 10 minimum: 1 default: 10 title: Limit responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/B2BLeadSearchHistoryResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/crm/b2b-leads/searches/{search_id}: get: tags: - crm-b2b-leads summary: Get B2B Lead Search operationId: get_b2b_lead_search_api_crm_b2b_leads_searches__search_id__get security: - HTTPBearer: [] parameters: - name: search_id in: path required: true schema: type: string title: Search Id responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/B2BLeadSearchJobResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/crm/b2b-leads/searches/{search_id}/hydrate-emails: post: tags: - crm-b2b-leads summary: Hydrate B2B Lead Emails operationId: hydrate_b2b_lead_emails_api_crm_b2b_leads_searches__search_id__hydrate_emails_post security: - HTTPBearer: [] parameters: - name: search_id in: path required: true schema: type: string title: Search Id requestBody: content: application/json: schema: anyOf: - $ref: '#/components/schemas/B2BHydrateEmailsRequest' - type: 'null' title: Payload responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/B2BHydrateEmailsResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/crm/b2b-leads/searches/{search_id}/accounts/{account_key}/contacts: post: tags: - crm-b2b-leads summary: Expand B2B Account Contacts operationId: expand_b2b_account_contacts_api_crm_b2b_leads_searches__search_id__accounts__account_key__contacts_post security: - HTTPBearer: [] parameters: - name: search_id in: path required: true schema: type: string title: Search Id - name: account_key in: path required: true schema: type: string title: Account Key requestBody: content: application/json: schema: anyOf: - $ref: '#/components/schemas/B2BAccountContactsRequest' - type: 'null' title: Payload responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/B2BAccountContactsResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/crm/b2b-leads/searches/{search_id}/candidates/{candidate_id}/draft: post: tags: - crm-b2b-leads summary: Draft B2B Lead Email operationId: draft_b2b_lead_email_api_crm_b2b_leads_searches__search_id__candidates__candidate_id__draft_post security: - HTTPBearer: [] parameters: - name: search_id in: path required: true schema: type: string title: Search Id - name: candidate_id in: path required: true schema: type: string title: Candidate Id requestBody: content: application/json: schema: anyOf: - $ref: '#/components/schemas/B2BDraftRequest' - type: 'null' title: Payload responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/B2BDraftResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/crm/b2b-leads/searches/{search_id}/candidates/{candidate_id}/save: post: tags: - crm-b2b-leads summary: Save B2B Lead Candidate operationId: save_b2b_lead_candidate_api_crm_b2b_leads_searches__search_id__candidates__candidate_id__save_post security: - HTTPBearer: [] parameters: - name: search_id in: path required: true schema: type: string title: Search Id - name: candidate_id in: path required: true schema: type: string title: Candidate Id requestBody: content: application/json: schema: anyOf: - $ref: '#/components/schemas/B2BSaveCandidateRequest' - type: 'null' title: Payload responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/B2BSaveCandidateResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' /api/crm/b2b-leads/prospects/{prospect_id}/draft: put: tags: - crm-b2b-leads summary: Update B2B Prospect Draft operationId: update_b2b_prospect_draft_api_crm_b2b_leads_prospects__prospect_id__draft_put security: - HTTPBearer: [] parameters: - name: prospect_id in: path required: true schema: type: string title: Prospect Id requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/B2BUpdateDraftRequest' responses: '200': description: Successful Response content: application/json: schema: $ref: '#/components/schemas/B2BUpdateDraftResponse' '422': description: Validation Error content: application/json: schema: $ref: '#/components/schemas/HTTPValidationError' components: schemas: HTTPValidationError: properties: detail: items: $ref: '#/components/schemas/ValidationError' type: array title: Detail type: object title: HTTPValidationError B2BDraftRequest: properties: force_refresh: type: boolean title: Force Refresh default: false type: object title: B2BDraftRequest B2BLeadSource: properties: url: type: string title: Url title: anyOf: - type: string - type: 'null' title: Title type: anyOf: - type: string - type: 'null' title: Type type: object required: - url title: B2BLeadSource B2BLeadSearchResponse: properties: search_id: type: string title: Search Id query: type: string title: Query interpreted_query: type: string title: Interpreted Query status: type: string const: completed title: Status default: completed cache_hit: type: boolean title: Cache Hit default: false generated_at: type: string title: Generated At expires_at: type: string title: Expires At email_hydration_status: type: string enum: - not_started - completed title: Email Hydration Status result_count: type: integer maximum: 15.0 minimum: 0.0 title: Result Count candidates: items: $ref: '#/components/schemas/B2BLeadCandidate' type: array maxItems: 15 title: Candidates sources: items: $ref: '#/components/schemas/B2BLeadSource' type: array title: Sources type: object required: - search_id - query - interpreted_query - generated_at - expires_at - email_hydration_status - result_count title: B2BLeadSearchResponse B2BDraftResponse: properties: candidate: $ref: '#/components/schemas/B2BLeadCandidate' type: object required: - candidate title: B2BDraftResponse B2BLeadContact: properties: email: anyOf: - type: string - type: 'null' title: Email status: type: string enum: - publicly_listed - provider_verified - not_hydrated - not_found title: Status kind: anyOf: - type: string enum: - person_business - company_contact - type: 'null' title: Kind source_url: anyOf: - type: string - type: 'null' title: Source Url evidence_text: anyOf: - type: string - type: 'null' title: Evidence Text provider_status: anyOf: - type: string const: valid - type: 'null' title: Provider Status confidence_score: anyOf: - type: integer maximum: 100.0 minimum: 0.0 - type: 'null' title: Confidence Score verified_at: anyOf: - type: string - type: 'null' title: Verified At type: object required: - status title: B2BLeadContact B2BActiveLeadSearchSummary: properties: search_id: type: string title: Search Id query: type: string title: Query started_at: type: string title: Started At type: object required: - search_id - query - started_at title: B2BActiveLeadSearchSummary description: A durable search that should resume polling after a page reload. B2BLeadCandidate: properties: candidate_id: type: string title: Candidate Id account_key: type: string title: Account Key default: '' full_name: type: string title: Full Name headline: anyOf: - type: string - type: 'null' title: Headline company: anyOf: - type: string - type: 'null' title: Company company_url: anyOf: - type: string - type: 'null' title: Company Url location: anyOf: - type: string - type: 'null' title: Location linkedin_url: anyOf: - type: string - type: 'null' title: Linkedin Url linkedin_status: anyOf: - type: string enum: - found - not_found - unavailable - type: 'null' title: Linkedin Status profile_url: anyOf: - type: string - type: 'null' title: Profile Url avatar_url: anyOf: - type: string - type: 'null' title: Avatar Url fit_reason: type: string title: Fit Reason company_fit_reason: type: string title: Company Fit Reason default: '' person_fit_reason: type: string title: Person Fit Reason default: '' outreach_angle: type: string title: Outreach Angle default: '' fit_evidence: items: $ref: '#/components/schemas/B2BFitEvidence' type: array title: Fit Evidence sources: items: $ref: '#/components/schemas/B2BLeadSource' type: array title: Sources contact: $ref: '#/components/schemas/B2BLeadContact' company_contact: anyOf: - $ref: '#/components/schemas/B2BCompanyContactRoute' - type: 'null' draft: anyOf: - $ref: '#/components/schemas/B2BLeadDraft' - type: 'null' crm: $ref: '#/components/schemas/B2BLeadCrmState' type: object required: - candidate_id - full_name - fit_reason - contact title: B2BLeadCandidate B2BAccountContactsRequest: properties: limit: type: integer maximum: 3.0 minimum: 1.0 title: Limit default: 3 force_refresh: type: boolean title: Force Refresh default: false type: object title: B2BAccountContactsRequest B2BUpdateDraftRequest: properties: subject: type: string maxLength: 160 minLength: 1 title: Subject body: type: string maxLength: 1200 minLength: 1 title: Body type: object required: - subject - body title: B2BUpdateDraftRequest B2BSaveCandidateRequest: properties: idempotency_key: anyOf: - type: string maxLength: 128 - type: 'null' title: Idempotency Key draft: anyOf: - $ref: '#/components/schemas/B2BEditableDraft' - type: 'null' type: object title: B2BSaveCandidateRequest B2BCompanyContactRoute: properties: email: type: string title: Email source_url: type: string title: Source Url evidence_text: type: string title: Evidence Text type: object required: - email - source_url - evidence_text title: B2BCompanyContactRoute description: A company-level public inbox, never a named person's email. B2BEditableDraft: properties: subject: type: string maxLength: 160 minLength: 1 title: Subject body: type: string maxLength: 1200 minLength: 1 title: Body type: object required: - subject - body title: B2BEditableDraft B2BLeadSearchJobResponse: properties: search_id: type: string title: Search Id job_id: anyOf: - type: string - type: 'null' title: Job Id status: type: string enum: - processing - completed - failed - cancelled title: Status poll_url: type: string title: Poll Url search: anyOf: - $ref: '#/components/schemas/B2BLeadSearchResponse' - type: 'null' error: anyOf: - type: string - type: 'null' title: Error type: object required: - search_id - status - poll_url title: B2BLeadSearchJobResponse description: 'Durable discovery submission and polling envelope. A completed cache hit can return its search immediately. Queued work keeps the same small contract and exposes the completed snapshot only after the worker has committed it atomically.' ValidationError: properties: loc: items: anyOf: - type: string - type: integer type: array title: Location msg: type: string title: Message type: type: string title: Error Type type: object required: - loc - msg - type title: ValidationError B2BLeadDraft: properties: subject: type: string title: Subject body: type: string title: Body status: type: string enum: - generated - edited title: Status default: generated type: object required: - subject - body title: B2BLeadDraft B2BAccountContactsResponse: properties: search: $ref: '#/components/schemas/B2BLeadSearchResponse' account_key: type: string title: Account Key added_count: type: integer maximum: 3.0 minimum: 0.0 title: Added Count replaced_count: type: integer maximum: 3.0 minimum: 0.0 title: Replaced Count type: object required: - search - account_key - added_count - replaced_count title: B2BAccountContactsResponse B2BLeadCrmState: properties: saved: type: boolean title: Saved default: false prospect_id: anyOf: - type: string - type: 'null' title: Prospect Id person_ref: anyOf: - type: string - type: 'null' title: Person Ref type: object title: B2BLeadCrmState B2BFitEvidence: properties: kind: type: string enum: - company - person title: Kind default: person claim: type: string title: Claim source_url: type: string title: Source Url evidence_text: type: string title: Evidence Text verification_method: type: string enum: - page_exact - openai_web_search - openai_web_search_ai_critic title: Verification Method default: openai_web_search type: object required: - claim - source_url - evidence_text title: B2BFitEvidence B2BLeadSearchSummary: properties: search_id: type: string title: Search Id query: type: string title: Query interpreted_query: type: string title: Interpreted Query result_count: type: integer maximum: 15.0 minimum: 0.0 title: Result Count company_count: type: integer maximum: 5.0 minimum: 0.0 title: Company Count contact_count: type: integer maximum: 15.0 minimum: 0.0 title: Contact Count generated_at: type: string title: Generated At expires_at: type: string title: Expires At email_hydration_status: type: string enum: - not_started - completed title: Email Hydration Status type: object required: - search_id - query - interpreted_query - result_count - company_count - contact_count - generated_at - expires_at - email_hydration_status title: B2BLeadSearchSummary B2BHydrateEmailsResponse: properties: search: $ref: '#/components/schemas/B2BLeadSearchResponse' attempted_count: type: integer maximum: 15.0 minimum: 0.0 title: Attempted Count found_count: type: integer maximum: 15.0 minimum: 0.0 title: Found Count direct_email_found_count: type: integer maximum: 15.0 minimum: 0.0 title: Direct Email Found Count default: 0 company_contact_found_count: type: integer maximum: 15.0 minimum: 0.0 title: Company Contact Found Count default: 0 provider_attempted_count: type: integer maximum: 15.0 minimum: 0.0 title: Provider Attempted Count default: 0 provider_verified_count: type: integer maximum: 15.0 minimum: 0.0 title: Provider Verified Count default: 0 provider_failure_count: type: integer maximum: 15.0 minimum: 0.0 title: Provider Failure Count default: 0 remaining_count: type: integer maximum: 15.0 minimum: 0.0 title: Remaining Count type: object required: - search - attempted_count - found_count - remaining_count title: B2BHydrateEmailsResponse B2BHydrateEmailsRequest: properties: candidate_ids: items: type: string type: array maxItems: 15 title: Candidate Ids retry_not_found: type: boolean title: Retry Not Found default: false type: object title: B2BHydrateEmailsRequest B2BUpdateDraftResponse: properties: prospect_id: type: string title: Prospect Id person_ref: type: string title: Person Ref draft: $ref: '#/components/schemas/B2BLeadDraft' type: object required: - prospect_id - person_ref - draft title: B2BUpdateDraftResponse B2BSaveCandidateResponse: properties: prospect_id: type: string title: Prospect Id person_ref: type: string title: Person Ref created: type: boolean title: Created candidate: $ref: '#/components/schemas/B2BLeadCandidate' type: object required: - prospect_id - person_ref - created - candidate title: B2BSaveCandidateResponse B2BLeadSearchHistoryResponse: properties: searches: items: $ref: '#/components/schemas/B2BLeadSearchSummary' type: array title: Searches active_searches: items: $ref: '#/components/schemas/B2BActiveLeadSearchSummary' type: array title: Active Searches type: object title: B2BLeadSearchHistoryResponse B2BLeadSearchRequest: properties: query: type: string maxLength: 500 minLength: 2 title: Query limit: type: integer maximum: 5.0 minimum: 3.0 title: Limit default: 5 force_refresh: type: boolean title: Force Refresh default: false type: object required: - query title: B2BLeadSearchRequest securitySchemes: HTTPBearer: type: http scheme: bearer