Skip to content
Hydda One API
Esc
↑↓navigate↵open⌘Jpreview
On this page

Authentication

Get an access token from the token endpoint, with a client id and secret or as a connector from Hydda.

Every request to the API carries an access token in the Authorization header:

Authorization: Bearer <access_token>

You get the token from POST https://idp.hydda.one/oauth/token. A token lives for 600 seconds and comes with no refresh token. Request a new one before it expires.

Which grant to use

You are building Grant You hold
A website or backend that sells bookable resources client_credentials The client id and secret of an Application.
Your own integration, for invoicing or contract signing client_credentials The client id and secret shown when the integration was created.
A connector from Hydda The installation-token grant The connector’s private key.

Almost every reader needs client_credentials. The installation-token grant works only for a connector that Hydda has registered.

With a client id and secret: client credentials

An organization administrator creates the credentials in the admin console and gives you a client_id and a client secret:

  • For an Application, under Settings, then Applications.
  • For an integration of your own, under Settings, then Integrations. Creating the integration creates its application with it.

The secret starts with everest_sk_ and is shown only once. An application can have two active secrets at a time, so you can roll to a new one without downtime.

Send the request as application/x-www-form-urlencoded. Put the credentials in HTTP Basic authentication:

curl https://idp.hydda.one/oauth/token \
  -u "$CLIENT_ID:$CLIENT_SECRET" \
  -d grant_type=client_credentials

Or put them in the form body instead. Do not send both.

curl https://idp.hydda.one/oauth/token \
  -d grant_type=client_credentials \
  -d client_id="$CLIENT_ID" \
  -d client_secret="$CLIENT_SECRET"

The response:

{ "access_token": "eyJ…", "token_type": "Bearer", "expires_in": 600 }

Do not send a scope parameter. The endpoint issues no scopes. What a token can do comes from the roles the Application holds. See Roles.

As a connector from Hydda: the installation-token grant

A connector that Hydda builds and runs has no client secret, and no credential per organization. It signs a short JWT with its one private key and exchanges it for a token for one installation: the connector inside one organization.

Only Hydda can register a connector and its key. An integration you build yourself uses client credentials, above.

The JWT is an RFC 7523 client assertion signed with ES256:

Claim Value
iss, sub The app id.
aud https://idp.hydda.one/oauth/token
iat, exp exp is at most 300 seconds after iat.
jti A unique id. An assertion works only once.

Send it with the installation’s id:

curl https://idp.hydda.one/oauth/token \
  -d grant_type=urn:everest:params:oauth:grant-type:installation-token \
  -d client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer \
  -d client_assertion="$ASSERTION" \
  -d installation_id="$INSTALLATION_ID"

The response has the same shape. The token lives for 600 seconds and carries the roles granted to that installation.

Discovery and signing keys

The identity host publishes its OpenID configuration and its public keys:

  • GET https://idp.hydda.one/.well-known/openid-configuration lists the token endpoint, the supported grant types and the client authentication methods.
  • GET https://idp.hydda.one/.well-known/jwks.json returns the keys that sign access tokens.

Token endpoint errors

The token endpoint answers failures in the OAuth 2.0 format, { "error", "error_description" }, not as problem details.

error Status When
invalid_request 400 The body is not form-encoded, grant_type is missing, a parameter is repeated, or both credential methods are used.
unsupported_grant_type 400 The grant type is not one of the two above.
invalid_scope 400 The request has a scope parameter.
invalid_grant 400 The installation is not active, or belongs to another app.
invalid_client 401 The credentials are wrong, revoked or disabled, or the assertion is not valid or was used before.
slow_down 429 More than 60 token requests for one client in 60 seconds. Wait for the Retry-After seconds.

invalid_client does not say which check failed, on purpose.

Revoking access

Revoking a secret, disabling an application or uninstalling a connector stops new tokens. A token already issued keeps working until it expires, at most 600 seconds later.

Was this page helpful?