openapi: 3.2.0 info: title: Twilio - Iam Iam V1New API Key API description: This is the public Twilio REST API. termsOfService: https://www.twilio.com/legal/tos contact: name: Twilio Support url: https://support.twilio.com email: support@twilio.com license: name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html version: 1.0.0 x-twilio: apiStandards: v0.1 servers: - url: https://iam.twilio.com security: - accountSid_authToken: [] tags: - name: IamV1NewApiKey paths: /v1/Keys: servers: - url: https://iam.twilio.com description: API keys x-twilio: defaultOutputProperties: - sid - friendly_name - date_created - flags mountName: get_api_keys className: get_api_keys pathType: list post: description: Create a new Signing Key for the account making the request. tags: - IamV1NewApiKey responses: '201': content: application/json: schema: $ref: '#/components/schemas/iam.v1.new_key' examples: createStandardKey: value: sid: REDACTED_TWILIO_API_KEY_SID 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 createRestrictedKey: value: sid: REDACTED_TWILIO_API_KEY_SID 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 headers: Access-Control-Allow-Origin: description: Specify the origin(s) allowed to access the resource schema: type: string example: '*' Access-Control-Allow-Methods: description: Specify the HTTP methods allowed when accessing the resource schema: type: string example: POST, OPTIONS Access-Control-Allow-Headers: description: Specify the headers allowed when accessing the resource schema: type: string example: Content-Type, Authorization Access-Control-Allow-Credentials: description: Indicates whether the browser should include credentials schema: type: boolean Access-Control-Expose-Headers: description: Headers exposed to the client schema: type: string example: X-Custom-Header1, X-Custom-Header2 description: Created security: - accountSid_authToken: [] operationId: CreateNewKey requestBody: content: application/x-www-form-urlencoded: schema: type: object title: CreateNewKeyRequest properties: AccountSid: type: string minLength: 34 maxLength: 34 pattern: ^AC[0-9a-fA-F]{32}$ description: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. FriendlyName: type: string description: A descriptive string that you create to describe the resource. It can be up to 64 characters long. KeyType: type: string description: '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.' Policy: description: '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](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys).' required: - AccountSid examples: createStandardKey: value: FriendlyName: foo AccountSid: REDACTED_TWILIO_ACCOUNT_SID createRestrictedKey: value: FriendlyName: foo AccountSid: REDACTED_TWILIO_ACCOUNT_SID KeyType: restricted Policy: '{"allow":["/twilio/messaging/messages/read"]}' x-twilio: mountName: new_api_key summary: Create new key x-summary-source: derived components: schemas: iam.v1.new_key: type: object properties: sid: type: - string - 'null' minLength: 34 maxLength: 34 pattern: ^SK[0-9a-fA-F]{32}$ description: The unique string that that we created to identify the NewKey resource. You will use this as the basic-auth `user` when authenticating to the API. friendly_name: type: - string - 'null' description: The string that you assigned to describe the resource. x-twilio: pii: handling: standard deleteSla: 30 date_created: type: - string - 'null' format: date-time-rfc-2822 description: The date and time in GMT that the API Key was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. date_updated: type: - string - 'null' format: date-time-rfc-2822 description: The date and time in GMT that the new API Key was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. secret: type: - string - 'null' description: The secret your application uses to sign Access Tokens and to authenticate to the REST API (you will use this as the basic-auth `password`). **Note that for security reasons, this field is ONLY returned when the API Key is first created.** policy: type: - object - 'null' description: Collection of allow assertions. securitySchemes: accountSid_authToken: scheme: basic type: http access_token_bearer: type: http scheme: bearer bearerFormat: access_token m2mOauth: type: http scheme: bearer bearerFormat: JWT description: M2M Access Token