> ## Documentation Index
> Fetch the complete documentation index at: https://www.truefoundry.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a secret group

> Create a secret group with initial secrets.



## OpenAPI

````yaml /openapi.json post /api/svc/v1/secret-groups
openapi: 3.1.0
info:
  title: TrueFoundry API
  description: API for TrueFoundry
  version: 0.1.0
  contact: {}
servers:
  - url: https://{controlPlaneURL}
    variables:
      controlPlaneURL:
        default: app.truefoundry.com
        description: Control Plane URL
security: []
tags:
  - name: Agent
  - name: Agent Skills
  - name: Applications
  - name: Metrics
  - name: Apply
  - name: Artifacts
  - name: Audit Logs
  - name: Clusters
  - name: Jobs
  - name: Logs
  - name: MCP Servers V2
  - name: MLRepos
  - name: Model Deployments
  - name: Models
  - name: Personal Access Tokens
  - name: Prompts
  - name: Provider Integrations
  - name: SCIM v2
  - name: Secret Groups
  - name: Secrets
  - name: Teams
  - name: Traces
  - name: Users
  - name: Virtual Accounts
  - name: Role Bindings
  - name: Workspaces
paths:
  /api/svc/v1/secret-groups:
    post:
      tags:
        - Secret Groups
      summary: Create a secret group
      description: Create a secret group with initial secrets.
      operationId: SecretGroup.post
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSecretGroupRequest'
      responses:
        '200':
          description: The created secret group.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetSecretGroupResponse'
        '422':
          description: Missing required fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
        '424':
          description: No secret store integration found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpError'
      security:
        - jwt: []
components:
  schemas:
    CreateSecretGroupRequest:
      type: object
      properties:
        name:
          type: string
          description: Name of the secret group.
        integrationId:
          type: string
          description: Id of the provider integration.
        secrets:
          description: The secrets to be associated with the secret group
          type: array
          items:
            $ref: '#/components/schemas/SecretInput'
      required:
        - name
        - integrationId
        - secrets
      title: CreateSecretGroupRequest
      x-fern-type-name: CreateSecretGroupRequest
    GetSecretGroupResponse:
      type: object
      properties:
        data:
          description: Secret Group
          allOf:
            - $ref: '#/components/schemas/SecretGroup'
      required:
        - data
      title: GetSecretGroupResponse
      x-fern-type-name: GetSecretGroupResponse
    HttpError:
      type: object
      properties:
        statusCode:
          type: integer
          description: HTTP Status Code
        message:
          type: string
          description: Error Message
        code:
          oneOf:
            - type: integer
            - type: string
          description: Error code
          nullable: true
        details:
          type: array
          description: Error details
          items:
            type: object
          nullable: true
      required:
        - statusCode
        - message
      title: HttpError
      x-fern-type-name: HttpError
    SecretInput:
      type: object
      properties:
        key:
          type: string
          description: Key of the secret.
        value:
          type: string
          description: Value of the secret.
      required:
        - key
        - value
      title: SecretInput
      x-fern-type-name: SecretInput
    SecretGroup:
      type: object
      properties:
        id:
          type: string
          nullable: true
        fqn:
          type: string
          nullable: true
        tenantName:
          type: string
        createdBySubject:
          $ref: '#/components/schemas/Subject'
        associatedSecrets:
          type: array
          items:
            $ref: '#/components/schemas/Secret'
        integrationId:
          type: string
          nullable: true
        manifest:
          type: object
          nullable: true
        accountId:
          type: string
          nullable: false
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        createdBy:
          type: string
          nullable: true
      required:
        - tenantName
        - createdBySubject
        - associatedSecrets
        - accountId
        - createdAt
        - updatedAt
      title: SecretGroup
      x-fern-type-name: SecretGroup
    Subject:
      type: object
      properties:
        subjectId:
          type: string
          description: Subject ID
        subjectType:
          description: Subject type
          allOf:
            - $ref: '#/components/schemas/SubjectType'
        subjectSlug:
          type: string
          description: Subject slug
          nullable: true
        subjectDisplayName:
          type: string
          description: Subject display name
          nullable: true
        subjectPatName:
          type: string
          description: Subject PAT name
          nullable: true
        subjectControllerName:
          type: string
          nullable: true
        subjectExternalIdentitySlug:
          type: string
          description: External identity slug (external_identity_id:sub:email)
          nullable: true
      required:
        - subjectId
        - subjectType
      title: Subject
      x-fern-type-name: Subject
    Secret:
      type: object
      properties:
        id:
          type: string
        fqn:
          type: string
        name:
          type: string
        secretGroupId:
          type: string
        value:
          type: string
          nullable: true
        createdBySubject:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Subject'
        createdAt:
          format: date-time
          type: string
          nullable: true
        updatedAt:
          format: date-time
          type: string
          nullable: true
        secretVersions:
          nullable: true
          type: array
          items:
            $ref: '#/components/schemas/SecretVersion'
        activeDeploymentsCount:
          type: integer
          nullable: true
        createdBy:
          type: string
          nullable: true
      required:
        - id
        - fqn
        - name
        - secretGroupId
      title: Secret
      x-fern-type-name: Secret
    SubjectType:
      type: string
      enum:
        - user
        - team
        - serviceaccount
        - virtualaccount
        - external-identity
        - agent-identity
        - role
      description: >-
        Type of the authenticated subject. "user" for human users,
        "serviceaccount" (also known as virtual account) for programmatic
        access.
      title: SubjectType
      x-fern-type-name: SubjectType
    SecretVersion:
      type: object
      properties:
        id:
          type: string
        fqn:
          type: string
        value:
          type: string
          nullable: true
        version:
          type: number
          nullable: true
        secret:
          nullable: true
          allOf:
            - $ref: '#/components/schemas/Secret'
        secretId:
          type: string
          nullable: true
        createdAt:
          format: date-time
          type: string
          nullable: true
        updatedAt:
          format: date-time
          type: string
          nullable: true
      required:
        - id
        - fqn
      title: SecretVersion
      x-fern-type-name: SecretVersion
  securitySchemes:
    jwt:
      type: http
      scheme: bearer
      bearerFormat: JWT

````