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

# Add secrets

> Adds one or more secrets to a project. Send a single secret object or a bulk array.



## OpenAPI

````yaml https://api.anything.com/v0/api/openapi.json post /v0/api/projects/{projectGroupId}/secrets
openapi: 3.1.0
info:
  title: Anything API
  version: 0.1.0
  description: >-
    The Anything API is the fastest way for agents to build and launch mobile
    and web apps.
servers:
  - url: /
security: []
paths:
  /v0/api/projects/{projectGroupId}/secrets:
    post:
      tags:
        - Secrets
      summary: Add secrets
      description: >-
        Adds one or more secrets to a project. Send a single secret object or a
        bulk array.
      parameters:
        - schema:
            type: string
            format: uuid
          required: true
          name: projectGroupId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    secrets:
                      type: array
                      items:
                        type: object
                        properties:
                          displayName:
                            type: string
                            minLength: 1
                          envKey:
                            type: string
                            minLength: 2
                          value:
                            type: string
                            minLength: 1
                        required:
                          - displayName
                          - value
                      minItems: 1
                    environment:
                      type: string
                      enum:
                        - DEVELOPMENT
                        - PREVIEW
                        - PRODUCTION
                  required:
                    - secrets
                    - environment
                - type: object
                  properties:
                    displayName:
                      type: string
                      minLength: 1
                    value:
                      type: string
                      minLength: 1
                    environment:
                      type: string
                      enum:
                        - DEVELOPMENT
                        - PREVIEW
                        - PRODUCTION
                  required:
                    - displayName
                    - value
      responses:
        '201':
          description: Secret(s) created
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      secrets:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                            envKey:
                              type: string
                            displayName:
                              type: string
                            environment:
                              type: string
                          required:
                            - id
                            - envKey
                            - displayName
                            - environment
                    required:
                      - secrets
                  - type: object
                    properties:
                      secret:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                          envKey:
                            type: string
                          displayName:
                            type: string
                          environment:
                            type: string
                        required:
                          - id
                          - envKey
                          - displayName
                          - environment
                    required:
                      - secret
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                  - error
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                  - error
        '404':
          description: >-
            Not found — the referenced resource does not exist (including
            malformed resource IDs)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  details:
                    type: array
                    items: {}
                  message:
                    type: string
                required:
                  - error
      security:
        - basicAuth: []
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        Use your Anything API key as the Basic auth username and leave the
        password empty. Example credentials: anything_xxx:

````