@@ -230,11 +230,16 @@ final class ParseableClient: Sendable {
230230 func createStream(name: String) async throws {
231231 let encoded = try Self.encodePathComponent(name)
232232 _ = try await performRequest(method: "PUT", path: "/api/v1/logstream/\(encoded)")
233+ // Recreating a same-named stream must not serve a previous stream's
234+ // cached schema/stats/info (cached for 60s), so drop the cache.
235+ await cache.invalidate()
233236 }
234237
235238 func deleteStream(name: String) async throws {
236239 let encoded = try Self.encodePathComponent(name)
237240 _ = try await performRequest(method: "DELETE", path: "/api/v1/logstream/\(encoded)")
241+ // Invalidate so a later same-named stream doesn't see stale schema/stats/info.
242+ await cache.invalidate()
238243 }
239244
240245 func getStreamSchema(stream: String) async throws -> StreamSchema {
@@ -343,6 +348,12 @@ final class ParseableClient: Sendable {
343348 }
344349 return config
345350 } catch let newEndpointError {
351+ // An auth failure won't be fixed by hitting the legacy endpoint (it
352+ // would just 401 again), so surface it immediately rather than
353+ // delaying the re-auth prompt behind a second failing round-trip.
354+ if case ParseableError.unauthorized = newEndpointError {
355+ throw newEndpointError
356+ }
346357 do {
347358 return try await legacyAlerts()
348359 } catch {