@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Twilio - Lookups
@base https://lookups.twilio.com
@version 1.0.0
@auth Bearer basic
@endpoints 10
@toc PhoneNumbers(5), batch(1), RateLimits(4)

@group PhoneNumbers
@endpoint GET /v2/PhoneNumbers/{PhoneNumber}
@required {PhoneNumber: str}
@optional {Fields: str, CountryCode: str, FirstName: str, LastName: str, AddressLine1: str, AddressLine2: str, City: str, State: str, PostalCode: str, AddressCountryCode: str(iso-country-code), NationalId: str, DateOfBirth: str, LastVerifiedDate: str, VerificationSid: str, PartnerSubId: str}
@returns(200) {calling_country_code: str?, country_code: str?, phone_number: str(phone-number)?, national_format: str?, valid: bool, validation_errors: [str], caller_name: map{caller_name: str, caller_type: str, error_code: int}, sim_swap: map{last_sim_swap: any, carrier_name: str, mobile_country_code: str, mobile_network_code: str, error_code: int}, call_forwarding: map{call_forwarding_enabled: bool, error_code: int(int32)}, line_type_intelligence: map{mobile_country_code: str, mobile_network_code: str, carrier_name: str, type: str, error_code: int}, line_status: map{status: str, error_code: int}, identity_match: map{first_name_match: str, last_name_match: str, address_lines_match: str, city_match: str, state_match: str, postal_code_match: str, address_country_match: str, national_id_match: str, date_of_birth_match: str, summary_score: int(int32), error_code: int(int32), error_message: str}, reassigned_number: map{last_verified_date: str, is_number_reassigned: str, error_code: str}, sms_pumping_risk: map{carrier_risk_category: str, number_blocked: bool, number_blocked_date: str(date-time), number_blocked_last_3_months: bool, sms_pumping_risk_score: int, error_code: int}, phone_number_quality_score: any, pre_fill: any, url: str(uri)}

@endgroup

@group batch
@endpoint POST /v2/batch/query
@optional {phone_numbers: [map{correlation_id: str, phone_number!: str, fields: [str], country_code: str, identity_match: map, reassigned_number: map, sms_pumping_risk: map}]}
@returns(200) {phone_numbers: [map]}

@endgroup

@group RateLimits
@endpoint GET /v2/RateLimits
@optional {Fields: [str]}
@returns(200) {rate_limits: [map]}
@errors {400}

@endpoint GET /v2/RateLimits/Fields/{Field}/Bucket/{Bucket}
@required {Field: str, Bucket: str}
@returns(200) {field: str, limit: int(int32), bucket: str, owner: str, ttl: int(int32)}
@errors {400, 404}

@endpoint DELETE /v2/RateLimits/Fields/{Field}/Bucket/{Bucket}
@required {Field: str, Bucket: str}
@returns(204)
@errors {400}

@endpoint PUT /v2/RateLimits/Fields/{Field}/Bucket/{Bucket}
@required {Field: str, Bucket: str}
@optional {limit: int(int32), ttl: int(int32)}
@returns(200) {field: str, limit: int(int32), bucket: str, owner: str, ttl: int(int32)}
@errors {400}

@endgroup

@group PhoneNumbers
@endpoint GET /v2/PhoneNumbers/{PhoneNumber}/Overrides/{Field}
@required {Field: str, PhoneNumber: str}
@returns(200) {phone_number: str, original_line_type: str, overridden_line_type: str, override_reason: str, override_timestamp: str(date-time), overridden_by_account_sid: str}
@errors {400, 404}

@endpoint POST /v2/PhoneNumbers/{PhoneNumber}/Overrides/{Field}
@required {Field: str, PhoneNumber: str}
@optional {line_type: str(mobile/landline/tollFree/fixedVoip/nonFixedVoip/personal/premium/voicemail/sharedCost/uan/pager/unknown), reason: str}
@returns(201) {phone_number: str, original_line_type: str, overridden_line_type: str, override_reason: str, override_timestamp: str(date-time), overridden_by_account_sid: str}
@errors {400}

@endpoint PUT /v2/PhoneNumbers/{PhoneNumber}/Overrides/{Field}
@required {Field: str, PhoneNumber: str}
@optional {line_type: str(mobile/landline/tollFree/fixedVoip/nonFixedVoip/personal/premium/voicemail/sharedCost/uan/pager/unknown), reason: str}
@returns(200) {phone_number: str, original_line_type: str, overridden_line_type: str, override_reason: str, override_timestamp: str(date-time), overridden_by_account_sid: str}
@errors {400, 404}

@endpoint DELETE /v2/PhoneNumbers/{PhoneNumber}/Overrides/{Field}
@required {Field: str, PhoneNumber: str}
@returns(204)
@errors {400}

@endgroup

@end
