{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":407,"path":"api-reference/rest-api-explorer/associate-header-api-resource.md","title":"Associate a request header with a resource","bundle":null,"doc_type":null,"release":"australia","body":"\n# Associate a request header with a resource\n\nDefine which request headers are expected for each resource within a scripted REST API.\n\n## Before you begin\n\nA REST API resource and a request header must already be defined within the scripted REST API.\n\nRole required: web\\_service\\_admin\n\n## About this task\n\nThe following procedure describes the process for manually associating a REST API request header with a resource. 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.  Create a Scripted REST Header Association record in one of the following ways\n\n<table id=\"choicetable_fv4_myc_j3c\"><thead><tr><th align=\"left\" id=\"d317164e67\">\n\nOption\n\n</th><th align=\"left\" id=\"d317164e70\">\n\nProcedure\n\n</th></tr></thead><tbody><tr><td id=\"d317164e76\">\n\n**Navigate through a scripted REST API record**\n\n</td><td>\n\n1.  Navigate to **All** &gt; **System Web Services** &gt; **Scripted REST APIs**.\n2.  Select a scripted REST API record.\n3.  In the **Resources** related list, select a resource.\n4.  In the **Request Header Associations** tab, select **New**.\n\n\n</td></tr><tr><td id=\"d317164e121\">\n\n**Navigate directly to a new Scripted REST Header Association record**\n\n</td><td>\n\nNavigate to **All** &gt; **Filter** and enter `sys_ws_header_map.form`.\n\n</td></tr></tbody>\n</table>2.  In the **API request header** field, select or enter the request header to associate with the resource.\n\n3.  In the **API resource** field, select or enter the API resource the request header should be associated with.\n\n    If you navigated to a new Scripted REST Header Association record through a scripted REST API record, **API resource** is pre-populated.\n\n4.  Select **Submit**.\n\n\n## Result\n\nThe request headers that you added are included in the exportable OpenAPI specification in the REST API Explorer with a \"type: string\" schema definition. For more information about exporting OpenAPI specifications, see [Export to OpenAPI specification](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/export-openapi-specification.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"}}