openapi: 3.2.0 info: title: Reposit Power Market Network API description: 'Documentation for the Reposit Power Market API. Used by fleet.repositpower.com and related services. Please review our [versioning and support policy](https://gist.github.com/mleonard87/d5ed0a82760ceb75adc7df0d62bf9c31) before using the API. ' contact: url: https://www.repositpower.com/ email: api@repositpower.com version: 1.0.0 servers: - url: https://marketapi.repositpower.com/ tags: - name: Network description: Indicates this API end-point is available to network organisations. paths: /api/data: get: tags: - Network summary: Fleet Data - Downsampled description: Return stored metrics for the entire fleet by downsampling. parameters: - name: metrics in: query description: 'This returns downsampled data of metrics for this powerstation. Timestamps in the response refer to the start of the period. The metrics to retreive as a comma separated list of any combination of the following: - meterVoltage - The average voltage (V) across all phases as measured at the meter/grid - meterFrequence - The average frequency (Hz) across all phases as measured at the meter/grid - meterPower - The total (sum) real power (kW) across all phases as measured at the meter/grid - meterReactivePower - The total (sum) reactive power (var) across all phases as measure at the meter/grid - solarPower - The total (sum) real power (kW) across all solar phases being generated by the PV array - solarReactivePower - The total (sum) reactive power (var) across all solar phases being generated by the PV array - remainingCharge - The total (sum) remaining charge (W) of the all batteries attached to this system - batteryPower - The total (sum) real power (kW) measured at the battery of all batteries attached to this system - inverterReactivePower - The total (sum) reactive power (var) measured at the inverter - inverterApparentPower - The total (sum) apparent power (kW) measured at the inverter - meterCurrent - The total (sum) current (Amp) measured at the meter/grid All real power measurements follow a sink convention, while all reactive power measurements follow a source convention. Apparent power is always positive. Phase suffixes may be used on the following metrics: meterVoltage, meterFrequency, meterPower, meterReactivePower, solarPower, solarReactivePower. Please note that phases are currently arbitrary - we cannot determine which phase is red/white/blue. For all single phase installations the data will be available on phase a. ' required: true schema: type: string - name: start in: query description: The start timestamp of the period of data you wish to retreive schema: type: integer - name: end in: query description: The end timestamp of the period of data you wish to retreive schema: type: integer - name: interval in: query description: The downsampling interval in seconds schema: type: integer - name: fill in: query description: The fill policy to use for empty values. By default any empty values for a deployment (i.e. a missing chuck of data) are ommitted. Specify `fill=null` to return all times with null values if the data is missing. Only `null` is supported. schema: type: string enum: - null responses: 200: description: OK content: application/json: schema: type: object data: example: - meterPower: d4c58e243e694bba9e57cbdf42970faf: 1505109600: 0.3857383972607584 1505111400: 0.3806250010513597 e720e221204149ec9fa172583bcf4258: 1505109600: 0.3849693243306107 1505111400: 0.3580208346247673 - meterVoltage: d4c58e243e694bba9e57cbdf42970faf: 1505109600: 244.38573839726075 1505111400: 244.38062500105136 e720e221204149ec9fa172583bcf4258: 1505109600: 245.3849693243306 1505111400: 245.35802083462477 status: example: OK 401: description: Invalid access token. If the error code in the returned JSON is `expired_token`, it means you need to request a new access token through the `/auth/login/` route using your username and password. content: application/json: schema: type: object example: error: expired_token message: The token you provided has expired. status: error security: - AccessToken: [] /api/capabilities: post: tags: - Network summary: Assign customers to a capability description: Takes a list of customers and assigns them to a capability. Returns a list of changes that have been applied and/or a list or errors. requestBody: description: A list of customers each with a set of capabilities and/or tariff to assign to. content: application/json: schema: type: object properties: data: type: array items: type: object properties: customers: type: array items: type: object properties: nmi: type: string description: National Metering Identifier for the customer. tariff: type: object properties: code: type: string description: The plan code of the tariff. startDate: type: string description: The effective date of the tariff. discount: type: integer description: The discount amount for this particular tariff. description: Optional. Specify a change of tariff for a customer. capabilities: type: array items: type: object properties: name: type: string description: Name of the Capability startDate: type: string description: The effective date of the capability example: - customers: - nmi: '11000000001' capabilities: - name: Hoodwink Network Support startDate: 2018-01-01 tariff: - code: HOODWINK_PLAN startDate: 2018-01-01 discount: 0.0 - nmi: '10000000001' capabilities: - name: Jensen Network Support startDate: 2017-01-01 required: false responses: 200: description: OK content: application/json: schema: type: object example: data: - errors: - message: Effective start date must be on or after the starting date of the capability - 2018-01-01 errorCode: invalid_capability customers: - '12345123451' - '110000012' - '1000000001' - message: Customer already assigned to another retailer customers: - '12345123451' - message: Must have a capability code customers: - '12345123451' - warnings: - message: Customer is not yet commissioned errorCode: not_commissioned_customer customers: - '1100000006' success: - '1100000001' - '1100000002' - '1100000003' - '1100000004' - '1100000005' - '1100000006' 401: description: Invalid access token. If the error code in the returned JSON is `expired_token`, it means you need to request a new access token through the `/auth/login/` route using your username and password. content: application/json: schema: type: object example: error: expired_token message: The token you provided has expired. status: error security: - AccessToken: [] x-codegen-request-body-name: data components: securitySchemes: AccessToken: type: apiKey description: 'To authenticate you need to generate an API Key using Reposit Fleet. API Keys can be limited to whitelisted origin IP addresses for security and do not expire making them more suitable to server-to-server comms. API keys may also be revoked via Reposit Fleet. ### Creating an API Key API keys for the Reposit Market API can be generated by first logging in to [Reposit Fleet](https://fleet.repositpower.com). Once you have logged in click your username at the top right and then select "[User Settings](https://fleet.repositpower.com/user/settings)" Within the section labelled "API Keys" click the "Add API Key" button. Within the dialog that appears you will be able to name the key you are generating and specify a whitelist of IP addresses that this token is valid for. You will also need to confirm your password. When you have configured your keys settings click "Add" and your newly created key will be displayed - the key itself is not stored by Reposit and therefore this is your only opportunity to save the key securely. **Note**: The generated key authenticates as the account that you are currently logged in to Reposit Fleet for and as such will carry the same permissions. If you require a locked down account it is recommend that you create a new account for Reposit Fleet and generate the API Key for this account. ### Using an API Key Simply add `Bearer ` followed by the API key in the `Authorization` header of any request to Market API. e.g.: `Authorization: Bearer A2YWQiLCJpc3...` ### Revoking an API Key If an API Key becomes lost or is no longer required then the API Key can be revoked. Login to Reposit Fleet as the user for which you wish to revoke the API Key and proceed to [User Settings](https://fleet.repositpower.com/user/settings). From within the "API Keys" you will be able to see a table of all issued API Keys, find the API Key you wish to revoke and select the "Remove" link in the table. Once an API Key is removed it will cease to work immediately and can not be recovered or reinstated. ' name: Bearer in: header