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

# Erase an end user's identifier

> Removes a caller-supplied `user` identifier from the usage records it was attributed to, so a deletion request from your own end user can be passed through. Billing rows are kept and only the identifier is cleared, which is why this reports rows CLEARED rather than deleted.

Idempotent: erasing an identifier that is already gone succeeds and reports `usage_events_cleared: 0`.

**This is a point in time, not a lock.** Usage rows are written asynchronously after a request completes, so a request already in flight for this end user can re-attribute a row after the call returns. Erase once traffic for the identifier has stopped, or call again.



## OpenAPI

````yaml /api/openapi.json post /v1/end-users/erasures
openapi: 3.1.0
info:
  title: MeshAPI
  description: One key, all AI models.
  version: 0.1.0
servers:
  - url: https://api.meshapi.ai
security:
  - BearerAuth: []
paths:
  /v1/end-users/erasures:
    post:
      tags:
        - End users
      summary: Erase an end user's identifier
      description: >-
        Removes a caller-supplied `user` identifier from the usage records it
        was attributed to, so a deletion request from your own end user can be
        passed through. Billing rows are kept and only the identifier is
        cleared, which is why this reports rows CLEARED rather than deleted.


        Idempotent: erasing an identifier that is already gone succeeds and
        reports `usage_events_cleared: 0`.


        **This is a point in time, not a lock.** Usage rows are written
        asynchronously after a request completes, so a request already in flight
        for this end user can re-attribute a row after the call returns. Erase
        once traffic for the identifier has stopped, or call again.
      operationId: erase_end_user
      parameters:
        - in: header
          name: X-Mesh-Version
          required: false
          schema:
            type: string
            enum:
              - 2026-08
              - 2026-09
            default: 2026-08
          example: 2026-09
          description: >-
            Dated version of the API contract to pin this request to. Omit it
            and the request is served under `2026-08` — the oldest supported
            version, so an existing integration is never moved by a release. A
            malformed or unsupported value is rejected with `400
            invalid_api_version` rather than falling back silently. The version
            actually served is echoed as `X-Mesh-Version` on every response,
            including errors.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ErasureRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErasureResult'
        '401':
          description: Missing or invalid credentials
        '422':
          description: The caller's key is not bound to an organisation
      security:
        - BearerAuth: []
components:
  schemas:
    ErasureRequest:
      properties:
        end_user_id:
          type: string
          maxLength: 256
          minLength: 1
          title: End User Id
          description: >-
            The `user` value as it was sent on the original requests. Matched
            exactly — this is an identifier, not a search.
      type: object
      required:
        - end_user_id
      title: ErasureRequest
    ErasureResult:
      properties:
        end_user_id_sha256:
          type: string
          title: End User Id Sha256
          description: >-
            SHA-256 of `<org_id>:<end_user_id>`. Returned instead of the
            identifier so a caller can correlate this erasure in their own
            records without us echoing back what we just deleted.
        usage_events_cleared:
          type: integer
          title: Usage Events Cleared
          description: >-
            Rows whose attribution was removed. The billing rows themselves
            survive — only `end_user_id` is nulled. Capped per call; if the cap
            was reached, `usage_events` appears in `pending` and the call should
            be repeated.
        pending:
          items:
            type: string
          type: array
          title: Pending
          description: >-
            Stores this call did NOT erase. Present so the response cannot be
            read as a complete-erasure claim when it is not one.
        reattributable_until_traffic_stops:
          type: boolean
          title: Reattributable Until Traffic Stops
          description: >-
            Always true, and stated rather than implied. Usage rows are written
            ASYNCHRONOUSLY after a request finishes, so a request already in
            flight for this end user can re-attribute a row after this call
            returns. The erasure is a point in time, not a lock. Call again once
            traffic for the identifier has stopped; the call is idempotent.
          default: true
      type: object
      required:
        - end_user_id_sha256
        - usage_events_cleared
        - pending
      title: ErasureResult
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Enter your MeshAPI key (`rsk_...`) or, for the admin-keys endpoints, a
        dashboard session token — sent as `Authorization: Bearer <token>`.

````