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

# Delete an end user

> Soft-delete an end-user record by ID, cascading to its related data as an audited event.

After a delete, the record no longer appears in list or get responses, and a second delete returns `404`. Your audit log records the delete as **enduser.deleted**, with the API key as the source.

Requires a key with the **End-users** permission. See [API authentication](/docs/developer/authentication).

<ParamField path="endUserId" type="string" required>
  The `_id` of the record, as returned by list or create.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  `true` on success.
</ResponseField>

<ResponseExample>
  ```json 200 theme={null}
  { "success": true }
  ```
</ResponseExample>

## Errors

| Status | Code                           | Cause                                  |
| ------ | ------------------------------ | -------------------------------------- |
| `400`  | `INVALID_URL`, `DELETE_FAILED` | A bad path, or the delete failed       |
| `401`  | `UNAUTHORIZED`                 | Missing, invalid, or revoked key       |
| `403`  | `FORBIDDEN`                    | Key lacks the **End-users** permission |
| `404`  | `NOT_FOUND`                    | No record matches the ID               |


## OpenAPI

````yaml api-reference/openapi.json DELETE /api/endusers/{endUserId}
openapi: 3.1.0
info:
  title: Tars API
  version: 3.0.0
  description: >-
    Public REST API for Tars agents: start conversations at trigger gambits,
    send channel messages, manage end users, and drive webhook campaigns.
servers:
  - url: https://us.api.hellotars.com
    description: United States
  - url: https://eu.api.hellotars.com
    description: European Union
  - url: https://in.api.hellotars.com
    description: India
  - url: https://qa.api.hellotars.com
    description: Qatar
security:
  - bearerAuth: []
tags:
  - name: Triggers
    description: Start conversations at trigger gambits
  - name: Channels
    description: Outbound channel message sends
  - name: End users
    description: End-user record management
  - name: Campaigns
    description: Webhook campaign sends and validation
paths:
  /api/endusers/{endUserId}:
    parameters:
      - name: endUserId
        in: path
        required: true
        description: The end-user record ID
        schema:
          type: string
    delete:
      tags:
        - End users
      summary: Delete an end user
      operationId: deleteEndUser
      responses:
        '200':
          description: End user soft-deleted with cascade
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    description: >-
                      True when the record and its related data were
                      soft-deleted.
                required:
                  - success
        '400':
          description: Malformed path or delete failure (INVALID_URL, DELETE_FAILED)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EndUserError'
        '401':
          description: Missing, invalid, or revoked API key (UNAUTHORIZED)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EndUserError'
        '403':
          description: Key lacks the endusers scope (FORBIDDEN)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EndUserError'
        '404':
          description: No record matches the ID (NOT_FOUND)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EndUserError'
components:
  schemas:
    EndUserError:
      type: object
      description: An error from the end-user endpoints.
      properties:
        error:
          type: string
          description: A sentence describing what went wrong.
        code:
          type: string
          description: >-
            A stable machine-readable code, for example DUPLICATE_ENDUSER or
            INVALID_ORIGIN.
        details:
          type: object
          description: >-
            Reserved for extra error context. The end-user endpoints do not
            currently return it.
      required:
        - error
        - code
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key sent as Authorization: Bearer YOUR_API_KEY. Campaign endpoints
        use campaign-scoped keys; the rest use organization or agent keys with
        the matching permission.

````