Skip to main content
POST
End Session
What This Does: Gracefully stops the avatar server, releases GPU resources and marks the session as ended. Call this when you’re done with the conversation to avoid unnecessary charges.

Path Parameters

string
required
The session ID to end

Response

boolean
Whether the request was successful
object
The updated session object (See Session schema).

Important Notes

  • Only active sessions (status: started) can be ended
  • Marks the session with an ended_at timestamp
  • Session status transitions from started to ended
  • Once ended, the session cannot be restarted
  • If the session is already ended, the API returns success: true.

Automatic Termination Handling

Best Practice: Always explicitly call this endpoint when you’re done with a session to ensure immediate resource release and billing accuracy.
Sessions are automatically terminated instantly when:
  • Client leaves the video room - When all participants leave the Daily/LiveKit room
  • Session timeout - When the session reaches its expiration time based on plan limits
Safety Mechanism: If automatic termination fails for any reason, our system has a safety check that will detect and clean up orphaned sessions within 3 minutes. This ensures sessions are always terminated even in edge cases where the instant triggers don’t fire.