{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":438,"path":"api-reference/rest-api-explorer/t_DefineRESTServiceHeaders.md","title":"Define a scripted REST API request header","bundle":null,"doc_type":null,"release":"australia","body":"\n# Define a scripted REST API request header\n\nDefine scripted REST API requestheaders to control which headers the API accepts.\n\n## Before you begin\n\nThere must be a scripted REST API defined before you can create requestheaders.\n\nRole required: web\\_service\\_admin\n\n## About this task\n\nThe following procedure describes the process for manual definition of a scripted REST API request header. For details about automatically generating request header definitions in non-production instances, see [Automatically generate API request definitions](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/autogenerate-api-request-definitions.md).\n\n## Procedure\n\n1.  Navigate to **All** &gt; **System Web Services** &gt; **Scripted REST APIs**.\n\n2.  Select a scripted REST API record.\n\n3.  In the **Request Headers** related list, select **New**.\n\n4.  Enter a **Header name**.\n\n5.  Enter a **Short description** and **Example value** to explain how to use the header.\n\n6.  Select **Submit**.\n\n7.  From the Request Headers tab, locate the header name and set **Is required** to \"true\" to document this request header as required.\n\n    **Note:** If you set **Is required** to \"true\", the scripted REST service doesn't enforce requiring the header. To enforce requiring a header, you must add logic to the scripted REST API resource that rejects requests that are missing the required headers.\n\n\n## What to do next\n\nAfter defining available headers, associate the headers with a scripted REST resource. For more information, see [Associate a request header with a resource](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/associate-header-api-resource.md).\n\n**Parent Topic:**[Create a scripted REST API](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/t_CreateAScriptedRESTService.md)\n\n"}}