Skip to main content
GET
/
oauth
/
authorize
Authorize
curl --request GET \
  --url https://api.nomos.energy/oauth/authorize
import requests

url = "https://api.nomos.energy/oauth/authorize"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://api.nomos.energy/oauth/authorize', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.nomos.energy/oauth/authorize",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.nomos.energy/oauth/authorize"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.nomos.energy/oauth/authorize")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.nomos.energy/oauth/authorize")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "code": "BAD_REQUEST",
  "message": "invalid_type in 'end': Required",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/BAD_REQUEST"
}
{
  "code": "UNAUTHORIZED",
  "message": "Invalid or malformed token",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/UNAUTHORIZED"
}
{
  "code": "PAYMENT_REQUIRED",
  "message": "Payment required",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/PAYMENT_REQUIRED"
}
{
  "code": "FORBIDDEN",
  "message": "You are not allowed to access this resource",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/FORBIDDEN"
}
{
  "code": "NOT_FOUND",
  "message": "Resource not found",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/NOT_FOUND"
}
{
  "code": "METHOD_NOT_ALLOWED",
  "message": "Method not allowed",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/METHOD_NOT_ALLOWED"
}
{
  "code": "CONFLICT",
  "message": "Resource already exists",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/CONFLICT"
}
{
  "code": "UNPROCESSABLE_ENTITY",
  "message": "invalid_enum_value in 'status': Invalid enum value. Expected 'pending' | 'active' | 'ended'",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/UNPROCESSABLE_ENTITY"
}
{
  "code": "TOO_MANY_REQUESTS",
  "message": "Wait 30 seconds before retrying.",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/TOO_MANY_REQUESTS"
}
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Internal Server Error",
  "requestId": "37a04f8f-e791-491c-81e1-86cd304649bb",
  "docs": "https://docs.nomos.energy/api-references/errors/INTERNAL_SERVER_ERROR"
}

Query Parameters

response_type
enum<string>
required

The response type, must be 'code' for authorization code flow

Available options:
code
Example:

"code"

client_id
string
required

The client identifier issued to the client during registration

Example:

"client_12345"

redirect_uri
string<uri>
required

The URI to redirect to after authorization is complete

Example:

"https://your-app.com/callback"

scope
string
state
string

Optional value used by the client to maintain state between request and callback

Example:

"xcoiv98sj3coijs"

code_challenge
string

PKCE code challenge derived from the code verifier

Example:

"E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM"

code_challenge_method
enum<string>

Method used to derive the code challenge, either 'S256' or 'plain'

Available options:
S256,
plain
Example:

"S256"

flow_type
enum<string>

If you want to use Nomos as identity provider, you can support a login or signup flow via explicitly setting this parameter. In contrast to the default, the login options skips the consent screen. The signup options allows your users to create a new customer without a subscription attached to it, and therefore register an account.

Available options:
login,
signup
Example:

"login"

Response

Redirect to the defined redirect_uri