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

# Deleting Access Codes

> Learn how to delete your access codes, and ensure that the code is successfully removed from the device.

## 1. Delete the access code using the API

To delete an access code, specify the desired `access_code_id` in the [Delete Access Code](/api/access_codes/delete) request.

<Tabs>
  <Tab title="JavaScript">
    **Code:**

    ```javascript theme={null}
    await seam.accessCodes.delete({
      access_code_id: '11111111-1111-1111-1111-555555555555',
    })
    ```

    **Output:**

    ```
    void
    ```
  </Tab>

  <Tab title="cURL">
    **Request:**

    ```bash theme={null}
    curl -X 'POST' \
      'https://connect.getseam.com/access_codes/delete' \
      -H 'accept: application/json' \
      -H "Authorization: Bearer ${SEAM_API_KEY}" \
      -H 'Content-Type: application/json' \
      -d '{
      "access_code_id": "11111111-1111-1111-1111-555555555555"
    }'
    ```

    **Response:**

    ```json theme={null}
    {
      "ok": true
    }
    ```
  </Tab>

  <Tab title="Python">
    **Code:**

    ```python theme={null}
    seam.access_codes.delete(
      access_code_id="11111111-1111-1111-1111-555555555555"
    )
    ```

    **Output:**

    ```
    None
    ```
  </Tab>

  <Tab title="Ruby">
    **Code:**

    ```ruby theme={null}
    client.access_codes.delete(
      access_code_id: "11111111-1111-1111-1111-555555555555"
    )
    ```

    **Output:**

    ```
    void
    ```
  </Tab>

  <Tab title="PHP">
    **Code:**

    ```php theme={null}
    $seam->access_codes->delete(
      access_code_id: "11111111-1111-1111-1111-555555555555"
    );
    ```

    **Output:**

    ```
    void
    ```
  </Tab>

  <Tab title="C#">
    **Code:**

    ```csharp theme={null}
    seam.AccessCodes.Delete(
      accessCodeId: "11111111-1111-1111-1111-555555555555"
    );
    ```

    **Output:**

    ```
    void
    ```
  </Tab>
</Tabs>

***

## 2. Verify that the access code has been removed

Poll for or configure a [webhook](../../../developer-tools/webhooks) to listen for an `access_code.deleted` or `access_code.removed_from_device` event containing the `access_code_id` of the access code that you've deleted. Note that if you delete an access code that was never programmed onto a device, Seam does not emit an `access_code.removed_from_device` event for this access code.

If you receive `access_code.failed_to_remove_from_device` or `access_code.delay_in_removing_from_device` events, see [Troubleshooting Access Code Issues](/low-level-apis/smart-locks/access-codes/troubleshooting-access-code-issues).
