Update a specific Key

POST /v1/Keys/{Sid}

API keys

Update a specific Key.

Path parameters

  • Sid string Required

    The Twilio-provided string that uniquely identifies the Key resource to update.

    Minimum length is 34, maximum length is 34. Format should match the following pattern: ^SK[0-9a-fA-F]{32}$.

application/x-www-form-urlencoded

Body

  • FriendlyName string

    A descriptive string that you create to describe the resource. It can be up to 64 characters long.

  • Policy

    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.

Responses

  • 200 application/json

    OK

    Hide headers attributes Show headers attributes
    • Access-Control-Allow-Origin string

      Specify the origin(s) allowed to access the resource

    • Access-Control-Allow-Methods string

      Specify the HTTP methods allowed when accessing the resource

    • Access-Control-Allow-Headers string

      Specify the headers allowed when accessing the resource

    • Access-Control-Allow-Credentials boolean

      Indicates whether the browser should include credentials

    • Access-Control-Expose-Headers string

      Headers exposed to the client

    Hide response attributes Show response attributes object
    • sid string | null

      The unique string that we created to identify the Key resource.

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^SK[0-9a-fA-F]{32}$.

    • friendly_name string | null

      The string that you assigned to describe the resource.

    • date_created string(date-time-rfc-2822) | null

      The date and time in GMT that the resource was created specified in RFC 2822 format.

    • date_updated string(date-time-rfc-2822) | null

      The date and time in GMT that the resource was last updated specified in RFC 2822 format.

    • policy object | null

      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/{Sid}
curl \
 --request POST 'https://iam.twilio.com/v1/Keys/{Sid}' \
 --user "username:password" \
 --header "Content-Type: application/x-www-form-urlencoded" \
 --data 'FriendlyName=foo'
Request examples
{"FriendlyName"=>"foo"}
{"Policy"=>"{\"allow\":[\"/twilio/messaging/messages/read\", \"/twilio/messaging/messages/update\"]}", "FriendlyName"=>"foo"}
Response examples (200)
{
  "sid": "SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "policy": null,
  "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",
      "/twilio/messaging/messages/update"
    ]
  },
  "date_created": "Mon, 13 Jun 2016 22:50:08 +0000",
  "date_updated": "Mon, 13 Jun 2016 22:50:08 +0000",
  "friendly_name": "foo"
}