> ## Documentation Index
> Fetch the complete documentation index at: https://cobalt-55-abhishek.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete Default-App Credential

> Remove a single auth credential from the org's default app.

Remove a named credential key from the linked account's default-app `authTokens` and invalidate the integration's token cache.

## Authentication

This endpoint accepts **either** authentication method.

**Option 1 — API key**

<ParamField header="x-api-key" type="string">
  Your Refold API key. Find it in **Settings → Credentials**.
</ParamField>

<ParamField header="linked_account_id" type="string">
  The linked account to operate on. May also be passed as a query parameter.
</ParamField>

**Option 2 — Session token**

<ParamField header="Authorization" type="string">
  Session token for the linked account (the account is taken from the token).

  **Format:** `Bearer YOUR_SESSION_TOKEN`
</ParamField>

## Path Parameters

<ParamField path="key" type="string" required>
  The credential key name to remove.

  **Example:** `api_key`
</ParamField>

## Response

<Tabs>
  <Tab title="200 OK">
    <ResponseField name="success" type="boolean">Whether the deletion succeeded.</ResponseField>
    <ResponseField name="message" type="string">Confirmation message.</ResponseField>
  </Tab>

  <Tab title="404 Not Found">
    Returned when the key (or the default-app integration) does not exist.
    <ResponseField name="status_code" type="integer">HTTP status code.</ResponseField>
    <ResponseField name="http_error_type" type="string">Error category, e.g. `NOT_FOUND`.</ResponseField>
    <ResponseField name="error" type="string">Internal error code, e.g. `RESOURCE_NOT_FOUND`.</ResponseField>
    <ResponseField name="message" type="string">Human-readable error description.</ResponseField>
  </Tab>
</Tabs>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "message": "Auth credential 'api_key' deleted successfully"
  }
  ```

  ```json 404 Key Not Found theme={null}
  {
    "status_code": 404,
    "http_error_type": "NOT_FOUND",
    "error": "RESOURCE_NOT_FOUND",
    "message": "Auth credential key 'api_key' not found"
  }
  ```

  ```json 404 No Default App theme={null}
  {
    "status_code": 404,
    "http_error_type": "NOT_FOUND",
    "error": "RESOURCE_NOT_FOUND",
    "message": "Default app integration not found for linked account user_12345"
  }
  ```
</ResponseExample>

<RequestExample>
  ```bash cURL (API key) theme={null}
  curl -X DELETE "https://app.refold.ai/api/v2/public/linked-account/default-app/auth-credentials/{key}?linked_account_id=YOUR_LINKED_ACCOUNT_ID" \
    -H "x-api-key: YOUR_API_KEY"
  ```

  ```bash cURL (session token) theme={null}
  curl -X DELETE "https://app.refold.ai/api/v2/public/linked-account/default-app/auth-credentials/{key}" \
    -H "Authorization: Bearer YOUR_SESSION_TOKEN"
  ```
</RequestExample>
