---
updatedAt: 2025-06-09T22:29:08.000Z
agentTools:
  projectIndex: https://docs.enerflo.io/llms.txt
---

# Request a JWT Authentication Token

![](https://files.readme.io/c296e09-image.png)

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "enerflo-20-basic-auth",
    "version": "1.0.2"
  },
  "servers": [
    {
      "url": "https://api.enerflo.io/"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/api/oauth/token": {
      "post": {
        "summary": "Request a JWT Authentication Token",
        "description": "",
        "operationId": "request-a-jwt-authentication-token",
        "parameters": [
          {
            "name": "x-org",
            "in": "header",
            "description": "This is your Enerflo v2 Subdomain. (Just the slug. For example if I use https://mysolarcompany.enerflo.io, then my x-org value is `mysolarcompany`)",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "grant_type",
                  "claims"
                ],
                "properties": {
                  "grant_type": {
                    "type": "string",
                    "default": "client_credentials",
                    "enum": [
                      "client_credentials"
                    ]
                  },
                  "claims": {
                    "type": "object",
                    "properties": {
                      "enerflo_next_url": {
                        "type": "string",
                        "description": "Optional. This is the fully qualified URL of the desired destination in Enerflo. (Ex: `https://enerflo.io/installs/123123123123`) If provided, when the JWT is exchanged for a session, the user will be redirected to the URL you provide here.",
                        "default": "https://enerflo.io"
                      },
                      "enerflo_user": {
                        "type": "object",
                        "description": "The `enerflo_user` object is required to identify which user the token will be generated for.",
                        "properties": {
                          "identifier": {
                            "type": "string",
                            "default": "email",
                            "enum": [
                              "email"
                            ]
                          },
                          "identity": {
                            "type": "string",
                            "description": "The full email address of the Enerflo user you wish to login.",
                            "default": "user@domain.com"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result":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ywdNzaQHjLqv1LFV4Rg2P_X5eykBriQiL76TUcnai7WIinmYcJIPaSrt__rYZoz5BjclceBQYX7ziIr3rs5ArBYJTZnzOc1kmZtdS0vtHfT5FC8kBBzDokYhqUr54\",\n  \"token_type\": \"Bearer\",\n  \"expires_in\": 60,\n  \"claims\": {\n    \"enerflo_next_url\": \"https://enerflo.io/verify/auth?next=https%3A%2F%2Fenerflo.io\"\n  }\n}3"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string",
                      "example": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJlbmVyZmxvX29yZ19zdWJkb21haW4iOiJlbmVyZmxvc2FsZXNkZW1vIiwiZW5lcmZsb191c2VyX2lkZW50aWZpZXIiOiJlbWFpbCIsImVuZXJmbG9fdXNlcl9pZGVudGl0eSI6InVzZXJAZG9tYWluLmNvbSIsImVuZXJmbG9fYXBwX2VudiI6InByb2R1Y3Rpb24iLCJlbmVyZmxvX25leHRfdXJsIjoiaHR0cHM6Ly9lbmVyZmxvLmlvIiwiaWF0IjoxNzA2MTExNjc2LCJleHAiOjE3MDYxMTE3MzYsImF1ZCI6ImVuZXJmbG8uaW8iLCJpc3MiOiJhcGkuZW5lcmZsby5pbyIsInN1YiI6ImVtYWlsL3VzZXJAZG9tYWluLmNvbSIsImp0aSI6IjFlOGZhYWU5LWY3NjgtNDdiMC05N2ZmLTQ4MTI5OThiZmU1ZiJ9.dknYbOG052qPbuYkZvmINC2WT-BjbVaiuh0VEJsOtcT-2xHVvME_J2HIWafihR6fynxheNKJFhSkOevU0YqbZlA1e_Vkp1i-eTonm81QVA1zczMBEp3rrRLeXblSz9RonnDTARqS7izO1qsNUSw4TBArdJrzWVNs8qndwG8ioKhOJ4raeIESxXVj1DqKMLWbYjBQL-uSNSaq0QDfWHdLNsa1vlZTKKWi4fXbZ9H5ugB7c4aC-dn0_gpf_dlP4sBdmV9nk6vnprP8ScCLmSs_AZD_2ni_ExOtF0KEZul0_xrdMzPyynEWLYZbavS06CQMMwGiArxM_R_1nMuQyYcXJrnpSpRPU6JuKFVJI3xTrdlFOu9yd_j7zI023JfoCmhOgAW-INkm2HSek0lcHEx3MV0XmZqnyPLSncH1oTrDiwPDT9IN1GOMynVbKum5CzgoNzuul9u68nFJrm3NaAj48tlwFc1NGf-NCZuP3NYr4TF3oow0Niaw5kxYgvgXoGGrOaAlG-WOUmCM3lh6-Pfm6xLLmpoI8HvTS2r2Jh0jY0CgTbywdNzaQHjLqv1LFV4Rg2P_X5eykBriQiL76TUcnai7WIinmYcJIPaSrt__rYZoz5BjclceBQYX7ziIr3rs5ArBYJTZnzOc1kmZtdS0vtHfT5FC8kBBzDokYhqUr54"
                    },
                    "token_type": {
                      "type": "string",
                      "example": "Bearer"
                    },
                    "expires_in": {
                      "type": "integer",
                      "example": 60,
                      "default": 0
                    },
                    "claims": {
                      "type": "object",
                      "properties": {
                        "enerflo_next_url": {
                          "type": "string",
                          "example": "https://enerflo.io/verify/auth?next=https%3A%2F%2Fenerflo.io"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```