Skip to content

Commit 1ba9640

Browse files
committed
feat: add Twilio OpenAPI specification for TwilioMessage schema
1 parent fc12d09 commit 1ba9640

2 files changed

Lines changed: 45884 additions & 0 deletions

File tree

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
{
2+
"openapi": "3.0.1",
3+
"info": {
4+
"title": "Twilio - Api",
5+
"description": "This is the public Twilio REST API.",
6+
"termsOfService": "https://www.twilio.com/legal/tos",
7+
"contact": {
8+
"name": "Twilio Support",
9+
"url": "https://support.twilio.com",
10+
"email": "support@twilio.com"
11+
},
12+
"license": {
13+
"name": "Apache 2.0",
14+
"url": "https://www.apache.org/licenses/LICENSE-2.0.html"
15+
},
16+
"version": "1.0.0",
17+
"x-twilio": {
18+
"apiStandards": "v0.1"
19+
}
20+
},
21+
"paths": {},
22+
"components": {
23+
"schemas": {
24+
"TwilioMessage": {
25+
"type": "object",
26+
"properties": {
27+
"body": {
28+
"type": "string",
29+
"nullable": true,
30+
"description": "The text content of the message",
31+
"x-twilio": {
32+
"pii": {
33+
"handling": "standard",
34+
"deleteSla": 30
35+
}
36+
}
37+
},
38+
"num_segments": {
39+
"type": "string",
40+
"nullable": true,
41+
"description": "The number of segments that make up the complete message. SMS message bodies that exceed the [character limit](https://www.twilio.com/docs/glossary/what-sms-character-limit) are segmented and charged as multiple messages. Note: For messages sent via a Messaging Service, `num_segments` is initially `0`, since a sender hasn't yet been assigned."
42+
},
43+
"direction": {
44+
"type": "object",
45+
"additionalProperties": true
46+
},
47+
"from": {
48+
"type": "string",
49+
"format": "phone-number",
50+
"nullable": true,
51+
"description": "The sender's phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). For incoming messages, this is the number or channel address of the sender. For outgoing messages, this value is a Twilio phone number, alphanumeric sender ID, short code, or channel address from which the message is sent.",
52+
"x-twilio": {
53+
"pii": {
54+
"handling": "standard",
55+
"deleteSla": 120
56+
}
57+
}
58+
},
59+
"to": {
60+
"type": "string",
61+
"nullable": true,
62+
"description": "The recipient's phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format) or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g. `whatsapp:+15552229999`)",
63+
"x-twilio": {
64+
"pii": {
65+
"handling": "standard",
66+
"deleteSla": 120
67+
}
68+
}
69+
},
70+
"date_updated": {
71+
"type": "string",
72+
"format": "date-time-rfc-2822",
73+
"nullable": true,
74+
"description": "The [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) timestamp (in GMT) of when the Message resource was last updated"
75+
},
76+
"price": {
77+
"type": "string",
78+
"nullable": true,
79+
"description": "The amount billed for the message in the currency specified by `price_unit`. The `price` is populated after the message has been sent/received, and may not be immediately availalble. View the [Pricing page](https://www.twilio.com/en-us/pricing) for more details."
80+
},
81+
"error_message": {
82+
"type": "string",
83+
"nullable": true,
84+
"description": "The description of the `error_code` if the Message `status` is `failed` or `undelivered`. If no error was encountered, the value is `null`. The value returned in this field for a specific error cause is subject to change as Twilio improves errors. Users should not use the `error_code` and `error_message` fields programmatically."
85+
},
86+
"uri": {
87+
"type": "string",
88+
"nullable": true,
89+
"description": "The URI of the Message resource, relative to `https://api.twilio.com`."
90+
},
91+
"account_sid": {
92+
"type": "string",
93+
"minLength": 34,
94+
"maxLength": 34,
95+
"pattern": "^AC[0-9a-fA-F]{32}$",
96+
"nullable": true,
97+
"description": "The SID of the [Account](https://www.twilio.com/docs/iam/api/account) associated with the Message resource"
98+
},
99+
"num_media": {
100+
"type": "string",
101+
"nullable": true,
102+
"description": "The number of media files associated with the Message resource."
103+
},
104+
"status": {
105+
"type": "object",
106+
"additionalProperties": true
107+
},
108+
"messaging_service_sid": {
109+
"type": "string",
110+
"minLength": 34,
111+
"maxLength": 34,
112+
"pattern": "^MG[0-9a-fA-F]{32}$",
113+
"nullable": true,
114+
"description": "The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) associated with the Message resource. A unique default value is assigned if a Messaging Service is not used."
115+
},
116+
"sid": {
117+
"type": "string",
118+
"minLength": 34,
119+
"maxLength": 34,
120+
"pattern": "^(SM|MM)[0-9a-fA-F]{32}$",
121+
"nullable": true,
122+
"description": "The unique, Twilio-provided string that identifies the Message resource."
123+
},
124+
"date_sent": {
125+
"type": "string",
126+
"format": "date-time-rfc-2822",
127+
"nullable": true,
128+
"description": "The [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) timestamp (in GMT) of when the Message was sent. For an outgoing message, this is when Twilio sent the message. For an incoming message, this is when Twilio sent the HTTP request to your incoming message webhook URL."
129+
},
130+
"date_created": {
131+
"type": "string",
132+
"format": "date-time-rfc-2822",
133+
"nullable": true,
134+
"description": "The [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) timestamp (in GMT) of when the Message resource was created"
135+
},
136+
"error_code": {
137+
"type": "integer",
138+
"nullable": true,
139+
"description": "The [error code](https://www.twilio.com/docs/api/errors) returned if the Message `status` is `failed` or `undelivered`. If no error was encountered, the value is `null`. The value returned in this field for a specific error cause is subject to change as Twilio improves errors. Users should not use the `error_code` and `error_message` fields programmatically."
140+
},
141+
"price_unit": {
142+
"type": "string",
143+
"format": "currency",
144+
"nullable": true,
145+
"description": "The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`)."
146+
},
147+
"api_version": {
148+
"type": "string",
149+
"nullable": true,
150+
"description": "The API version used to process the Message"
151+
},
152+
"subresource_uris": {
153+
"type": "object",
154+
"format": "uri-map",
155+
"nullable": true,
156+
"description": "A list of related resources identified by their URIs relative to `https://api.twilio.com`"
157+
}
158+
}
159+
}
160+
}
161+
}
162+
}

0 commit comments

Comments
 (0)