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

# Add Card to Exception File

> Adds the specified card to the exception file

Use this endpoint to add a terminated card to the exception file.
The card must be in a `TERMINATED` state, and your program must be enabled for Exception File Management.
See [Exception File Management](/docs/core-api/exception-file-management/) for prerequisites and guidance on [choosing an action code](/docs/core-api/exception-file-management/#_choosing_an_action_code).

The Marqeta platform processes this request asynchronously.
Subscribe to the `pan.exception_file.added` webhook event to confirm when the card network completes the action.
See [Exception File Management events](/docs/core-api/event-types/#_exception_file_management_events) for details.


## OpenAPI

````yaml POST /exception-file/{cardToken}
openapi: 3.0.3
info:
  title: Exception File Management
  description: >-
    Marqeta's Exception File Management service enables you to manage cards on
    the exception file.
  version: 0.0.1
  x-docs-collection: Core API
  contact:
    name: Marqeta
    url: https://www.marqeta.com
servers:
  - url: https://sandbox-api.marqeta.com/v3
security: []
tags:
  - name: Exception File
    description: >-
      Marqeta's Exception File Management service enables you to manage card
      entries on the exception file.
paths:
  /exception-file/{cardToken}:
    post:
      tags:
        - Exception File
      summary: Adds a card to the exception file
      description: Adds the specified card to the exception file.
      operationId: addCardToExceptionFile
      parameters:
        - name: cardToken
          in: path
          required: true
          schema:
            type: string
            x-allowableValues: Valid card token
          description: Card token to be added to the exception file.
        - $ref: '#/components/parameters/programHeaderParam'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExceptionFileMgmtRequest'
            example:
              action_date: '2027-01-01'
              action_code: CLOS
        required: true
      responses:
        '202':
          description: >-
            Request accepted for processing. The card is added to the exception
            file asynchronously.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionFileMgmtResponse'
              example:
                message: Request accepted for processing
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionFileMgmtResponse'
              examples:
                cardNotTerminated:
                  summary: Card is not in terminated state
                  value:
                    message: >-
                      Card must be in terminated state to be added to the
                      Exception File
                programNotOnboarded:
                  summary: >-
                    Program is not onboarded for the exception file Management
                    feature
                  value:
                    message: >-
                      Program is not onboarded for the Exception File Management
                      feature
                panSharedCardNotTerminated:
                  summary: Another card sharing the PAN is not in terminated state
                  value:
                    message: Another card sharing the PAN is not in terminated state
        '404':
          description: Card token is not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionFileMgmtResponse'
              example:
                message: Card token is not found
        '409':
          description: >-
            An identical record already exists on the exception file. The
            request is idempotent, so you can treat this response as a success.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionFileMgmtResponse'
              example:
                message: This update has already been received
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExceptionFileMgmtResponse'
              example:
                message: Unable to process the request. Please retry later
      security:
        - zionToken: []
        - oauth2:
            - exception-file-mgmt-service:write
components:
  parameters:
    programHeaderParam:
      name: X-Marqeta-Program-Short-Code
      description: Program short code of the program managing the card.
      in: header
      example: sqc9
      required: true
      schema:
        type: string
        x-allowableValues: Valid program short code
  schemas:
    ExceptionFileMgmtRequest:
      required:
        - action_code
      type: object
      description: Request to add or update a card on the exception file.
      properties:
        action_date:
          type: string
          format: date
          pattern: ^\d{4}-\d{2}-\d{2}$
          description: >-
            Purge date of the record in exception file, in YYYY-MM-DD format.
            Evaluated in UTC. Must be between 30 days and 24 months from the
            current date. Defaults to 90 days from the current date if not
            provided.
        action_code:
          type: string
          description: >
            Code representing the action to be taken on the card.

            - `CLOS` - Card terminated / closed account

            - `LCPU` - Lost card

            - `SCPU` - Stolen card

            - `INVA` - Invalid / not found account

            - `PUWF` - Fraud pickup (non-specific)

            - `PUNF` - Pickup (no fraud)

            - `EXPC` - Expired card (authorization only; declines with response
            code 54)

            - `DNTH` - General block (authorization only; declines with response
            code 05)
          enum:
            - CLOS
            - LCPU
            - SCPU
            - INVA
            - PUWF
            - PUNF
            - EXPC
            - DNTH
    ExceptionFileMgmtResponse:
      type: object
      properties:
        message:
          type: string
          description: Human-readable message describing the result of the request.
  securitySchemes:
    zionToken:
      type: http
      scheme: basic
    oauth2:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: https://internal-auth.mq01-dev.marqeta.io/oauth/token
          scopes:
            exception-file-mgmt-service:read: Read exception file records
            exception-file-mgmt-service:write: Create, update, or delete exception file records

````

## Related topics

- [Exception File Management](/docs/core-api/exception-file-management.md)
- [Update Card on Exception File](/docs/core-api/exception-file-update.md)
- [Retrieve Card from Exception File](/docs/core-api/exception-file-retrieve.md)
- [Remove Card from Exception File](/docs/core-api/exception-file-remove.md)
- [Event Types](/docs/core-api/event-types.md)
