Skip to main content

schemas

Creates, updates, deletes, gets or lists a schemas resource.

Overview

Nameschemas
TypeResource
Idpagerduty.enrichment.schemas

Fields

The following fields are returned by SELECT queries:

The requested enrichment schema.

NameDatatypeDescription
idstring (uuid)Unique identifier for the enrichment schema.
namestringDisplay name of the enrichment schema.
created_atstring (date-time)Timestamp when the schema was created.
deleted_atstring (date-time)Timestamp when the schema was deleted, or null if it has not been deleted.
descriptionstringDescription of this set of enrichment data.
fieldsarrayThe fields that make up the schema, including both query and enriched fields. A schema must contain 1-3 query fields and at least one enriched field, up to a maximum of 25 fields. Field names are unique within the schema (case-insensitive).
integration_typestringThe source of the enrichment schema. CSV schemas are created and populated through the schema and CSV-upload endpoints; SERVICENOW schemas are managed by the ServiceNow CMDB integration. Schemas created through the API are always CSV, and only CSV schemas can be deleted. (CSV, SERVICENOW)
typestringThe type of the resource. (example: enrichment_schema)
updated_atstring (date-time)Timestamp when the schema was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectschema_idRetrieves a specific enrichment schema by ID.<br /><br /><!-- theme: warning --><br /><br />> ### Early Access<br />> This API is in Early Access and may change at any time. Contact your PagerDuty account team to request access.<br /><br />Scoped OAuth requires: contextual_data.read<br />
listselectLists all enrichment schemas for the account.<br /><br /><!-- theme: warning --><br /><br />> ### Early Access<br />> This API is in Early Access and may change at any time. Contact your PagerDuty account team to request access.<br /><br />Scoped OAuth requires: contextual_data.read<br />
createinsertname, fieldsfilenameCreates an enrichment schema. Provide a JSON body to define the schema explicitly (returns 201), or upload a CSV file as multipart/form-data or text/csv to auto-generate a schema from the file's columns — the first column becomes a query field and the rest become enriched fields (returns 202 once the file is accepted for processing). A schema must include 1-3 query fields and at least one enriched field, up to 25 fields total, with unique (case-insensitive) field names. Schemas created through the API are always CSV, and an account may have at most 25 CSV schemas. CSV uploads are limited to 10 MB.<br /><br /><!-- theme: warning --><br /><br />> ### Early Access<br />> This API is in Early Access and may change at any time. Contact your PagerDuty account team to request access.<br /><br />Scoped OAuth requires: contextual_data.write<br />
updateupdateschema_id, schemaUpdates the name and/or description of an enrichment schema. At least one of name or description must be provided. Schema fields cannot be changed after creation.<br /><br /><!-- theme: warning --><br /><br />> ### Early Access<br />> This API is in Early Access and may change at any time. Contact your PagerDuty account team to request access.<br /><br />Scoped OAuth requires: contextual_data.write<br />
deletedeleteschema_idSoft-deletes an enrichment schema and returns the deleted schema. Only CSV schemas can be deleted; SERVICENOW schemas are managed by the ServiceNow CMDB integration.<br /><br /><!-- theme: warning --><br /><br />> ### Early Access<br />> This API is in Early Access and may change at any time. Contact your PagerDuty account team to request access.<br /><br />Scoped OAuth requires: contextual_data.write<br />

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
schema_idstring (uuid)The ID of the enrichment schema.
filenamestringThe filename for the CSV content. Required when creating a schema from a text/csv body; optional for text/csv record uploads. Ignored for multipart/form-data and JSON requests.

SELECT examples

Retrieves a specific enrichment schema by ID.<br /><br /><!-- theme: warning --><br /><br />> ### Early Access<br />> This API is in Early Access and may change at any time. Contact your PagerDuty account team to request access.<br /><br />Scoped OAuth requires: contextual_data.read<br />

SELECT
id,
name,
created_at,
deleted_at,
description,
fields,
integration_type,
type,
updated_at
FROM pagerduty.enrichment.schemas
WHERE schema_id = '{{ schema_id }}' -- required
;

INSERT examples

Creates an enrichment schema. Provide a JSON body to define the schema explicitly (returns 201), or upload a CSV file as multipart/form-data or text/csv to auto-generate a schema from the file's columns — the first column becomes a query field and the rest become enriched fields (returns 202 once the file is accepted for processing). A schema must include 1-3 query fields and at least one enriched field, up to 25 fields total, with unique (case-insensitive) field names. Schemas created through the API are always CSV, and an account may have at most 25 CSV schemas. CSV uploads are limited to 10 MB.<br /><br /><!-- theme: warning --><br /><br />> ### Early Access<br />> This API is in Early Access and may change at any time. Contact your PagerDuty account team to request access.<br /><br />Scoped OAuth requires: contextual_data.write<br />

INSERT INTO pagerduty.enrichment.schemas (
integration_type,
name,
description,
fields,
filename
)
SELECT
'{{ integration_type }}',
'{{ name }}' /* required */,
'{{ description }}',
'{{ fields }}' /* required */,
'{{ filename }}'
RETURNING
schema
;

UPDATE examples

Updates the name and/or description of an enrichment schema. At least one of name or description must be provided. Schema fields cannot be changed after creation.<br /><br /><!-- theme: warning --><br /><br />> ### Early Access<br />> This API is in Early Access and may change at any time. Contact your PagerDuty account team to request access.<br /><br />Scoped OAuth requires: contextual_data.write<br />

UPDATE pagerduty.enrichment.schemas
SET
schema = '{{ schema }}'
WHERE
schema_id = '{{ schema_id }}' --required
AND schema = '{{ schema }}' --required
RETURNING
schema;

DELETE examples

Soft-deletes an enrichment schema and returns the deleted schema. Only CSV schemas can be deleted; SERVICENOW schemas are managed by the ServiceNow CMDB integration.<br /><br /><!-- theme: warning --><br /><br />> ### Early Access<br />> This API is in Early Access and may change at any time. Contact your PagerDuty account team to request access.<br /><br />Scoped OAuth requires: contextual_data.write<br />

DELETE FROM pagerduty.enrichment.schemas
WHERE schema_id = '{{ schema_id }}' --required
;