# Subscribe to live trip updates **SUBSCRIBE /trips/{id}** Open a stream of live updates for a trip, such as delays, platform changes, and departure or arrival events. Choose JSON Lines (`application/jsonl`) or Server-Sent Events (`text/event-stream`) with the `Accept` header. The connection stays open until the trip arrives, is cancelled, or the client disconnects. ## Servers - Mock Server: https://try.microcks.io/rest/Train+Travel+API/1.0.0 (A mock server for testing and development purposes) - Production: https://api.example.com (The production server for the Train Travel API) ## Authentication methods - O auth2 ## Parameters ### Path parameters - **id** (string(uuid)) The ID of the trip to subscribe to. ## Responses ### 200 A stream of live trip status updates #### Headers - **Cache-Control** () - **RateLimit** () #### Body: application/jsonl (object) - **type** (string) The kind of update. - **trip_id** (string(uuid)) Identifier of the trip this update belongs to. - **occurred_at** (string(date-time)) When the update occurred. - **minutes** (integer) Delay in minutes. Present when `type` is `delay`. - **reason** (string) Human-readable reason for the update. - **platform** (string) Assigned platform. Present when `type` is `platform`. ### 400 Bad Request #### Headers - **RateLimit** () #### Body: application/problem+json (object) - **type** (string) A URI reference that identifies the problem type - **title** (string) A short, human-readable summary of the problem type - **detail** (string) A human-readable explanation specific to this occurrence of the problem - **instance** (string) A URI reference that identifies the specific occurrence of the problem - **status** (integer) The HTTP status code ### 401 Unauthorized #### Headers - **RateLimit** () #### Body: application/problem+json (object) - **type** (string) A URI reference that identifies the problem type - **title** (string) A short, human-readable summary of the problem type - **detail** (string) A human-readable explanation specific to this occurrence of the problem - **instance** (string) A URI reference that identifies the specific occurrence of the problem - **status** (integer) The HTTP status code ### 403 Forbidden #### Headers - **RateLimit** () #### Body: application/problem+json (object) - **type** (string) A URI reference that identifies the problem type - **title** (string) A short, human-readable summary of the problem type - **detail** (string) A human-readable explanation specific to this occurrence of the problem - **instance** (string) A URI reference that identifies the specific occurrence of the problem - **status** (integer) The HTTP status code ### 404 Not Found #### Headers - **RateLimit** () #### Body: application/problem+json (object) - **type** (string) A URI reference that identifies the problem type - **title** (string) A short, human-readable summary of the problem type - **detail** (string) A human-readable explanation specific to this occurrence of the problem - **instance** (string) A URI reference that identifies the specific occurrence of the problem - **status** (integer) The HTTP status code ### 429 Too Many Requests #### Headers - **RateLimit** () - **Retry-After** () The Retry-After header indicates how long the user agent should wait before making a follow-up request. The value is in seconds and can be an integer or a date in the future. If the value is an integer, it indicates the number of seconds to wait. If the value is a date, it indicates the time at which the user agent should make a follow-up request. #### Body: application/problem+json (object) - **type** (string) A URI reference that identifies the problem type - **title** (string) A short, human-readable summary of the problem type - **detail** (string) A human-readable explanation specific to this occurrence of the problem - **instance** (string) A URI reference that identifies the specific occurrence of the problem - **status** (integer) The HTTP status code ### 500 Internal Server Error #### Headers - **RateLimit** () #### Body: application/problem+json (object) - **type** (string) A URI reference that identifies the problem type - **title** (string) A short, human-readable summary of the problem type - **detail** (string) A human-readable explanation specific to this occurrence of the problem - **instance** (string) A URI reference that identifies the specific occurrence of the problem - **status** (integer) The HTTP status code [Powered by Bump.sh](https://bump.sh)