Skip to content

Authentication

The AutoRetouch API uses OAuth 2.0 Device Authorization Grant for authentication. This flow is ideal for applications that run on devices without a browser or with limited input capabilities.

PropertyValue
Auth Serverhttps://auth.autoretouch.com
Client IDV8EkfbxtBi93cAySTVWAecEum4d6pt4J
Scopeoffline_access
Audiencehttps://api.autoretouch.com
  1. Request a device code
  2. User visits the verification URL and confirms the device
  3. Poll for tokens (or wait for user confirmation)
  4. Use the access token in API requests
  5. Refresh the token when it expires

Start the device authorization flow by requesting a device code.

POST https://auth.autoretouch.com/oauth/device/code
Terminal window
curl -X POST "https://auth.autoretouch.com/oauth/device/code" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=V8EkfbxtBi93cAySTVWAecEum4d6pt4J" \
-d "scope=offline_access" \
-d "audience=https://api.autoretouch.com"
{
"device_code": "6NeU6254VaqvBhnMy5JbB54t",
"user_code": "GZXN-BHFN",
"verification_uri": "https://auth.autoretouch.com/activate",
"verification_uri_complete": "https://auth.autoretouch.com/activate?user_code=GZXN-BHFN",
"expires_in": 900,
"interval": 5
}
FieldDescription
device_codeCode to exchange for tokens (keep secret)
user_codeCode the user enters to confirm
verification_uriURL where user confirms the device
verification_uri_completeURL with code pre-filled
expires_inSeconds until the code expires (900 = 15 minutes)
intervalMinimum seconds between polling requests

Direct the user to verification_uri_complete to confirm the device.


After the user confirms the device, exchange the device code for access and refresh tokens.

POST https://auth.autoretouch.com/oauth/token
Terminal window
curl -X POST "https://auth.autoretouch.com/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=urn:ietf:params:oauth:grant-type:device_code" \
-d "device_code={device_code}" \
-d "client_id=V8EkfbxtBi93cAySTVWAecEum4d6pt4J"
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
"refresh_token": "bELBlOx5prjxEMXYFM78-qsKv...",
"scope": "offline_access",
"expires_in": 86400,
"token_type": "Bearer"
}
FieldDescription
access_tokenJWT to use in API requests (valid 24 hours)
refresh_tokenLong-lived token to get new access tokens
expires_inAccess token lifetime in seconds

If the user hasn’t confirmed yet or the code is invalid:

{
"error": "invalid_grant",
"error_description": "Invalid or expired device code."
}

Poll this endpoint at the specified interval until you receive tokens or the code expires.


Access tokens expire after 24 hours. Use the refresh token to get a new access token.

POST https://auth.autoretouch.com/oauth/token
Terminal window
curl -X POST "https://auth.autoretouch.com/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=refresh_token" \
-d "refresh_token={refresh_token}" \
-d "client_id=V8EkfbxtBi93cAySTVWAecEum4d6pt4J"
{
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGci...",
"scope": "offline_access",
"expires_in": 86400,
"token_type": "Bearer"
}
{
"error": "invalid_grant",
"error_description": "Unknown or invalid refresh token."
}

Revoke a refresh token to disable API access for a device.

POST https://auth.autoretouch.com/oauth/revoke
Terminal window
curl -X POST "https://auth.autoretouch.com/oauth/revoke" \
-H "Content-Type: application/json" \
-d '{
"client_id": "V8EkfbxtBi93cAySTVWAecEum4d6pt4J",
"token": "{refresh_token}"
}'

Returns 200 OK with an empty body on success.


Include the access token as a Bearer token in the Authorization header for all API requests:

Terminal window
curl -X GET "https://api.autoretouch.com/v1/organization" \
-H "Authorization: Bearer {access_token}"

You can also create API credentials through the AutoRetouch web app:

  1. Login at webapp.autoretouch.com
  2. Click your profile menu (top-right)
  3. Select “API”
  4. Click the ”+” button to add a new device
  5. Enter a device name and confirm
  6. Complete the device authorization flow in the popup
  7. Copy the refresh token (shown only once!)

API credentials page