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

# Delete Cards for User

> This API deletes cards for a specified user from the MoEngage Cards database.


#### Rate Limit

The rate limit is **50K RPM** (Requests Per Minute) and is applicable at the workspace (App) level.


## OpenAPI

````yaml /api/cards/cards.yaml delete /cards/delete
openapi: 3.0.3
info:
  title: MoEngage Cards API
  description: >
    The Fetch Cards API can be used to fetch cards for any user (using the
    unique_id or uid) from the MoEngage Cards database. You can filter the
    search results based on the platform and card category and see if any card
    was updated for the user since the previous sync.
  version: '1.0'
servers:
  - url: https://api-{dc}.moengage.com/v1
    variables:
      dc:
        default: '01'
        description: >-
          The ‘dc’ in the API Endpoint URL refers to the MoEngage Data Center
          (DC). MoEngage hosts each customer in a different DC. You can find
          your DC number and replace the value of ‘dc’ in the URL by referring
          to the DC and API endpoint mapping
          [here](/api/introduction#data-centers). Your MoEngage Data Center (DC)
          can be 01, 02, 03, 04, 05, 06, or 101.
security:
  - basicAuth: []
tags:
  - name: Cards
    description: Operations related to fetching and deleting user cards.
paths:
  /cards/delete:
    delete:
      tags:
        - Cards
      summary: Delete Cards for User
      description: >
        This API deletes cards for a specified user from the MoEngage Cards
        database.
      operationId: deleteCards
      parameters:
        - $ref: '#/components/parameters/AppKeyHeader'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeleteCardsRequest'
            example:
              uid: user@example.com
              campaign_ids:
                - campaign_id1
                - campaign_id2
              platforms:
                - android
                - ios
      responses:
        '200':
          description: >-
            This response is returned when the request is processed
            successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteCardsResponse'
        '400':
          description: >-
            This response is returned when the required parameters are missing
            from the request or when the provided parameters are invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                missing_uid:
                  summary: Missing ID
                  value:
                    status: false
                    error: >-
                      Required field missing. Please include either 'uid' or
                      'unique_id'
                    request_id: 64f6a59ed1e36d0d57a790c1
                invalid_campaigns:
                  summary: Invalid Campaign IDs
                  value:
                    status: false
                    error: Invalid or missing 'campaign_ids' field
                    request_id: 64f6a59ed1e36d0d57a790c1
                user_not_found:
                  summary: User Not Found
                  value:
                    status: false
                    error: User not found for this uid/ unique_id
                    request_id: 64f6a59ed1e36d0d57a790c1
        '401':
          description: >-
            This response is returned when the authorization parameters are
            missing in the HTTP Auth Header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                auth_required:
                  summary: Auth Required
                  value:
                    title: Authentication required
                    description: >-
                      APP_ID and APP_SECRET_KEY is missing in Authorization
                      Header.
                    code: KMxkunyz
        '429':
          description: >-
            This response is returned when the number of requests per minute has
            exceeded the rate limit.
          headers:
            x-ratelimit-limit:
              schema:
                type: integer
            x-ratelimit-remaining:
              schema:
                type: integer
            x-ratelimit-reset:
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                title: Request limit reached
                description: This API call has exceeded the rate limit
                code: KMxkunyz
        '500':
          description: >-
            This response is returned when the system runs into an unexpected
            error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                title: Internal Server Error
                message: >-
                  An unexpected error was encountered while processing this
                  request. Please contact MoEngage Team
components:
  parameters:
    AppKeyHeader:
      name: MOE-APPKEY
      in: header
      required: true
      description: >-
        This is the Workspace ID of your MoEngage account that must be passed
        with the request. You can find it in the MoEngage dashboard at
        **Settings** > **Account** > **APIs** > **Workspace ID (earlier app
        id)**.
      schema:
        type: string
  schemas:
    DeleteCardsRequest:
      type: object
      required:
        - campaign_ids
      x-mint:
        content: >
          <Note>You must provide either `uid` or `unique_id` in the request
          body.</Note>
      properties:
        uid:
          type: string
          description: >
            The `uid` is the unique **MoEngage Standard ID** (Email ID Standard
            or Mobile Number Standard) that identifies the user.
        unique_id:
          type: string
          description: >
            The `unique_id` is the platform-specific device identifier. Refer to
            [Generating
            unique_id](/api/cards/fetch-cards-for-user#generating-unique_id) for
            details.
        campaign_ids:
          type: array
          items:
            type: string
          description: >
            List of campaign IDs whose cards should be deleted for the user.

            In the case of a periodic campaign, if the campaign ID of the parent
            campaign is specified, the cards will get deleted for the child
            campaigns as well.
        platforms:
          type: array
          items:
            type: string
            enum:
              - ANDROID
              - IOS
              - WEB
              - android
              - ios
              - web
          description: >
            Specify platforms to delete cards from. If omitted, the cards
            specified for deletion will be deleted from all the platforms they
            are associated with.

            Allowed Values: ANDROID, IOS, WEB
      description: |
        You must provide either 'uid' or 'unique_id'.

        #### Generating unique_id
          The `unique_id` refers to the device identifier and is platform-specific. 
          * [Android](https://moengage.github.io/android-api-reference/core/com.moengage.core/[android-jvm]-mo-e-core-helper/get-mo-engage-device-id.html)
          * **iOS**: `MoEngageSDKCore.getMoEngageDeviceId(completionHandler: @escaping UserInfoHandler)`
    DeleteCardsResponse:
      type: object
      properties:
        status:
          type: boolean
          description: >-
            This field represents whether the request was successful and
            contains `true` when the request was successful and `false`
            otherwise.
        request_id:
          type: string
          description: Unique identifier that denotes the request.
        data:
          $ref: '#/components/schemas/DeleteCardsResponseData'
          description: >-
            This field contains the platform-specific results of the delete
            operation.
          nullable: true
        title:
          type: string
          description: >-
            This field is present in the response body only when the request is
            unsuccessful and contains the error type.
          nullable: true
        description:
          type: string
          description: >-
            This field is present in the response body only when the request is
            unsuccessful and contains the error description.
          nullable: true
        code:
          type: string
          description: >-
            This field is present in the response body only when the request is
            unsuccessful and contains the error code.
          nullable: true
        error:
          type: string
          description: Error message if status is false.
          nullable: true
    ErrorResponse:
      type: object
      properties:
        status:
          type: boolean
          example: false
        error:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        code:
          type: string
          nullable: true
        request_id:
          type: string
          nullable: true
    DeleteCardsResponseData:
      type: object
      properties:
        android:
          $ref: '#/components/schemas/DeleteCardsPlatformResult'
          nullable: true
        ios:
          $ref: '#/components/schemas/DeleteCardsPlatformResult'
          nullable: true
        web:
          $ref: '#/components/schemas/DeleteCardsPlatformResult'
          nullable: true
    DeleteCardsPlatformResult:
      type: object
      properties:
        success:
          type: array
          items:
            type: string
          description: List of campaign IDs successfully deleted for this platform.
        failed:
          type: array
          items:
            type: string
          description: List of campaign IDs that failed to delete for this platform.
        invalid:
          type: array
          items:
            type: string
          description: >-
            List of campaign IDs that do not exist for this platform for the
            user.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >
        Authentication is done via Basic Auth. This requires a base64-encoded
        string of your credentials in the format 'username:password'.


        - **Username**: Use your MoEngage workspace ID (also known as the App
        ID). You can find it in the MoEngage dashboard at **Settings** >
        **Account** > **APIs** > **Workspace ID (earlier app id)**.

        - **Password**: Use your API Key, which you can find within the
        **Campaign report/Business events/Custom templates/Catalog API/Inform
        Report** tile.


        For more information on authentication and getting your credentials,
        refer
        [here](https://www.moengage.com/docs/api/introduction#getting-your-credentials).

````