Menu

Expand
Rate this page:

Schema Resource

Schemas define how information is organized within an event’s data attribute. You can use the schema to explore the fields in an event type before subscribing to it. You can use also it in production to validate that the events you receive match their published schemas.

There are two ways to find the schema id of an Event-Type.

  1. You can fetch any event type resource through the Event Type API and find the schema_id in its properties.
  2. If you are already receiving events in your sink, the metadata of the event will contain the url of its schema in a field called dataschema. The schema id is part of the url. For example, if the url is https://events-schemas.twilio.com/VoiceInsights.CallSummary/1, the schema id is VoiceInsights.CallSummary.

Schema properties

Resource Properties in REST API format
id
string Not PII

The unique identifier of the schema. Each schema can have multiple versions, that share the same id.

url
url Not PII

The URL of this resource.

links
uri_map Not PII

Contains a dictionary of URL links to nested resources of this schema.

latest_version_date_created
date_time<iso8601> Not PII

The date that the latest schema version was created, given in ISO 8601 format.

latest_version
integer Not PII

The latest version published of this schema.

Fetch a Schema resource

get
https://events.twilio.com/v1/Schemas/{Id}
Parameters
Parameters in REST API format
id
Path
get string Not PII

The unique identifier of the schema. Each schema can have multiple versions, that share the same id.

Example 1
Loading Code Sample...
        
        

        Fetch schema

        Rate this page:

        Need some help?

        We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

        Loading Code Sample...
              
              
              

              Thank you for your feedback!

              Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

              Sending your feedback...
              🎉 Thank you for your feedback!
              Something went wrong. Please try again.

              Thanks for your feedback!

              thanks-feedback-gif