Retrieve a list of all Sessions for the Service

GET /v1/Services/{ServiceSid}/Sessions

TODO: Resource-level docs

Retrieve a list of all Sessions for the Service. A maximum of 100 records will be returned per page.

Path parameters

Query parameters

  • PageSize integer

    How many resources to return in each list page. The default is 50, and the maximum is 1000.

    Minimum value is 1, maximum value is 1000.

Responses

  • OK

    Hide response attributes Show response attributes object
    • meta object
      Hide meta attributes Show meta attributes object
    • sessions array[object]
      Hide sessions attributes Show sessions attributes array[object]
      • account_sid string | null

        The SID of the Account that created the resource

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

      • closed_reason string | null

        The reason the Session ended

      • date_created string(date-time) | null

        The ISO 8601 date and time in GMT when the resource was created

      • date_ended string(date-time) | null

        The ISO 8601 date when the Session ended

      • date_expiry string(date-time) | null

        The ISO 8601 date when the Session should expire

      • date_last_interaction string(date-time) | null

        The ISO 8601 date when the Session last had an interaction

      • date_started string(date-time) | null

        The ISO 8601 date when the Session started

      • date_updated string(date-time) | null

        The ISO 8601 date and time in GMT when the resource was last updated

      • mode string | null

        The Mode of the Session

        Values are message-only, voice-only, or voice-and-message.

      • service_sid string | null

        The SID of the resource's parent Service

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^KS[0-9a-fA-F]{32}$.

      • sid string | null

        The unique string that identifies the resource

        Minimum length is 34, maximum length is 34. Format should match the following pattern: ^KC[0-9a-fA-F]{32}$.

      • status string | null

        The status of the Session

        Values are open, in-progress, closed, failed, or unknown.

      • ttl integer | null

        When the session will expire

      • unique_name string | null

        An application-defined string that uniquely identifies the resource

      • url string(uri) | null

        The absolute URL of the Session resource

GET /v1/Services/{ServiceSid}/Sessions
curl \
 -X GET https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions \
 --user "username:password"
Response examples (200)
{
  "meta": {
    "first_page_url": "https://example.com",
    "key": "string",
    "next_page_url": "https://example.com",
    "page": 42,
    "page_size": 42,
    "previous_page_url": "https://example.com",
    "url": "https://example.com"
  },
  "sessions": [
    {
      "account_sid": "string",
      "closed_reason": "string",
      "date_created": "2023-05-04T09:42:00+00:00",
      "date_ended": "2023-05-04T09:42:00+00:00",
      "date_expiry": "2023-05-04T09:42:00+00:00",
      "date_last_interaction": "2023-05-04T09:42:00+00:00",
      "date_started": "2023-05-04T09:42:00+00:00",
      "date_updated": "2023-05-04T09:42:00+00:00",
      "links": {},
      "mode": "message-only",
      "service_sid": "string",
      "sid": "string",
      "status": "open",
      "ttl": 42,
      "unique_name": "string",
      "url": "https://example.com"
    }
  ]
}
Response examples (200)
{
  "meta": {
    "first_page_url": "https://example.com",
    "key": "string",
    "next_page_url": "https://example.com",
    "page": 42,
    "page_size": 42,
    "previous_page_url": "https://example.com",
    "url": "https://example.com"
  },
  "sessions": [
    {
      "account_sid": "string",
      "closed_reason": "string",
      "date_created": "2024-05-04T09:42:00+00:00",
      "date_ended": "2024-05-04T09:42:00+00:00",
      "date_expiry": "2024-05-04T09:42:00+00:00",
      "date_last_interaction": "2024-05-04T09:42:00+00:00",
      "date_started": "2024-05-04T09:42:00+00:00",
      "date_updated": "2024-05-04T09:42:00+00:00",
      "links": {},
      "mode": "message-only",
      "service_sid": "string",
      "sid": "string",
      "status": "open",
      "ttl": 42,
      "unique_name": "string",
      "url": "https://example.com"
    }
  ]
}