Ostrom Contracts API

Describe how to fetch information related with contracts

Operations 5

GET /contracts Retrieve user contracts information #
GET /contracts/{contractId}/energy-consumption Retrieve user contract smart meter consumption #
GET /users/{externalUserId}/contracts Retrieve user contracts information by external user id #
GET /users/{externalUserId}/contracts/{contractId} Retrieve user contract information by external user id #
GET /users/{externalUserId}/contracts/{contractId}/energy-consumption Retrieve user contract smart meter consumption by external user id #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/ostrom-contracts-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

ostrom-contracts-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ostrom Auth Contracts API
  version: '2023-11-01'
  description: 'The Ostrom API is designed to allow our customer and partners to develop apps that integrates with our smart energy management platform. The API has a RESTful architecture and utilizes OAuth2 authorization.

    '
  license:
    name: Ostrom Commercial License
    url: https://ostrom.de
servers:
- url: https://sandbox.ostrom-api.io
  description: Sandbox environment (test data)
- url: https://production.ostrom-api.io
  description: Production environment (live data)
- url: https://auth.sandbox.ostrom-api.io
  description: Authentication sandbox environment (generate access token - test data)
- url: https://auth.production.ostrom-api.io
  description: Authentication production environment (generate access token - live data)
tags:
- name: Contracts
  description: Describe how to fetch information related with contracts
paths:
  /contracts:
    get:
      operationId: getContracts
      tags:
      - Contracts
      summary: Retrieve user contracts information
      description: 'Allowed role: `USER`'
      security:
      - ClientAccessToken: []
      responses:
        '200':
          description: Successful user contract data fetch
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetContractsResponse'
        '400':
          description: The request is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError400'
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError401'
        '404':
          description: Entity with the provided id was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError404'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestError429'
  /contracts/{contractId}/energy-consumption:
    get:
      operationId: getContractEnergyConsumption
      tags:
      - Contracts
      summary: Retrieve user contract smart meter consumption
      description: 'Allowed role: `USER`'
      parameters:
      - in: path
        name: contractId
        schema:
          type: number
        required: true
        description: ID of the contract
      - in: query
        name: startDate
        schema:
          type: string
          format: date-time
        required: true
        description: start date ISO format on UTC timezone. e.g. 2023-11-01T00:00:00.000Z
      - in: query
        name: endDate
        schema:
          type: string
          format: date-time
        required: true
        description: end date ISO format on UTC timezone. e.g. 2023-11-02T00:00:00.000Z
      - in: query
        name: resolution
        schema:
          type: string
          enum:
          - HOUR
          - DAY
          - MONTH
        required: true
        description: The unit of time the data will be aggregated
      security:
      - ClientAccessToken: []
      responses:
        '200':
          description: Successful user contract energy consumption data fetch
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetContractsEnergyConsumptionResponse'
        '400':
          description: The request is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError400'
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError401'
        '404':
          description: Entity with the provided id was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError404'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestError429'
  /users/{externalUserId}/contracts:
    get:
      operationId: getContractsByExternalUserId
      tags:
      - Contracts
      summary: Retrieve user contracts information by external user id
      description: 'Allowed role: `PARTNER`'
      parameters:
      - in: path
        name: externalUserId
        schema:
          type: string
        required: true
        description: Partner user unique identifier
      security:
      - ClientAccessToken: []
      responses:
        '200':
          description: Successful user contract data fetch
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetContractsResponse'
        '400':
          description: The request is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError400'
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError401'
        '404':
          description: Entity with the provided id was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError404'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestError429'
  /users/{externalUserId}/contracts/{contractId}:
    get:
      operationId: getContractByExternalUserId
      tags:
      - Contracts
      summary: Retrieve user contract information by external user id
      description: 'Allowed role: `PARTNER`'
      parameters:
      - in: path
        name: externalUserId
        schema:
          type: string
        required: true
        description: Partner user unique identifier
      - in: path
        name: contractId
        schema:
          type: number
        required: true
        description: ID of the contract
      security:
      - ClientAccessToken: []
      responses:
        '200':
          description: Successful user contract data fetch
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetContractsItemResponse'
        '400':
          description: The request is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError400'
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError401'
        '404':
          description: Entity with the provided id was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError404'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestError429'
  /users/{externalUserId}/contracts/{contractId}/energy-consumption:
    get:
      operationId: getContractEnergyConsumptionByExternalUserId
      tags:
      - Contracts
      summary: Retrieve user contract smart meter consumption by external user id
      description: 'Allowed role: `PARTNER`'
      parameters:
      - in: path
        name: externalUserId
        schema:
          type: string
        required: true
        description: Partner user unique identifier
      - in: path
        name: contractId
        schema:
          type: number
        required: true
        description: ID of the contract
      - in: query
        name: startDate
        schema:
          type: string
          format: date-time
        required: true
        description: start date ISO format on UTC timezone. e.g. 2023-11-01T00:00:00.000Z
      - in: query
        name: endDate
        schema:
          type: string
          format: date-time
        required: true
        description: end date ISO format on UTC timezone. e.g. 2023-11-02T00:00:00.000Z
      - in: query
        name: resolution
        schema:
          type: string
          enum:
          - HOUR
          - DAY
          - MONTH
        required: true
        description: The unit of time the data will be aggregated
      security:
      - ClientAccessToken: []
      responses:
        '200':
          description: Successful user contract energy consumption data fetch
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetContractsEnergyConsumptionResponse'
        '400':
          description: The request is invalid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError400'
        '401':
          description: Unauthorized access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError401'
        '404':
          description: Entity with the provided id was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError404'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestError429'
