πŸ”— 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
channelTypestringβœ…The channel type (e.g., whatsapp)

πŸ”Ή Query Parameters

NameTypeRequiredDescription
pagenumber❌Page number for pagination

πŸ”Ή Headers

NameTypeRequiredDescription
x-api-keystringβœ…Your 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
channelTypestringβœ…Channel type (e.g., whatsapp)

πŸ”Ή Headers

NameTypeRequiredDescription
x-api-keystringβœ…Your 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
channelTypestringβœ…The channel type (e.g., whatsapp)
platformIdentifierstringβœ…Phone number or username (e.g., +5511999999999)

πŸ”Ή Body Parameters

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

πŸ”Ή Headers

NameTypeRequiredDescription
x-api-keystringβœ…Your 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"
}