Server REST Settings Update

Updates server REST API settings.

Request

Property Value
Method PATCH
URL /api/server/settings/rest
Content-Type application/json
Authentication Bearer Token

Request Body

Parameter Type Required Description
data.attributes.apiKey string No API key for authentication
data.attributes.ipWhiteList string[] No List of whitelisted IP addresses
data.attributes.corsSettings.enabled boolean No CORS enabled
data.attributes.corsSettings.allowedOrigins string[] No List of allowed CORS origins

Example Request

{
  "data": {
    "attributes": {
      "apiKey": "my-secret-api-key",
      "ipWhiteList": [],
      "corsSettings": {
        "enabled": false
      }
    }
  }
}

Response

Status Codes

Code Description
200 Success - Settings updated
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid or missing token
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error

Successful Response (200)

{
  "data": {
    "attributes": {
      "enabled": {
        "editable": true,
        "value": true
      },
      "apiKey": {
        "editable": true,
        "value": "xxxxx"
      },
      "ipWhiteList": {
        "editable": true,
        "value": []
      },
      "corsSettings": {
        "enabled": {
          "editable": true,
          "value": false
        },
        "allowedOrigins": {
          "editable": true,
          "value": ["*"]
        }
      }
    }
  },
  "meta": {
    "executionTime": 25,
    "generatedAt": 1764852311256
  },
  "message": "REST Settings have been updated"
}

Response Body

REST Settings

Parameter Type Description
data.attributes.enabled.value boolean REST API enabled
data.attributes.enabled.editable boolean Indicates if the field can be modified
data.attributes.enabled.lockedBy string Locked by environment variable (if present)
data.attributes.apiKey.value string API key for authentication
data.attributes.apiKey.editable boolean Indicates if the field can be modified
data.attributes.apiKey.lockedBy string Locked by environment variable (if present)
data.attributes.ipWhiteList.value string[] List of whitelisted IP addresses
data.attributes.ipWhiteList.editable boolean Indicates if the field can be modified
data.attributes.ipWhiteList.lockedBy string Locked by environment variable (if present)
data.attributes.corsSettings.enabled.value boolean CORS enabled
data.attributes.corsSettings.enabled.editable boolean Indicates if the field can be modified
data.attributes.corsSettings.enabled.lockedBy string Locked by environment variable (if present)
data.attributes.corsSettings.allowedOrigins.value string[] List of allowed CORS origins
data.attributes.corsSettings.allowedOrigins.editable boolean Indicates if the field can be modified
data.attributes.corsSettings.allowedOrigins.lockedBy string Locked by environment variable (if present)
message string Response status message

Metadata

Parameter Type Description
meta.executionTime integer Request processing time in milliseconds
meta.generatedAt integer Response generation timestamp (Unix timestamp in ms)

Error Response (4xx/5xx)

{
  "message": "Error message"
}

Error Response Body

Parameter Type Description
message string Human-readable error message