Flip Energy API
    Flip Energy API
    • Overview
    • Important concepts
    • Authentication
    • Enrollment process
    • End-user app design
    • Monitoring / Telemetry
    • Control
    • Change log
    • Mobile App API
      • Devices
        • Create Device
        • Read Devices
        • Read Device
        • Update Device
        • Delete Device
      • Enrollments
        • Create Enrollment
        • Read Enrollments
        • Read Enrollment
        • Delete Enrollment
      • Events
        • Read Events
        • Read Event
        • Update Event Participation
      • Programs
        • Read Programs
        • Read Program
      • Sites
        • Read Site
        • Update Site
    • Cloud API
      • Sites
        • Get Site Token
        • Get Sites
      • Commissioning
        • Commission Site And Devices
      • Sessions
        • Sessions
      • Commands
        • Command Created
        • Update Command Status
      • Programs
        • Read Programs
      • Telemetry
        • Report Battery Telemetry
      • Webhooks
        • Overview
        • List of events
        • Webhook headers
        • Schemas
          • Command
          • Enrollment
          • Event

    Authentication

    All endpoints are protected and require authentication. The only supported method is Bearer Token. Add the following header to your request, replacing token with the proper value:
    Authorization: Bearer <token>
    There are two types of tokens: client tokens, and site tokens.

    Client tokens#

    Client tokens can be generated by you in the developer portal.
    They unlock access to all functions of the API, and as such should be stored securely. They are intended to be used for server to server communications only. They never expire, but can be revoked manually if needed.
    To protect you and security of our systems, Flip doesn't store the tokens, and cannot retrieve them if they are ever lost. Please make sure you store them securely.

    Site tokens#

    Site tokens are created by calling /v1/auth/site/{site_id}, and are specific to a given site. They are intended to be used for communications between your mobile app and Flip's API. They expire after one hour, after which you will need to call the endpoint to request a new one again.
    WARNING
    If a site token is used to get or act on data from a different site, a 401 UNAUTHORIZED or 403 FORBIDDEN error will be returned.

    Which type of token for which endpoint#

    EndpointClient tokenSite token
    POST /v1/auth/site/{id}✅❌
    POST /v1/commission✅❌
    GET /v1/site/{siteId}/devices❌✅
    GET /v1/site/{siteId}/device/{id}❌✅
    PATCH /v1/site/{siteId}/device/{id}❌✅
    GET /v1/site/{siteId}/device/{id}/dispatches❌✅
    GET /v1/site/{siteId}/dispatch/{id}❌✅
    PATCH /v1/site/{siteId}/dispatch/{id}❌✅
    POST /v1/site/{siteId}/enrollments❌✅
    GET /v1/site/{siteId}/enrollments❌✅
    DEL /v1/site/{siteId}/enrollment/{id}❌✅
    GET /v1/site/{siteId}/programs❌✅
    GET /v1/site/{siteId}/program/{id}❌✅
    GET /v1/site/{siteId}❌✅
    PATCH /v1/site/{siteId}❌✅
    GET /v1/commands✅❌
    PATCH /v1/command/{id}✅❌
    POST /v1/telemetry✅❌
    Modified at 2024-06-28 12:37:28
    Previous
    Important concepts
    Next
    Enrollment process
    Built with