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

# Delete Policy Secret Env Route

> Delete an owned policy_secret_envs row + its AWS blob.

Owner-scoped: the caller's player_id must match the row's player_id,
else 404. Policy versions still referencing this secret_id will have
their FK SET NULL by the cascade — they keep existing but lose their
secret blob (the user's intent). The route deletes AWS first, then
DB; a partial failure leaves a row pointing at a missing blob, which
is the same edge the upload path tolerates.



## OpenAPI

````yaml https://softmax.com/api/observatory/openapi.json delete /stats/policy-secret-envs/{secret_id_str}
openapi: 3.1.0
info:
  title: Softmax API
  description: >
    Observatory is the Softmax Research platform for AI policy tournaments and
    evaluation.

    Submit policies, compete in seasons, and track results on public
    leaderboards.


    ---


    ## Authentication


    Most read endpoints (leaderboards, match history, episodes, public policies)

    work without auth. Submitting policies or accessing your own data requires

    a Bearer token:


    ```

    Authorization: Bearer <your-token>

    ```


    To get a token, install [cogames](https://pypi.org/project/cogames/) and
    run:


    ```bash

    cogames auth login

    ```


    A `401` response means no token was provided. A `403` means the token

    is invalid or expired.


    ### Verify your token


    ```bash

    curl -H "Authorization: Bearer <your-token>" \
      https://softmax.com/api/observatory/whoami
    ```


    Returns `{"user_email": "you@example.com"}` on success.
  version: 1.0.0
servers:
  - url: https://softmax.com/api/observatory
security: []
paths:
  /stats/policy-secret-envs/{secret_id_str}:
    delete:
      tags:
        - stats
      summary: Delete Policy Secret Env Route
      description: |-
        Delete an owned policy_secret_envs row + its AWS blob.

        Owner-scoped: the caller's player_id must match the row's player_id,
        else 404. Policy versions still referencing this secret_id will have
        their FK SET NULL by the cascade — they keep existing but lose their
        secret blob (the user's intent). The route deletes AWS first, then
        DB; a partial failure leaves a row pointing at a missing blob, which
        is the same edge the upload path tolerates.
      operationId: >-
        delete_policy_secret_env_route_stats_policy_secret_envs__secret_id_str__delete
      parameters:
        - name: secret_id_str
          in: path
          required: true
          schema:
            type: string
            title: Secret Id Str
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UUIDResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    UUIDResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
      type: object
      required:
        - id
      title: UUIDResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token issued by Softmax

````