Create CORS Policy
createCorsPolicyCreates a new CORS policy by specifying all required fields (origins, methods, headers, etc.) and returns the policy ID.
Instructions
Create a new CORS policy on the global AM CorsService. All seven policy fields are required. A user-facing policyId may optionally be supplied; if omitted, AM assigns one. The policy ID is returned in the success response.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| policyId | No | Optional user-facing identifier for the CORS policy. If omitted, AM assigns one. | |
| acceptedOrigins | Yes | Allowed origins (e.g. ["https://example.org"]) | |
| acceptedMethods | Yes | HTTP methods allowed during preflight | |
| acceptedHeaders | Yes | Non-simple request headers allowed during preflight | |
| exposedHeaders | Yes | Response headers exposed to the browser | |
| maxAge | Yes | Preflight cache duration in seconds | |
| allowCredentials | Yes | Whether to send Access-Control-Allow-Credentials: true on responses | |
| enabled | Yes | Whether the policy is enabled; if false, no CORS headers are added |