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

# Create Secret



## OpenAPI

````yaml /openapi.json post /api/v1/secrets
openapi: 3.1.0
info:
  title: Trajectory API
  version: 0.1.0
servers:
  - url: https://api.trajectory.ai
security: []
paths:
  /api/v1/secrets:
    post:
      tags:
        - secrets
      summary: Create Secret
      operationId: createSecret
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSecretRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateSecretResponse'
        default:
          $ref: '#/components/responses/ApiErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateSecretRequest:
      properties:
        name:
          type: string
          title: Name
          description: Name to reference the secret by; unique among live secrets.
        value:
          type: string
          title: Value
          description: The secret value. Write-only — never returned after creation.
        description:
          anyOf:
            - type: string
              maxLength: 1024
            - type: 'null'
          title: Description
          description: Optional human-readable description.
      type: object
      required:
        - name
        - value
      title: CreateSecretRequest
    CreateSecretResponse:
      properties:
        secret:
          $ref: '#/components/schemas/Secret'
          description: Metadata for the newly created secret.
      type: object
      required:
        - secret
      title: CreateSecretResponse
    Secret:
      properties:
        secret_id:
          type: string
          title: Secret Id
          description: Opaque identifier used to reference the secret.
        name:
          type: string
          title: Name
          description: Name the secret is referenced by (e.g. in ${secret:NAME}).
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional human-readable description.
        byte_length:
          type: integer
          title: Byte Length
          description: Length of the secret value in UTF-8 bytes.
        created_at:
          anyOf:
            - type: string
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: UTC timestamp the secret was created.
        updated_at:
          anyOf:
            - type: string
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: UTC timestamp the secret was last updated.
      type: object
      required:
        - secret_id
        - name
        - byte_length
      title: Secret
    ApiErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/ApiErrorBody'
      required:
        - error
      title: ApiErrorEnvelope
      type: object
    ApiErrorBody:
      properties:
        type:
          $ref: '#/components/schemas/ErrorType'
        code:
          title: Code
          type: string
        message:
          type: string
          title: Message
        param:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Param
        doc_url:
          type: string
          title: Doc Url
        context:
          additionalProperties: true
          title: Context
          type: object
      required:
        - type
        - code
        - message
        - doc_url
        - context
      title: ApiErrorBody
      type: object
    ErrorType:
      enum:
        - invalid_request_error
        - authentication_error
        - permission_error
        - conflict_error
        - rate_limit_error
        - dependency_error
        - api_error
      title: ErrorType
      type: string
  responses:
    ApiErrorResponse:
      description: >-
        Common API error. Possible codes: `authentication_required`,
        `permission_denied`, `validation_error`, `rate_limited`,
        `internal_error`, `service_unavailable`.
      headers:
        X-Request-ID:
          $ref: '#/components/headers/RequestId'
        Trajectory-Should-Retry:
          $ref: '#/components/headers/TrajectoryShouldRetry'
        Retry-After:
          $ref: '#/components/headers/RetryAfter'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorEnvelope'
  headers:
    RequestId:
      schema:
        type: string
    TrajectoryShouldRetry:
      schema:
        type: boolean
    RetryAfter:
      schema:
        type: string
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Organization API key

````