Enphase Energy Events API

Events API

Operations 10

GET /api/v1/events/{event_id} Retrieve details of a specific event #
PUT /api/v1/events/{event_id} Update an existing Event in a program #
DELETE /api/v1/events/{event_id} Cancel or End Event #
PUT /api/v1/events/optout/{event_id} Optout-Optin site from the event #
GET /api/v2/events Retrieve all events in a program #
POST /api/v2/events Create a new Event in a program #
GET /api/v1/events Retrieve all events in a program #
POST /api/v1/events Create a new Event in a program #
GET /api/v2/events/{event_id} Retrieve details of a specific event #
DELETE /api/v2/events/{event_id} Cancel or End Event #

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/enphase-events-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 email required.

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

OpenAPI Specification

enphase-events-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Reference Events API
  description: Integrate the VPP API into your application
  version: 1.1.0
servers:
- url: https://vpp.enphaseenergy.com
tags:
- name: Events
  description: Events API
paths:
  /api/v1/events/{event_id}:
    get:
      tags:
      - Events
      summary: Retrieve details of a specific event
      description: Returns event details based on the inputted event_id. The API will return event status, command delivery status along with all the parameters specified as inputs during event creation
      operationId: getEventDetails
      parameters:
      - name: event_id
        in: path
        description: Unique Id of the event
        required: true
        schema:
          type: string
      - name: x-api-key
        in: header
        description: Unique API Key of your account
        required: true
        schema:
          type: string
        example: your-api-key-here
      - name: Authorization
        in: header
        description: access_token generated from auth API must be passed as Authorization header
        required: true
        schema:
          type: string
        example: Bearer your-access-token
      responses:
        '200':
          description: Event details retrieved successfully
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/GsApiVppEventResponse'
              examples:
                EventDetailExample:
                  summary: Sample event detail response
                  description: EventDetailExample
                  value:
                    event_id: f75b0ada-ee9b-4cdb-b0f1-b915267d203c
                    name: Event 202203241315
                    program_id: test
                    events:
                    - site_id: '698934045'
                      event_status: completed
                      start_time: '2022-03-24T13:15:00.000+00:00'
                      end_time: '2022-03-24T13:30:00.000+00:00'
                      created_at: '2022-03-24T11:15:00.000+00:00'
                      completed_at: '2022-03-24T13:30:00.000+00:00'
                      function: BATTERY
                      mode: Discharge_To_Load_Grid
                      target_soc: 10
                      rate_watt: 1200
                      command_delivery_status: Delivered
                      superseded: false
        '400':
          description: Bad Request
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Type Mismatch\",\n  \"additionalInfo\": \"Cannot cast the parameter to required type xxxx\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Missing Parameter\",\n  \"additionalInfo\": \"Required xxx parameter abc is not present\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-2:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Constraint Violation\",\n  \"additionalInfo\": \"xxxx\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-3:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Content-Type invalid\",\n  \"additionalInfo\": \"Content type xxx not supported\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-4:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Request headers or parameters are not appropriate\",\n  \"additionalInfo\": \"Request headers or parameters are not appropriate. Please check request headers and parameters\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '401':
          description: Unauthorized
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"401\",\n  \"displayMessage\": \"Authorization is not provided or invalid\",\n  \"additionalInfo\": \"Authorization is not provided or invalid. Please check your Authorization\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"code\": \"401\",\n  \"displayMessage\": \"You are not authorized for this access\",\n  \"additionalInfo\": \"You are not authorized for this access. Please check your access\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '403':
          description: Forbidden
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"You cannot access this event\",\n  \"additionalInfo\": \"This event is not belongs to programs which are mapped to your account\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"message\": \"Forbidden\"\n}"
                case-2:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"x-api-key is not provided or invalid\",\n  \"additionalInfo\": \"x-api-key is not provided or invalid. Please check your x-api-key\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-3:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"No account found for specified Authorization\",\n  \"additionalInfo\": \"No account found for specified Authorization. Please check your access_token\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-4:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"x-api-key is not valid for this account\",\n  \"additionalInfo\": \"x-api-key is not valid for this account. Please check your x-api-key\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-5:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"You do not have access to this resource\",\n  \"additionalInfo\": \"You do not have access to this resource. Please check your access\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '404':
          description: Not Found
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"404\",\n  \"displayMessage\": \"No events found\",\n  \"additionalInfo\": \"No events found for event_id:f75b0ada-ee9b-4cdb-b0f1-b915267d203c\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"code\": \"404\",\n  \"displayMessage\": \"Requested resource Not Found\",\n  \"additionalInfo\": \"Requested resource Not Found. Please check your request\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"422\",\n  \"displayMessage\": \"Unprocessable Entity\",\n  \"additionalInfo\": \"Unprocessable Entity. Please check your request\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
    put:
      tags:
      - Events
      summary: Update an existing Event in a program
      description: Update an existing event in a program based on the inputted event_id. For an event, only rate_watt and target_soc are allowed to be updated and updation of an event is allowed only upto 1 minute before event start time.
      operationId: updateEvent
      parameters:
      - name: event_id
        in: path
        description: Unique ID of the Event
        required: true
        schema:
          type: string
      - name: x-api-key
        in: header
        description: Unique API Key of your account
        required: true
        schema:
          type: string
        example: your-api-key-here
      - name: Authorization
        in: header
        description: access_token generated from auth API must be passed as Authorization header
        required: true
        schema:
          type: string
        example: Bearer your-access-token
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EventUpdateRequest'
            examples:
              example-0:
                value: "{\n    \"target_soc\":10,\n    \"rate_watt\": 3000\n}\n"
        required: true
      responses:
        '200':
          description: Event updated successfully
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/EventResponse'
              examples:
                SuccessfulUpdate:
                  summary: Sample response for updated event
                  description: SuccessfulUpdate
                  value:
                    message: Event updated successfully
                    event_id: f75b0ada-ee9b-4cdb-b0f1-b915267d203c
                    name: Event 202204061130
                    no_of_sites: 1
                    program_id: test
                    total_watts: 1200
        '400':
          description: Bad Request
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"rate_watt out of range\",\n  \"additionalInfo\": \"rate_watt cannot be less than 0 when its value is provided\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Event cannot be updated right now because site info is not available for some site\",\n  \"additionalInfo\": \"Event cannot be updated right now because site info is not available for some site. Gateways list is null or blank site_id 12345\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-2:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Target SOC : xx is less than minimum target SOC for abcd. Minimum target SOC = yy\",\n  \"additionalInfo\": \"Target SOC : xx is less than minimum target SOC for abcd. Minimum target SOC = yy\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-3:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Target SOC : xx is more than maximum target SOC for abcd. Maximum target SOC = zz\",\n  \"additionalInfo\": \"Target SOC : xx is more than maximum target SOC for abcd. Maximum target SOC = zz\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-4:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Default target_soc is xx for this program with no option to override\",\n  \"additionalInfo\": \"Default target_soc is xx for this program with no option to override\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-5:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"rate_watt needs to be at least 20% of total available power for the selected VPPs/Site group. Total available power = xxxx W\",\n  \"additionalInfo\": \"rate_watt needs to be at least 20% of total available power for the selected VPPs/Site group. Total available power = xxxx W\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-6:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"rate_watt should be less than total available VPPs/Site group's cumulative Power. Total available power = xxxx W\",\n  \"additionalInfo\": \"rate_watt should be less than total available VPPs/Site group's cumulative Power. Total available power = xxxx W\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-7:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Default rate_watt is xxxx W with no option to override\",\n  \"additionalInfo\": \"Default rate_watt is xxxx W with no option to override\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-8:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Type Mismatch\",\n  \"additionalInfo\": \"Cannot cast the parameter to required type xxxx\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-9:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Missing Parameter\",\n  \"additionalInfo\": \"Required xxx parameter abc is not present\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-10:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Constraint Violation\",\n  \"additionalInfo\": \"xxxx\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-11:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Content-Type invalid\",\n  \"additionalInfo\": \"Content type xxx not supported\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-12:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Request headers or parameters are not appropriate\",\n  \"additionalInfo\": \"Request headers or parameters are not appropriate. Please check request headers and parameters\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '401':
          description: Unauthorized
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"401\",\n  \"displayMessage\": \"Authorization is not provided or invalid\",\n  \"additionalInfo\": \"Authorization is not provided or invalid. Please check your Authorization\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"code\": \"401\",\n  \"displayMessage\": \"You are not authorized for this access\",\n  \"additionalInfo\": \"You are not authorized for this access. Please check your access\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '403':
          description: Forbidden
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"You cannot access this event\",\n  \"additionalInfo\": \"This event is not belongs to programs which are mapped to your account\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"message\": \"Forbidden\"\n}"
                case-2:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"x-api-key is not provided or invalid\",\n  \"additionalInfo\": \"x-api-key is not provided or invalid. Please check your x-api-key\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-3:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"No account found for specified Authorization\",\n  \"additionalInfo\": \"No account found for specified Authorization. Please check your access_token\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-4:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"x-api-key is not valid for this account\",\n  \"additionalInfo\": \"x-api-key is not valid for this account. Please check your x-api-key\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-5:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"You do not have access to this resource\",\n  \"additionalInfo\": \"You do not have access to this resource. Please check your access\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '404':
          description: Not Found
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"404\",\n  \"displayMessage\": \"No events found\",\n  \"additionalInfo\": \"No events found for event_id:f75b0ada-ee9b-4cdb-b0f1-b915267d203c\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"code\": \"404\",\n  \"displayMessage\": \"Requested resource Not Found\",\n  \"additionalInfo\": \"Requested resource Not Found. Please check your request\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"422\",\n  \"displayMessage\": \"Only scheduled events can be updated\",\n  \"additionalInfo\": \"Only scheduled events can be updated. This event status is xyz\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"code\": \"422\",\n  \"displayMessage\": \"Unprocessable Entity\",\n  \"additionalInfo\": \"Unprocessable Entity. Please check your request\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
    delete:
      tags:
      - Events
      summary: Cancel or End Event
      description: The API can be used to cancel a scheduled event or end an ongoing event in a program. An event that is either completed or already cancelled cannot be cancelled or ended.
      operationId: cancelEvent
      parameters:
      - name: event_id
        in: path
        description: Unique ID of the event
        required: true
        schema:
          type: string
      - name: x-api-key
        in: header
        description: Unique API Key of your account
        required: true
        schema:
          type: string
        example: your-api-key-here
      - name: Authorization
        in: header
        description: access_token generated from auth API must be passed as Authorization header
        required: true
        schema:
          type: string
        example: Bearer your-access-token
      responses:
        '200':
          description: Event cancelled successfully
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/EventResponse'
              examples:
                successExample:
                  summary: Sample response
                  description: successExample
                  value:
                    message: Event cancelled successfully
                    event_id: f75b0ada-ee9b-4cdb-b0f1-b915267d203c
                    name: Event 202204061130
                    no_of_sites: 1
                    program_id: test
                    total_watts: 1200
        '400':
          description: Bad Request
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Only scheduled or in_progress events can be deleted\",\n  \"additionalInfo\": \"Only scheduled or in_progress events can be deleted. This event status is xyz\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Cancellation request is already submitted/in_progress/completed for this event\",\n  \"additionalInfo\": \"Cancellation request is already submitted/in_progress/completed for this event. Cancellation request status is xyz\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-2:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Type Mismatch\",\n  \"additionalInfo\": \"Cannot cast the parameter to required type xxxx\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-3:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Missing Parameter\",\n  \"additionalInfo\": \"Required xxx parameter abc is not present\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-4:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Constraint Violation\",\n  \"additionalInfo\": \"xxxx\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-5:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Content-Type invalid\",\n  \"additionalInfo\": \"Content type xxx not supported\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-6:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Request headers or parameters are not appropriate\",\n  \"additionalInfo\": \"Request headers or parameters are not appropriate. Please check request headers and parameters\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '401':
          description: Unauthorized
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"401\",\n  \"displayMessage\": \"Authorization is not provided or invalid\",\n  \"additionalInfo\": \"Authorization is not provided or invalid. Please check your Authorization\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"code\": \"401\",\n  \"displayMessage\": \"You are not authorized for this access\",\n  \"additionalInfo\": \"You are not authorized for this access. Please check your access\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '403':
          description: Forbidden
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"You cannot access this event\",\n  \"additionalInfo\": \"This event is not belongs to programs which are mapped to your account\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"Upcoming event cancellation is not allowed for this program\",\n  \"additionalInfo\": \"Upcoming event cancellation is not allowed for this program. Please check program feature flags\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-2:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"Ongoing event ending is not allowed for this program\",\n  \"additionalInfo\": \"Ongoing event ending is not allowed for this program. Please check program feature flags\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-3:
                  value: "{\n  \"message\": \"Forbidden\"\n}"
                case-4:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"x-api-key is not provided or invalid\",\n  \"additionalInfo\": \"x-api-key is not provided or invalid. Please check your x-api-key\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-5:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"No account found for specified Authorization\",\n  \"additionalInfo\": \"No account found for specified Authorization. Please check your access_token\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-6:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"x-api-key is not valid for this account\",\n  \"additionalInfo\": \"x-api-key is not valid for this account. Please check your x-api-key\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-7:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"You do not have access to this resource\",\n  \"additionalInfo\": \"You do not have access to this resource. Please check your access\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '404':
          description: Not Found
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"404\",\n  \"displayMessage\": \"No events found\",\n  \"additionalInfo\": \"No events found for event_id:f75b0ada-ee9b-4cdb-b0f1-b915267d203c\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"code\": \"404\",\n  \"displayMessage\": \"Requested resource Not Found\",\n  \"additionalInfo\": \"Requested resource Not Found. Please check your request\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"422\",\n  \"displayMessage\": \"Unprocessable Entity\",\n  \"additionalInfo\": \"Unprocessable Entity. Please check your request\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
  /api/v1/events/optout/{event_id}:
    put:
      tags:
      - Events
      summary: Optout-Optin site from the event
      description: 'Optout/Optin site from the event. Site can be opted out only for the scheduled events.

        Optout/Optin is allowed only up to 1 minute before the event start time.

        '
      operationId: optOutOptInEvent
      parameters:
      - name: event_id
        in: path
        description: Unique ID of the Event
        required: true
        schema:
          type: string
      - name: x-api-key
        in: header
        description: Unique API Key of your account
        required: true
        schema:
          type: string
        example: your-api-key-here
      - name: Authorization
        in: header
        description: access_token generated from auth API must be passed as Authorization header
        required: true
        schema:
          type: string
        example: Bearer your-access-token
      requestBody:
        description: Optout-Optin event details
        content:
          '*/*':
            schema:
              $ref: '#/components/schemas/EventOptoutOptinRequest'
            examples:
              example-0:
                value: "{\n    \"site_id\": 12345,\n    \"optout\":true\n}\n"
        required: true
      responses:
        '200':
          description: Site Opted Out successfully
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/EventOptoutOptinResponse'
              examples:
                OptoutSuccessExample:
                  description: OptoutSuccessExample
                  value:
                    message: Site Opted Out successfully
                    event_id: f75b0ada-ee9b-4cdb-b0f1-b915267d203c
                    site_id: 12345
        '400':
          description: Bad Request
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"site_id cannot be null\",\n  \"additionalInfo\": \"site_id cannot be null. please provide site_id which needs to be opt out/opt in from the event\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"optout cannot be null\",\n  \"additionalInfo\": \"optout cannot be null. please provide true for optout site from the event and false for optin site to the event\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-2:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Type Mismatch\",\n  \"additionalInfo\": \"Cannot cast the parameter to required type xxxx\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-3:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Missing Parameter\",\n  \"additionalInfo\": \"Required xxx parameter abc is not present\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-4:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Constraint Violation\",\n  \"additionalInfo\": \"xxxx\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-5:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Content-Type invalid\",\n  \"additionalInfo\": \"Content type xxx not supported\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-6:
                  value: "{\n  \"code\": \"400\",\n  \"displayMessage\": \"Request headers or parameters are not appropriate\",\n  \"additionalInfo\": \"Request headers or parameters are not appropriate. Please check request headers and parameters\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '401':
          description: Unauthorized
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"401\",\n  \"displayMessage\": \"Authorization is not provided or invalid\",\n  \"additionalInfo\": \"Authorization is not provided or invalid. Please check your Authorization\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"code\": \"401\",\n  \"displayMessage\": \"You are not authorized for this access\",\n  \"additionalInfo\": \"You are not authorized for this access. Please check your access\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '403':
          description: Forbidden
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"You cannot access this event\",\n  \"additionalInfo\": \"This event is not belongs to programs which are mapped to your account\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"message\": \"Forbidden\"\n}"
                case-2:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"x-api-key is not provided or invalid\",\n  \"additionalInfo\": \"x-api-key is not provided or invalid. Please check your x-api-key\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-3:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"No account found for specified Authorization\",\n  \"additionalInfo\": \"No account found for specified Authorization. Please check your access_token\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-4:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"x-api-key is not valid for this account\",\n  \"additionalInfo\": \"x-api-key is not valid for this account. Please check your x-api-key\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-5:
                  value: "{\n  \"code\": \"403\",\n  \"displayMessage\": \"You do not have access to this resource\",\n  \"additionalInfo\": \"You do not have access to this resource. Please check your access\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '404':
          description: Not Found
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"404\",\n  \"displayMessage\": \"No events found\",\n  \"additionalInfo\": \"No events found for event_id:f75b0ada-ee9b-4cdb-b0f1-b915267d203c\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"code\": \"404\",\n  \"displayMessage\": \"No event found for this site_id\",\n  \"additionalInfo\": \"No events found for event_id:f75b0ada-ee9b-4cdb-b0f1-b915267d203c and site_id:12345\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-2:
                  value: "{\n  \"code\": \"404\",\n  \"displayMessage\": \"Requested resource Not Found\",\n  \"additionalInfo\": \"Requested resource Not Found. Please check your request\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
        '422':
          description: Unprocessable Entity
          content:
            '*/*':
              examples:
                case-0:
                  value: "{\n  \"code\": \"422\",\n  \"displayMessage\": \"Only scheduled events can be opted out or opted in\",\n  \"additionalInfo\": \"Only scheduled events can be opted out or opted in. This event status is xxxx\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-1:
                  value: "{\n  \"code\": \"422\",\n  \"displayMessage\": \"This site is already opted out\",\n  \"additionalInfo\": \"This site is already opted out\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-2:
                  value: "{\n  \"code\": \"422\",\n  \"displayMessage\": \"This site is already opted in\",\n  \"additionalInfo\": \"This site is already opted in\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-3:
                  value: "{\n  \"code\": \"422\",\n  \"displayMessage\": \"Event cannot be opted out/opted in because its start time is within x minutes from current time\",\n  \"additionalInfo\": \"Event cannot be opted out/opted in because its start time is within x minutes from current time\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
                case-4:
                  value: "{\n  \"code\": \"422\",\n  \"displayMessage\": \"Unprocessable Entity\",\n  \"additionalInfo\": \"Unprocessable Entity. Please check your request\",\n  \"errorRefNo\": \"e20fdf9aa241bea9\",\n}"
  /api/v2/events:
    get:
      tags:
      - Events
      summary: Retrieve all events in a program
      description: Returns a paginated list of all events in a program and total count of events based on the inputted program_id
      o

# --- truncated at 32 KB (116 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/enphase/refs/heads/main/openapi/enphase-events-api-openapi.yml