components:
  schemas:
    BadRequestError400:
      type: object
      properties:
        type:
          type: string
          description: The type of the error
        detail:
          type: string
          description: A human-readable message providing more details about the error
      example:
        type: bad_request
        detail: invalid fields array...
    GetContractsAddressResponse:
      type: object
      description: The address of the contract
      properties:
        zip:
          type: string
          description: The zip code of the address
        city:
          type: string
          description: The city of the address
        street:
          type: string
          description: The street of the address
        houseNumber:
          type: string
          description: The house number of the address
    UnauthorizedError401:
      type: object
      properties:
        type:
          type: string
          description: The type of the error
        detail:
          type: string
          description: A human-readable message providing more details about the error
      example:
        type: unauthorized
        detail: Unauthorized API access.
    GetContractsResponse:
      type: object
      properties:
        data:
          type: array
          description: Contact data
          items:
            $ref: '#/components/schemas/GetContractsItemResponse'
    TooManyRequestError429:
      type: object
      properties:
        type:
          type: string
          description: The type of the error
        detail:
          type: string
          description: A human-readable message providing more details about the error
      example:
        type: too_many_requests
        detail: API request limit per minute has been reached. Please try again later.
    GetContractsEnergyConsumptionResponse:
      type: object
      properties:
        data:
          type: array
          description: The energy consumption data
          items:
            $ref: '#/components/schemas/GetContractsEnergyConsumptionItemResponse'
    GetContractsEnergyConsumptionItemResponse:
      type: object
      properties:
        date:
          type: string
          description: The date of the energy consumption data (start from)
          example: '2023-10-22T01:00:00.000Z'
        kWh:
          type: number
          description: The energy consumption in kWh
          example: 0.48
    GetContractsItemResponse:
      type: object
      properties:
        id:
          type: number
          description: The id of the contract
        type:
          type: string
          description: type of the contract
        productCode:
          type: string
          description: Product code of the contract
        status:
          type: string
          description: Status of the contract
        customerFirstName:
          type: string
          description: Customer first name
        customerLastName:
          type: string
          description: Customer last name
        startDate:
          type: string
          description: Start date of the contract in ISO format
        currentMonthlyDepositAmount:
          type: string
          description: Current monthly deposit amount in EUR of the contract
        address:
          $ref: '#/components/schemas/GetContractsAddressResponse'
      example:
        id: '100523456'
        type: ELECTRICITY
        productCode: SIMPLY_DYNAMIC
        status: ACTIVE
        customerFirstName: Max
        customerLastName: Mustermann
        startDate: '2024-03-22'
        currentMonthlyDepositAmount: 120
        address:
          zip: '22083'
          city: Hamburg
          street: Mozartstr.
          houseNumber: '35'
    BadRequestError404:
      type: object
      properties:
        type:
          type: string
          description: The type of the error
        detail:
          type: string
          description: A human-readable message providing more details about the error
      example:
        type: not_found
        detail: information about not found object...
  securitySchemes:
    ClientAccessToken:
      type: oauth2
      description: 'A `ClientAccessToken` is obtained via the [OAuth 2.0 Client Credentials grant](https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/) and carries authorization to access all functionalities and data in your Ostrom account. Full details at [The ClientAccessToken](/api/reference#getting-an-access-token)

        '
      flows:
        clientCredentials:
          tokenUrl: https://auth.sandbox.ostrom-api.io/oauth2/token
          scopes: {}
    OAuth2BasicAuth:
      type: http
      scheme: basic