Getting Started with the HTTP API
The PowerTSM HTTP API accepts and returns JSON. All interactions follow standard HTTP conventions. This page covers the basics needed to make a first successful request.
Prerequisites
Section titled “Prerequisites”- A running instance of the PowerTSM HTTP API (see Installing the HTTP API)
- An HTTP client (e.g.,
curl, Postman, or any HTTP library)
Request Format
Section titled “Request Format”All requests must include an Accept: application/json header. Requests that include a body (POST, PUT) must also set Content-Type: application/json.
The service includes additional formatting information in the Content-Type response header as media type parameters:
Content-Type: application/json; api-version=4.12.0; timeZone=utc; charset=utf-8; timeFormat=iso8601; casing=camelThese parameters can be set in the Accept header to control how the response is formatted. For example, to receive PascalCase property names:
Accept: application/json; casing=pascalAPI Versioning
Section titled “API Versioning”The API supports multiple versions for backward compatibility. The version is specified as a media type parameter in the Accept header:
Accept: application/json; api-version=4.12.0When no api-version is specified, the latest available version is used.
Authentication
Section titled “Authentication”Authentication is handled via identity providers configured at the server level. The API supports OpenID Connect-compatible identity providers such as Azure Entra ID or KeyCloak.
To verify authentication, send a request to the identity endpoint:
GET /security/authentication/identityA 200 response confirms that the bearer token was accepted and the identity was resolved.
To discover the configured identity providers:
GET /security/authentication/identityProvidersTo sign in through a specific provider, send GET /security/authentication/identityProviders/{identityProvider}/signin, where {identityProvider} is one of the providers returned by the previous request.
Verifying the Service
Section titled “Verifying the Service”To confirm the service is reachable and find available OpenAPI specification versions:
GET /documentation/openapi/specificationsAPI specifications response
Section titled “ API specifications response”{ "default": "https://localhost:5001/documentation/openapi/specifications/tsm.http.api-4.12.0.json", "4.12.0": "https://localhost:5001/documentation/openapi/specifications/tsm.http.api-4.12.0.json"}Loading a Repository
Section titled “Loading a Repository”All time series operations are scoped to a repository. To list available repositories:
GET /repositoriesTo load a specific repository:
GET /repositories/{repository}Replace {repository} with the name of the configured repository, for example TSM_SQLSERVER.
Error Responses
Section titled “Error Responses”When a request fails, the API returns a ProblemDetails response with Content-Type: application/problem+json.
{#### <Icon name="ExampleIcon" /> Error response body
"type": "...", "title": "A short description of the error category", "status": 400, "detail": "A detailed explanation of what went wrong", "instance": "..."}4XXresponses indicate a client error (invalid input, not found, unauthorized, etc.)5XXresponses indicate a server-side error