docs

Get Token

1.0.0
OpenAPI 3.0.1

This is the specification of Authentication API. For more information about how to interact with the Authentication API, you can read the respective developer guide.

Getting Started

This API must be only used by backend services

Creating an API Client

First you will need to create a new API client using the SCAYLE Panel to obtain your client_id and client_secret. Make sure to store those credentials safely in your backend.

Authenticating a User

There are three different options on how to authenticate a user:

  1. Register a new user
  2. Login an existing user
  3. Login as a guest customer without a password

All of those endpoints will require you to provide the client_id and client_secret as a Basic Auth header.

Credentials client_id and client_secret don't have any expiration date. After successfully authenticating a user, you will get an access token and a refresh token. Access tokens are valid for 30 days and Refresh Tokens are valid for 60 days.

Validating a token

You will need to call the validation endpoint to check if an access token is still valid.

Refreshing a token

Refreshing a token is done by using the POST token endpoint by using the refresh_token OAuth grant.

You should consider to check the expiration date of the JWT to trigger a refresh early enough.

Server:https://{tenant-space}.auth.scayle.cloud
Client Libraries

OAuth Client endpoints

​

Endpoints for the OAuth clients with Basic Authorization

OAuth Client endpoints Operations

Get Token

​

This endpoint allows you to exchange an authorization code for a pair of access and refresh tokens, or to exchange a refresh token for a new pair of access and refresh tokens.

Body·

required
application/json
  • OAuth grant type

  • Integer numbers.

  • The authorization code

  • The code verifier for PKCE flow, required only when auth_code was generated with PKCE flow

  • The refresh token

Responses

  • application/json
  • application/json
  • application/json
  • application/json
Request Example for post/v1/oauth/token
curl https://TENANT_SPACE.auth.scayle.cloud/v1/oauth/token \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Basic username:password' \
  --data '{
  "grant_type": "refresh_token",
  "refresh_token": "def502006e21b4d0c6f154dd21a6fa273dc7dd9856606add87d5aa4a5078bdca44c9d3477f56981450ad40846665183e5ba19d16f4b020e53311e4729d5463cf7b2d79fb72f85c3a4ecb3aea1d881e7a2a1784ca7dc991c1e80066ef55b6c4c50731baa5d81f4ba98685773e24a6ef491490a46a78edfac6d5ff830138d5b946cdbfd71d469328cf5537cef20518097ea3f7664ccda2f061e881671e7647daad0344211e6d4e4dbc2662ad236190508fe68900c4b2deb4e57503af6dcce09c1694fe34c1fb08959b81fd356bf7406b0b8bc36d5f79a2ea939ad83b6d75b54034912992d1faa6f2c4ada225896212769c9d4e96d896a5c9cffbfd025e8dd6bee651b3e0f7e93910593c1a3570d3522bf6a9143b09c44339ea0170d87b153dfafe9a7adeddf59dd9181ad705573d72b0149de9af5fab053c1d409b3d32d6535d4042dc27bd94b198e7aa2756a9391e6c672bcbb1b7795d3045223c81fe15e86db68b"
}'
{
  "token_type": "Bearer",
  "expires_in": 2678400,
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiI1IiwianRpIjoiZjE3MDg2MWY0NDk4N2ExMmQyOTkxZjQ4NzE0ZGU2MTRhNGNjMTg2NjMyNmYxNmM1ODJmNGZkMTA2OTA3ZjM2NTU3NTQyYWI5YzFiY2ViNWEiLCJpYXQiOjE2Nzc2ODA0NzAuNzc3NDI2LCJuYmYiOjE2Nzc2ODA0NzAuNzc3NDM3LCJleHAiOjE2ODAzNTg4NzAuNzU0ODQsInN1YiI6IjEiLCJzY29wZXMiOltdLCJjdXN0b21lcklkIjoxMTcyOTU1MX0.SMf4J2jFDfFAOJnWfhgn4nO3_udda1LhIuVt9r0z1-Aeu8VVdhT53W_zUDAXEIVW3ba2VYne-u8hFxWaT82QXEukRuO8Wn23ZTfjtD7-0mWTz_psrvlg5-DjYZFFXvQ6P6tT9rOc21ibkEYl14-Wd1Ie2zF7HUdOu939rEBcEVU5jmJ-zzyHn7d3Qb1Z7CJL-_EU341rgQyByUCfYTmDAKN6wmI9hGChzgFIDewbV3CHXOs0RjQD6v0fZRZIBb91cdNpw1gLvAY-FhqcenBmGbBx09K9TwBum1zlQYpH_DrBFxH2HEa72-jERJWjUmMBVkSZ_9fHpQkrG3v9h7lDEobfRsfpolF89xCPPl-ug2oz_gLojTsWFXXfchIN-i8CNn3tY4D08qqsOs5lsl-OyA_pievPdSz8Q04pMTjmK1K5myPqONeG6X2gf8BQg--A4weOGYjJIjyo_NcEJN8nCKseg6i06JF2tSQAe0QnOzuVvVOHb-4HlD2h3XF2emGRtxGVXtvFtq5UhFgu9QNmwC8NkLJHBNDTlx7zDybNpHz597usUGV-ye06DZPs0Cx0Ch_RNUO6vV4aQUe0BsiEb4ZGncWt09uqO5iio8IFJTieHYpphPQg99asYhkcGqt1ZMoc6TFpm3lmpZE6uEfzhcEmu9FZA21NTxRtUHLLc9Q",
  "refresh_token": "def50200e47c39150262586222c6b1f9c700b386f2214fc33945a775f574c5902a0b919e701ec9fbfdbc3517d59936e8748443c8ca568d04616056b0755ef59a0281ac53ebec032f7f6155b2bf4cdf7cb845ff0639cc622cfbc1b0c9d72fb443e94f614ee87399f2bd593474b7cab30d4ea6b226c173989f3518ae616c2c8edb502f975c34c569cd70d326d7c9cf440a7f5e2f47f066c562064e9291e3ecd9cbf2a9df0989a48aa2732425478720319be7a3a235ac68c17bb3203b8fd1ba5fcdc71e205c8083b343df68bbfada6abc3d3c1d60eacdcef7d7d9a915e39a0c589766c6315f40c8af0b74af8cea9e230650c47fd425a0b7292862bc753cb97004ec8b505b7a37023ebc2ad3987c6693cbce5abb8e36f74e3b22e0b2d256f5845bbe63d4fddf2752a6a73e4229daa5f3f2c93f54121c58528b1a28f6bf347f1284d3145634ccd8552d7a05d8a086a212a2da2775a93a7ade1c8a42e309085a2a121999"
}

Models

​
​
​

Last updated: November 27, 2026