Issue a machine access token
Exchanges API credentials for a Bearer JWT using the OAuth 2.0 client credentials grant.
Send application/json (not application/x-www-form-urlencoded).
Tokens expire after 3600 seconds. There is no refresh token.
Exchange credentials again to obtain a new token. Several tokens may be valid until each expires.
Revoking a credential invalidates outstanding tokens.
This response is the OAuth token object — it does not use the { data, meta } envelope.
curl -X POST "https://api.scrut.io/oauth/token" \
-H "Content-Type: application/json" \
-d '{
"grant_type": "client_credentials",
"client_id": "550e8400-e29b-41d4-a716-446655440000",
"client_secret": "your-client-secret"
}'
import requests
import json
url = "https://api.scrut.io/oauth/token"
headers = {
"Content-Type": "application/json"
}
data = {
"grant_type": "client_credentials",
"client_id": "550e8400-e29b-41d4-a716-446655440000",
"client_secret": "your-client-secret"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.scrut.io/oauth/token", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"grant_type": "client_credentials",
"client_id": "550e8400-e29b-41d4-a716-446655440000",
"client_secret": "your-client-secret"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"grant_type": "client_credentials",
"client_id": "550e8400-e29b-41d4-a716-446655440000",
"client_secret": "your-client-secret"
}`)
req, err := http.NewRequest("POST", "https://api.scrut.io/oauth/token", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.scrut.io/oauth/token')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = '{
"grant_type": "client_credentials",
"client_id": "550e8400-e29b-41d4-a716-446655440000",
"client_secret": "your-client-secret"
}'
response = http.request(request)
puts response.body
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXAiOiJtYWNoaW5lX2FjY2VzcyIsInN1YiI6IjU1MGU4NDAwLWUyOWItNDFkNC1hNzE2LTQ0NjY1NTQ0MDAwMCJ9.dummy-signature-for-documentation-only",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "evidence:read, evidence:write, policy:read"
}
{
"error": "invalid_request",
"error_description": "grant_type is required"
}
{
"error": "invalid_client",
"error_description": "Invalid client credentials. Verify client_id and client_secret, or create a new credential in the Developer Console."
}
{
"error": "temporarily_unavailable",
"error_description": "Rate limit exceeded. Retry after 12 seconds."
}
{
"error": "temporarily_unavailable",
"error_description": "The authorization server is temporarily unavailable. Retry later."
}
/oauth/token
Target server for requests. Edit to use your own host.
The media type of the request body
Only the client credentials grant is supported.
UUID v4 from Settings → Developer Console.
Secret shown once at credential creation.
Request Preview
Response
Response will appear here after sending the request
Body
Only the client credentials grant is supported.
client_credentialsUUID v4 from Settings → Developer Console.
550e8400-e29b-41d4-a716-446655440000Responses
RS256 machine JWT. Send as Authorization: Bearer $SCRUT_ACCESS_TOKEN.
BearerLifetime in seconds. There is no refresh token — exchange credentials again.
Comma-separated scopes granted with this access token. A write scope includes read access for the same resource (for example, evidence:write includes evidence:read).