Skip to main content

Update a session

Update the title or metadata of a Forward Session.

Request headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT>
Content-TypeYesapplication/json
Idempotency-KeyNoOptional idempotency key for unsafe requests.

Path parameters

ParameterTypeRequiredDescription
session_idstringYesSession ID.

Request body

ParameterTypeRequiredDescription
titlestringNoNew Session title.
metadataobjectNoMetadata merge patch. Provided keys overwrite existing keys; keys not present are preserved.

Example request

curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/sessions/sess_xxx' \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Updated session title",
  "metadata": {
    "source": "mobile",
    "biz_id": "ticket_123"
  }
}'

Example response

HTTP 200 OK
{
  "id": "sess_xxx",
  "type": "session",
  "identity_id": "idn_xxx",
  "template": {
    "id": "tmpl_support",
    "type": "template",
    "name": "Support assistant",
    "model": "ultimate",
    "version": 3
  },
  "source_type": "api",
  "status": "idle",
  "title": "Updated session title",
  "incremental_streaming_enabled": true,
  "metadata": {
    "source": "mobile",
    "biz_id": "ticket_123"
  },
  "config": {
    "environment_variables": {
      "API_KEY": "sk-xxx"
    }
  },
  "stats": {
    "active_seconds": 30,
    "duration_seconds": 3600
  },
  "usage": {
    "credits": 12.7
  },
  "created_at": "2026-06-22T10:00:00Z",
  "updated_at": "2026-06-22T12:00:00Z"
}

Response fields

FieldTypeDescription
Return valueobjectSession object after update.

Errors

HTTPTypeCodeTrigger
400invalid_request_errorinvalid_requestUpdate body is invalid.
404not_found_errorsession_not_foundSession does not exist.
409conflict_errorsession_archivedSession is archived.
401authentication_errorTOKEN_INVALIDPAT missing, invalid, or malformed.

Notes

  • config, resources, and incremental_streaming_enabled are create-time settings and cannot be changed through this endpoint.