> ## 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.

# Remoção de Credencial

> Remova a credencial de um sistema para uma customer_key. Para a credencial coringa ou um certificado, use system_name "*".

<ParamField body="system_name" type="string" required>
  Sistema da credencial, exatamente como foi cadastrado. Para a credencial coringa ou para um certificado digital, use `*`.
</ParamField>

<ParamField body="customer_key" type="string">
  `customer_key` da credencial. Se omitido, é usado o valor padrão `*`.
</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": "advogado_01"
  }'
  ```
</RequestExample>

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

<Accordion title="Erros possíveis">
  | Código | HTTP | Quando acontece |
  | :- | :- | :- |
  | Erro de validação | 400 | `system_name` ausente. |
  | `SOURCE_NOT_FOUND` | 404 | O `system_name` não corresponde a nenhum sistema do Cofre. |
  | `CREDENTIAL_NOT_FOUND` | 404 | Não há credencial para essa combinação de `system_name` e `customer_key`. |
</Accordion>

Se a credencial tiver um certificado digital, o arquivo armazenado é apagado junto.


## 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.