Authentication

Retrieve a token

post/oauth/token

Request

  • Base URL
    https://api.nomos.energy
  • URL
    https://api.nomos.energy/oauth/token
  • Auth
    HTTP basic

Request body

grant_type'authorization_code' | 'refresh_token' | 'client_credentials' required

The OAuth 2.0 grant type being used for the token request

codestring

The authorization code received from the authorization server (required for authorization_code grant type)

refresh_tokenstring

The refresh token used to obtain a new access token (required for refresh_token grant type)

client_idstring

The client identifier issued to the client during registration (required for public clients, when not authenticating via Basic Auth)

scopestring
code_verifierstring

PKCE code verifier used to verify the authorization request (required when PKCE was used in authorization request)

Example request

{
  "grant_type": "authorization_code",
  "code": "da5cece172d6a8f65f91f90b3fe65b1e",
  "refresh_token": "ddbc4f94dbb2d19e23a81327042b35fc",
  "client_id": "client_12345",
  "code_verifier": "dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"
}

Response

The issued access token and refresh token

access_tokenstring required

The access token to access the API endpoints

token_type'Bearer' required

The type of token issued, always 'Bearer'

expires_innumber required

The lifetime of the access token in seconds (60 minutes)

refresh_tokenstring required

The refresh token to create a new access_token

scopestring required

Space-delimited list of scopes granted on this token (RFC 6749).

Example response

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlcyI6WyJhZG1pbiJdLCJwYJ0bmVyIjoi...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_token": "ddbc4f94dbb2d19e23a81327042b35fc",
  "scope": "read:* write:*"
}

Changes

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • warning

      removed the optional property from the response with the status

    • info

      removed the non-success response with the status

    • info

      removed the non-success response with the status

    • info

      removed the non-success response with the status

    • info

      removed the non-success response with the status

    • info

      removed the non-success response with the status

    • info

      removed the non-success response with the status

    • info

      removed the custom enum value from the // response property for the response status

    • info

      removed the duplicate_customer_email enum value from the // response property for the response status

    • info

      removed the duplicate_grid_reduction enum value from the // response property for the response status

    • info

      removed the duplicate_meter_order enum value from the // response property for the response status

    • info

      removed the duplicate_meter_reading enum value from the // response property for the response status

    • info

      removed the ended_subscription enum value from the // response property for the response status

    • info

      removed the implausible_meter_reading enum value from the // response property for the response status

    • info

      removed the invalid_element enum value from the // response property for the response status

    • info

      removed the invalid_format enum value from the // response property for the response status

    • info

      removed the invalid_iban enum value from the // response property for the response status

    • info

      removed the invalid_key enum value from the // response property for the response status

    • info

      removed the invalid_termination_date enum value from the // response property for the response status

    • info

      removed the invalid_type enum value from the // response property for the response status

    • info

      removed the invalid_union enum value from the // response property for the response status

    • info

      removed the invalid_value enum value from the // response property for the response status

    • info

      removed the missing_module_1 enum value from the // response property for the response status

    • info

      removed the missing_smart_meter enum value from the // response property for the response status

    • info

      removed the not_multiple_of enum value from the // response property for the response status

    • info

      removed the out_of_period_meter_reading enum value from the // response property for the response status

    • info

      removed the subscription_not_started enum value from the // response property for the response status

    • info

      removed the too_big enum value from the // response property for the response status

    • info

      removed the too_small enum value from the // response property for the response status

    • info

      removed the unrecognized_keys enum value from the // response property for the response status

    • info

      removed the unserviceable_zip enum value from the // response property for the response status

    • info

      removed the unsupported_meter enum value from the // response property for the response status

    • info

      removed the unsupported_meter_order enum value from the // response property for the response status

    • info

      removed the unsupported_meter_reading enum value from the // response property for the response status

    • info

      removed the unsupported_product enum value from the // response property for the response status

    • info

      removed the upgrade_api_version enum value from the // response property for the response status

    • info

      removed the withdrawal_not_allowed enum value from the // response property for the response status