Schema Registry API

concept brazil Updated Sep 10, 2026 19 min read schema_registry-api.md
Raw file servicenow.com

Use the Schema Registry API to retrieve Avro schemas generated by Stream Connect, along with their subject and version history.

This API is a ServiceNow implementation of the Schema Registry API for Confluent Platform. Avro schemas are generated by Stream Connect for tables published to Kafka. This API is read-only; schemas and their evolution history are generated and maintained internally by Stream Connect.

This API requires the ServiceNow IntegrationHub Stream Connect Schema plugin (com.glide.hub.stream_connect.schema). This plugin provides the following tables:

  • Table Message Schema [sys_table_message_schema]: Stores each generated Avro schema.
  • Table Message Schema Evolution [sys_table_message_schema_evolution]: Tracks the subject and version for each schema. Schema subjects correspond to a table's Stream Connect topic name.

The calling user must have the message_schema_viewer role.

Parent Topic:REST API reference

Schema Registry - GET /schemas

Retrieves all schemas. Optional query parameters can be used for filtering and pagination.

URL format

Default URL: /api/now/schemaregistry/schemas

Supported request parameters

Name Description
None

Name

Description

latestOnly

Flag that indicates whether to return all schema versions for each subject in the response.Valid values:

  • true: Returns only the latest schema versions for each subject in the response.
  • false: Returns all schema versions for each subject in the response.

Default: false

Data type: Boolean

limit

Maximum number of records to return. For requests that exceed this number of records, use the offset parameter to paginate record retrieval.Default: 10,000

Data type: Number

offset

Starting index at which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable chunks.Default: 0

Data type: Number

subjectPrefix

Restrict results to subject names starting with this string.Default: No filtering on subject names.

Data type: String

|Name|Description| |----|-----------| |None| |

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Header

Description

Accept

Data format of the response body. Supported types: application/vnd.schemaregistry.v1+json, application/vnd.schemaregistry+json, and application/json. Default: application/json

|Header|Description| |------|-----------| |None| |

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status code Description
200 Successful. The request was successfully processed.
403 Forbidden. The user doesn't have access rights to the specified record.
500 Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.

Response body parameters (JSON)

Name

Description

deleted

Flag that indicates whether the schema entry is marked as deleted.Valid values:

  • true: The schema entry is marked as deleted.
  • false: The schema entry isn't marked as deleted.

Data type: Boolean

guid

Globally unique identifier of the schema in the format <subject>:<version>.Data type: String

id

The numeric schema ID.Data type: Number

schema

The Avro schema definition as a JSON-encoded string.Data type: String

schemaType

The schema format (Avro).Data type: String

subject

The subject name, corresponding to the table's Stream Connect topic.Data type: String

ts

The creation timestamp for the schema record in epoch milliseconds.Data type: Number

version

The version number for the schema under this subject.Data type: Number

### cURL request

This example retrieves every registered schema entry.

Shell
curl -s "https://instance.servicenow.com/api/now/schemaregistry/schemas" \  --request GET \  --header "Accept:application/vnd.schemaregistry.v1+json" \  --user 'username':'password'

Response body.

JSON
[  {    "subject": "sn_incident",    "version": 1,    "id": 1879111090,    "guid": "sn_incident:1",    "schemaType": "AVRO",    "schema": "{\"type\":\"record\",\"name\":\"stream_producer_table\", ... }",    "ts": 1781633080000,    "deleted": false  },  {    "subject": "sn_incident",    "version": 2,    "id": 344617968,    "guid": "sn_incident:2",    "schemaType": "AVRO",    "schema": "{\"type\":\"record\",\"name\":\"stream_producer_table\", ... }",    "ts": 1782071298000,    "deleted": false  }]

Schema Registry - GET /schemas/ids/{id}

Retrieves the full schema entry for the specified schema ID.

URL format

Default URL: /api/now/schemaregistry/schemas/ids/{id}

Supported request parameters

Name

Description

id

Numeric schema ID.Table: Table Message Schema [sys_table_message_schema]

Field: Schema ID

Data type: Number

Name

Description

subject

Scopes the schema lookup to the specified subject context.Default: No filtering on subject. Returns the latest version registered for the schema across all subjects that use it.

Data type: String

|Name|Description| |----|-----------| |None| |

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Header

Description

Accept

Data format of the response body. Supported types: application/vnd.schemaregistry.v1+json, application/vnd.schemaregistry+json, and application/json. Default: application/json

