@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Twilio - Voice
@base https://voice.twilio.com
@version 1.0.0
@auth Bearer basic
@endpoints 32
@hint download_for_search
@toc Archives(1), ByocTrunks(5), ConnectionPolicies(10), DialingPermissions(4), Settings(2), IpRecords(5), SourceIpMappings(5)

@group Archives
@endpoint DELETE /v1/Archives/{Date}/Calls/{Sid}
@desc Delete an archived call record from Bulk Export. Note: this does not also delete the record from the Voice API.
@required {Date: str(date) # The date of the Call in UTC., Sid: str # The Twilio-provided Call SID that uniquely identifies the Call resource to delete}
@returns(204) The resource was deleted successfully.

@endgroup

@group ByocTrunks
@endpoint POST /v1/ByocTrunks
@returns(201) {account_sid: str?, sid: str?, friendly_name: str?, voice_url: str(uri)?, voice_method: str(http-method)?, voice_fallback_url: str(uri)?, voice_fallback_method: str(http-method)?, status_callback_url: str(uri)?, status_callback_method: str(http-method)?, cnam_lookup_enabled: bool?, connection_policy_sid: str?, from_domain_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # Created

@endpoint GET /v1/ByocTrunks
@optional {PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {byoc_trunks: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint GET /v1/ByocTrunks/{Sid}
@required {Sid: str # The Twilio-provided string that uniquely identifies the BYOC Trunk resource to fetch.}
@returns(200) {account_sid: str?, sid: str?, friendly_name: str?, voice_url: str(uri)?, voice_method: str(http-method)?, voice_fallback_url: str(uri)?, voice_fallback_method: str(http-method)?, status_callback_url: str(uri)?, status_callback_method: str(http-method)?, cnam_lookup_enabled: bool?, connection_policy_sid: str?, from_domain_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # OK

@endpoint POST /v1/ByocTrunks/{Sid}
@required {Sid: str # The Twilio-provided string that uniquely identifies the BYOC Trunk resource to update.}
@returns(200) {account_sid: str?, sid: str?, friendly_name: str?, voice_url: str(uri)?, voice_method: str(http-method)?, voice_fallback_url: str(uri)?, voice_fallback_method: str(http-method)?, status_callback_url: str(uri)?, status_callback_method: str(http-method)?, cnam_lookup_enabled: bool?, connection_policy_sid: str?, from_domain_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # OK

@endpoint DELETE /v1/ByocTrunks/{Sid}
@required {Sid: str # The Twilio-provided string that uniquely identifies the BYOC Trunk resource to delete.}
@returns(204) The resource was deleted successfully.

@endgroup

@group ConnectionPolicies
@endpoint POST /v1/ConnectionPolicies
@returns(201) {account_sid: str?, sid: str?, friendly_name: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?, links: map?} # Created

@endpoint GET /v1/ConnectionPolicies
@optional {PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {connection_policies: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint GET /v1/ConnectionPolicies/{Sid}
@required {Sid: str # The unique string that we created to identify the Connection Policy resource to fetch.}
@returns(200) {account_sid: str?, sid: str?, friendly_name: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?, links: map?} # OK

@endpoint POST /v1/ConnectionPolicies/{Sid}
@required {Sid: str # The unique string that we created to identify the Connection Policy resource to update.}
@returns(200) {account_sid: str?, sid: str?, friendly_name: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?, links: map?} # OK

@endpoint DELETE /v1/ConnectionPolicies/{Sid}
@required {Sid: str # The unique string that we created to identify the Connection Policy resource to delete.}
@returns(204) The resource was deleted successfully.

@endpoint POST /v1/ConnectionPolicies/{ConnectionPolicySid}/Targets
@required {ConnectionPolicySid: str # The SID of the Connection Policy that owns the Target.}
@returns(201) {account_sid: str?, connection_policy_sid: str?, sid: str?, friendly_name: str?, target: str(uri)?, priority: int, weight: int, enabled: bool?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # Created

@endpoint GET /v1/ConnectionPolicies/{ConnectionPolicySid}/Targets
@required {ConnectionPolicySid: str # The SID of the Connection Policy from which to read the Targets.}
@optional {PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {targets: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint GET /v1/ConnectionPolicies/{ConnectionPolicySid}/Targets/{Sid}
@required {ConnectionPolicySid: str # The SID of the Connection Policy that owns the Target., Sid: str # The unique string that we created to identify the Target resource to fetch.}
@returns(200) {account_sid: str?, connection_policy_sid: str?, sid: str?, friendly_name: str?, target: str(uri)?, priority: int, weight: int, enabled: bool?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # OK

@endpoint POST /v1/ConnectionPolicies/{ConnectionPolicySid}/Targets/{Sid}
@required {ConnectionPolicySid: str # The SID of the Connection Policy that owns the Target., Sid: str # The unique string that we created to identify the Target resource to update.}
@returns(200) {account_sid: str?, connection_policy_sid: str?, sid: str?, friendly_name: str?, target: str(uri)?, priority: int, weight: int, enabled: bool?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # OK

@endpoint DELETE /v1/ConnectionPolicies/{ConnectionPolicySid}/Targets/{Sid}
@required {ConnectionPolicySid: str # The SID of the Connection Policy that owns the Target., Sid: str # The unique string that we created to identify the Target resource to delete.}
@returns(204) The resource was deleted successfully.

@endgroup

@group DialingPermissions
@endpoint GET /v1/DialingPermissions/Countries/{IsoCode}
@desc Retrieve voice dialing country permissions identified by the given ISO country code
@required {IsoCode: str(iso-country-code) # The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the DialingPermissions Country resource to fetch}
@returns(200) {iso_code: str(iso-country-code)?, name: str?, continent: str?, country_codes: [str]?, low_risk_numbers_enabled: bool?, high_risk_special_numbers_enabled: bool?, high_risk_tollfraud_numbers_enabled: bool?, url: str(uri)?, links: map?} # OK

@endpoint GET /v1/DialingPermissions/Countries
@desc Retrieve all voice dialing country permissions for this account
@optional {IsoCode: str(iso-country-code) # Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2), Continent: str # Filter to retrieve the country permissions by specifying the continent, CountryCode: str # Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html), LowRiskNumbersEnabled: bool # Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`., HighRiskSpecialNumbersEnabled: bool # Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false`, HighRiskTollfraudNumbersEnabled: bool # Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/blog/how-to-protect-your-account-from-toll-fraud-with-voice-dialing-geo-permissions-html) numbers enabled. Can be: `true` or `false`., PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {content: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint POST /v1/DialingPermissions/BulkCountryUpdates
@desc Create a bulk update request to change voice dialing country permissions of one or more countries identified by the corresponding [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
@returns(201) {update_count: int, update_request: str?} # Created

@endpoint GET /v1/DialingPermissions/Countries/{IsoCode}/HighRiskSpecialPrefixes
@desc Fetch the high-risk special services prefixes from the country resource corresponding to the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)
@required {IsoCode: str(iso-country-code) # The [ISO 3166-1 country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) to identify the country permissions from which high-risk special service number prefixes are fetched}
@optional {PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {content: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endgroup

@group Settings
@endpoint GET /v1/Settings
@desc Retrieve voice dialing permissions inheritance for the sub-account
@returns(200) {dialing_permissions_inheritance: bool?, url: str(uri)?} # OK

@endpoint POST /v1/Settings
@desc Update voice dialing permissions inheritance for the sub-account
@returns(202) {dialing_permissions_inheritance: bool?, url: str(uri)?} # Accepted

@endgroup

@group IpRecords
@endpoint POST /v1/IpRecords
@returns(201) {account_sid: str?, sid: str?, friendly_name: str?, ip_address: str?, cidr_prefix_length: int, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # Created

@endpoint GET /v1/IpRecords
@optional {PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {ip_records: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint GET /v1/IpRecords/{Sid}
@required {Sid: str # The Twilio-provided string that uniquely identifies the IP Record resource to fetch.}
@returns(200) {account_sid: str?, sid: str?, friendly_name: str?, ip_address: str?, cidr_prefix_length: int, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # OK

@endpoint POST /v1/IpRecords/{Sid}
@required {Sid: str # The Twilio-provided string that uniquely identifies the IP Record resource to update.}
@returns(200) {account_sid: str?, sid: str?, friendly_name: str?, ip_address: str?, cidr_prefix_length: int, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # OK

@endpoint DELETE /v1/IpRecords/{Sid}
@required {Sid: str # The Twilio-provided string that uniquely identifies the IP Record resource to delete.}
@returns(204) The resource was deleted successfully.

@endgroup

@group SourceIpMappings
@endpoint POST /v1/SourceIpMappings
@returns(201) {sid: str?, ip_record_sid: str?, sip_domain_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # Created

@endpoint GET /v1/SourceIpMappings
@optional {PageSize: int(int64) # How many resources to return in each list page. The default is 50, and the maximum is 1000., Page: int # The page index. This value is simply for client state., PageToken: str # The page token. This is provided by the API.}
@returns(200) {source_ip_mappings: [map], meta: map{first_page_url: str(uri), key: str, next_page_url: str(uri)?, page: int, page_size: int, previous_page_url: str(uri)?, url: str(uri)}} # OK

@endpoint GET /v1/SourceIpMappings/{Sid}
@required {Sid: str # The Twilio-provided string that uniquely identifies the IP Record resource to fetch.}
@returns(200) {sid: str?, ip_record_sid: str?, sip_domain_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # OK

@endpoint POST /v1/SourceIpMappings/{Sid}
@required {Sid: str # The Twilio-provided string that uniquely identifies the IP Record resource to update.}
@returns(200) {sid: str?, ip_record_sid: str?, sip_domain_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # OK

@endpoint DELETE /v1/SourceIpMappings/{Sid}
@required {Sid: str # The Twilio-provided string that uniquely identifies the IP Record resource to delete.}
@returns(204) The resource was deleted successfully.

@endgroup

@end
