--- title: Define a REST API schema description: Specify the expected data structure for requests or responses within a REST API by defining a schema. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/api-reference/rest-api-explorer/define-scripted-rest-api-schema.html release: australia product: REST API Explorer classification: rest-api-explorer topic_type: task last_updated: "2026-03-12" reading_time_minutes: 2 breadcrumb: [Create a scripted REST API, Scripted REST APIs, REST APIs, Web services, API implementation, API implementation and reference] --- # Define a REST API schema Specify the expected data structure for requests or responses within a REST API by defining a schema. ## Before you begin Role required: web\_service\_admin ## About this task Schemas are records that define the structure and format of request and response bodies and headers for a REST API in the OpenAPI 3.0.1 format. When you define a schema in the ServiceNow AI Platform, the schema is used to define the structure of requests and responses within the associated REST API. The schema data for the requests and responses is then available in the exportable OpenAPI specification for the API. 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). The following procedure describes the process for manual schema definition. 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). ## Procedure 1. Create a REST Schema in one of the following ways.
| Option | Procedure |
|---|---|
| **Navigate through a scripted REST API record** | 1. Navigate to **All** > **System Web Services** > **Scripted REST APIs**. 2. Select a scripted REST API record. 3. In the **Schemas** related list, select **New**. |
| **Navigate directly to a new REST Schema record** | 1. Navigate to **All** > **Filter** and enter `sys_ws_schema.form`. 2. In the **API** field, select or enter the API to associate with the schema. |