Amazon Secrets Manager Rotation API

Operations for rotating secrets.

GitHub OpenAPI
Business capability
Identity & Access Management BC-620.20

Operations 1

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /#RotateSecret Rotate a secret · Rotate Secret #
Ask an LLM
“How do I set up automatic rotation for a stored database credential?”
“Can I point a secret at a Lambda function that performs the rotation?”
Tell an agent
Rotate secret {SecretId} now.
Configure secret {SecretId} to rotate with Lambda function {RotationLambdaARN} on the schedule {RotationRules}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/amazon-secrets-manager:amazon-secrets-manager-rotation-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

amazon-secrets-manager-rotation-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: AWS Secrets Manager Rotation API
  version: '2017-10-17'
  description: Generated from AWS's published Smithy model for AWS Secrets Manager. 1 operation(s).
  contact:
    name: Amazon Web Services
    url: https://aws.amazon.com/contact-us/
  license:
    name: Apache 2.0
    identifier: Apache-2.0
    url: https://github.com/aws/api-models-aws/blob/main/LICENSE
servers:
- url: https://secretsmanager.{region}.amazonaws.com
  variables:
    region:
      default: us-east-1
security:
- sigv4: []
paths:
  /#RotateSecret:
    post:
      operationId: RotateSecret
      summary: Rotate Secret
      description: Configures and starts the asynchronous process of rotating the secret. For information about rotation,
        see Rotate secrets in the Secrets Manager User Guide. If you include the configuration parameters, the operation sets
        the values for the secret and then immediately starts a rotation. If you don't include the configuration parameters,
        the operation starts a rotation with the values already stored in the secret. When rotation is successful, the AWSPENDING
        staging label might be attached to the same version as the AWSCURRENT version, or it might not be attached to any
        version. If the AWSPENDING staging label is present but not attached to the same version as AWSCURRENT, then any later
        invocation of RotateSecret assumes that a previous rotation request is still in progress and returns an error. When
        rotation is unsuccessful, the AWSPENDING staging label might be attached to an empty secret version. For more information,
        see Troubleshoot rotation in the Secrets Manager User Guide. Secrets Manager generates a CloudTrail log entry when
        you call this action. Do not include sensitive information in request parameters because it might be logged. For more
        information, see Logging Secrets Ma
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/RotateSecretResponse'
              example:
                ARN: arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret-a1b2c3
                Name: MyTestDatabaseSecret
                VersionId: EXAMPLE2-90ab-cdef-fedc-ba987SECRET2
        '500':
          description: InternalServiceError
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InternalServiceError'
        '400':
          description: InvalidParameterException; InvalidRequestException; ResourceNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InvalidParameterException'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - secretsmanager.RotateSecret
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/RotateSecretRequest'
            example:
              SecretId: MyTestDatabaseSecret
              RotationLambdaARN: arn:aws:lambda:us-west-2:123456789012:function:MyTestDatabaseRotationLambda
              RotationRules:
                ScheduleExpression: cron(0 16 1,15 * ? *)
                Duration: 2h
      tags:
      - Rotation
