> ## Documentation Index
> Fetch the complete documentation index at: https://docs.api.tamtam.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a deal stage lookalike signal

> When a CRM deal reaches a stage you watch (a win, typically), the companies that most resemble that deal's company are routed to the owning rep as company leads: each closed-won deal becomes a small prospecting list automatically.

Read [List CRM deal stages](/api-reference/signals/list-crm-deal-stages) first and pass its ids as `watched_stages`; a label typed by hand is not a valid value on HubSpot. Shape the candidates with `countries`, `industries`, `sizes` and the employee range: the signal fires on one deal and has no distribution of its own to learn a range from. `exclude_existing_crm_companies` defaults to true; recommending a company you already sold to is the most embarrassing thing this signal can do.

Needs a connected CRM. Only deals reaching the stage after creation count, so it stays quiet until the next one lands.

**Creating a signal starts nothing and bills nothing.** A signal runs only when a lead generation program picks it: [Start a lead generation run](/api-reference/signals/start-lead-generation-run) sweeps it now and records a program you can put on a schedule under Settings > Signals > Lead generation. [List signals](/api-reference/signals/list-signals) reports `used_by_program_count` per signal; zero means it is defined and never runs. List first, so you do not create a second signal over a question you already ask: duplicates bill twice and split the leads across two names.



## OpenAPI

````yaml /reference/openapi.yaml post /v2/deal-stage-lookalike-signals
openapi: 3.1.0
info:
  title: Tamtam Public API
  version: 2.0.0
servers:
  - url: https://api.tamtam.ai/api
security: []
paths:
  /v2/deal-stage-lookalike-signals:
    post:
      tags:
        - Signals
      summary: Create a deal stage lookalike signal
      description: >-
        When a CRM deal reaches a stage you watch (a win, typically), the
        companies that most resemble that deal's company are routed to the
        owning rep as company leads: each closed-won deal becomes a small
        prospecting list automatically.


        Read [List CRM deal stages](/api-reference/signals/list-crm-deal-stages)
        first and pass its ids as `watched_stages`; a label typed by hand is not
        a valid value on HubSpot. Shape the candidates with `countries`,
        `industries`, `sizes` and the employee range: the signal fires on one
        deal and has no distribution of its own to learn a range from.
        `exclude_existing_crm_companies` defaults to true; recommending a
        company you already sold to is the most embarrassing thing this signal
        can do.


        Needs a connected CRM. Only deals reaching the stage after creation
        count, so it stays quiet until the next one lands.


        **Creating a signal starts nothing and bills nothing.** A signal runs
        only when a lead generation program picks it: [Start a lead generation
        run](/api-reference/signals/start-lead-generation-run) sweeps it now and
        records a program you can put on a schedule under Settings > Signals >
        Lead generation. [List signals](/api-reference/signals/list-signals)
        reports `used_by_program_count` per signal; zero means it is defined and
        never runs. List first, so you do not create a second signal over a
        question you already ask: duplicates bill twice and split the leads
        across two names.
      operationId: create-deal-stage-lookalike-signal
      parameters:
        - description: >-
            Target account UUID. Required for staff callers; ignored for
            customer API keys.
          explode: false
          in: query
          name: account_id
          schema:
            description: >-
              Target account UUID. Required for staff callers; ignored for
              customer API keys.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DealStageLookalikeSignalBody'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignalCreatedDto'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - apikeyAuth: []
        - bearerAuth: []
components:
  schemas:
    DealStageLookalikeSignalBody:
      additionalProperties: false
      properties:
        countries:
          description: Two-letter country codes the candidates must be in.
          items:
            type: string
          type:
            - array
            - 'null'
        crm:
          description: >-
            Your connected CRM. Must match the crm passed to List CRM deal
            stages.
          enum:
            - hubspot
            - salesforce
          type: string
        exclude_existing_crm_companies:
          description: >-
            Drop candidates you already have a deal on. Defaults to true; leave
            it on unless you want existing customers back.
          type: boolean
        industries:
          description: Industry names the candidates must be in.
          items:
            type: string
          type:
            - array
            - 'null'
        is_enabled:
          description: Defaults to true.
          type: boolean
        max_employees:
          description: Largest candidate headcount. Omit for no ceiling.
          format: int32
          minimum: 0
          type: integer
        max_lookalikes_per_deal:
          description: How many companies each won deal produces. Defaults to 25.
          format: int32
          minimum: 1
          type: integer
        min_deal_amount:
          description: >-
            Only deals worth at least this trigger the signal. Omit for every
            deal whatever its size.
          format: double
          minimum: 0
          type: number
        min_employees:
          description: Smallest candidate headcount. Omit for no floor.
          format: int32
          minimum: 0
          type: integer
        min_score:
          description: >-
            Lookalike score floor, 0 to 100. Defaults to 70. Raise it for fewer,
            closer matches.
          format: int32
          maximum: 100
          minimum: 0
          type: integer
        name:
          description: Short label, unique in the account, e.g. 'Lookalikes of closed-won'.
          minLength: 1
          type: string
        pipeline_ids:
          description: >-
            HubSpot only: restrict to these pipelines. Salesforce cannot filter
            on pipeline.
          items:
            type: string
          type:
            - array
            - 'null'
        sizes:
          description: >-
            LinkedIn employee-size buckets the candidates must fall in: 1-10,
            11-50, 51-200, 201-500, 501-1000, 1001-5000, 5001-10000, 10001+.
          items:
            type: string
          type:
            - array
            - 'null'
        watched_stages:
          description: Stage ids from List CRM deal stages, never labels typed by hand.
          items:
            type: string
          minItems: 1
          type:
            - array
            - 'null'
      required:
        - name
        - crm
        - watched_stages
      type: object
    SignalCreatedDto:
      additionalProperties: false
      properties:
        id:
          type: string
        is_enabled:
          type: boolean
        kind:
          description: >-
            The kind, as List signals reports it and as a lead generation run
            takes it.
          type: string
        name:
          type: string
        used_by_program_count:
          description: >-
            Always 0 on creation: a signal runs only when a lead generation
            program picks it.
          format: int64
          type: integer
      required:
        - kind
        - id
        - name
        - is_enabled
        - used_by_program_count
      type: object
    ErrorModel:
      additionalProperties: false
      properties:
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
  securitySchemes:
    apikeyAuth:
      description: Account API key passed in the Authorization header
      in: header
      name: Authorization
      type: apiKey
    bearerAuth:
      description: Bearer JWT obtained via the OAuth 2.1 authorization flow
      scheme: bearer
      type: http

````