Skip to main content
PUT
/
api
/
signals
/
sources
/
config
Upsert a datasource config
curl --request PUT \
  --url https://app.puffle.ai/api/signals/sources/config \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "source_id": "<string>",
  "enabled": true,
  "config": {}
}
'
{
  "config": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "source_id": "<string>",
    "enabled": true,
    "config": {},
    "last_fetched_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}

Overview

Upserts one signal_source_configs row keyed by source_id. When enabled is included, the handler cascades the value to every signal_type_sources row owned by the caller with the same source_id. This is the single switch that turns a datasource on or off across all signal types at once; per-type overrides (via updateSignalTypeSource) still win afterwards.
This operation shares the URL path /api/signals/sources/config with the list verb. See List signal source configs to enumerate every user-level row.

AI agent notes

This is the internal UI-facing endpoint. Third-party integrations should prefer the v1 public API under /api/v1/signals/sources/config.config is replaced, not merged. The handler writes config verbatim — merge on the client side if you want to preserve existing keys.Cascade is best-effort. If the cascade to signal_type_sources fails, the primary upsert is still saved. The handler logs a warning and returns success. Re-issue the call if the cascade matters.

Authorizations

Authorization
string
header
required

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

Body

application/json

Upsert payload. Only source_id is required; unspecified fields default to enabled: false, config: {} on insert.

source_id
string
required

Adapter ID. Required. Must be a registered adapter.

enabled
boolean

Global enable flag for this source. If provided, cascades to every signal_type_sources row owned by the caller with this source_id.

config
object

Free-form JSONB config consumed by the adapter. Replaces the existing config — the handler does not merge.

Response

Config upserted. Cascade to signal_type_sources is best-effort.

config
object
required

User-level datasource config row. One per (user, source_id) pair.