|Header|Description| |------|-----------| |None| |

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status code Description
200 Successful. The request was successfully processed.
403 Forbidden. The user doesn't have access rights to the specified record.
404 Not found. The requested item wasn't found.
500 Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.

Response body parameters (JSON)

Name

Description

deleted

Flag that indicates whether the schema entry is marked as deleted.Valid values:

  • true: The schema entry is marked as deleted.
  • false: The schema entry isn't marked as deleted.

Data type: Boolean

guid

Globally unique identifier of the schema in the format <subject>:<version>.Data type: String

schema

The Avro schema definition as a JSON-encoded string.Data type: String

subject

The subject name, corresponding to the table's Stream Connect topic.Data type: String

ts

The creation timestamp for the schema record in epoch milliseconds.Data type: Number

version

The version number for the schema under this subject.Data type: Number

### cURL request

This example retrieves the schema entry for schema 1879111090.

Shell
curl -s "https://instance.servicenow.com/api/now/schemaregistry/schemas/ids/1879111090" \  --request GET \  --header "Accept:application/vnd.schemaregistry.v1+json" \  --user 'username':'password'

Response body.

JSON
{  "subject": "sn_incident",  "version": 1,  "schema": "{\"type\":\"record\",\"name\":\"stream_producer_table\", ... }",  "guid": "sn_incident:1",  "ts": 1781633080000,  "deleted": false}

Schema Registry - GET /schemas/ids/{id}/schema

Retrieves the Avro schema definition string for the specified schema ID.

To retrieve the full schema entry, including subject and version information, call GET /schemas/ids/{id}.

URL format

Default URL: /api/now/schemaregistry/schemas/ids/{id}/schema

Supported request parameters

Name

Description

id

Numeric schema ID.Table: Table Message Schema [sys_table_message_schema]

Field: Schema ID

Data type: Number

Name

Description

subject

Scopes the schema lookup to the specified subject context.Default: No filtering on subject. Returns the latest version registered for the schema across all subjects that use it.

Data type: String

|Name|Description| |----|-----------| |None| |

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Header

Description

Accept

Data format of the response body. Supported types: application/vnd.schemaregistry.v1+json, application/vnd.schemaregistry+json, and application/json. Default: application/json

|Header|Description| |------|-----------| |None| |

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status code Description
200 Successful. The request was successfully processed.
403 Forbidden. The user doesn't have access rights to the specified record.
404 Not found. The requested item wasn't found.
500 Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.

Response body parameters (JSON)

Name Description
String The Avro schema definition as an unescaped JSON-encoded string.

cURL request

This example retrieves the schema string for schema 1879111090.

Shell
curl -s "https://instance.servicenow.com/api/now/schemaregistry/schemas/ids/1879111090/schema" \  --request GET \  --header "Accept:application/vnd.schemaregistry.v1+json" \  --user 'username':'password'

Response body.

PowerShell
"{\"type\":\"record\",\"name\":\"stream_producer_table\",\"fields\":[ ... ]}"

Schema Registry - GET /schemas/ids/{id}/subjects

Retrieves all subjects associated with the specified schema ID.

URL format

Default URL: /api/now/schemaregistry/schemas/ids/{id}/subjects

Supported request parameters

Name

Description

id

Numeric schema ID.Table: Table Message Schema [sys_table_message_schema]

Field: Schema ID

Data type: Number

Name

Description

limit

Maximum number of records to return. For requests that exceed this number of records, use the offset parameter to paginate record retrieval.Default: No limit

Data type: Number

offset

Starting index at which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable chunks.Default: 0

Data type: Number

subject

Scopes the schema lookup to the specified subject context. Returns only the specified subject, if associated with the schema.Default: No filtering on subject. Returns all subjects associated with the specified schema ID.

Data type: String

|Name|Description| |----|-----------| |None| |

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Header

Description

Accept

Data format of the response body. Supported types: application/vnd.schemaregistry.v1+json, application/vnd.schemaregistry+json, and application/json. Default: application/json

|Header|Description| |------|-----------| |None| |

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status code Description
200 Successful. The request was successfully processed.
403 Forbidden. The user doesn't have access rights to the specified record.
404 Not found. The requested item wasn't found.
500 Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.

Response body parameters (JSON)

Name Description
Array Array of subject name strings.

cURL request

This example retrieves the subjects associated with schema 1879111090.

Shell
curl -s "https://instance.servicenow.com/api/now/schemaregistry/schemas/ids/1879111090/subjects" \  --request GET \  --header "Accept:application/vnd.schemaregistry.v1+json" \  --user 'username':'password'

Response body.

JSON
["sn_incident"]

