Update your sign-in limits
Changes one or both limits, at once and everywhere you are signed in. Lowering the session limit below your two-factor trust lowers the trust with it, and trust_lowered says so. Lengthening either limit is never saved from the API: it is refused 409 confirmation_required with a confirm_url, where you confirm it is you in the Control Panel.
Body
How long you stay signed in. null leaves it as it is.
How long a trusted browser skips your two-factor code. null leaves it as it is.
Returns
200 Your sign-in limits as they are now.
Fields of the 200 answer
The values you can choose, shortest first.
Fields of each item
A length of time, as its key.
8h16h1d3d7dThe length in words, such as 16 hours.
How long you stay signed in, counted from the moment you sign in.
Fields
A length of time, as its key.
8h16h1d3d7dThe length in words, such as 16 hours.
Whether you have never chosen a value, so the default applies.
Always false for customers and agencies.
How long a trusted browser skips your two-factor code. Never longer than session_limit.
Fields
A length of time, as its key.
8h16h1d3d7dThe length in words, such as 16 hours.
Whether you have two-factor authentication on. Without it no browser can be trusted.
Whether you have never chosen a value, so the default applies.
Whether the two-factor trust was lowered to follow the session limit down.
If it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | scope_required | Use a token with the scope named in scope. |
404 | feature_off | This feature is not on for your organisation yet. |
409 | confirmation_required | Staying signed in longer needs you to confirm it is you. Confirm it in the Control Panel, then try again. |
422 | invalid | Fix the field named in field; errors says why. |
422 | trust_above_session_limit | A trusted browser cannot skip the code for longer than you stay signed in. Choose a shorter time for the trusted browser, or a longer sign-in. |
429 | rate_limited | Wait for the seconds in Retry-After. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl -X PATCH https://manage.corefinity.com/api/user/sign-in-settings \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"session_limit": "1d",
"two_factor_trust": "8h"
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->patch('https://manage.corefinity.com/api/user/sign-in-settings', [
'session_limit' => '1d',
'two_factor_trust' => '8h',
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/user/sign-in-settings', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
session_limit: '1d',
two_factor_trust: '8h',
}),
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.patch(
"https://manage.corefinity.com/api/user/sign-in-settings",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"session_limit": "1d",
"two_factor_trust": "8h",
},
)
data = res.json() if res.content else None{
"choices": [
{
"key": "8h",
"label": "8 hours",
"minutes": 480
},
{
"key": "16h",
"label": "16 hours",
"minutes": 960
},
{
"key": "1d",
"label": "1 day",
"minutes": 1440
},
{
"key": "3d",
"label": "3 days",
"minutes": 4320
},
{
"key": "7d",
"label": "7 days",
"minutes": 10080
}
],
"session_limit": {
"default": false,
"key": "16h",
"label": "16 hours",
"minutes": 960
},
"staff_cap": false,
"trust_lowered": true,
"two_factor_trust": {
"applies": true,
"default": false,
"key": "16h",
"label": "16 hours",
"minutes": 960
}
}{
"message": "Unauthenticated."
}{
"code": "scope_required",
"message": "This access token does not have the destructive scope this needs. Use a token with the destructive scope.",
"reason": "scope_required",
"scope": "destructive"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "confirmation_required",
"confirm_url": "https://manage.corefinity.com/profile?session_limit=3d&two_factor_trust=1d&from=api#sessions",
"message": "Confirm it's you in the Control Panel to stay signed in longer.",
"reason": "confirmation_required"
}{
"code": "invalid",
"errors": {
"session_limit": [
"Choose 8 hours, 16 hours, 1 day, 3 days or 7 days."
]
},
"field": "session_limit",
"message": "Choose 8 hours, 16 hours, 1 day, 3 days or 7 days.",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}Try it is off for this endpointIt has not been cleared for the console. Copy the request and run it yourself when you are sure.