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.
-
The `KeyType` form parameter is used to specify the type of key you want to create.
Default Behavior: If `KeyType` is not specified, the API will generate a standard key.
Restricted Key: If `KeyType` is set to `restricted`, the API will create a new restricted key. In this case, a policy object is required to define the permissions.
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.
curl \
--request POST 'https://iam.twilio.com/v1/Keys' \
--user "username:password" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data 'AccountSid=ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&FriendlyName=foo'
{"AccountSid" => "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "FriendlyName" => "foo"}
{"Policy" => "{\"allow\":[\"/twilio/messaging/messages/read\"]}", "KeyType" => "restricted", "AccountSid" => "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "FriendlyName" => "foo"}
{
"sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"policy": null,
"secret": "foobar",
"date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
"date_updated": "Mon, 13 Jun 2016 22:50:08 +0000",
"friendly_name": "foo"
}
{
"sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"policy": {
"allow": [
"/twilio/messaging/messages/read"
]
},
"secret": "foobar",
"date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
"date_updated": "Mon, 13 Jun 2016 22:50:08 +0000",
"friendly_name": "foo"
}