Schema Registry - GET /schemas/ids/{id}/versions

Retrieves all subject-version pairs associated with a specified schema ID.

A schema can have multiple versions and be associated with multiple subjects. This endpoint returns every subject-version pair associated with the schema ID as a JSON array, ordered by subject and then by version.

URL format

Default URL: /api/now/schemaregistry/schemas/ids/{id}/versions

Supported request parameters

Name

Description

id

Numeric schema ID.Table: Table Message Schema [sys_table_message_schema]

Field: Schema ID

Data type: Number

Name

Description

subject

Scopes the schema lookup to the specified subject context. Returns only versions for the specified subject.Default: No filtering on subject. Returns all subject-version pairs associated with a specified schema ID.

Data type: String

|Name|Description| |----|-----------| |None| |

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Header

Description

Accept

Data format of the response body. Supported types: application/vnd.schemaregistry.v1+json, application/vnd.schemaregistry+json, and application/json. Default: application/json

|Header|Description| |------|-----------| |None| |

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status code Description
200 Successful. The request was successfully processed.
403 Forbidden. The user doesn't have access rights to the specified record.
404 Not found. The requested item wasn't found.
500 Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.

Response body parameters (JSON)

The response is a JSON array. Each element is an object with these fields, listed alphabetically:

Name

Description

Array

JSON array of objects, each containing a subject-version pair.

<Array>.subject

The subject name.Data type: String

<Array>.version

The version number for the schema registered under this subject.Data type: Number

### cURL request

This example retrieves all subject-version pairs for schema 1879111090.

Shell
curl -s "https://instance.servicenow.com/api/now/schemaregistry/schemas/ids/1879111090/versions" \  --request GET \  --header "Accept:application/vnd.schemaregistry.v1+json" \  --user 'username':'password'

Response body.

JSON
[  {    "subject": "sn_incident",    "version": 1  }]

Schema Registry - GET /subjects

Retrieves all subjects from the schema registry.

This endpoint returns a list of distinct subject names that have at least one registered schema version. Subjects are registered in the Table Message Schema Evolution [sys_table_message_schema_evolution] table.

URL format

Default URL: /api/now/schemaregistry/subjects

Supported request parameters

Name Description
None

Name

Description

limit

Maximum number of records to return. For requests that exceed this number of records, use the offset parameter to paginate record retrieval.Default: No limit

Data type: Number

offset

Starting index at which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable chunks.Default: 0

Data type: Number

subjectPrefix

Restrict results to subject names starting with this string.Default: No filtering on subject names.

Data type: String

|Name|Description| |----|-----------| |None| |

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Header

Description

Accept

Data format of the response body. Supported types: application/vnd.schemaregistry.v1+json, application/vnd.schemaregistry+json, and application/json. Default: application/json

|Header|Description| |------|-----------| |None| |

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status code Description
200 Successful. The request was successfully processed.
403 Forbidden. The user doesn't have access rights to the specified record.
500 Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.

Response body parameters (JSON)

Name Description
Array Array of subject name strings.

cURL request

This example retrieves all registered subjects.

Shell
curl -s "https://instance.servicenow.com/api/now/schemaregistry/subjects" \  --request GET \  --header "Accept:application/vnd.schemaregistry.v1+json" \  --user 'username':'password'

Response body.

JSON
["sn_everything_table","sn_incident","sn_problem","sn_sys_user"]

Schema Registry - GET /subjects/{subject}/versions

Retrieves every version number registered under the specified subject.

URL format

Default URL: /api/now/schemaregistry/subjects/{subject}/versions

Supported request parameters

Name

Description

subject

Subject name.Data type: String

Name

Description

limit

Maximum number of records to return. For requests that exceed this number of records, use the offset parameter to paginate record retrieval.Default: 10,000

Data type: Number

offset

Starting index at which to begin retrieving records. Use this value to paginate record retrieval. This functionality enables the retrieval of all records, regardless of the number of records, in small manageable chunks.Default: 0

Data type: Number

|Name|Description| |----|-----------| |None| |

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Header

Description

Accept

Data format of the response body. Supported types: application/vnd.schemaregistry.v1+json, application/vnd.schemaregistry+json, and application/json. Default: application/json

|Header|Description| |------|-----------| |None| |

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status code Description
200 Successful. The request was successfully processed.
403 Forbidden. The user doesn't have access rights to the specified record.
404 Not found. The requested item wasn't found.
500 Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.

Response body parameters (JSON)

Name Description
Array Array of version numbers in ascending order.

cURL request

This example retrieves the registered versions for the sn_incident subject.

