Skip to main content

schemas

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

Overview

Nameschemas
TypeResource
Idpagerduty.custom_fields.schemas

Fields

The following fields are returned by SELECT queries:

The schema requested.

NameDatatypeDescription
idstringThe ID of the resource.
created_atstring (date-time)The date/time the object was created at.
descriptionstringA description of this schema.
field_configurationsarray
selfstring (url)The API show URL at which the object is accessible
summarystringA short-form, server-generated string that provides succinct, important information about an object suitable for primary labeling of an entity in a client. In many cases, this will be identical to name, though it is not intended to be an identifier.
titlestringThe name of the schema.
typestring
updated_atstring (date-time)The date/time the object was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_custom_fields_schemaselectschema_id, X-EARLY-ACCESSinclude[]Get detailed information about a Schema.

<!-- theme: warning -->
> ### Early Access
> This endpoint is in Early Access and may change at any time. You must pass in the X-EARLY-ACCESS header to access it.
list_custom_fields_schemasselectX-EARLY-ACCESSlimit, offset, totalList all Schemas.

<!-- theme: warning -->
> ### Early Access
> This endpoint is in Early Access and may change at any time. You must pass in the X-EARLY-ACCESS header to access it.
create_custom_fields_schemainsertX-EARLY-ACCESS, data__schemaCreate a new Schema, along with the Field Configurations if provided. An account may have up to 100 Schemas.

<!-- theme: warning -->
> ### Early Access
> This endpoint is in Early Access and may change at any time. You must pass in the X-EARLY-ACCESS header to access it.
delete_custom_fields_schemadeleteschema_id, X-EARLY-ACCESSDelete a Schema. Schemas may not be deleted if they are in use by any Service.

<!-- theme: warning -->
> ### Early Access
> This endpoint is in Early Access and may change at any time. You must pass in the X-EARLY-ACCESS header to access it.
_list_custom_fields_schemasexecX-EARLY-ACCESSlimit, offset, totalList all Schemas.

<!-- theme: warning -->
> ### Early Access
> This endpoint is in Early Access and may change at any time. You must pass in the X-EARLY-ACCESS header to access it.
_get_custom_fields_schemaexecschema_id, X-EARLY-ACCESSinclude[]Get detailed information about a Schema.

<!-- theme: warning -->
> ### Early Access
> This endpoint is in Early Access and may change at any time. You must pass in the X-EARLY-ACCESS header to access it.
update_custom_fields_schemaexecschema_id, X-EARLY-ACCESS, schemaUpdate a Schema, along with the Field Configurations if provided.

<!-- theme: warning -->
> ### Early Access
> This endpoint is in Early Access and may change at any time. You must pass in the X-EARLY-ACCESS header to access it.

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
X-EARLY-ACCESSstringThis header indicates that this API endpoint is UNDER CONSTRUCTION and may change at any time. You MUST pass in this header and the above value. Do not use this endpoint in production, as it may change!
schema_idstringThe ID of the schema.
include[]stringArray of additional details to include. Including field_configurations will also include full field details.
limitintegerThe number of results per page.
offsetintegerOffset to start pagination search results.
totalbooleanBy default the total field in pagination responses is set to null to provide the fastest possible response times. Set total to true for this field to be populated. See our Pagination Docs for more information.

SELECT examples

Get detailed information about a Schema.

<!-- theme: warning -->
> ### Early Access
> This endpoint is in Early Access and may change at any time. You must pass in the X-EARLY-ACCESS header to access it.

SELECT
id,
created_at,
description,
field_configurations,
self,
summary,
title,
type,
updated_at
FROM pagerduty.custom_fields.schemas
WHERE schema_id = '{{ schema_id }}' -- required
AND X-EARLY-ACCESS = '{{ X-EARLY-ACCESS }}' -- required
AND include[] = '{{ include[] }}'
;

INSERT examples

Create a new Schema, along with the Field Configurations if provided. An account may have up to 100 Schemas.

<!-- theme: warning -->
> ### Early Access
> This endpoint is in Early Access and may change at any time. You must pass in the X-EARLY-ACCESS header to access it.

INSERT INTO pagerduty.custom_fields.schemas (
data__schema,
X-EARLY-ACCESS
)
SELECT
'{{ schema }}' /* required */,
'{{ X-EARLY-ACCESS }}'
RETURNING
schema
;

DELETE examples

Delete a Schema. Schemas may not be deleted if they are in use by any Service.

<!-- theme: warning -->
> ### Early Access
> This endpoint is in Early Access and may change at any time. You must pass in the X-EARLY-ACCESS header to access it.

DELETE FROM pagerduty.custom_fields.schemas
WHERE schema_id = '{{ schema_id }}' --required
AND X-EARLY-ACCESS = '{{ X-EARLY-ACCESS }}' --required
;

Lifecycle Methods

List all Schemas.

<!-- theme: warning -->
> ### Early Access
> This endpoint is in Early Access and may change at any time. You must pass in the X-EARLY-ACCESS header to access it.

EXEC pagerduty.custom_fields.schemas._list_custom_fields_schemas 
@X-EARLY-ACCESS='{{ X-EARLY-ACCESS }}' --required,
@limit='{{ limit }}',
@offset='{{ offset }}',
@total={{ total }}
;