Associate a request header with a resource
Define which request headers are expected for each resource within a scripted REST API.
Before you begin
A REST API resource and a request header must already be defined within the scripted REST API.
Role required: web_service_admin
About this task
The 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.
Procedure
- Create a Scripted REST Header Association record in one of the following ways
|
Option |
Procedure |
|---|---|
|
Navigate through a scripted REST API record |
|
|
Navigate directly to a new Scripted REST Header Association record |
Navigate to All > Filter and enter |
-
In the API resource field, select or enter the API resource the request header should be associated with.
If you navigated to a new Scripted REST Header Association record through a scripted REST API record, API resource is pre-populated.
-
Select Submit.
Result
The 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.
Parent Topic:Create a scripted REST API
---
title: Associate a request header with a resource
description: Define which request headers are expected for each resource within a scripted REST API.
locale: en-US
canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/rest-api-explorer/associate-header-api-resource.html
release: australia
product: REST API Explorer
classification: rest-api-explorer
topic_type: task
last_updated: "2026-09-10"
reading_time_minutes: 1
breadcrumb: [Create a scripted REST API, Scripted REST APIs, REST APIs, Web services, API implementation, API implementation and reference]
---
# Associate a request header with a resource
Define which request headers are expected for each resource within a scripted REST API.
## Before you begin
A REST API resource and a request header must already be defined within the scripted REST API.
Role required: web\_service\_admin
## About this task
The 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).
## Procedure
1. Create a Scripted REST Header Association record in one of the following ways
<table id="choicetable_fv4_myc_j3c"><thead><tr><th align="left" id="d330976e66">
Option
</th><th align="left" id="d330976e69">
Procedure
</th></tr></thead><tbody><tr><td id="d330976e75">
**Navigate through a scripted REST API record**
</td><td>
1. Navigate to **All** > **System Web Services** > **Scripted REST APIs**.
2. Select a scripted REST API record.
3. In the **Resources** related list, select a resource.
4. In the **Request Header Associations** tab, select **New**.
</td></tr><tr><td id="d330976e120">
**Navigate directly to a new Scripted REST Header Association record**
</td><td>
Navigate to **All** > **Filter** and enter `sys_ws_header_map.form`.
</td></tr></tbody>
</table>2. In the **API request header** field, select or enter the request header to associate with the resource.
3. In the **API resource** field, select or enter the API resource the request header should be associated with.
If you navigated to a new Scripted REST Header Association record through a scripted REST API record, **API resource** is pre-populated.
4. Select **Submit**.
## Result
The 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).
**Parent Topic:**[Create a scripted REST API](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/rest-api-explorer/t_CreateAScriptedRESTService.md)
| title | Associate a request header with a resource |
| description | Define which request headers are expected for each resource within a scripted REST API. |
| locale | en-US |
| canonical_url | https://www.servicenow.com/docs/r/australia/api-reference/rest-api-explorer/associate-header-api-resource.html |
| release | australia |
| product | REST API Explorer |
| classification | rest-api-explorer |
| topic_type | task |
| last_updated | 2026-09-10 |
| reading_time_minutes | 1 |
| breadcrumb | Create a scripted REST APIScripted REST APIsREST APIsWeb servicesAPI implementationAPI implementation and reference |