Label

Query messages with a label

Queries messages with the given label.

get/v1/projects/{project_id}/labels/{id}/messages

Request

  • Base URL: https://api.telerivet.com
  • URL: https://api.telerivet.com/v1/projects/{project_id}/labels/{id}/messages
  • Auth: one of:
    • HTTP basic
    • OAuth 2 (authorization code, authorization URL https://telerivet.com/oauth/authorize, token URL https://api.telerivet.com/oauth/token)

Path parameters

project_idstring required

ID of the Project

idstring required

ID of the Label

Query parameters

direction'incoming' | 'outgoing'

Filter messages by direction

message_type'sms' | 'mms' | 'ussd' | 'ussd_session' | 'call' | 'chat' | 'service'

Filter messages by message_type

source'phone' | 'provider' | 'web' | 'api' | 'service' | 'webhook' | 'scheduled' | 'integration' | 'mcp' | 'welcome'

Filter messages by source

starredboolean

Filter messages by starred/unstarred

status'ignored' | 'processing' | 'received' | 'sent' | 'queued' | 'failed' | 'failed_queued' | 'cancelled' | 'delivered' | 'not_delivered' | 'read'

Filter messages by status

time_created[min]integer

Unix timestamp in seconds

Filter messages created on or after a particular time

time_created[max]integer

Unix timestamp in seconds

Filter messages created before a particular time

external_idstring

Filter messages by ID from an external provider

contact_idstring

ID of Contact

ID of the contact who sent/received the message

phone_idstring

ID of Phone

ID of the phone (basic route) that sent/received the message

broadcast_idstring

ID of Broadcast

ID of the broadcast containing the message

scheduled_idstring

ID of ScheduledMessage

ID of the scheduled message that created this message

group_idstring

ID of Group

Filter messages sent or received by contacts in a particular group. The group must be a normal group, not a dynamic group.

sort'default'

Sort the results based on a field

sort_dir'asc' | 'desc'

Sort the results in ascending or descending order

page_sizeinteger

Number of results returned per page (max 500)

offsetinteger

Number of items to skip from beginning of result set

markerstring

'next_marker' property returned by a previous call to this API method, indicating where the next page of results should start.

countboolean

If true, the API will return the count of items matching the filter, instead of the items themselves

Response

Successful response. When count=1 parameter is provided, returns {"count": N} instead.

truncatedboolean

True if there are more results

next_markerstring

Marker for pagination

page_sizeinteger

Number of results per page

sort_dir'asc' | 'desc'

Sort direction

countinteger

Total count of matching items (only when count=1 parameter is provided)

Example response

{
  "data": [
    {
      "id": "SM1629708e59c5c781",
      "direction": "outgoing",
      "status": "sent",
      "message_type": "sms",
      "source": "service",
      "time_created": 1390347812,
      "time_sent": 1390347814,
      "time_updated": 1390347818,
      "from_number": "+16505550001",
      "to_number": "+16505550123",
      "content": "Thank you for registering!",
      "starred": true,
      "priority": 1,
      "send_attempts": 1,
      "external_id": "142092393",
      "num_parts": 1,
      "price": 0.01,
      "price_currency": "USD",
      "service_id": "SV3d246818d0e3d1fb",
      "phone_id": "PN4d246818d0ecd1fa",
      "contact_id": "CTa1299c3d0e371023",
      "route_id": "RT2a586298d3412adf",
      "broadcast_id": "MB98918598dab29800",
      "scheduled_id": "SEa502e6f9d23f1cb6",
      "user_id": "URba3e403e98f49735",
      "project_id": "PJ2ad0100821a98bea",
      "url": "https://telerivet.com/p/asdf/message/SM1629708e59c5c781"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.