openapi: 3.2.0 info: title: Reposit Power Market Curtailment 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: Curtailment description: API end-points related to export curtailments. paths: /api/constraints/curtailments: get: tags: - Curtailment summary: Get curtailment constraints description: Return the constraints of a Virtual Power Plant given a set of query parameters. The parameters correspond to fields to specify when creating a curtailment. This route should be used before executing a curtailment in order to determine the capabilities of that particular Virtual Power Plant. parameters: - name: powerstation in: query description: The ID of the power station being curtailed. schema: type: string - name: duration in: query description: The duration of the curtailment in seconds. schema: type: number responses: 200: description: OK content: application/json: schema: type: object example: data: realPowerP: 55 security: - AccessToken: [] /api/curtailments: get: tags: - Curtailment summary: All Curtailments description: Returns a list of export curtailments. parameters: - name: filter in: query description: A filter to apply to the returned export curtailments. One of UPCOMING, COMPLETED, INPROGRESS, CANCELLED. Leave empty to view all. schema: type: string enum: - UPCOMING - COMPLETED - INPROGRESS - name: offset in: query description: An integer to offset the results by - to use for paging through the total results. schema: type: number default: 0.0 - name: limit in: query description: An integer to limit the results by - to use for paging through the total results. schema: type: number default: 100.0 responses: 200: description: OK content: application/json: schema: type: object example: data: - component: solar id: 8380ecf0-e8b9-42c7-8bb5-2e75d13bf484 powerstation: 05bf160741c343ce869d0e9ec7b2ad88 request: duration: 1800 realPowerP: -1.4 startTime: 1503026870 state: COMPLETED - component: solar id: b2588e2c-5675-48aa-a835-9c887b52b16a request: duration: 600 realPowerP: -1.4 startTime: 1503452085 state: COMPLETED 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: [] post: tags: - Curtailment summary: Create Curtailment description: Create an export curtailment request. requestBody: description: The curtailment to create. content: application/json: schema: required: - duration - powerstation - realPowerP - startTime type: object properties: component: type: string description: The component that is being curtailed. enum: - grid - solar powerstation: type: string description: The ID of the power station being curtailed. realPowerP: type: number description: The real power limit to which the aggregated components are being curtailed (kW). This value must always be negative. startTime: type: number description: A unix timestamp of the start time of the curtailment. duration: type: number description: The duration of the curtailment in seconds. example: component: grid powerstation: cd0412cbc2e444d7a170520ba284091a realPowerP: -1 startTime: 1504549112 duration: 21600 required: false responses: 200: description: OK content: application/json: schema: type: object example: component: grid powerstation: cd0412cbc2e444d7a170520ba284091a realPowerP: -1 startTime: 1504549112 duration: 1505549112 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: curtailment /api/curtailments/{curtailmentId}: get: tags: - Curtailment summary: Get Single Curtailment description: Returns detailed data about the export curtailment with the supplied curtailment ID. parameters: - name: curtailmentId in: path description: The ID of the export curtailment. required: true schema: type: string responses: 200: description: OK content: application/json: schema: type: object example: data: component: grid createdAt: 1504140351 currentResponse: deploymentsAccepted: 1 id: aa2df12e-d628-45d6-8a90-2d9b6d6137aa powerstation: 05bf160741c343ce869d0e9ec7b2ad88 request: deploymentsRequested: 1 duration: 21600 realPowerP: -1 startTime: 1504549112 nodes: - d4c58e243e694bba9e57cbdf42970faf - e720e221204149ec9fa172583bcf4258 state: UPCOMING 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/curtailments/{curtailmentId}/cancel: post: tags: - Curtailment summary: Cancel Curtailment description: Cancels a scheduled curtailment parameters: - name: curtailmentId in: path description: The ID of the export curtailment. required: true schema: type: string responses: 200: description: OK content: application/json: schema: type: object example: data: status: 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/curtailments/setpoint: get: tags: - Curtailment summary: Get Curtailment Setpoint description: Get the current setpoint for default curtailment behaviour. parameters: - name: powerstationId in: query description: The ID of the powerstation to query. required: true schema: type: string responses: 200: description: OK content: application/json: schema: type: object example: data: powerstation: eb014defdded417e8b6a9d7ed078cedf meterRealPowerP: 0.0 inverterRealPowerP: -24.0 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 404: description: A curtailment setpoint for the requested powerstation cannot be found. Either the powerstation has not been created or it is has not yet received a valid setpoint. content: application/json: schema: type: object example: message: No setpoint for powerstation '6442adf69e004405808542b687bcf494' found. status: NOT FOUND security: - AccessToken: [] post: tags: - Curtailment summary: Change Curtailment Setpoint description: Change the setpoint for default curtailment behaviour. requestBody: description: The updated curtailment setpoint. content: application/json: schema: required: - inverterRealPowerP - meterRealPowerP - powerstation type: object properties: powerstation: type: string description: The ID of the power station being updated. meterRealPowerP: type: number description: The real power limit to which the aggregated grid output is being curtailed by default (kW). A null entry removes any constraint from the component. Other values must always be negative. inverterRealPowerP: type: number description: The real power limit to which the aggregated inverter output is being curtailed by default (kW). A null entry removes any constraint from the component. Other values must always be negative. example: powerstation: cd0412cbc2e444d7a170520ba284091a meterRealPowerP: 0 inverterRealPowerP: -1.3 required: false responses: 200: description: OK content: application/json: schema: type: object example: data: status: 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: [] x-codegen-request-body-name: setpoint /api/curtailments/heartbeat: post: tags: - Curtailment summary: Curtailment Heartbeat description: Send a curtailment heartbeat to a powerstation. Nodes receiving a heartbeat will return to their default curtailment behaviour if the heartbeat is lost. requestBody: description: The updated curtailment setpoint. content: application/json: schema: required: - powerstation type: object properties: powerstation: type: string description: The ID of the power station being heartbeated. example: powerstation: cd0412cbc2e444d7a170520ba284091a required: false responses: 200: description: OK content: application/json: schema: type: object example: data: status: 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: [] x-codegen-request-body-name: setpoint 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