Chats

Search chats by text

GET search

Endpoint

GET /api/v1/chats/search

Parameters

Name Description
by_text required Text to search by
by_company Filter by company_id (admin only)
page Page number
per_page Number of items per page

Request

Route

GET /api/v1/chats/search?by_text=word

Headers

Accept: application/json
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI2MCIsInNjcCI6InVzZXIiLCJhdWQiOm51bGwsImlhdCI6MTczNzU1MTU1MSwiZXhwIjoxNzQwMTQzNTUxLCJqdGkiOiI1Zjk5OTEwZi0zMTdjLTQxODAtOTI2OC02ZGM4MGViMDY3MTkifQ.50cBswRcY4ghRIjgXsH3FdGhNIRSep_axvIRI6auvFQ
Host: example.org
Cookie: 

Query Parameters

by_text=word

Response

Simulated Response

Status

200

Headers

x-frame-options: SAMEORIGIN
x-xss-protection: 0
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
referrer-policy: strict-origin-when-cross-origin
per-page: 20
total: 2
content-type: application/json; charset=utf-8
vary: Accept, Origin
etag: W/"c9eeab45bf542df9048b6adcafe8854c"
cache-control: max-age=0, private, must-revalidate
x-request-id: 5c4569b9-6a03-48c3-bf62-5272f65b28d8
x-runtime: 0.018090
content-length: 745

Body

{
  "messages": [
    {
      "id": 8,
      "chat": {
        "id": 24,
        "topic": {
          "id": 13,
          "number": 91379717,
          "title": "Principal Sales Strategist"
        },
        "topic_type": "Job"
      },
      "created_at": "2025-01-22T13:12:31.084Z",
      "files": [

      ],
      "sender": {
        "id": 14,
        "user": {
          "id": 59,
          "admin": false,
          "contact_phone_number": null,
          "first_name": "Karl",
          "last_name": "Lind",
          "role": "operator"
        }
      },
      "sender_id": 14,
      "text": "Driver message with word in text field"
    },
    {
      "id": 7,
      "chat": {
        "id": 24,
        "topic": {
          "id": 13,
          "number": 91379717,
          "title": "Principal Sales Strategist"
        },
        "topic_type": "Job"
      },
      "created_at": "2025-01-22T13:12:31.067Z",
      "files": [

      ],
      "sender": {
        "id": 13,
        "user": {
          "id": 60,
          "admin": false,
          "first_name": "Otis",
          "last_name": "Casper",
          "referral_code": "490174",
          "role": "driver"
        }
      },
      "sender_id": 13,
      "text": "Driver message with word in text field"
    }
  ]
}