@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Twilio - Accounts
@base https://accounts.twilio.com
@version 1.0.0
@auth Bearer basic
@endpoints 20
@toc AuthTokens(3), Consents(1), Contacts(1), Credentials(10), Messaging(2), SafeList(3)

@group AuthTokens
@endpoint POST /v1/AuthTokens/Promote
@desc Promote the secondary Auth Token to primary. After promoting the new token, all requests to Twilio using your old primary Auth Token will result in an error.
@returns(200) {account_sid: str?, auth_token: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # OK

@endgroup

@group Consents
@endpoint POST /v1/Consents/Bulk
@returns(201) {items: any?} # Created

@endgroup

@group Contacts
@endpoint POST /v1/Contacts/Bulk
@returns(201) {items: any?} # Created

@endgroup

@group Credentials
@endpoint GET /v1/Credentials/AWS
@desc Retrieves a collection of AWS Credentials belonging to the account used to make the request
@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) {credentials: [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/Credentials/AWS
@desc Create a new AWS Credential
@returns(201) {sid: str?, account_sid: str?, friendly_name: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # Created

@endpoint GET /v1/Credentials/AWS/{Sid}
@desc Fetch the AWS credentials specified by the provided Credential Sid
@required {Sid: str # The Twilio-provided string that uniquely identifies the AWS resource to fetch.}
@returns(200) {sid: str?, account_sid: str?, friendly_name: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # OK

@endpoint POST /v1/Credentials/AWS/{Sid}
@desc Modify the properties of a given Account
@required {Sid: str # The Twilio-provided string that uniquely identifies the AWS resource to update.}
@returns(200) {sid: str?, account_sid: str?, friendly_name: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # OK

@endpoint DELETE /v1/Credentials/AWS/{Sid}
@desc Delete a Credential from your account
@required {Sid: str # The Twilio-provided string that uniquely identifies the AWS resource to delete.}
@returns(204) The resource was deleted successfully.

@endpoint GET /v1/Credentials/PublicKeys
@desc Retrieves a collection of Public Key Credentials belonging to the account used to make the request
@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) {credentials: [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/Credentials/PublicKeys
@desc Create a new Public Key Credential
@returns(201) {sid: str?, account_sid: str?, friendly_name: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # Created

@endpoint GET /v1/Credentials/PublicKeys/{Sid}
@desc Fetch the public key specified by the provided Credential Sid
@required {Sid: str # The Twilio-provided string that uniquely identifies the PublicKey resource to fetch.}
@returns(200) {sid: str?, account_sid: str?, friendly_name: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # OK

@endpoint POST /v1/Credentials/PublicKeys/{Sid}
@desc Modify the properties of a given Account
@required {Sid: str # The Twilio-provided string that uniquely identifies the PublicKey resource to update.}
@returns(200) {sid: str?, account_sid: str?, friendly_name: str?, date_created: str(date-time)?, date_updated: str(date-time)?, url: str(uri)?} # OK

@endpoint DELETE /v1/Credentials/PublicKeys/{Sid}
@desc Delete a Credential from your account
@required {Sid: str # The Twilio-provided string that uniquely identifies the PublicKey resource to delete.}
@returns(204) The resource was deleted successfully.

@endgroup

@group Messaging
@endpoint PATCH /v1/Messaging/GeoPermissions
@returns(200) {permissions: any?} # OK

@endpoint GET /v1/Messaging/GeoPermissions
@optional {CountryCode: str # The country code to filter the geo permissions. If provided, only the geo permission for the specified country will be returned.}
@returns(200) {permissions: any?} # OK

@endgroup

@group SafeList
@endpoint POST /v1/SafeList/Numbers
@desc Add a new phone number or phone number 1k prefix to SafeList.
@returns(201) {sid: str?, phone_number: str?} # Created

@endpoint GET /v1/SafeList/Numbers
@desc Check if a phone number or phone number 1k prefix exists in SafeList.
@optional {PhoneNumber: str # The phone number or phone number 1k prefix to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).}
@returns(200) {sid: str?, phone_number: str?} # OK

@endpoint DELETE /v1/SafeList/Numbers
@desc Remove a phone number or phone number 1k prefix from SafeList.
@optional {PhoneNumber: str # The phone number or phone number 1k prefix to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164).}
@returns(204) The resource was deleted successfully.

@endgroup

@group AuthTokens
@endpoint POST /v1/AuthTokens/Secondary
@desc Create a new secondary Auth Token
@returns(201) {account_sid: str?, date_created: str(date-time)?, date_updated: str(date-time)?, secondary_auth_token: str?, url: str(uri)?} # Created

@endpoint DELETE /v1/AuthTokens/Secondary
@desc Delete the secondary Auth Token from your account
@returns(204) The resource was deleted successfully.

@endgroup

@end
