# `GET /v1/workspace/apps/{appId}/secrets` — List an App's secrets

Part of the [Bkper Managed Agent API](https://bkper.com/docs/api/managed-agent.md). Read its guide for authentication, conventions, and examples.

The names of the secrets of the App's production and preview deployments, or that it is not deployed there yet; never their values. For anyone Bkper lets see the App; 404 not_found for any other App. Only with the user's own token: through an App or channel bot, 404. For every App Bkper knows, managed or hosted elsewhere; deploying keeps them. Values are write-only: never returned, logged or shown to the agent.

## Operation contract

```json
{
  "operationId": "listAppSecrets",
  "tags": [
    "Workspace"
  ],
  "summary": "List an App's secrets",
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "parameters": [
    {
      "name": "appId",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string",
        "pattern": "^[A-Za-z0-9_-]{1,64}$"
      }
    }
  ],
  "description": "The names of the secrets of the App's production and preview deployments, or that it is not deployed there yet; never their values. For anyone Bkper lets see the App; 404 not_found for any other App. Only with the user's own token: through an App or channel bot, 404. For every App Bkper knows, managed or hosted elsewhere; deploying keeps them. Values are write-only: never returned, logged or shown to the agent.",
  "responses": {
    "200": {
      "description": "Success",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/AppSecrets"
          }
        }
      }
    },
    "400": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "401": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "403": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "404": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "409": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "410": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "411": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "413": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "422": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    },
    "503": {
      "description": "Rejected; never contains credentials or upstream payloads.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      }
    }
  }
}
```

## Schemas

### AppSecrets

```json
{
  "type": "object",
  "properties": {
    "production": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "deployed": {
              "type": "boolean",
              "const": true
            },
            "names": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Its secrets' names, never their values."
            }
          },
          "required": [
            "deployed",
            "names"
          ]
        },
        {
          "type": "object",
          "properties": {
            "deployed": {
              "type": "boolean",
              "const": false
            }
          },
          "required": [
            "deployed"
          ],
          "description": "The App is not deployed there yet: nothing to set until it is."
        }
      ],
      "description": "The App's production deployment."
    },
    "preview": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "deployed": {
              "type": "boolean",
              "const": true
            },
            "names": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Its secrets' names, never their values."
            }
          },
          "required": [
            "deployed",
            "names"
          ]
        },
        {
          "type": "object",
          "properties": {
            "deployed": {
              "type": "boolean",
              "const": false
            }
          },
          "required": [
            "deployed"
          ],
          "description": "The App is not deployed there yet: nothing to set until it is."
        }
      ],
      "description": "The App's preview deployment."
    }
  },
  "required": [
    "production",
    "preview"
  ],
  "description": "The secrets of an App's deployments on Bkper, by name: what `bkper app secrets list` shows."
}
```

### Error

```json
{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable code, e.g. not_found, idempotency_conflict, session_working, usage_limit_exceeded. Open."
        },
        "type": {
          "description": "Category, e.g. invalid_request_error, authentication_error, usage_limit_error. Open.",
          "type": "string"
        },
        "message": {
          "type": "string"
        },
        "host": {
          "description": "host_in_use: the host another service holds.",
          "type": "string"
        },
        "service": {
          "description": "host_in_use: the id of the service that holds the host.",
          "type": "string"
        },
        "reason": {
          "description": "file_invalid: why the change, or a picture, was refused. Open: path | text | size | skill | skills | count | type.",
          "type": "string"
        },
        "paths": {
          "description": "file_exists from an add: every path of the request where a file is and `replace` was not set, all at once, so the person can be asked once. publish_conflict: the files someone published changes to the same lines of.",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "publishers": {
          "description": "publish_conflict: who published those changes, by name.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "code"
      ]
    }
  },
  "required": [
    "error"
  ]
}
```

## Authentication

```json
{
  "bearerAuth": {
    "type": "http",
    "scheme": "bearer"
  }
}
```
