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

# Bulk delete agent secrets

> Permanently deletes one or more named secrets from the Matillion Hosted Customer Vault (MHCV) associated with the given Agent. Supported only for Maia Hosted Runners - not available for customer-hosted runners (AWS/Azure/Snowflake/GCP secret managers). Deletion is a hard delete with no recovery window: recreating a secret with the same name afterwards is unobstructed and lands as a fresh version.

Returns 207 once the vault has answered with an outcome for every name, including when every name failed - the response body carries both `success` and `error` arrays on every 207, and a naive client checking `status == 200` will treat every successful call as a failure. A failure before the runner reports any outcomes (for example the runner is unreachable or does not support deletion) returns 400/403/500/504 instead. The `success` array holds both freshly deleted secrets (`outcome: DELETED`) and names that were already absent (`outcome: ALREADY_ABSENT`) - both count as success, since the caller's intent ("ensure these secrets do not exist") is satisfied either way. Deletion is idempotent from the caller's perspective, so retrying a request can report `ALREADY_ABSENT` for a name the first attempt actually deleted.



## OpenAPI

````yaml /openapi/public-api-endpoint-reference.yaml delete /v1/agents/{agentId}/secrets
openapi: 3.1.0
info:
  title: Maia Public REST API
  version: '1.0'
servers:
  - description: EU1
    url: https://eu1.api.matillion.com/dpc
  - description: US1
    url: https://us1.api.matillion.com/dpc
  - description: AU1
    url: https://au1.api.matillion.com/dpc
  - description: EU2
    url: https://eu2.api.matillion.com/dpc
security:
  - bearerAuth: []
tags:
  - description: Operations for managing Project Variables
    name: Project Variables
  - description: Manage Pipelines
    name: Pipelines
  - description: >-
      Describe how to configure a connection for a given auth provider, auth
      type and platform connection type.
    name: Connection Schema
  - description: Manage your AI agent tasks
    name: AI Agent Tasks
  - description: SCIM endpoints for user/group permission management
    name: Directory Integration
  - description: Manage Artifacts
    name: Artifacts
  - description: Manage Streaming Pipelines
    name: Streaming Pipelines
  - description: ''
    name: Projects
  - description: Connector Profiles
    name: Connectors
  - description: >-
      Validate Matillion resources against the Vanguard validation framework.
      Pipeline resource files (orchestration, transformation, test) are the only
      supported resource type today; support for additional resource types (e.g.
      SQL scripts or Python source files) is anticipated in future.
    name: Resource Validation
  - description: Manage Schedules
    name: Schedules
  - description: Manage Connections
    name: Connections
  - description: Review pipelines against quality rules
    name: Pipeline Quality Review
  - description: Execute tests within a project
    name: Test Execution
  - description: Publish shared pipeline artifacts
    name: Shared Pipeline Artifacts
  - description: Manage Repositories
    name: Repositories
  - description: Report on Credit Consumption
    name: Consumption
  - description: >-
      Start and track the migration of a Git repository into a project's working
      tree.
    name: Repository Migration
  - description: Operations for data lineage and governance
    name: Data Lineage
  - description: Manage Runners
    name: Runners
  - description: Execute a pipeline
    name: Pipeline Execution
  - description: ''
    name: Environments
  - description: Operations for managing Environment-level Overrides of Project Variables
    name: Project Variable Environment Overrides
  - description: Manage secrets stored in an Agent's Matillion-hosted vault.
    name: Agent Secrets
  - description: Query audit events
    name: Audit Events
paths:
  /v1/agents/{agentId}/secrets:
    delete:
      tags:
        - Agent Secrets
      summary: Bulk delete agent secrets
      description: >-
        Permanently deletes one or more named secrets from the Matillion Hosted
        Customer Vault (MHCV) associated with the given Agent. Supported only
        for Maia Hosted Runners - not available for customer-hosted runners
        (AWS/Azure/Snowflake/GCP secret managers). Deletion is a hard delete
        with no recovery window: recreating a secret with the same name
        afterwards is unobstructed and lands as a fresh version.


        Returns 207 once the vault has answered with an outcome for every name,
        including when every name failed - the response body carries both
        `success` and `error` arrays on every 207, and a naive client checking
        `status == 200` will treat every successful call as a failure. A failure
        before the runner reports any outcomes (for example the runner is
        unreachable or does not support deletion) returns 400/403/500/504
        instead. The `success` array holds both freshly deleted secrets
        (`outcome: DELETED`) and names that were already absent (`outcome:
        ALREADY_ABSENT`) - both count as success, since the caller's intent
        ("ensure these secrets do not exist") is satisfied either way. Deletion
        is idempotent from the caller's perspective, so retrying a request can
        report `ALREADY_ABSENT` for a name the first attempt actually deleted.
      operationId: deleteSecrets
      parameters:
        - description: The ID of the agent whose vault the secrets are stored in.
          in: path
          name: agentId
          required: true
          schema:
            type: string
        - description: >-
            Comma-separated list of secret names to delete (1-50 names per
            request). The parameter can also be repeated instead
            (`secretNames=a&secretNames=b`); a name containing a comma must be
            sent this way, repeated even if it is the only name
            (`secretNames=a,b&secretNames=a,b`), to disambiguate it from two
            names.
          in: query
          name: secretNames
          required: true
          schema:
            type: array
            items:
              type: string
            maxItems: 50
            minItems: 1
            uniqueItems: true
      responses:
        '207':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkDeleteSecretsResponse'
          description: >-
            Per-secret delete outcomes. Always returned, including on complete
            success (with an empty `error` array) and total failure (with an
            empty `success` array).
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: >-
            Invalid request, or the agent's vault does not support secret
            deletion
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Forbidden
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Unexpected error occurred
        '504':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: Gateway timeout
components:
  schemas:
    BulkDeleteSecretsResponse:
      type: object
      description: >-
        Per-secret outcomes for a bulk delete request. Both `success` and
        `error` are always present, including when one of them is empty.
      properties:
        error:
          type: array
          description: >-
            Secrets that could not be deleted due to an internal failure.
            Retrying the request may succeed.
          items:
            $ref: '#/components/schemas/SecretDeleteError'
        success:
          type: array
          description: >-
            Secrets that either were deleted or were already absent - see the
            `outcome` field on each entry to distinguish the two.
          items:
            $ref: '#/components/schemas/DeletedSecret'
      required:
        - error
        - success
    ProblemDetail:
      type: object
      properties:
        detail:
          type: string
        instance:
          type: string
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
          format: uri
        violations:
          type: array
          items:
            type: string
    SecretDeleteError:
      type: object
      description: >-
        A secret name for which the delete request failed due to an internal
        error.
      properties:
        name:
          type: string
          description: The requested secret name.
        status:
          type: string
          description: >-
            The HTTP status code describing the failure category, as a string.
            Always "500", since per-name failures are not distinguished by
            category.
        title:
          type: string
          description: A short, human-readable description of the failure.
      required:
        - name
        - status
        - title
    DeletedSecret:
      type: object
      description: >-
        A secret name for which the delete request completed without an internal
        error - either because it was permanently deleted, or because it did not
        exist to begin with.
      properties:
        name:
          type: string
          description: The requested secret name.
        outcome:
          type: string
          description: >-
            Whether the secret was actually deleted, or was already absent. Both
            count as success.
          enum:
            - DELETED
            - ALREADY_ABSENT
      required:
        - name
        - outcome
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: a valid bearer token
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.