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

# Create Secret

> Create a new secret in a workspace



## OpenAPI

````yaml POST /workspaces/{workspace_id}/secrets
openapi: 3.0.0
info:
  description: API For SiftD Platform Intelligence Notebooks(SPIN)
  title: SPIN Server API
  contact: {}
  version: '1.0'
servers:
  - url: https://s-server-demo.siftd.ai/api
security:
  - bearerAuth: []
paths:
  /workspaces/{workspace_id}/secrets:
    post:
      tags:
        - secrets
      summary: Create secret
      description: Create a new secret in a workspace
      parameters:
        - description: Organization ID
          name: org_id
          in: query
          required: true
          schema:
            type: string
        - description: Workspace ID
          name: workspace_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/models.Secret'
        description: Secret object
        required: true
      responses:
        '201':
          description: Created
          headers:
            Location:
              description: /api/workspaces/{workspace_id}/secrets/{secret_id}
              schema:
                type: string
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/models.Secret'
components:
  schemas:
    models.Secret:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        store_ref:
          type: string
        store_type:
          $ref: '#/components/schemas/models.SecretStoreType'
        value:
          type: string
    models.SecretStoreType:
      type: string
      enum:
        - spin_store
        - runtime_env
        - runtime_file
      x-enum-varnames:
        - SECRET_STORE_TYPE_SPIN
        - SECRET_STORE_TYPE_RTENV
        - SECRET_STORE_TYPE_RTFILE
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````