Create or update custom headers
const url = 'https://dashboard.quantcdn.io/api/v2/organizations/test-org/projects/test-project/custom-headers';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"headers":{"X-Custom-Header":"value","Cache-Control":"max-age=3600"}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://dashboard.quantcdn.io/api/v2/organizations/test-org/projects/test-project/custom-headers \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "headers": { "X-Custom-Header": "value", "Cache-Control": "max-age=3600" } }'Replaces the custom headers of the project. On a project that Security > CSP manages, the CSP header names in the request are ignored and their stored values stay; the response header X-Quant-Warning then names them. The status is still 200.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Organization identifier
Example
test-orgProject identifier
Example
test-projectRequest Bodyrequired
Section titled “Request Bodyrequired”object
Custom headers
object
Example
{ "X-Custom-Header": "value", "Cache-Control": "max-age=3600"}Responses
Section titled “Responses”The request has succeeded. The body is the stored header map. When Security > CSP manages the project, the CSP header names of the request (Content-Security-Policy, Content-Security-Policy-Report-Only, Reporting-Endpoints) are not changed, and the response header X-Quant-Warning names them.
Custom headers as key-value pairs
object
Example
{ "X-Custom-Header": "value", "Cache-Control": "max-age=3600"}The server could not understand the request due to invalid syntax.
object
Error message
Error flag
Example
{ "message": "The requested resource was not found", "error": true}Access is forbidden.
object
Error message
Error flag
Example
{ "message": "The requested resource was not found", "error": true}