🔗 Channels

Use these endpoints to interact with communication channels like WhatsApp. You can retrieve contacts and channels based on type, and tag users by their identifier (e.g., phone number).

🔽 GET /api/public/channels/{channelType}/contacts – Retrieve Contacts by Channel Type

Fetches a list of contacts associated with the specified channel (e.g., WhatsApp).

Click to expand full details

🔹 URL

GET /api/public/channels/{channelType}/contacts

🔹 Path Parameters

NameTypeRequiredDescription
channelTypestringThe channel type (e.g., whatsapp)

🔹 Query Parameters

NameTypeRequiredDescription
pagenumberPage number for pagination

🔹 Headers

NameTypeRequiredDescription
x-api-keystringYour API key for authorization

🔹 Example Request

curl --request GET \
  'https://iris-backend-production.up.railway.app/api/public/channels/whatsapp/contacts?page=1' \
  --header 'x-api-key: YOUR_API_KEY'

🔹 Success Response

[
  {
    "id": "contact_01",
    "name": "Pedro",
    "phone": "+5511999999999",
    "tags": ["lead"]
  },
  ...
]

🔽 GET /api/public/channels/{channelType} – Retrieve Channel by Type

Retrieves the authenticated user's channel info for a given channel type.

Click to expand full details

🔹 URL

GET /api/public/channels/{channelType}

🔹 Path Parameters

NameTypeRequiredDescription
channelTypestringChannel type (e.g., whatsapp)

🔹 Headers

NameTypeRequiredDescription
x-api-keystringYour API key for authorization

🔹 Example Request

curl --request GET \
  'https://iris-backend-production.up.railway.app/api/public/channels/whatsapp' \
  --header 'x-api-key: YOUR_API_KEY'

🔹 Success Response

{
  "id": "channel_01",
  "type": "whatsapp",
  "name": "Main WhatsApp Channel",
  "status": "connected"
}

🔽 POST /api/public/channels/{channelType}/{platformIdentifier}/tags – Create a Tag for a Contact

Adds tags to a contact identified by their phone number or platform ID.

Click to expand full details

🔹 URL

POST /api/public/channels/{channelType}/{platformIdentifier}/tags

🔹 Path Parameters

NameTypeRequiredDescription
channelTypestringThe channel type (e.g., whatsapp)
platformIdentifierstringPhone number or username (e.g., +5511999999999)

🔹 Body Parameters

{
  "tags": ["event_signup", "VIP"]
}

🔹 Headers

NameTypeRequiredDescription
x-api-keystringYour API key for authorization

🔹 Example Request

curl --request POST \
  'https://iris-backend-production.up.railway.app/api/public/channels/whatsapp/+5511999999999/tags' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "tags": ["event_signup", "VIP"]
  }'

🔹 Success Response

{
  "status": "success",
  "message": "Tags added to contact"
}