You can define a CORS rule to control which domains can access REST API endpoints and other web resources.

Before you begin

Role required: cors_rule_admin, web_service_admin, or admin

Procedure

  1. Navigate to All > System Web Services > REST > CORS Rules.
  2. Select New.
  3. On the form, fill in the fields.
  4. Select the HTTP Methods tab and the HTTP methods allowed.
    Only the selected methods can be called from the specified domain.
  5. Select the HTTP Headers tab and fill in the fields.
    Table 2. HTTP Headers section
    Field Description
    Access-Control-Allow-Credentials Option to allow sending credentials in the request. If this option is enabled, you can't use a wildcard in the Domain field.
    Access-Control-Allow-Headers Enter a comma-separated list of HTTP headers to allow in the request or the wildcard character (*) to allow any header.
    Access-Control-Expose-Headers Enter a comma-separated list of HTTP headers to send in the response.
  6. Select Submit.