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

# Credential Deletion

> Delete the credential of a system for a customer_key. For the wildcard credential or a certificate, use system_name "*".

<ParamField body="system_name" type="string" required>
  System of the credential, exactly as registered. For the wildcard credential or a digital certificate, use `*`.
</ParamField>

<ParamField body="customer_key" type="string">
  `customer_key` of the credential. If omitted, the default value `*` is used.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location --request DELETE 'https://crawler.prod.judit.io/credentials' \
  --header 'api-key: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
    "system_name": "PROJUDI TJGO - 1º grau",
    "customer_key": "lawyer_01"
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {}
  ```
</ResponseExample>

<Accordion title="Possible errors">
  | Code | HTTP | When it happens |
  | :- | :- | :- |
  | Validation error | 400 | `system_name` is missing. |
  | `SOURCE_NOT_FOUND` | 404 | The `system_name` does not match any system in the vault. |
  | `CREDENTIAL_NOT_FOUND` | 404 | There is no credential for this `system_name` and `customer_key` combination. |
</Accordion>

If the credential holds a digital certificate, the stored file is deleted with it.


## OpenAPI

````yaml openapi/vault.json DELETE /credentials
openapi: 3.0.3
info:
  title: JUDIT - Credentials Vault API
  description: >-
    OpenAPI description for the credentials vault routes: register, inspect and
    delete per-tribunal credentials (username/password, 2FA secret or A1
    certificate).
  version: 1.0.0
servers:
  - url: https://crawler.prod.judit.io
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Credentials
    description: Register and inspect tribunal system credentials stored in the vault
paths:
  /credentials:
    delete:
      tags:
        - Credentials
      summary: Delete a credential
      description: >-
        Deletes the credential of a system for a `customer_key`. To delete the
        wildcard credential or a certificate, use `system_name: "*"`. A stored
        certificate is deleted together with the credential.
      operationId: deleteCredential
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - system_name
              properties:
                system_name:
                  type: string
                  description: System name as registered, or `*`.
                customer_key:
                  type: string
                  description: Credential key. Defaults to `*`.
            example:
              system_name: PROJUDI TJGO - 1º grau
              customer_key: advogado_01
      responses:
        '200':
          description: Credential deleted
          content:
            application/json:
              schema:
                type: object
              example: {}
        '400':
          description: Invalid body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: '`SOURCE_NOT_FOUND` (unknown system) or `CREDENTIAL_NOT_FOUND`'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      description: Error envelope. The specific error code is in `data`.
      properties:
        error:
          type: object
          properties:
            name:
              type: string
              example: HttpBadRequestError
            message:
              type: string
              example: BAD_REQUEST
            data:
              type: array
              items:
                type: string
              example:
                - PFX_PASSWORD_INVALID
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: api-key
      description: API key for authentication

````

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