Skip to main content
POST
/
api
/
v1
/
signals
/
types
/
{id}
/
generate
Auto-configure a signal type with AI
curl --request POST \
  --url https://app.puffle.ai/api/v1/signals/types/{id}/generate \
  --header 'Authorization: Bearer <token>'
{
  "run_id": "run_a1b2c3d4e5f6"
}

Overview

Kicks off a Trigger.dev background task that uses the caller’s company profile to produce production-quality signal type configuration. Specifically, the task writes (in place) to the signal type:
  • search_instructions — what the scanner should look for
  • scoring_criteria — how to rank matches
  • keywords — 10-20 targeted search terms
  • config — for structured types (hiring/funding/etc.), the typed payload (roles, seniority, stages, industries, etc.)
The call returns immediately with a Trigger.dev run_id. The signal type row updates when the task completes — typically within 30-90 seconds. Precondition: company context. The caller must have a company profile filled out (via /api/onboarding/*). Without it, the endpoint returns 428 precondition_failed.

AI agent notes

Poll for completion. After the 200 response, call GET /api/v1/signals/types/{id} every 10-15 s until you see non-placeholder values in search_instructions, scoring_criteria, and keywords. A reasonable giveup threshold is 3 minutes; at that point open a support ticket with the run_id.Idempotent-ish. Calling generate a second time while the first run is still executing will dispatch a second run — the last one to finish wins. Wait for completion before re-running.Company context bootstrap. If you hit 428, drive the caller through /api/onboarding/* first. Generate isn’t useful without a profile because the prompts need to know what the caller sells to know what to track.Built-in types are fine. You can run generate on both built-in and custom types — for built-in, it updates the prompts/keywords/config but leaves name and sources locked (just like PATCH).This is the public partner API — rate-limited at 100 req/min. The generate call itself is cheap; the background task may incur LLM costs billed separately.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string<uuid>
required

Signal type 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)$

Response

Generation task dispatched.

Generation is async — poll GET /api/v1/signals/types/{id} to see the updated prompts/keywords/config once the task completes.

run_id
string
required

Trigger.dev run identifier. Use it to correlate Vercel logs with the background task in the Trigger dashboard.