Skip to main content
POST
/
api
/
signals
/
types
/
{id}
/
generate
Generate a signal type from user context
curl --request POST \
  --url https://app.puffle.ai/api/signals/types/{id}/generate \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "runId": "<string>"
}

Overview

Enqueues the signal-type-generate Trigger.dev task. The task reads user_context, company_context, content_context, market_context, and extra_context from user_profiles, then uses Claude to draft keywords, scoring_prompt, search_prompt, and disqualifiers for the signal type. The handler returns as soon as the task is queued — the task writes back to the signal type row when it completes. Requires the user to have completed onboarding. If any required context field is missing, the handler returns 400 with { error: "missing_context", missing: [...] } naming the empty fields.

AI agent notes

This is the internal UI-facing endpoint. Third-party integrations should prefer the v1 public API under /api/v1/signals/types/{id}/generate.Polling. This endpoint returns immediately with a runId. To observe completion, poll GET /api/signals/types and watch for the type’s scoring_prompt / search_prompt to become non-empty. For deeper inspection use the Trigger.dev dashboard with the returned runId.Pre-check context. If you’ve just finished an onboarding flow, call GET /api/onboarding/status first — generateSignalType will 400 otherwise and the missing array tells you which fields to populate.Non-destructive but overwrites. The task replaces the existing prompts and keywords on the signal type. If the human has hand-tuned them, confirm before calling.

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 to regenerate config for.

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

Task queued.

success
enum<boolean>
required
Available options:
true
runId
string
required

Trigger.dev run ID for the signal-type-generate task. Use it with the Trigger.dev dashboard or correlation-id workflow to follow the run. This endpoint does not poll — it returns as soon as the task is queued.