AimForge DOCS
Pricing Login
docs / http api / settings write

PATCH /api/settings

Updates one or more numeric settings. Changes take effect immediately — they mirror to the GUI and are picked up by the pipeline within roughly 50ms.

Request

PATCH /api/settings HTTP/1.1
Host: localhost:4242
Content-Type: application/json

{
  "sensitivity": 0.15
}

The body is a JSON object. Keys are setting names (matching var= declarations in your script); values must be numeric.

You can patch a single setting or multiple at once:

{
  "sensitivity": 0.15,
  "fov":         480.0,
  "delay":       20.0
}

Response

200 OK — returns the full updated settings map (not just the keys you changed):

{
  "sensitivity": 0.15,
  "fov":         480.0,
  "delay":       20.0
}

This lets you immediately confirm the new state without a follow-up GET.

Validation & errors

400 Bad Request — returned when the input fails validation. The response body is:

{ "error": "<description>" }
Condition Error message
Empty body Empty body
Malformed JSON Invalid JSON
Unknown setting key Unknown setting key: 'foo'
Non-numeric value Value for 'sensitivity' must be a number

Validation rules:

Examples

curl

curl -X PATCH http://localhost:4242/api/settings \
     -H "Content-Type: application/json" \
     -d '{"sensitivity": 0.15}'

Multi-key:

curl -X PATCH http://localhost:4242/api/settings \
     -H "Content-Type: application/json" \
     -d '{"sensitivity": 0.15, "fov": 480, "delay": 20}'

JavaScript

await fetch('http://localhost:4242/api/settings', {
  method: 'PATCH',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ sensitivity: 0.15 }),
});

PowerShell

$body = @{ sensitivity = 0.15 } | ConvertTo-Json
Invoke-RestMethod `
  -Uri http://localhost:4242/api/settings `
  -Method Patch `
  -ContentType 'application/json' `
  -Body $body

Notes

See also