---
updatedAt: 2026-05-22T00:42:32.000Z
agentTools:
  projectIndex: https://docs.oneschema.co/llms.txt
---

# Create Managed Secret

Create a new managed secret reference within an AWS Secrets Manager account.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "AWS Secrets Manager",
    "version": "0.0.1",
    "contact": {
      "name": "OneSchema Support",
      "email": "support@oneschema.co"
    },
    "license": {
      "name": "proprietary",
      "url": "https://www.oneschema.co/terms-and-conditions"
    },
    "termsOfService": "https://www.oneschema.co/terms-and-conditions",
    "description": "An API for managing AWS Secrets Manager connections and managed secrets in OneSchema."
  },
  "tags": [
    {
      "name": "AWS Secrets Manager Secrets",
      "description": "Manage secret references within AWS Secrets Manager accounts"
    }
  ],
  "paths": {
    "/v0/aws-secrets-manager/accounts/{account-id}/secrets": {
      "post": {
        "operationId": "create-aws-secrets-manager-secret",
        "summary": "Create Managed Secret",
        "description": "Create a new managed secret reference within an AWS Secrets Manager account.",
        "parameters": [
          {
            "name": "account-id",
            "in": "path",
            "required": true,
            "description": "The ID of the AWS Secrets Manager account",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/aws-managed-secret-resource"
                }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error-response"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized (missing or invalid API key)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error-response"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error-response"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error-response"
                }
              }
            }
          }
        },
        "tags": [
          "AWS Secrets Manager Secrets"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/aws-managed-secret-post-request"
              }
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "components": {
    "schemas": {
      "aws-managed-secret-post-request": {
        "type": "object",
        "required": [
          "name",
          "secret_identifier",
          "region"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "A descriptive label for this secret reference"
          },
          "secret_identifier": {
            "type": "string",
            "description": "The name or ARN of the secret in AWS Secrets Manager"
          },
          "region": {
            "type": "string",
            "description": "The AWS region where the secret is stored"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "An optional description"
          },
          "secret_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "A specific version ID or stage label (omit to use the latest version)"
          },
          "version_kind": {
            "type": "string",
            "enum": [
              "id",
              "stage"
            ],
            "description": "Selects whether secret_version is treated as a VersionId or VersionStage for AWS GetSecretValue"
          }
        }
      },
      "aws-managed-secret-resource": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "The unique identifier of the managed secret"
          },
          "name": {
            "type": "string",
            "description": "The name of the managed secret"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "description": "An optional description"
          },
          "account_id": {
            "type": "integer",
            "description": "The account this secret belongs to"
          },
          "secret_identifier": {
            "type": "string",
            "description": "The identifier used to fetch the secret from AWS Secrets Manager"
          },
          "secret_version": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "region": {
            "type": "string",
            "description": "The AWS region where the secret is stored"
          },
          "version_kind": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "id",
                  "stage"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Selects whether secret_version is treated as a VersionId or VersionStage for AWS GetSecretValue"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "error-response": {
        "type": "object",
        "required": [
          "message"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "A machine-readable error code"
          },
          "param": {
            "type": "string",
            "description": "The parameter that caused the error"
          },
          "message": {
            "type": "string",
            "description": "A human-readable error message"
          },
          "data": {
            "type": "object",
            "description": "Additional error context"
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.oneschema.co",
      "description": "Production server (hosted in the US)",
      "variables": {}
    },
    {
      "url": "https://api.eu.oneschema.co",
      "description": "Production server (hosted in the EU)",
      "variables": {}
    },
    {
      "url": "https://api.ca.oneschema.co",
      "description": "Production server (hosted in Canada)",
      "variables": {}
    },
    {
      "url": "https://api.au.oneschema.co",
      "description": "Production server (hosted in Australia)",
      "variables": {}
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```