API keys
Create a new Signing Key for the account making the request.
Body
-
The SID of the Account that created the Payments resource.
Minimum length is
34, maximum length is34. Format should match the following pattern:^AC[0-9a-fA-F]{32}$. -
A descriptive string that you create to describe the resource. It can be up to 64 characters long.
-
Value is
restricted. -
The `Policy` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the Twilio documentation.
POST
/v1/Keys
curl \
--request POST 'https://iam.twilio.com/v1/Keys' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'FriendlyName=foo&AccountSid=ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
Request examples
Create standard key
{"FriendlyName" => "foo", "AccountSid" => "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}
{"FriendlyName" => "foo", "AccountSid" => "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "KeyType" => "restricted", "Policy" => "{\"allow\":[\"/twilio/messaging/messages/read\"]}"}
Response examples (201)
Create standard key
{
"sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "foo",
"date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
"date_updated": "Mon, 13 Jun 2016 22:50:08 +0000",
"secret": "foobar",
"policy": null
}
{
"sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"friendly_name": "foo",
"date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
"date_updated": "Mon, 13 Jun 2016 22:50:08 +0000",
"secret": "foobar",
"policy": {
"allow": [
"/twilio/messaging/messages/read"
]
}
}