components:
  securitySchemes:
    sigv4:
      type: apiKey
      in: header
      name: Authorization
      description: AWS Signature Version 4. The Authorization header carries an AWS4-HMAC-SHA256 signature over the canonical
        request, with X-Amz-Date (and X-Amz-Security-Token for temporary credentials). Not a bearer token.
      x-aws-sigv4:
        signingName: secretsmanager
  schemas:
    ExternalSecretRotationMetadataItem:
      type: object
      properties:
        Key:
          type: string
          description: The key that identifies the item.
        Value:
          type: string
          description: The value of the specified item.
    InternalServiceError:
      type: object
      properties:
        Message:
          type: string
    InvalidParameterException:
      type: object
      properties:
        Message:
          type: string
    RotateSecretRequest:
      type: object
      properties:
        SecretId:
          type: string
          description: The ARN or name of the secret to rotate. For an ARN, we recommend that you specify a complete ARN rather
            than a partial ARN. See Finding a secret from a partial ARN.
        ClientRequestToken:
          type: string
          description: A unique identifier for the new version of the secret. You only need to specify this value if you implement
            your own retry logic and you want to ensure that Secrets Manager doesn't attempt to create a secret version twice.
            If you use the Amazon Web Services CLI or one of the Amazon Web Services SDKs to call this operation, then you
            can leave this parameter empty. The CLI or SDK generates a random UUID for you and includes it as the value for
            this parameter in the request. If you generate a raw HTTP request to the Secrets Manager service endpoint, then
            you must generate a ClientRequestToken and
        RotationLambdaARN:
          type: string
          description: For secrets that use a Lambda rotation function to rotate, the ARN of the Lambda rotation function.
            For secrets that use managed rotation, omit this field. For more information, see Managed rotation in the Secrets
            Manager User Guide.
        RotationRules:
          $ref: '#/components/schemas/RotationRulesType'
        ExternalSecretRotationMetadata:
          type: array
          items:
            $ref: '#/components/schemas/ExternalSecretRotationMetadataItem'
          description: The metadata needed to successfully rotate a managed external secret. A list of key value pairs in
            JSON format specified by the partner. For more information about the required information, see Using Secrets Manager
            managed external secrets
        ExternalSecretRotationRoleArn:
          type: string
          description: The Amazon Resource Name (ARN) of the role that allows Secrets Manager to rotate a secret held by a
            third-party partner. For more information, see Security and permissions.
        RotateImmediately:
          type: boolean
          description: 'Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.
            The rotation schedule is defined in RotateSecretRequest$RotationRules. The default for RotateImmediately is true.
            If you don''t specify this value, Secrets Manager rotates the secret immediately. If you set RotateImmediately
            to false, Secrets Manager tests the rotation configuration by running the testSecret step of the Lambda rotation
            function. This test creates an AWSPENDING version of the secret and then removes it. When changing an existing
            rotation schedule and setting RotateImmediately to '
      required:
      - SecretId
    RotateSecretResponse:
      type: object
      properties:
        ARN:
          type: string
          description: The ARN of the secret.
        Name:
          type: string
          description: The name of the secret.
        VersionId:
          type: string
          description: The ID of the new version of the secret.
    RotationRulesType:
      type: object
      properties:
        AutomaticallyAfterDays:
          type: integer
          description: The number of days between rotations of the secret. You can use this value to check that your secret
            meets your compliance guidelines for how often secrets must be rotated. If you use this field to set the rotation
            schedule, Secrets Manager calculates the next rotation date based on the previous rotation. Manually updating
            the secret value by calling PutSecretValue or UpdateSecret is considered a valid rotation. In DescribeSecret and
            ListSecrets, this value is calculated from the rotation schedule after every successful rotation. In RotateSecret,
            you can set the rotation schedule in RotationRu
        Duration:
          type: string
          description: The length of the rotation window in hours, for example 3h for a three hour window. Secrets Manager
            rotates your secret at any time during this window. The window must not extend into the next rotation window or
            the next UTC day. The window starts according to the ScheduleExpression. If you don't specify a Duration, for
            a ScheduleExpression in hours, the window automatically closes after one hour. For a ScheduleExpression in days,
            the window automatically closes at the end of the UTC day. For more information, including examples, see Schedule
            expressions in Secrets Manager rotation in the Secr
        ScheduleExpression:
          type: string
          description: A cron() or rate() expression that defines the schedule for rotating your secret. Secrets Manager rotation
            schedules use UTC time zone. Secrets Manager rotates your secret any time during a rotation window. Secrets Manager
            rate() expressions represent the interval in hours or days that you want to rotate your secret, for example rate(12
            hours) or rate(10 days). You can rotate a secret as often as every four hours. If you use a rate() expression,
            the rotation window starts at midnight. For a rate in hours, the default rotation window closes after one hour.
            For a rate in days, the default rotati
x-provenance:
  method: harvested
  publisher: Amazon Web Services
  source: https://raw.githubusercontent.com/aws/api-models-aws/3cd98287b471c106254abd89279cc87308d38bfd/models/secrets-manager/service/2017-10-17/secrets-manager-2017-10-17.json
  note: converted by smithy-to-openapi.py from AWS's Smithy model (roadmap#1001)