Shell
curl -s "https://instance.servicenow.com/api/now/schemaregistry/subjects/sn_incident/versions" \  --request GET \  --header "Accept:application/vnd.schemaregistry.v1+json" \  --user 'username':'password'

Response body.

JSON
[1,2,3]

Schema Registry - GET /subjects/{subject}/versions/{version}

Retrieves the full schema entry for the specified subject and version.

URL format

Default URL: /api/now/schemaregistry/subjects/{subject}/versions/{version}

Supported request parameters

Name

Description

subject

Subject name.Data type: String

version

Version number. To use the latest version, pass latest or -1. To use a specific version number, pass a positive integer.Data type: String

|Name|Description| |----|-----------| |None| |
Name Description
None

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Header

Description

Accept

Data format of the response body. Supported types: application/vnd.schemaregistry.v1+json, application/vnd.schemaregistry+json, and application/json. Default: application/json

|Header|Description| |------|-----------| |None| |

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status code Description
200 Successful. The request was successfully processed.
403 Forbidden. The user doesn't have access rights to the specified record.
404 Not found. The requested item wasn't found.
422 Unprocessable content. The value provided for version isn't valid.
500 Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.

Response body parameters (JSON)

Name

Description

deleted

Flag that indicates whether the schema entry is marked as deleted.Valid values:

  • true: The schema entry is marked as deleted.
  • false: The schema entry isn't marked as deleted.

Data type: Boolean

guid

Globally unique identifier of the schema in the format <subject>:<version>.Data type: String

id

The numeric schema ID.Data type: Number

schema

The Avro schema definition as a JSON-encoded string.Data type: String

schemaType

The schema format (Avro).Data type: String

subject

The subject name, corresponding to the table's Stream Connect topic.Data type: String

ts

The creation timestamp for the schema record in epoch milliseconds.Data type: Number

version

The version number for the schema under this subject.Data type: Number

### cURL request

This example retrieves the schema entry for v1 of the sn_incident subject.

Shell
curl -s "https://instance.servicenow.com/api/now/schemaregistry/subjects/sn_incident/versions/1" \  --request GET \  --header "Accept:application/vnd.schemaregistry.v1+json" \  --user 'username':'password'

Response body.

JSON
{  "subject": "sn_incident",  "id": 1879111090,  "version": 1,  "schemaType": "AVRO",  "schema": "{\"type\":\"record\",\"name\":\"stream_producer_table\", ... }",  "guid": "sn_incident:1",  "ts": 1781633080000,  "deleted": false}

Schema Registry - GET /subjects/{subject}/versions/{version}/schema

Retrieves the Avro schema definition string for a specified subject and version.

To retrieve the full schema entry, including subject and version information, call GET /subjects/{subject}/versions/{version}.

URL format

Default URL: /api/now/schemaregistry/subjects/{subject}/versions/{version}/schema

Supported request parameters

Name

Description

subject

Subject name.Data type: String

version

Version number. To use the latest version, pass latest or -1. To use a specific version number, pass a positive integer.Data type: String

|Name|Description| |----|-----------| |None| |
Name Description
None

Headers

The following request and response headers apply to this HTTP action only, or apply to this action in a distinct way. For a list of general headers used in the REST API, see Supported REST API headers.

Header

Description

Accept

Data format of the response body. Supported types: application/vnd.schemaregistry.v1+json, application/vnd.schemaregistry+json, and application/json. Default: application/json

|Header|Description| |------|-----------| |None| |

Status codes

The following status codes apply to this HTTP action. For a list of possible status codes used in the REST API, see REST API HTTP response codes.

Status code Description
200 Successful. The request was successfully processed.
403 Forbidden. The user doesn't have access rights to the specified record.
404 Not found. The requested item wasn't found.
422 Unprocessable content. The value provided for version isn't valid.
500 Internal server error. An unexpected error occurred while processing the request. The response contains additional information about the error.

Response body parameters (JSON)

Name Description
String The Avro schema definition as a raw unescaped string.

cURL request

This example retrieves the schema definition string for v1 of the sn_incident subject.

Shell
curl -s "https://instance.servicenow.com/api/now/schemaregistry/subjects/sn_incident/versions/1/schema" \  --request GET \  --header "Accept:application/vnd.schemaregistry.v1+json" \  --user 'username':'password'

Response body.

Text
{"type":"record","name":"stream_producer_table","fields":[ ... ]}
Keywords Stream Connectschema registryKafkaAvro schemaschema evolution
Search documentation
Search document titles and file paths on the brazil branch