diff --git a/src/libs/Terra/Generated/Terra.ActivityClient.ActivityGet.g.cs b/src/libs/Terra/Generated/Terra.ActivityClient.ActivityGet.g.cs index eb4c0fb..c0d53cc 100644 --- a/src/libs/Terra/Generated/Terra.ActivityClient.ActivityGet.g.cs +++ b/src/libs/Terra/Generated/Terra.ActivityClient.ActivityGet.g.cs @@ -443,6 +443,43 @@ partial void ProcessActivityGetResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // A referenced resource does not exist on Terra's end. if ((int)__response.StatusCode == 404) { @@ -480,6 +517,43 @@ partial void ProcessActivityGetResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.AthleteClient.AthleteGet.g.cs b/src/libs/Terra/Generated/Terra.AthleteClient.AthleteGet.g.cs index dd7a5a9..09ea96e 100644 --- a/src/libs/Terra/Generated/Terra.AthleteClient.AthleteGet.g.cs +++ b/src/libs/Terra/Generated/Terra.AthleteClient.AthleteGet.g.cs @@ -413,6 +413,43 @@ partial void ProcessAthleteGetResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // A referenced resource does not exist on Terra's end. if ((int)__response.StatusCode == 404) { @@ -450,6 +487,43 @@ partial void ProcessAthleteGetResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.AuthenticationClient.AuthenticationAuthenticateUser.g.cs b/src/libs/Terra/Generated/Terra.AuthenticationClient.AuthenticationAuthenticateUser.g.cs index 25bc3bb..f0c9938 100644 --- a/src/libs/Terra/Generated/Terra.AuthenticationClient.AuthenticationAuthenticateUser.g.cs +++ b/src/libs/Terra/Generated/Terra.AuthenticationClient.AuthenticationAuthenticateUser.g.cs @@ -386,6 +386,43 @@ partial void ProcessAuthenticationAuthenticateUserResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // A referenced resource does not exist on Terra's end. if ((int)__response.StatusCode == 404) { @@ -423,6 +460,43 @@ partial void ProcessAuthenticationAuthenticateUserResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.AuthenticationClient.AuthenticationCreateAuthToken.g.cs b/src/libs/Terra/Generated/Terra.AuthenticationClient.AuthenticationCreateAuthToken.g.cs index 5e8fb2a..a5ce7a8 100644 --- a/src/libs/Terra/Generated/Terra.AuthenticationClient.AuthenticationCreateAuthToken.g.cs +++ b/src/libs/Terra/Generated/Terra.AuthenticationClient.AuthenticationCreateAuthToken.g.cs @@ -329,6 +329,43 @@ partial void ProcessAuthenticationCreateAuthTokenResponseContent( retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // A referenced resource does not exist on Terra's end. if ((int)__response.StatusCode == 404) { @@ -366,6 +403,43 @@ partial void ProcessAuthenticationCreateAuthTokenResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.AuthenticationClient.AuthenticationGenerateWidgetSession.g.cs b/src/libs/Terra/Generated/Terra.AuthenticationClient.AuthenticationGenerateWidgetSession.g.cs index 79b20ab..69da5a7 100644 --- a/src/libs/Terra/Generated/Terra.AuthenticationClient.AuthenticationGenerateWidgetSession.g.cs +++ b/src/libs/Terra/Generated/Terra.AuthenticationClient.AuthenticationGenerateWidgetSession.g.cs @@ -374,6 +374,43 @@ partial void ProcessAuthenticationGenerateWidgetSessionResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // Returned for Terra accounts created after the widget relaunch (2026-09-03) — this endpoint is deprecated for them. Create widget sessions with POST https://access.tryterra.co/api/widget/session instead. The response carries Deprecation and Link (rel="deprecation") headers. if ((int)__response.StatusCode == 410) { @@ -411,6 +448,43 @@ partial void ProcessAuthenticationGenerateWidgetSessionResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.BodyClient.BodyGet.g.cs b/src/libs/Terra/Generated/Terra.BodyClient.BodyGet.g.cs index 0728bc6..554ab60 100644 --- a/src/libs/Terra/Generated/Terra.BodyClient.BodyGet.g.cs +++ b/src/libs/Terra/Generated/Terra.BodyClient.BodyGet.g.cs @@ -443,6 +443,43 @@ partial void ProcessBodyGetResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // A referenced resource does not exist on Terra's end. if ((int)__response.StatusCode == 404) { @@ -480,6 +517,43 @@ partial void ProcessBodyGetResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.DailyClient.DailyGet.g.cs b/src/libs/Terra/Generated/Terra.DailyClient.DailyGet.g.cs index fb93ed2..b19bd16 100644 --- a/src/libs/Terra/Generated/Terra.DailyClient.DailyGet.g.cs +++ b/src/libs/Terra/Generated/Terra.DailyClient.DailyGet.g.cs @@ -443,6 +443,43 @@ partial void ProcessDailyGetResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // A referenced resource does not exist on Terra's end. if ((int)__response.StatusCode == 404) { @@ -480,6 +517,43 @@ partial void ProcessDailyGetResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.ITerraClient.g.cs b/src/libs/Terra/Generated/Terra.ITerraClient.g.cs index 2dcb6d4..a55f4f5 100644 --- a/src/libs/Terra/Generated/Terra.ITerraClient.g.cs +++ b/src/libs/Terra/Generated/Terra.ITerraClient.g.cs @@ -4,7 +4,7 @@ namespace Terra { /// - /// The Terra API (v2 surface, served at access.tryterra.co/api/v2).
+ /// The Terra API (v2 surface, served at access.tryterra.co/api/v2). Protected product operations require a current product entitlement in addition to valid credentials and token scopes. Missing access returns HTTP 403 with code entitlement_required; disabled environments return environment_disabled. Unavailable current authorization returns HTTP 503 with code authorization_unavailable. Billing, configuration and recovery remain available under their existing permissions.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsGet.g.cs b/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsGet.g.cs index f4a8328..ac302d7 100644 --- a/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsGet.g.cs +++ b/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsGet.g.cs @@ -400,6 +400,43 @@ partial void ProcessReportsGetResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // A referenced resource does not exist on Terra's end. if ((int)__response.StatusCode == 404) { @@ -437,6 +474,43 @@ partial void ProcessReportsGetResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsList.g.cs b/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsList.g.cs index 1745973..6f7663f 100644 --- a/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsList.g.cs +++ b/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsList.g.cs @@ -463,6 +463,80 @@ partial void ProcessReportsListResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsListDeliveries.g.cs b/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsListDeliveries.g.cs index 99434be..9725d96 100644 --- a/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsListDeliveries.g.cs +++ b/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsListDeliveries.g.cs @@ -400,6 +400,43 @@ partial void ProcessReportsListDeliveriesResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // A referenced resource does not exist on Terra's end. if ((int)__response.StatusCode == 404) { @@ -437,6 +474,43 @@ partial void ProcessReportsListDeliveriesResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsListFiles.g.cs b/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsListFiles.g.cs index d6a864c..887333a 100644 --- a/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsListFiles.g.cs +++ b/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsListFiles.g.cs @@ -400,6 +400,43 @@ partial void ProcessReportsListFilesResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // A referenced resource does not exist on Terra's end. if ((int)__response.StatusCode == 404) { @@ -437,6 +474,43 @@ partial void ProcessReportsListFilesResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsUpload.g.cs b/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsUpload.g.cs index 48ea8ca..7a292f2 100644 --- a/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsUpload.g.cs +++ b/src/libs/Terra/Generated/Terra.LabReportsClient.ReportsUpload.g.cs @@ -459,7 +459,7 @@ request.Filename is null h => h.Key, h => h.Value)); } - // The credential is not authorized for this operation. + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. if ((int)__response.StatusCode == 403) { string? __content_403 = null; @@ -533,6 +533,43 @@ request.Filename is null h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { @@ -1063,7 +1100,7 @@ request.Filename is null h => h.Key, h => h.Value)); } - // The credential is not authorized for this operation. + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. if ((int)__response.StatusCode == 403) { string? __content_403 = null; @@ -1137,6 +1174,43 @@ request.Filename is null h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { @@ -1625,7 +1699,7 @@ request.Filename is null h => h.Key, h => h.Value)); } - // The credential is not authorized for this operation. + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. if ((int)__response.StatusCode == 403) { string? __content_403 = null; @@ -1699,6 +1773,43 @@ request.Filename is null h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.MenstruationClient.MenstruationGet.g.cs b/src/libs/Terra/Generated/Terra.MenstruationClient.MenstruationGet.g.cs index f28ddef..c94ce9c 100644 --- a/src/libs/Terra/Generated/Terra.MenstruationClient.MenstruationGet.g.cs +++ b/src/libs/Terra/Generated/Terra.MenstruationClient.MenstruationGet.g.cs @@ -443,6 +443,43 @@ partial void ProcessMenstruationGetResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // A referenced resource does not exist on Terra's end. if ((int)__response.StatusCode == 404) { @@ -480,6 +517,43 @@ partial void ProcessMenstruationGetResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.Models.Problem.g.cs b/src/libs/Terra/Generated/Terra.Models.Problem.g.cs index ac98751..9a38284 100644 --- a/src/libs/Terra/Generated/Terra.Models.Problem.g.cs +++ b/src/libs/Terra/Generated/Terra.Models.Problem.g.cs @@ -35,6 +35,18 @@ public sealed partial class Problem [global::System.Text.Json.Serialization.JsonRequired] public required string Instance { get; set; } + /// + /// Stable error classification. Product gates return entitlement_required (403), environment_disabled (403), or authorization_unavailable (503). + /// + [global::System.Text.Json.Serialization.JsonPropertyName("code")] + public string? Code { get; set; } + + /// + /// The product checked by the authorization gate, when classified. + /// + [global::System.Text.Json.Serialization.JsonPropertyName("product")] + public string? Product { get; set; } + /// /// A human-readable explanation specific to this occurrence of the problem.
/// Example: dev-id or x-api-key headers are missing @@ -64,6 +76,12 @@ public sealed partial class Problem /// The request path, including any query string, that produced this problem.
/// Example: /api/v2/activity?user_id=d4aba475-f714-4663-88fe-28f18b8599b0&to_webhook=false /// + /// + /// Stable error classification. Product gates return entitlement_required (403), environment_disabled (403), or authorization_unavailable (503). + /// + /// + /// The product checked by the authorization gate, when classified. + /// /// /// A human-readable explanation specific to this occurrence of the problem.
/// Example: dev-id or x-api-key headers are missing @@ -75,11 +93,15 @@ public Problem( string type, string title, string instance, + string? code, + string? product, string? detail) { this.Type = type ?? throw new global::System.ArgumentNullException(nameof(type)); this.Title = title ?? throw new global::System.ArgumentNullException(nameof(title)); this.Instance = instance ?? throw new global::System.ArgumentNullException(nameof(instance)); + this.Code = code; + this.Product = product; this.Detail = detail; } diff --git a/src/libs/Terra/Generated/Terra.NutritionClient.NutritionGet.g.cs b/src/libs/Terra/Generated/Terra.NutritionClient.NutritionGet.g.cs index fe4afc1..3ab92b9 100644 --- a/src/libs/Terra/Generated/Terra.NutritionClient.NutritionGet.g.cs +++ b/src/libs/Terra/Generated/Terra.NutritionClient.NutritionGet.g.cs @@ -443,6 +443,43 @@ partial void ProcessNutritionGetResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // A referenced resource does not exist on Terra's end. if ((int)__response.StatusCode == 404) { @@ -480,6 +517,43 @@ partial void ProcessNutritionGetResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.SleepClient.SleepGet.g.cs b/src/libs/Terra/Generated/Terra.SleepClient.SleepGet.g.cs index ee04d63..57accc9 100644 --- a/src/libs/Terra/Generated/Terra.SleepClient.SleepGet.g.cs +++ b/src/libs/Terra/Generated/Terra.SleepClient.SleepGet.g.cs @@ -443,6 +443,43 @@ partial void ProcessSleepGetResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // A referenced resource does not exist on Terra's end. if ((int)__response.StatusCode == 404) { @@ -480,6 +517,43 @@ partial void ProcessSleepGetResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.TerraClient.g.cs b/src/libs/Terra/Generated/Terra.TerraClient.g.cs index 52411a9..51c47cc 100644 --- a/src/libs/Terra/Generated/Terra.TerraClient.g.cs +++ b/src/libs/Terra/Generated/Terra.TerraClient.g.cs @@ -4,7 +4,7 @@ namespace Terra { /// - /// The Terra API (v2 surface, served at access.tryterra.co/api/v2).
+ /// The Terra API (v2 surface, served at access.tryterra.co/api/v2). Protected product operations require a current product entitlement in addition to valid credentials and token scopes. Missing access returns HTTP 403 with code entitlement_required; disabled environments return environment_disabled. Unavailable current authorization returns HTTP 503 with code authorization_unavailable. Billing, configuration and recovery remain available under their existing permissions.
/// If no httpClient is provided, a new one will be created.
/// If no baseUri is provided, the default baseUri from OpenAPI spec will be used. ///
diff --git a/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsCreateWorkout.g.cs b/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsCreateWorkout.g.cs index ed08c98..9724fa8 100644 --- a/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsCreateWorkout.g.cs +++ b/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsCreateWorkout.g.cs @@ -411,6 +411,80 @@ partial void ProcessWorkoutsCreateWorkoutResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsGetPlannedWorkout.g.cs b/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsGetPlannedWorkout.g.cs index 2669d1c..a013d57 100644 --- a/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsGetPlannedWorkout.g.cs +++ b/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsGetPlannedWorkout.g.cs @@ -375,6 +375,43 @@ partial void ProcessWorkoutsGetPlannedWorkoutResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // A referenced resource does not exist on Terra's end. if ((int)__response.StatusCode == 404) { @@ -412,6 +449,43 @@ partial void ProcessWorkoutsGetPlannedWorkoutResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsGetWorkout.g.cs b/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsGetWorkout.g.cs index 23c212b..d650094 100644 --- a/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsGetWorkout.g.cs +++ b/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsGetWorkout.g.cs @@ -361,6 +361,43 @@ partial void ProcessWorkoutsGetWorkoutResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // A referenced resource does not exist on Terra's end. if ((int)__response.StatusCode == 404) { @@ -398,6 +435,43 @@ partial void ProcessWorkoutsGetWorkoutResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsListPlannedWorkouts.g.cs b/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsListPlannedWorkouts.g.cs index 57def19..5a25c8a 100644 --- a/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsListPlannedWorkouts.g.cs +++ b/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsListPlannedWorkouts.g.cs @@ -423,6 +423,43 @@ partial void ProcessWorkoutsListPlannedWorkoutsResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } // A referenced resource does not exist on Terra's end. if ((int)__response.StatusCode == 404) { @@ -460,6 +497,43 @@ partial void ProcessWorkoutsListPlannedWorkoutsResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsListWorkouts.g.cs b/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsListWorkouts.g.cs index 545707e..27c1aba 100644 --- a/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsListWorkouts.g.cs +++ b/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsListWorkouts.g.cs @@ -354,6 +354,80 @@ partial void ProcessWorkoutsListWorkoutsResponseContent( h => h.Key, h => h.Value)); } + // The credential is not authorized, the environment is disabled, or the required product entitlement is missing. + if ((int)__response.StatusCode == 403) + { + string? __content_403 = null; + global::System.Exception? __exception_403 = null; + global::Terra.Problem? __value_403 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + else + { + __content_403 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_403 = global::Terra.Problem.FromJson(__content_403, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_403 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_403 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_403, + responseBody: __content_403, + responseObject: __value_403, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsPlanWorkout.g.cs b/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsPlanWorkout.g.cs index ab740a2..088ab35 100644 --- a/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsPlanWorkout.g.cs +++ b/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsPlanWorkout.g.cs @@ -543,6 +543,43 @@ partial void ProcessWorkoutsPlanWorkoutResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsUpdatePlannedWorkout.g.cs b/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsUpdatePlannedWorkout.g.cs index ea77a52..f5ff53a 100644 --- a/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsUpdatePlannedWorkout.g.cs +++ b/src/libs/Terra/Generated/Terra.WorkoutsClient.WorkoutsUpdatePlannedWorkout.g.cs @@ -504,6 +504,43 @@ partial void ProcessWorkoutsUpdatePlannedWorkoutResponseContent( h => h.Key, h => h.Value)); } + // Current product authorization is unavailable; retry after the service recovers. + if ((int)__response.StatusCode == 503) + { + string? __content_503 = null; + global::System.Exception? __exception_503 = null; + global::Terra.Problem? __value_503 = null; + try + { + if (__effectiveReadResponseAsString) + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + else + { + __content_503 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false); + + __value_503 = global::Terra.Problem.FromJson(__content_503, JsonSerializerContext); + } + } + catch (global::System.Exception __ex) + { + __exception_503 = __ex; + } + + + throw global::Terra.ApiException.Create( + statusCode: __response.StatusCode, + message: __content_503 ?? __response.ReasonPhrase ?? string.Empty, + innerException: __exception_503, + responseBody: __content_503, + responseObject: __value_503, + responseHeaders: global::System.Linq.Enumerable.ToDictionary( + __response.Headers, + h => h.Key, + h => h.Value)); + } if (__effectiveReadResponseAsString) { diff --git a/src/libs/Terra/Generated/autosdk.generated-examples.json b/src/libs/Terra/Generated/autosdk.generated-examples.json index 7a92963..56be4c9 100644 --- a/src/libs/Terra/Generated/autosdk.generated-examples.json +++ b/src/libs/Terra/Generated/autosdk.generated-examples.json @@ -6,7 +6,7 @@ "Slug": "activity-get", "Description": "Returns completed workout sessions, each with a defined start and end time and an activity type such as running or cycling.", "Language": "http", - "Code": "### Retrieve activity data\n# @name Activity_Get\nGET {{host}}/activity?user_id={{user_id}}\u0026start_date={{start_date}}\u0026end_date={{end_date}}\u0026to_webhook={{to_webhook}}\u0026with_samples={{with_samples}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Returned upon successful data request\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson", + "Code": "### Retrieve activity data\n# @name Activity_Get\nGET {{host}}/activity?user_id={{user_id}}\u0026start_date={{start_date}}\u0026end_date={{end_date}}\u0026to_webhook={{to_webhook}}\u0026with_samples={{with_samples}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Returned upon successful data request\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Activity_Get", "Setup": null @@ -17,7 +17,7 @@ "Slug": "athlete-get", "Description": "Returns the user profile, such as first and last name, birth date and gender.", "Language": "http", - "Code": "### Retrieve athlete profile\n# @name Athlete_Get\nGET {{host}}/athlete?user_id={{user_id}}\u0026to_webhook={{to_webhook}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Returned upon successful data request\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson", + "Code": "### Retrieve athlete profile\n# @name Athlete_Get\nGET {{host}}/athlete?user_id={{user_id}}\u0026to_webhook={{to_webhook}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Returned upon successful data request\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Athlete_Get", "Setup": null @@ -28,7 +28,7 @@ "Slug": "authentication-authenticateuser", "Description": "Creates a login link that allows end users to connect their fitness tracking account", "Language": "http", - "Code": "### Generate an authentication link\n# @name Authentication_AuthenticateUser\nPOST {{host}}/auth/authenticateUser?resource=FITBIT\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, application/problem\u002Bjson\n\n{\n \u0022language\u0022: \u0022string\u0022,\n \u0022reference_id\u0022: \u0022string\u0022,\n \u0022auth_success_redirect_url\u0022: \u0022string\u0022,\n \u0022auth_failure_redirect_url\u0022: \u0022string\u0022,\n \u0022sdk_app\u0022: \u0022avengers\u0022\n}\n\n## Responses\n# 200\n# Description: Returned when authentication link could be successfully generated\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson", + "Code": "### Generate an authentication link\n# @name Authentication_AuthenticateUser\nPOST {{host}}/auth/authenticateUser?resource=FITBIT\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, application/problem\u002Bjson\n\n{\n \u0022language\u0022: \u0022string\u0022,\n \u0022reference_id\u0022: \u0022string\u0022,\n \u0022auth_success_redirect_url\u0022: \u0022string\u0022,\n \u0022auth_failure_redirect_url\u0022: \u0022string\u0022,\n \u0022sdk_app\u0022: \u0022avengers\u0022\n}\n\n## Responses\n# 200\n# Description: Returned when authentication link could be successfully generated\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Authentication_AuthenticateUser", "Setup": null @@ -61,7 +61,7 @@ "Slug": "authentication-generatewidgetsession", "Description": "Returns a Terra Widget session with a hosted URL where the end user selects a provider and logs in.", "Language": "http", - "Code": "### Generate a Terra Widget session link\n# @name Authentication_GenerateWidgetSession\nPOST {{host}}/auth/generateWidgetSession\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, application/problem\u002Bjson\n\n{\n \u0022providers\u0022: \u0022GARMIN,FITBIT,OURA,WITHINGS,SUUNTO\u0022,\n \u0022language\u0022: \u0022en\u0022,\n \u0022reference_id\u0022: \u0022user123@email.com\u0022,\n \u0022auth_success_redirect_url\u0022: \u0022https://myapp.com/success\u0022,\n \u0022auth_failure_redirect_url\u0022: \u0022https://myapp.com/failure\u0022\n}\n\n## Responses\n# 200\n# Description: Returned when authentication link could be successfully generated\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 410\n# Description: Returned for Terra accounts created after the widget relaunch (2026-09-03) \u2014 this endpoint is deprecated for them. Create widget sessions with POST https://access.tryterra.co/api/widget/session instead. The response carries Deprecation and Link (rel=\u0022deprecation\u0022) headers.\n# Content-Type: application/json", + "Code": "### Generate a Terra Widget session link\n# @name Authentication_GenerateWidgetSession\nPOST {{host}}/auth/generateWidgetSession\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, application/problem\u002Bjson\n\n{\n \u0022providers\u0022: \u0022GARMIN,FITBIT,OURA,WITHINGS,SUUNTO\u0022,\n \u0022language\u0022: \u0022en\u0022,\n \u0022reference_id\u0022: \u0022user123@email.com\u0022,\n \u0022auth_success_redirect_url\u0022: \u0022https://myapp.com/success\u0022,\n \u0022auth_failure_redirect_url\u0022: \u0022https://myapp.com/failure\u0022\n}\n\n## Responses\n# 200\n# Description: Returned when authentication link could be successfully generated\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing.\n# Content-Type: application/problem\u002Bjson\n# 410\n# Description: Returned for Terra accounts created after the widget relaunch (2026-09-03) \u2014 this endpoint is deprecated for them. Create widget sessions with POST https://access.tryterra.co/api/widget/session instead. The response carries Deprecation and Link (rel=\u0022deprecation\u0022) headers.\n# Content-Type: application/json\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Authentication_GenerateWidgetSession", "Setup": null @@ -72,7 +72,7 @@ "Slug": "body-get", "Description": "Returns body metrics such as weight, height and body-fat percentage.", "Language": "http", - "Code": "### Retrieve body metrics\n# @name Body_Get\nGET {{host}}/body?user_id={{user_id}}\u0026start_date={{start_date}}\u0026end_date={{end_date}}\u0026to_webhook={{to_webhook}}\u0026with_samples={{with_samples}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Returned upon successful data request\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson", + "Code": "### Retrieve body metrics\n# @name Body_Get\nGET {{host}}/body?user_id={{user_id}}\u0026start_date={{start_date}}\u0026end_date={{end_date}}\u0026to_webhook={{to_webhook}}\u0026with_samples={{with_samples}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Returned upon successful data request\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Body_Get", "Setup": null @@ -83,7 +83,7 @@ "Slug": "daily-get", "Description": "Returns daily summaries of activity metrics such as steps, distance and calories burned.", "Language": "http", - "Code": "### Retrieve daily summaries\n# @name Daily_Get\nGET {{host}}/daily?user_id={{user_id}}\u0026start_date={{start_date}}\u0026end_date={{end_date}}\u0026to_webhook={{to_webhook}}\u0026with_samples={{with_samples}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Returned upon successful data request\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson", + "Code": "### Retrieve daily summaries\n# @name Daily_Get\nGET {{host}}/daily?user_id={{user_id}}\u0026start_date={{start_date}}\u0026end_date={{end_date}}\u0026to_webhook={{to_webhook}}\u0026with_samples={{with_samples}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Returned upon successful data request\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Daily_Get", "Setup": null @@ -149,7 +149,7 @@ "Slug": "reports-upload", "Description": "Upload a single report file (PDF, PNG, JPEG, GIF, or WebP) as multipart form data. Both clinical lab reports and DXA body-composition/bone-density scans go to this endpoint \u2014 Terra identifies which it is from the file, so there is no parameter to declare the type; read \u0060report_type\u0060 off the session or the webhook. Returns an \u0060upload_id\u0060; a single upload may fan out to multiple sessions, so learn the \u0060session_id\u0060(s) from the webhook events or from \u0060GET /reports?upload_id=...\u0060.", "Language": "http", - "Code": "### Upload a report\n# @name Reports_Upload\nPOST {{host}}/reports?reference_id=patient_456\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json, application/problem\u002Bjson\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022file\u0022; filename=\u0022file.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./file.bin\n--AutoSDKBoundary--\n\n## Responses\n# 202\n# Description: Upload accepted for processing.\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The credential is not authorized for this operation.\n# Content-Type: application/json\n# 413\n# Description: The uploaded payload exceeds the size limit.\n# Content-Type: application/json", + "Code": "### Upload a report\n# @name Reports_Upload\nPOST {{host}}/reports?reference_id=patient_456\nAuthorization: Bearer {{token}}\nContent-Type: multipart/form-data; boundary=AutoSDKBoundary\nAccept: application/json, application/problem\u002Bjson\n\n--AutoSDKBoundary\nContent-Disposition: form-data; name=\u0022file\u0022; filename=\u0022file.bin\u0022\nContent-Type: application/octet-stream\n\n\u003C ./file.bin\n--AutoSDKBoundary--\n\n## Responses\n# 202\n# Description: Upload accepted for processing.\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing.\n# Content-Type: application/problem\u002Bjson\n# 413\n# Description: The uploaded payload exceeds the size limit.\n# Content-Type: application/json\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Reports_Upload", "Setup": null @@ -160,7 +160,7 @@ "Slug": "menstruation-get", "Description": "Returns menstruation data such as cycle length, period length and ovulation date.", "Language": "http", - "Code": "### Retrieve menstruation data\n# @name Menstruation_Get\nGET {{host}}/menstruation?user_id={{user_id}}\u0026start_date={{start_date}}\u0026end_date={{end_date}}\u0026to_webhook={{to_webhook}}\u0026with_samples={{with_samples}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Returned upon successful data request\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson", + "Code": "### Retrieve menstruation data\n# @name Menstruation_Get\nGET {{host}}/menstruation?user_id={{user_id}}\u0026start_date={{start_date}}\u0026end_date={{end_date}}\u0026to_webhook={{to_webhook}}\u0026with_samples={{with_samples}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Returned upon successful data request\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Menstruation_Get", "Setup": null @@ -171,7 +171,7 @@ "Slug": "nutrition-get", "Description": "Returns nutrition data such as meal type, calories and macronutrients.", "Language": "http", - "Code": "### Retrieve nutrition data\n# @name Nutrition_Get\nGET {{host}}/nutrition?user_id={{user_id}}\u0026start_date={{start_date}}\u0026end_date={{end_date}}\u0026to_webhook={{to_webhook}}\u0026with_samples={{with_samples}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Returned upon successful data request\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson", + "Code": "### Retrieve nutrition data\n# @name Nutrition_Get\nGET {{host}}/nutrition?user_id={{user_id}}\u0026start_date={{start_date}}\u0026end_date={{end_date}}\u0026to_webhook={{to_webhook}}\u0026with_samples={{with_samples}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Returned upon successful data request\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Nutrition_Get", "Setup": null @@ -182,7 +182,7 @@ "Slug": "sleep-get", "Description": "Returns sleep sessions, each with a defined start and end time, such as sleep duration, stages and quality.", "Language": "http", - "Code": "### Retrieve sleep sessions\n# @name Sleep_Get\nGET {{host}}/sleep?user_id={{user_id}}\u0026start_date={{start_date}}\u0026end_date={{end_date}}\u0026to_webhook={{to_webhook}}\u0026with_samples={{with_samples}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Returned upon successful data request\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson", + "Code": "### Retrieve sleep sessions\n# @name Sleep_Get\nGET {{host}}/sleep?user_id={{user_id}}\u0026start_date={{start_date}}\u0026end_date={{end_date}}\u0026to_webhook={{to_webhook}}\u0026with_samples={{with_samples}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Returned upon successful data request\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Sleep_Get", "Setup": null @@ -226,7 +226,7 @@ "Slug": "workouts-createworkout", "Description": "Stores a reusable workout template. Plan it onto a user\u0027s calendar with \u0060POST /workouts/{workout_id}/plan\u0060; the template itself carries no date and is not pushed to any provider until planned.", "Language": "http", - "Code": "### Create a workout template\n# @name Workouts_CreateWorkout\nPOST {{host}}/workouts\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, application/problem\u002Bjson\n\n{\n \u0022name\u0022: \u0022string\u0022,\n \u0022description\u0022: \u0022string\u0022,\n \u0022environment\u0022: \u0022indoor\u0022,\n \u0022pool_length_meters\u0022: 0,\n \u0022step_blocks\u0022: [\n {\n \u0022completion_condition\u0022: {},\n \u0022steps\u0022: []\n }\n ],\n \u0022estimated_duration_seconds\u0022: 0,\n \u0022estimated_distance_meters\u0022: 0,\n \u0022estimated_calories\u0022: 0,\n \u0022estimated_tss\u0022: 0,\n \u0022estimated_intensity_factor\u0022: 0,\n \u0022workout_id\u0022: \u0022string\u0022,\n \u0022sport\u0022: \u0022running\u0022\n}\n\n## Responses\n# 200\n# Description: Template stored\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson", + "Code": "### Create a workout template\n# @name Workouts_CreateWorkout\nPOST {{host}}/workouts\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, application/problem\u002Bjson\n\n{\n \u0022name\u0022: \u0022string\u0022,\n \u0022description\u0022: \u0022string\u0022,\n \u0022environment\u0022: \u0022indoor\u0022,\n \u0022pool_length_meters\u0022: 0,\n \u0022step_blocks\u0022: [\n {\n \u0022completion_condition\u0022: {},\n \u0022steps\u0022: []\n }\n ],\n \u0022estimated_duration_seconds\u0022: 0,\n \u0022estimated_distance_meters\u0022: 0,\n \u0022estimated_calories\u0022: 0,\n \u0022estimated_tss\u0022: 0,\n \u0022estimated_intensity_factor\u0022: 0,\n \u0022workout_id\u0022: \u0022string\u0022,\n \u0022sport\u0022: \u0022running\u0022\n}\n\n## Responses\n# 200\n# Description: Template stored\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing.\n# Content-Type: application/problem\u002Bjson\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Workouts_CreateWorkout", "Setup": null @@ -259,7 +259,7 @@ "Slug": "workouts-getplannedworkout", "Description": "Returns a planned workout created through Terra. Provider-created (external) workouts are not addressable by id \u2014 they are returned by the list endpoint with their full body under \u0060details\u0060.", "Language": "http", - "Code": "### Get a planned workout\n# @name Workouts_GetPlannedWorkout\nGET {{host}}/plannedWorkouts/{{planned_workout_id}}?user_id={{user_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: The planned workout\n# Content-Type: application/json\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson", + "Code": "### Get a planned workout\n# @name Workouts_GetPlannedWorkout\nGET {{host}}/plannedWorkouts/{{planned_workout_id}}?user_id={{user_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: The planned workout\n# Content-Type: application/json\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Workouts_GetPlannedWorkout", "Setup": null @@ -270,7 +270,7 @@ "Slug": "workouts-getworkout", "Description": "Generated from OpenAPI examples.", "Language": "http", - "Code": "### Get a workout template\n# @name Workouts_GetWorkout\nGET {{host}}/workouts/{{workout_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: The stored template\n# Content-Type: application/json\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson", + "Code": "### Get a workout template\n# @name Workouts_GetWorkout\nGET {{host}}/workouts/{{workout_id}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: The stored template\n# Content-Type: application/json\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Workouts_GetWorkout", "Setup": null @@ -281,7 +281,7 @@ "Slug": "workouts-listplannedworkouts", "Description": "Returns the user\u0027s planned workouts, including workouts created on the provider side (is_external true) where the provider exposes them. Every item carries its workout body under \u0060template\u0060, in the same shape for Terra-created and external workouts. External workouts are fetched live from the provider and are not stored by Terra; a workout pushed through Terra that the provider echoes back is listed once, as the Terra row. When the provider could not be read, or a template could not be loaded, the response is still 200 with the rows Terra has and carries the \u0060X-Terra-Provider-Data-Truncated: true\u0060 header. Note that providers may limit how far ahead planned workouts are visible.", "Language": "http", - "Code": "### List planned workouts\n# @name Workouts_ListPlannedWorkouts\nGET {{host}}/plannedWorkouts?user_id={{user_id}}\u0026start_date={{start_date}}\u0026end_date={{end_date}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Planned workouts for the connection\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson", + "Code": "### List planned workouts\n# @name Workouts_ListPlannedWorkouts\nGET {{host}}/plannedWorkouts?user_id={{user_id}}\u0026start_date={{start_date}}\u0026end_date={{end_date}}\nAuthorization: Bearer {{token}}\nAccept: application/json, application/problem\u002Bjson\n\n## Responses\n# 200\n# Description: Planned workouts for the connection\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Workouts_ListPlannedWorkouts", "Setup": null @@ -303,7 +303,7 @@ "Slug": "workouts-planworkout", "Description": "Schedules the workout template for a user on a given date and pushes it to the user\u0027s connected provider (or queues it for SDK delivery). Athlete metrics personalise zone-based targets for this plan only.", "Language": "http", - "Code": "### Plan a workout onto a user\u0027s calendar\n# @name Workouts_PlanWorkout\nPOST {{host}}/workouts/{{workout_id}}/plan?user_id={{user_id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, application/problem\u002Bjson\n\n{\n \u0022planned_date\u0022: \u00222025-01-01\u0022,\n \u0022ftp\u0022: 0,\n \u0022max_heart_rate\u0022: 0,\n \u0022threshold_heart_rate\u0022: 0,\n \u0022threshold_speed\u0022: 0,\n \u0022pool_length_meters\u0022: 0\n}\n\n## Responses\n# 201\n# Description: Planned workout created and pushed (or queued for SDK delivery)\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The Planned Workouts add-on is not enabled for this account.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson\n# 424\n# Description: The provider rejected the workout push; retry later.\n# Content-Type: application/problem\u002Bjson", + "Code": "### Plan a workout onto a user\u0027s calendar\n# @name Workouts_PlanWorkout\nPOST {{host}}/workouts/{{workout_id}}/plan?user_id={{user_id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, application/problem\u002Bjson\n\n{\n \u0022planned_date\u0022: \u00222025-01-01\u0022,\n \u0022ftp\u0022: 0,\n \u0022max_heart_rate\u0022: 0,\n \u0022threshold_heart_rate\u0022: 0,\n \u0022threshold_speed\u0022: 0,\n \u0022pool_length_meters\u0022: 0\n}\n\n## Responses\n# 201\n# Description: Planned workout created and pushed (or queued for SDK delivery)\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The Planned Workouts add-on is not enabled for this account.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson\n# 424\n# Description: The provider rejected the workout push; retry later.\n# Content-Type: application/problem\u002Bjson\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Workouts_PlanWorkout", "Setup": null @@ -314,7 +314,7 @@ "Slug": "workouts-updateplannedworkout", "Description": "Generated from OpenAPI examples.", "Language": "http", - "Code": "### Reschedule a planned workout\n# @name Workouts_UpdatePlannedWorkout\nPATCH {{host}}/plannedWorkouts/{{planned_workout_id}}?user_id={{user_id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, application/problem\u002Bjson\n\n{\n \u0022planned_date\u0022: \u00222025-01-01\u0022\n}\n\n## Responses\n# 200\n# Description: Updated planned workout\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The Planned Workouts add-on is not enabled for this account.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson", + "Code": "### Reschedule a planned workout\n# @name Workouts_UpdatePlannedWorkout\nPATCH {{host}}/plannedWorkouts/{{planned_workout_id}}?user_id={{user_id}}\nAuthorization: Bearer {{token}}\nContent-Type: application/json\nAccept: application/json, application/problem\u002Bjson\n\n{\n \u0022planned_date\u0022: \u00222025-01-01\u0022\n}\n\n## Responses\n# 200\n# Description: Updated planned workout\n# Content-Type: application/json\n# 400\n# Description: One or more parameters is malformed. The \u0060detail\u0060 field describes the specific problem.\n# Content-Type: application/problem\u002Bjson\n# 401\n# Description: Authentication credentials are missing or invalid.\n# Content-Type: application/problem\u002Bjson\n# 403\n# Description: The Planned Workouts add-on is not enabled for this account.\n# Content-Type: application/problem\u002Bjson\n# 404\n# Description: A referenced resource does not exist on Terra\u0027s end.\n# Content-Type: application/problem\u002Bjson\n# 503\n# Description: Current product authorization is unavailable; retry after the service recovers.\n# Content-Type: application/problem\u002Bjson", "Format": "http", "OperationId": "Workouts_UpdatePlannedWorkout", "Setup": null diff --git a/src/libs/Terra/openapi.yaml b/src/libs/Terra/openapi.yaml index 72cc0b6..fc85fa4 100644 --- a/src/libs/Terra/openapi.yaml +++ b/src/libs/Terra/openapi.yaml @@ -1,8 +1,12 @@ openapi: 3.0.3 info: - description: The Terra API (v2 surface, served at access.tryterra.co/api/v2). + description: 'The Terra API (v2 surface, served at access.tryterra.co/api/v2). Protected product operations require a current product entitlement in addition to valid credentials and token scopes. Missing + access returns HTTP 403 with code entitlement_required; disabled environments return environment_disabled. Unavailable current authorization returns HTTP 503 with code authorization_unavailable. Billing, + configuration and recovery remain available under their existing permissions. + + ' title: TerraAPI - version: 2026.09.09 + version: 2026.09.16 license: name: Apache-2.0 url: https://github.com/tryterra/openapi/blob/master/LICENSE @@ -78,8 +82,12 @@ paths: example: https://www.fitbit.com/oauth2/authorize?response_type=code&client_id=23BBG9&scope=settings+nutrition+sleep+heartrate+electrocardiogram+weight+respiratory_rate+oxygen_saturation+profile+temperature+cardio_fitness+activity+location&state=bLqqjPie9ptwoWm6VBxHCu6JkkoWJp '400': $ref: '#/components/responses/BadRequest' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /auth/generateWidgetSession: post: summary: Generate a Terra Widget session link @@ -122,6 +130,8 @@ paths: example: 900 '400': $ref: '#/components/responses/BadRequest' + '403': + $ref: '#/components/responses/Forbidden' '410': description: Returned for Terra accounts created after the widget relaunch (2026-09-03) — this endpoint is deprecated for them. Create widget sessions with POST https://access.tryterra.co/api/widget/session instead. The response carries Deprecation and Link (rel="deprecation") headers. @@ -129,6 +139,8 @@ paths: application/json: schema: $ref: '#/components/schemas/Problem' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /auth/deauthenticateUser: delete: summary: Deauthenticate a user @@ -199,8 +211,12 @@ paths: type: integer example: 180 default: 0 + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /auth/generateAuthToken: post: tags: @@ -241,8 +257,12 @@ paths: type: integer example: 180 default: 0 + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' deprecated: true /activity: get: @@ -315,8 +335,12 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /athlete: get: summary: Retrieve athlete profile @@ -352,8 +376,12 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /body: get: summary: Retrieve body metrics @@ -425,8 +453,12 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /daily: get: summary: Retrieve daily summaries @@ -498,8 +530,12 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /menstruation: get: summary: Retrieve menstruation data @@ -571,8 +607,12 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /nutrition: get: summary: Retrieve nutrition data @@ -644,8 +684,12 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /sleep: get: summary: Retrieve sleep sessions @@ -717,8 +761,12 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /workouts: post: tags: @@ -754,6 +802,10 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' get: tags: - Workouts @@ -771,6 +823,10 @@ paths: $ref: '#/components/schemas/WorkoutTemplate' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /workouts/{workout_id}: get: tags: @@ -793,8 +849,12 @@ paths: $ref: '#/components/schemas/WorkoutTemplate' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' delete: tags: - Workouts @@ -930,6 +990,8 @@ paths: application/problem+json: schema: $ref: '#/components/schemas/Problem' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /plannedWorkouts: get: tags: @@ -997,8 +1059,12 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /plannedWorkouts/{planned_workout_id}: get: tags: @@ -1029,8 +1095,12 @@ paths: $ref: '#/components/schemas/PlannedWorkoutSummary' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' patch: tags: - Workouts @@ -1080,6 +1150,8 @@ paths: $ref: '#/components/schemas/Problem' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' delete: tags: - Workouts @@ -1354,6 +1426,8 @@ paths: $ref: '#/components/responses/Forbidden' '413': $ref: '#/components/responses/PayloadTooLarge' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' get: summary: List report sessions description: List report sessions for your account — both lab reports and scans — with optional reference, upload, and inclusive date-range filters. Use the date filters to narrow large result sets, @@ -1423,6 +1497,10 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /reports/{session_id}: get: summary: Retrieve a lab report session @@ -1450,8 +1528,12 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' delete: summary: Delete a lab report session description: Soft-delete a session. It is marked deleted immediately; associated storage is cleaned up by a background process. @@ -1501,8 +1583,12 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /reports/{session_id}/files: get: summary: List input files @@ -1529,8 +1615,12 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /lab-reports: post: deprecated: true @@ -1577,6 +1667,8 @@ paths: $ref: '#/components/responses/Forbidden' '413': $ref: '#/components/responses/PayloadTooLarge' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' get: deprecated: true summary: List report sessions @@ -1647,6 +1739,10 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /lab-reports/{session_id}: get: deprecated: true @@ -1675,8 +1771,12 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' delete: deprecated: true summary: Delete a lab report session @@ -1728,8 +1828,12 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' /lab-reports/{session_id}/files: get: deprecated: true @@ -1757,8 +1861,12 @@ paths: $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/Forbidden' '404': $ref: '#/components/responses/NotFound' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' webhooks: auth: post: @@ -1802,6 +1910,10 @@ webhooks: responses: '200': description: Successful authentication response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' deauth: post: description: Fires when a user disconnects a previously connected provider account. Carries the affected `user`, identified by `user_id`. Remove that user and their stored data from your system according @@ -1829,6 +1941,10 @@ webhooks: responses: '200': description: Successful deauthentication response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' user_reauth: post: description: Fires when a user re-authenticates a provider already connected under the same `reference_id`, which replaces the old connection with a new `user_id`. The payload carries both `old_user`, @@ -1865,6 +1981,10 @@ webhooks: responses: '200': description: Successful reauthentication response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' access_revoked: post: description: Fires when a user revokes Terra's access from the provider's side, for example in their wearable app's settings. Carries the affected `user`. Remove the user and their stored data according @@ -1892,6 +2012,10 @@ webhooks: responses: '200': description: Successful access revocation response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' permission_change: post: description: 'Fires when the set of scopes a user has granted changes on the provider side. Carries the `user` with its current `scopes`, along with `scopes_added` and `scopes_removed`. Treat it as @@ -1922,6 +2046,10 @@ webhooks: responses: '200': description: Successful permission change response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' connection_error: post: description: Fires when a request to a provider returns HTTP 401, 403 or 412, meaning the stored credentials are no longer valid. Carries the affected `user`. Unlike `access_revoked`, Terra cannot @@ -1949,6 +2077,10 @@ webhooks: responses: '200': description: Successful connection error response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' large_request_sending: post: description: Fires just before Terra begins delivering the data for a large historical request of more than one month. Carries `expected_payloads`, the number of chunked data events that will follow, @@ -1977,6 +2109,10 @@ webhooks: responses: '200': description: Successful large request sending response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' large_request_processing: post: description: Fires when you request more than one month of a user's data, acknowledging that Terra has begun assembling it. The data follows as a series of data events that share one `terra_reference`, @@ -2005,6 +2141,10 @@ webhooks: responses: '200': description: Successful large request processing response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' s3_upload: post: description: Fires in place of a normal data event when a payload is too large to deliver inline, for destinations configured in ping mode. Carries a `type` of `s3_payload` and a pre-signed, time-limited @@ -2026,6 +2166,10 @@ webhooks: responses: '200': description: Successful S3 upload response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' activity: post: description: Fires when a new completed activity is available, such as a tracked run or ride with a defined start and end. Carries a `data` array of activity sessions for the `user`. Deliveries are @@ -2071,6 +2215,10 @@ webhooks: responses: '200': description: Successful activity response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' athlete: post: description: Fires when a user's athlete profile becomes available or changes, such as name, birth date or gender. Carries the `user` and their profile `data`. Store it against the user; unlike the @@ -2105,6 +2253,10 @@ webhooks: responses: '200': description: Successful athlete response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' nutrition: post: description: Fires when new nutrition data is available, such as logged meals, calories and macronutrients. Carries a `data` array for the `user`. Deliveries are at-least-once, so overwrite keyed @@ -2142,6 +2294,10 @@ webhooks: responses: '200': description: Successful nutrition response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' daily: post: description: Fires as a user's daily totals accrue, carrying the running summary up to the moment of the event, such as steps, calories and distance. Each payload is a cumulative superset for the @@ -2181,6 +2337,10 @@ webhooks: responses: '200': description: Successful daily response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' sleep: post: description: Fires when a new sleep session is available, with a defined start and end. Carries a `data` array of sleep sessions for the `user`. Deliveries are at-least-once, so overwrite keyed on @@ -2221,6 +2381,10 @@ webhooks: responses: '200': description: Successful sleep response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' menstruation: post: description: Fires when new menstruation data is available for a day, such as cycle phase and flow. Each payload is relevant to the 24-hour window identified by `metadata.start_time`, so overwrite @@ -2257,6 +2421,10 @@ webhooks: responses: '200': description: Successful menstruation response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' body: post: description: Fires when new body-metric data is available for a day, such as weight, heart rate or blood-oxygen samples. Each payload is a cumulative superset for the 24-hour window identified by @@ -2298,6 +2466,10 @@ webhooks: responses: '200': description: Successful body response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' lab_report: post: description: 'lab_report data event: sent when a report finishes processing. The same event carries both clinical lab reports and DXA body-composition/bone-density scans - branch on data.report_type, @@ -2436,6 +2608,10 @@ webhooks: responses: '200': description: Successful lab_report response + '403': + $ref: '#/components/responses/Forbidden' + '503': + $ref: '#/components/responses/AuthorizationUnavailable' components: securitySchemes: ApiKeyAuth: @@ -2483,9 +2659,15 @@ components: instance: /activity detail: user not found Forbidden: - description: The credential is not authorized for this operation. + description: The credential is not authorized, the environment is disabled, or the required product entitlement is missing. content: - application/json: + application/problem+json: + schema: + $ref: '#/components/schemas/Problem' + AuthorizationUnavailable: + description: Current product authorization is unavailable; retry after the service recovers. + content: + application/problem+json: schema: $ref: '#/components/schemas/Problem' PayloadTooLarge: @@ -2688,6 +2870,12 @@ components: type: string description: The request path, including any query string, that produced this problem. example: /api/v2/activity?user_id=d4aba475-f714-4663-88fe-28f18b8599b0&to_webhook=false + code: + type: string + description: Stable error classification. Product gates return entitlement_required (403), environment_disabled (403), or authorization_unavailable (503). + product: + type: string + description: The product checked by the authorization gate, when classified. detail: type: string description: A human-readable explanation specific to this occurrence of the problem.