schemas
Creates, updates, deletes, gets or lists a schemas resource.
Overview
| Name | schemas |
| Type | Resource |
| Id | pagerduty.enrichment.schemas |
Fields
The following fields are returned by SELECT queries:
- get
- list
The requested enrichment schema.
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique identifier for the enrichment schema. |
name | string | Display name of the enrichment schema. |
created_at | string (date-time) | Timestamp when the schema was created. |
deleted_at | string (date-time) | Timestamp when the schema was deleted, or null if it has not been deleted. |
description | string | Description of this set of enrichment data. |
fields | array | The 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_type | string | The 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) |
type | string | The type of the resource. (example: enrichment_schema) |
updated_at | string (date-time) | Timestamp when the schema was last updated. |
The list of enrichment schemas for the account.
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique identifier for the enrichment schema. |
name | string | Display name of the enrichment schema. |
created_at | string (date-time) | Timestamp when the schema was created. |
deleted_at | string (date-time) | Timestamp when the schema was deleted, or null if it has not been deleted. |
description | string | Description of this set of enrichment data. |
fields | array | The 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_type | string | The 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) |
type | string | The type of the resource. (example: enrichment_schema) |
updated_at | string (date-time) | Timestamp when the schema was last updated. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | schema_id | 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 /> | |
list | select | Lists 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 /> | ||
create | insert | name, fields | filename | 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 /> |
update | update | schema_id, schema | 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 /> | |
delete | delete | schema_id | 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 /> |
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.
| Name | Datatype | Description |
|---|---|---|
schema_id | string (uuid) | The ID of the enrichment schema. |
filename | string | The 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
- get
- list
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
;
Lists 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 />
SELECT
id,
name,
created_at,
deleted_at,
description,
fields,
integration_type,
type,
updated_at
FROM pagerduty.enrichment.schemas
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: schemas
props:
- name: integration_type
value: "{{ integration_type }}"
description: |
The schema source. Only `CSV` is supported through the API; the schema is always recorded as `CSV` regardless of the value sent.
valid_values: ['CSV']
- name: name
value: "{{ name }}"
description: |
Display name of the enrichment schema.
- name: description
value: "{{ description }}"
description: |
Description of this set of enrichment data.
- name: fields
description: |
The schema fields. Must include 1-3 query fields and at least one enriched field, up to 25 fields total. Field names must be unique (case-insensitive).
value:
- name: "{{ name }}"
type: "{{ type }}"
- name: filename
value: "{{ filename }}"
description: The 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.
description: The 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.
UPDATE examples
- update
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
- delete
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
;