---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/api-reference

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Define a schema

# Define a REST API schema {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute to read  
Specify the expected data structure for requests or responses within a REST API by defining a schema.{#define-scripted-rest-api-schema__patch-rn-ap1-1}

## 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://servicenow-prod.fluidtopics.net/VM1BPwWaXiyDxp0N9N0zPg "Export a REST API as an OpenAPI specification to import it into another web services tool.").

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://servicenow-prod.fluidtopics.net/PMIDsmNMHbcgTE5adyjmIg "Use sample requests made to an API resource to generate request header associations, query parameter associations, and a request schema for that resource.").{#define-scripted-rest-api-schema__patch-rn-ap1-2}

## Procedure

1. Create a REST Schema in one of the following ways.

   | Option | Procedure |
   | Navigate through a scripted REST API record | 1. Navigate to AllSystem Web ServicesScripted REST APIs. 2. Select a scripted REST API record. 3. In the Schemas related list, select New. {#define-scripted-rest-api-schema__ol_dlh_5zc_j3c} |
   | Navigate directly to a new REST Schema record | 1. Navigate to AllFilter and enter <kbd class="ph userinput">sys_ws_schema.form</kbd>. 2. In the API field, select or enter the API to associate with the schema. {#define-scripted-rest-api-schema__ol_hkp_wqc_l3c} |
   |-|-|

   {#define-scripted-rest-api-schema__choicetable_kbq_szc_j3c}
2. In the Name field, enter a name for the schema.
3. In the Schema field, define the data type and structure of the new schema using the [OpenAPI version 3.0.1 format](https://spec.openapis.org/oas/v3.0.1.html).  
   For example, the following entry specifies that the schema is an object that contains a first name. The first name is a string data type.

       { "type": "object", "properties": { "firstName": { "type": "string" } } }

4. Select an OpenAPI version.
5. In the Description field, summarize the expected structure of the new schema.
6. Select Submit.

## What to do next

Define additional schemas as needed.
Use
the schemas to specify the expected structure and format in a REST request or response. For more information, see [Define an API resource request structure](https://servicenow-prod.fluidtopics.net/SlOjLdlA77b3Oq0NmV~CEA "Add a schema to a REST request record to define the request's expected data structure.") or [Define an API resource response structure](https://servicenow-prod.fluidtopics.net/Mg5xvaxmIDTay7vrHoVVjQ "Add a schema and relevant response headers to a REST response to define the response's expected data structure.").

*[\>]: and then


