CRM

channels

13 uç · /api/crm/v1/channels

İstek örnekleri ucun GERÇEK metodu ve yolundan üretilir. 13 ucun elle doğrulanmış gövde örneği henüz yok; o uçlarda iskelet gövdesizdir — uydurma bir alan yazmıyoruz.

POST/api/crm/public/v1/channels/consent

`POST /channels/consent` — WhatsApp gönderim onayını kaydet.

API anahtarı
İstek
curl -X POST "https://{slug}.crm.blesyum.app/api/crm/public/v1/channels/consent" \
  -H "Authorization: Bearer blsk_..." \
  -H "Accept: application/json"
Yanıt
{
  "data": "…",
  "trace_id": "01JC…"
}
GET/api/crm/v1/channels

List channels

Oturum
İstek
curl -X GET "https://{slug}.crm.blesyum.app/api/crm/v1/channels" \
  -H "Authorization: Bearer <oturum-token>" \
  -H "Accept: application/json"
Yanıt
{
  "data": "…",
  "trace_id": "01JC…"
}
DELETE/api/crm/v1/channels/{id}

Disconnect channel

OturumYol parametresi: id
İstek
curl -X DELETE "https://{slug}.crm.blesyum.app/api/crm/v1/channels/<id>" \
  -H "Authorization: Bearer <oturum-token>" \
  -H "Accept: application/json"
Yanıt
{
  "data": "…",
  "trace_id": "01JC…"
}
PATCH/api/crm/v1/channels/{id}/ai

CF15 Paket 10 — kanalda AI cevabını aç/kapat (`settings.ai_enabled`).

OturumYol parametresi: id

Varsayılan **kapalı**: kredi harcayan bir davranış kendiliğinden başlamamalı. Ayar `settings` jsonb'sinde tutulur — ayrı kolon eklemeye gerek yok, kanal başına davranış ayarlarının doğal yeri orası.

İstek
curl -X PATCH "https://{slug}.crm.blesyum.app/api/crm/v1/channels/<id>/ai" \
  -H "Authorization: Bearer <oturum-token>" \
  -H "Accept: application/json"
Yanıt
{
  "data": "…",
  "trace_id": "01JC…"
}
PATCH/api/crm/v1/channels/{id}/status

Set channel status

OturumYol parametresi: id
İstek
curl -X PATCH "https://{slug}.crm.blesyum.app/api/crm/v1/channels/<id>/status" \
  -H "Authorization: Bearer <oturum-token>" \
  -H "Accept: application/json"
Yanıt
{
  "data": "…",
  "trace_id": "01JC…"
}
POST/api/crm/v1/channels/connect/{channel}

Connect channel

OturumYol parametresi: channel
İstek
curl -X POST "https://{slug}.crm.blesyum.app/api/crm/v1/channels/connect/<channel>" \
  -H "Authorization: Bearer <oturum-token>" \
  -H "Accept: application/json"
Yanıt
{
  "data": "…",
  "trace_id": "01JC…"
}
POST/api/crm/v1/channels/consent

`POST /channels/consent` — WhatsApp gönderim onayını kaydet.

Oturum
İstek
curl -X POST "https://{slug}.crm.blesyum.app/api/crm/v1/channels/consent" \
  -H "Authorization: Bearer <oturum-token>" \
  -H "Accept: application/json"
Yanıt
{
  "data": "…",
  "trace_id": "01JC…"
}
GET/api/crm/v1/channels/meta/oauth/callback

CF14 — Meta Embedded Signup callback. **PUBLIC** (Meta tarayıcıyı buraya yönlendirir; Bearer

Herkese açık

YOK). Kimlik/kiracı tek-kullanımlık `state` satırından çözülür. Sıra: state tüket → code→token → `debug_token` ile GERÇEK varlık listesi → iddia edilen varlık o listede mi (anti-spoof) → bağlantı + hesap(lar) → WABA'ya abone ol → şablonları senkronla.

İstek
curl -X GET "https://{slug}.crm.blesyum.app/api/crm/v1/channels/meta/oauth/callback" \
  -H "Accept: application/json"
Yanıt
{
  "data": "…",
  "trace_id": "01JC…"
}
GET/api/crm/v1/channels/meta/oauth/start

CF14 — Meta Embedded Signup başlat. **JSON döner, 307 DÖNMEZ.**

Oturum

Eskiden 307 Location dönüyordu ve frontend üst-düzey `<a href>` ile geliyordu; tarayıcı navigasyonu Bearer başlığı taşımadığı için bu uç config dolar dolmaz 401 verecekti (kodun kendi yorumu bunu öngörmüştü). Artık authed fetch ile `{url}` alınır ve istemci `window.location.assign(url)` yapar — yetki kapısı korunur, akış çalışır.

İstek
curl -X GET "https://{slug}.crm.blesyum.app/api/crm/v1/channels/meta/oauth/start" \
  -H "Authorization: Bearer <oturum-token>" \
  -H "Accept: application/json"
Yanıt
{
  "data": "…",
  "trace_id": "01JC…"
}
POST/api/crm/v1/channels/send-template

Send template

Oturum
İstek
curl -X POST "https://{slug}.crm.blesyum.app/api/crm/v1/channels/send-template" \
  -H "Authorization: Bearer <oturum-token>" \
  -H "Accept: application/json"
Yanıt
{
  "data": "…",
  "trace_id": "01JC…"
}
GET/api/crm/v1/channels/templates

List templates

Oturum
İstek
curl -X GET "https://{slug}.crm.blesyum.app/api/crm/v1/channels/templates" \
  -H "Authorization: Bearer <oturum-token>" \
  -H "Accept: application/json"
Yanıt
{
  "data": "…",
  "trace_id": "01JC…"
}
POST/api/crm/v1/channels/templates

Submit template

Oturum
İstek
curl -X POST "https://{slug}.crm.blesyum.app/api/crm/v1/channels/templates" \
  -H "Authorization: Bearer <oturum-token>" \
  -H "Accept: application/json"
Yanıt
{
  "data": "…",
  "trace_id": "01JC…"
}
POST/api/crm/v1/channels/templates/sync

Sync templates

Oturum
İstek
curl -X POST "https://{slug}.crm.blesyum.app/api/crm/v1/channels/templates/sync" \
  -H "Authorization: Bearer <oturum-token>" \
  -H "Accept: application/json"
Yanıt
{
  "data": "…",
  "trace_id": "01JC…"
}
Bu sayfa işine yaradı mı?