Amazon Secrets Manager Secrets Manager Secret Value API

The Secrets Manager Secret Value API from Amazon Secrets Manager — 3 operation(s) for secrets manager secret value.

GitHub OpenAPI
Business capability
Configuration & Secrets Management BC-4210.60

Operations 3

POST /#BatchGetSecretValue Batch Get Secret Value #
POST /#GetSecretValue Get Secret Value #
POST /#PutSecretValue Put Secret Value #

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-secret-value-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-secret-value-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: AWS Secrets Manager Secret Value API
  version: '2017-10-17'
  description: Generated from AWS's published Smithy model for AWS Secrets Manager. 3 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:
  /#BatchGetSecretValue:
    post:
      operationId: BatchGetSecretValue
      summary: Batch Get Secret Value
      description: 'Retrieves the contents of the encrypted fields SecretString or SecretBinary for up to 20 secrets. To retrieve
        a single secret, call GetSecretValue. To choose which secrets to retrieve, you can specify a list of secrets by name
        or ARN, or you can use filters. If Secrets Manager encounters errors such as AccessDeniedException while attempting
        to retrieve any of the secrets, you can see the errors in Errors in the response. Secrets Manager generates CloudTrail
        GetSecretValue log entries for each secret you request when you call this action. Do not include sensitive information
        in request parameters because it might be logged. For more information, see Logging Secrets Manager events with CloudTrail.
        Required permissions: secretsmanager:BatchGetSecretValue, and you must have secretsmanager:GetSecretValue for each
        secret. If you use filters, you must also have secretsmanager:ListSecrets. If the secrets are encrypted using customer-managed
        keys instead of the Amazon Web Services managed key aws/secretsmanager, then you also need kms:Decrypt permissions
        for the keys. For more information, see IAM policy actions for Secrets Manager and Authentication and access control
        in Secrets Manager.'
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/BatchGetSecretValueResponse'
              example:
                SecretValues:
                - ARN: '&region-arn;&asm-service-name;:us-west-2:&ExampleAccountId;:secret:MySecret1-a1b2c3'
                  CreatedDate: 1700591229.801
                  Name: MySecret1
                  SecretString: '{"username":"diego_ramirez","password":"EXAMPLE-PASSWORD","engine":"mysql","host":"secretsmanagertutorial.cluster.us-west-2.rds.amazonaws.com","port":3306,"dbClusterIdentifier":"secretsmanagertutorial"}'
                  VersionId: a1b2c3d4-5678-90ab-cdef-EXAMPLEaaaaa
                  VersionStages:
                  - AWSCURRENT
                - ARN: '&region-arn;&asm-service-name;:us-west-2:&ExampleAccountId;:secret:MySecret2-a1b2c3'
                  CreatedDate: 1699911394.105
                  Name: MySecret2
                  SecretString: '{"username":"akua_mansa","password":"EXAMPLE-PASSWORD"'
                  VersionId: a1b2c3d4-5678-90ab-cdef-EXAMPLEbbbbb
                  VersionStages:
                  - AWSCURRENT
                - ARN: '&region-arn;&asm-service-name;:us-west-2:&ExampleAccountId;:secret:MySecret3-a1b2c3'
                  CreatedDate: 1699911394.105
                  Name: MySecret3
                  SecretString: '{"username":"jie_liu","password":"EXAMPLE-PASSWORD"'
                  VersionId: a1b2c3d4-5678-90ab-cdef-EXAMPLEccccc
                  VersionStages:
                  - AWSCURRENT
                Errors: []
        '400':
          description: DecryptionFailure; InvalidNextTokenException; InvalidParameterException; InvalidRequestException; ResourceNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/DecryptionFailure'
        '500':
          description: InternalServiceError
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InternalServiceError'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - secretsmanager.BatchGetSecretValue
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/BatchGetSecretValueRequest'
            example:
              SecretIdList:
              - MySecret1
              - MySecret2
              - MySecret3
      tags:
      - Secret Value
  /#GetSecretValue:
    post:
      operationId: GetSecretValue
      summary: Get Secret Value
      description: 'Retrieves the contents of the encrypted fields SecretString or SecretBinary from the specified version
        of a secret, whichever contains content. To retrieve the values for a group of secrets, call BatchGetSecretValue.
        We recommend that you cache your secret values by using client-side caching. Caching secrets improves speed and reduces
        your costs. For more information, see Cache secrets for your applications. To retrieve the previous version of a secret,
        use VersionStage and specify AWSPREVIOUS. To revert to the previous version of a secret, call UpdateSecretVersionStage.
        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 Manager events with CloudTrail.
        Required permissions: secretsmanager:GetSecretValue. If the secret is encrypted using a customer-managed key instead
        of the Amazon Web Services managed key aws/secretsmanager, then you also need kms:Decrypt permissions for that key.
        For more information, see IAM policy actions for Secrets Manager and Authentication and access control in Secrets
        Manager.'
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/GetSecretValueResponse'
              example:
                ARN: arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret-a1b2c3
                CreatedDate: 1523477145.713
                Name: MyTestDatabaseSecret
                SecretString: "{\n  \"username\":\"david\",\n  \"password\":\"EXAMPLE-PASSWORD\"\n}\n"
                VersionId: EXAMPLE1-90ab-cdef-fedc-ba987SECRET1
                VersionStages:
                - AWSPREVIOUS
        '400':
          description: DecryptionFailure; InvalidParameterException; InvalidRequestException; ResourceNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/DecryptionFailure'
        '500':
          description: InternalServiceError
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InternalServiceError'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - secretsmanager.GetSecretValue
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/GetSecretValueRequest'
            example:
              SecretId: MyTestDatabaseSecret
      tags:
      - Secret Value
  /#PutSecretValue:
    post:
      operationId: PutSecretValue
      summary: Put Secret Value
      description: Creates a new version of your secret by creating a new encrypted value and attaching it to the secret.
        version can contain a new SecretString value or a new SecretBinary value. Do not call PutSecretValue at a sustained
        rate of more than once every 10 minutes. When you update the secret value, Secrets Manager creates a new version of
        the secret. Secrets Manager keeps 100 of the most recent versions, but it keeps all secret versions created in the
        last 24 hours. If you call PutSecretValue more than once every 10 minutes, you will create more versions than Secrets
        Manager removes, and you will reach the quota for secret versions. You can specify the staging labels to attach to
        the new version in VersionStages. If you don't include VersionStages, then Secrets Manager automatically moves the
        staging label AWSCURRENT to this version. If this operation creates the first version for the secret, then Secrets
        Manager automatically attaches the staging label AWSCURRENT to it. If this operation moves the staging label AWSCURRENT
        from another version to this version, then Secrets Manager also automatically moves the staging label AWSPREVIOUS
        to the version that AWSCURRENT was removed from. This
      responses:
        '200':
          description: Success
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/PutSecretValueResponse'
              example:
                ARN: arn:aws:secretsmanager:us-west-2:123456789012:secret:MyTestDatabaseSecret-a1b2c3
                Name: MyTestDatabaseSecret
                VersionId: EXAMPLE2-90ab-cdef-fedc-ba987EXAMPLE
                VersionStages:
                - AWSCURRENT
        '400':
          description: DecryptionFailure; EncryptionFailure; InvalidParameterException; InvalidRequestException; LimitExceededException;
            ResourceExistsException; ResourceNotFoundException
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/DecryptionFailure'
        '500':
          description: InternalServiceError
          content:
            application/x-amz-json-1.1:
              schema:
                $ref: '#/components/schemas/InternalServiceError'
      parameters:
      - name: X-Amz-Target
        in: header
        required: true
        schema:
          type: string
          enum:
          - secretsmanager.PutSecretValue
      requestBody:
        required: true
        content:
          application/x-amz-json-1.1:
            schema:
              $ref: '#/components/schemas/PutSecretValueRequest'
            example:
              SecretId: MyTestDatabaseSecret
              SecretString: '{"username":"david","password":"EXAMPLE-PASSWORD"}'
              ClientRequestToken: EXAMPLE2-90ab-cdef-fedc-ba987EXAMPLE
      tags:
      - Secret Value
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:
    APIErrorType:
      type: object
      properties:
        SecretId:
          type: string
          description: The ARN or name of the secret.
        ErrorCode:
          type: string
          description: The error Secrets Manager encountered while retrieving an individual secret as part of BatchGetSecretValue,
            for example ResourceNotFoundException,InvalidParameterException, InvalidRequestException, DecryptionFailure, or
            AccessDeniedException.
        Message:
          type: string
          description: A message describing the error.
    BatchGetSecretValueRequest:
      type: object
      properties:
        SecretIdList:
          type: array
          items:
            type: string
          description: The ARN or names of the secrets to retrieve. You must include Filters or SecretIdList, but not both.
        Filters:
          type: array
          items:
            $ref: '#/components/schemas/Filter'
          description: The filters to choose which secrets to retrieve. You must include Filters or SecretIdList, but not
            both.
        MaxResults:
          type: integer
          description: The number of results to include in the response. If there are more results available, in the response,
            Secrets Manager includes NextToken. To get the next results, call BatchGetSecretValue again with the value from
            NextToken. To use this parameter, you must also use the Filters parameter.
        NextToken:
          type: string
          description: A token that indicates where the output should continue from, if a previous call did not show all results.
            To get the next results, call BatchGetSecretValue again with this value.
    BatchGetSecretValueResponse:
      type: object
      properties:
        SecretValues:
          type: array
          items:
            $ref: '#/components/schemas/SecretValueEntry'
          description: A list of secret values.
        NextToken:
          type: string
          description: Secrets Manager includes this value if there's more output available than what is included in the current
            response. This can occur even when the response includes no values at all, such as when you ask for a filtered
            view of a long list. To get the next results, call BatchGetSecretValue again with this value.
        Errors:
          type: array
          items:
            $ref: '#/components/schemas/APIErrorType'
          description: A list of errors Secrets Manager encountered while attempting to retrieve individual secrets.
    DecryptionFailure:
      type: object
      properties:
        Message:
          type: string
    Filter:
      type: object
      properties:
        Key:
          type: string
          enum:
          - description
          - name
          - tag-key
          - tag-value
          - primary-region
          - owning-service
          - all
          description: 'The following are keys you can use: description: Prefix match, not case-sensitive. name: Prefix match,
            case-sensitive. tag-key: Prefix match, case-sensitive. tag-value: Prefix match, case-sensitive. primary-region:
            Prefix match, case-sensitive. owning-service: Prefix match, case-sensitive. all: Breaks the filter value string
            into words and then searches all attributes for matches. Not case-sensitive.'
        Values:
          type: array
          items:
            type: string
          description: The keyword to filter for. You can prefix your search value with an exclamation mark (!) in order to
            perform negation filters.
    GetSecretValueRequest:
      type: object
      properties:
        SecretId:
          type: string
          description: The ARN or name of the secret to retrieve. To retrieve a secret from another account, you must use
            an ARN. For an ARN, we recommend that you specify a complete ARN rather than a partial ARN. See Finding a secret
            from a partial ARN.
        VersionId:
          type: string
          description: The unique identifier of the version of the secret to retrieve. If you include both this parameter
            and VersionStage, the two parameters must refer to the same secret version. If you don't specify either a VersionStage
            or VersionId, then Secrets Manager returns the AWSCURRENT version. This value is typically a UUID-type value with
            32 hexadecimal digits.
        VersionStage:
          type: string
          description: The staging label of the version of the secret to retrieve. Secrets Manager uses staging labels to
            keep track of different versions during the rotation process. If you include both this parameter and VersionId,
            the two parameters must refer to the same secret version. If you don't specify either a VersionStage or VersionId,
            Secrets Manager returns the AWSCURRENT version.
      required:
      - SecretId
    GetSecretValueResponse:
      type: object
      properties:
        ARN:
          type: string
          description: The ARN of the secret.
        Name:
          type: string
          description: The friendly name of the secret.
        VersionId:
          type: string
          description: The unique identifier of this version of the secret.
        SecretBinary:
          type: string
          format: byte
          description: 'The decrypted secret value, if the secret value was originally provided as binary data in the form
            of a byte array. When you retrieve a SecretBinary using the HTTP API, the Python SDK, or the Amazon Web Services
            CLI, the value is Base64-encoded. Otherwise, it is not encoded. If the secret was created by using the Secrets
            Manager console, or if the secret value was originally provided as a string, then this field is omitted. The secret
            value appears in SecretString instead. Sensitive: This field contains sensitive information, so the service does
            not include it in CloudTrail log entries. If you'
        SecretString:
          type: string
          description: 'The decrypted secret value, if the secret value was originally provided as a string or through the
            Secrets Manager console. If this secret was created by using the console, then Secrets Manager stores the information
            as a JSON structure of key/value pairs. Sensitive: This field contains sensitive information, so the service does
            not include it in CloudTrail log entries. If you create your own log entries, you must also avoid logging the
            information in this field.'
        VersionStages:
          type: array
          items:
            type: string
          description: A list of all of the staging labels currently attached to this version of the secret.
        CreatedDate:
          type: string
          format: date-time
          description: The date and time that this version of the secret was created. If you don't specify which version in
            VersionId or VersionStage, then Secrets Manager uses the AWSCURRENT version.
    InternalServiceError:
      type: object
      properties:
        Message:
          type: string
    PutSecretValueRequest:
      type: object
      properties:
        SecretId:
          type: string
          description: The ARN or name of the secret to add a new version to. For an ARN, we recommend that you specify a
            complete ARN rather than a partial ARN. See Finding a secret from a partial ARN. If the secret doesn't already
            exist, use CreateSecret instead.
        ClientRequestToken:
          type: string
          description: A unique identifier for the new version of the secret. 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 include
            it in the request. This value helps ensure idempotency. Secrets Manager uses this value to prevent the accidental
            creation of duplicate versions if there are f
        SecretBinary:
          type: string
          format: byte
          description: 'The binary data to encrypt and store in the new version of the secret. To use this parameter in the
            command-line tools, we recommend that you store your binary data in a file and then pass the contents of the file
            as a parameter. You must include SecretBinary or SecretString, but not both. You can''t access this value from
            the Secrets Manager console. Sensitive: This field contains sensitive information, so the service does not include
            it in CloudTrail log entries. If you create your own log entries, you must also avoid logging the information
            in this field.'
        SecretString:
          type: string
          description: 'The text to encrypt and store in the new version of the secret. You must include SecretBinary or SecretString,
            but not both. We recommend you create the secret string as JSON key/value pairs, as shown in the example. Sensitive:
            This field contains sensitive information, so the service does not include it in CloudTrail log entries. If you
            create your own log entries, you must also avoid logging the information in this field.'
        VersionStages:
          type: array
          items:
            type: string
          description: A list of staging labels to attach to this version of the secret. Secrets Manager uses staging labels
            to track versions of a secret through the rotation process. If you specify a staging label that's already associated
            with a different version of the same secret, then Secrets Manager removes the label from the other version and
            attaches it to this version. If you specify AWSCURRENT, and it is already attached to another version, then Secrets
            Manager also moves the staging label AWSPREVIOUS to the version that AWSCURRENT was removed from. If you don't
            include VersionStages, then Secrets Manager
        RotationToken:
          type: string
          description: 'A unique identifier that indicates the source of the request. Required for secret rotations using
            an IAM assumed role or cross-account rotation, in which you rotate a secret in one account by using a Lambda rotation
            function in another account. In both cases, the rotation function assumes an IAM role to call Secrets Manager,
            and then Secrets Manager validates the identity using the token. For more information, see How rotation works
            and Rotation by Lambda functions. Sensitive: This field contains sensitive information, so the service does not
            include it in CloudTrail log entries. If you create'
      required:
      - SecretId
    PutSecretValueResponse:
      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 unique identifier of the version of the secret.
        VersionStages:
          type: array
          items:
            type: string
          description: The list of staging labels that are currently attached to this version of the secret. Secrets Manager
            uses staging labels to track a version as it progresses through the secret rotation process.
    SecretValueEntry:
      type: object
      properties:
        ARN:
          type: string
          description: The Amazon Resource Name (ARN) of the secret.
        Name:
          type: string
          description: The friendly name of the secret.
        VersionId:
          type: string
          description: The unique version identifier of this version of the secret.
        SecretBinary:
          type: string
          format: byte
          description: The decrypted secret value, if the secret value was originally provided as binary data in the form
            of a byte array. The parameter represents the binary data as a base64-encoded string.
        SecretString:
          type: string
          description: The decrypted secret value, if the secret value was originally provided as a string or through the
            Secrets Manager console.
        VersionStages:
          type: array
          items:
            type: string
          description: A list of all of the staging labels currently attached to this version of the secret.
        CreatedDate:
          type: string
          format: date-time
          description: The date the secret was created.
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)