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

# Create secret

> Create a secret in your project.



## OpenAPI

````yaml post /v1/secrets
openapi: 3.0.3
info:
  title: Execute
  version: 0.1.4
servers:
  - url: https://api.riza.io
security:
  - bearerHttpAuthentication: []
paths:
  /v1/secrets:
    post:
      tags:
        - Secret
      summary: Create secret
      description: Create a secret in your project.
      operationId: createSecret
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSecretRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Secret'
          description: OK
        '401':
          content:
            application/json:
              examples:
                unauthenticated:
                  value:
                    code: 16
                    message: unauthenticated
              schema:
                $ref: '#/components/schemas/Status'
          description: Unauthenticated error response
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Riza from '@riza-io/api';


            const client = new Riza({
              apiKey: process.env['RIZA_API_KEY'], // This is the default and can be omitted
            });


            const secret = await client.secrets.create({ name: 'name', value:
            'value' });


            console.log(secret.id);
        - lang: Python
          source: |-
            import os
            from rizaio import Riza

            client = Riza(
                api_key=os.environ.get("RIZA_API_KEY"),  # This is the default and can be omitted
            )
            secret = client.secrets.create(
                name="name",
                value="value",
            )
            print(secret.id)
        - lang: Go
          source: |
            package main

            import (
              "context"
              "fmt"

              "github.com/riza-io/riza-api-go"
              "github.com/riza-io/riza-api-go/option"
            )

            func main() {
              client := riza.NewClient(
                option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("RIZA_API_KEY")
              )
              secret, err := client.Secrets.New(context.TODO(), riza.SecretNewParams{
                Name: riza.F("name"),
                Value: riza.F("value"),
              })
              if err != nil {
                panic(err.Error())
              }
              fmt.Printf("%+v\n", secret.ID)
            }
components:
  schemas:
    CreateSecretRequest:
      properties:
        name:
          type: string
        value:
          type: string
      required:
        - name
        - value
      type: object
    Secret:
      properties:
        id:
          type: string
        name:
          type: string
      required:
        - id
        - name
      type: object
    Status:
      properties:
        code:
          description: >-
            The status code, which should be an enum value of
            [google.rpc.Code][google.rpc.Code].
          type: integer
        message:
          description: >-
            A developer-facing error message, which should be in English. Any
            user-facing error message should be localized and sent in the
            [google.rpc.Status.details][google.rpc.Status.details] field, or
            localized by the client.
          type: string
      type: object
  securitySchemes:
    bearerHttpAuthentication:
      scheme: bearer
      type: http

````