{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":405,"path":"api-reference/rest-api-explorer/add-schema-rest-api-request.md","title":"Define an API resource request structure","bundle":null,"doc_type":null,"release":"australia","body":"\n# Define an API resource request structure\n\nAdd a schema to a REST request record to define the request's expected data structure.\n\n## Before you begin\n\nYou must define at least one REST API resource and at least one schema in the REST API before defining the request structure.\n\nRole required: web\\_service\\_admin\n\n## About this task\n\nThe following procedure describes the process for manually adding a request schema to a resource. For details about automatically generating request schema 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 a new REST Request record in one of the following ways.\n\n    If you navigate through a scripted REST API record, most fields in the REST Request record are pre-populated.\n\n<table id=\"choicetable_ehs_g3d_j3c\"><thead><tr><th align=\"left\" id=\"d467176e70\">\n\nOption\n\n</th><th align=\"left\" id=\"d467176e73\">\n\nProcedure\n\n</th></tr></thead><tbody><tr><td id=\"d467176e79\">\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 Schema** tab, select **New**.\n\n\n</td></tr><tr><td id=\"d467176e124\">\n\n**Navigate directly to a new REST Request record**\n\n</td><td>\n\n1.  Navigate to **All** &gt; **Filter** and enter `sys_ws_request_spec.form`.\n2.  In the **API** field, select an API.\n3.  In the **API resource** field, select the API resource whose request schema you want to specify.\n4.  In the **Version** field, select the API resource version.\n5.  In the **Http method** field, select the method whose request schema you want to specify \\(for example, PUT\\).\n\n\n</td></tr></tbody>\n</table>2.  In the **Schema** field, find or enter the schema you want to define the structure and format of the resource's request body.\n\n3.  In the **Description** field, summarize the expected format of the REST request.\n\n4.  Select **Submit**.\n\n\n## Result\n\nThe schema you used to define the request body structure is included in the exportable OpenAPI specification in the REST API Explorer. 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"}}