Update a specific Session

POST /v1/Services/{ServiceSid}/Sessions/{Sid}

TODO: Resource-level docs

Update a specific Session.

Path parameters

  • ServiceSid string Required

    The SID of the parent Service of the resource to update.

  • Sid string Required

    The Twilio-provided string that uniquely identifies the Session resource to update.

Body

  • DateExpiry string(date-time)

    The ISO 8601 date when the Session should expire. If this is value is present, it overrides the ttl value.

  • [Experimental] For accounts with the ProxyAllowParticipantConflict account flag, setting to true enables per-request opt-in to allowing Proxy to return a 400 error (Twilio error code 80604) when a request to set a Session to in-progress would cause Participants with the same Identifier/ProxyIdentifier pair to be active in multiple Sessions. If not provided, requests will be allowed to succeed, and a Debugger notification (80801) will be emitted. Having multiple, active Participants with the same Identifier/ProxyIdentifier pair causes calls and messages from affected Participants to be routed incorrectly. Please note, the default behavior for accounts without the ProxyAllowParticipantConflict flag is to reject the request as described. This will eventually be the default for all accounts.

  • Status string

    The new status of the resource. Can be: in-progress to re-open a session or closed to close a session.

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

  • Ttl integer

    The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction.

Responses

  • OK

    Hide response attributes Show response attributes 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

POST /v1/Services/{ServiceSid}/Sessions/{Sid}
curl \
 -X POST https://proxy.twilio.com/v1/Services/{ServiceSid}/Sessions/{Sid} \
 --user "username:password" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d 'DateExpiry=2023-05-04T09%3A42%3A00%2B00%3A00&FailOnParticipantConflict=true&Status=open&Ttl=42'
Request example
{
  "DateExpiry": "2023-05-04T09:42:00+00:00",
  "FailOnParticipantConflict": true,
  "Status": "open",
  "Ttl": 42
}
Request examples
{
  "DateExpiry": "2024-05-04T09:42:00+00:00",
  "FailOnParticipantConflict": true,
  "Status": "open",
  "Ttl": 42
}
Response examples (200)
{
  "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)
{
  "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"
}