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.
- You can fetch any event type resource through the Event Type API and find the
schema_id
in its properties. - 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 schemaid
is part of the url. For example, if the url is https://events-schemas.twilio.com/VoiceInsights.CallSummary/1, the schemaid
isVoiceInsights.CallSummary.
Schema properties
Resource Properties in REST API format | |
---|---|
id
|
The unique identifier of the schema. Each schema can have multiple versions, that share the same id. |
url
|
The URL of this resource. |
links
|
Contains a dictionary of URL links to nested resources of this schema. |
latest_version_date_created
|
The date that the latest schema version was created, given in ISO 8601 format. |
latest_version
|
The latest version published of this schema. |
Fetch a Schema resource
https://events.twilio.com/v1/Schemas/{Id}
Parameters
Parameters in REST API format | |
---|---|
id
Path
|
The unique identifier of the schema. Each schema can have multiple versions, that share the same id. |
Example 1
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.