---
title: "Manage Table Access"
method: POST
path: "/api/new_mdm/manage_table_access"
tags: ["MDM NEW"]
---

# Manage Table Access

`POST /api/new_mdm/manage_table_access`

**Function**: `manage_table_access`
**Type**: API Endpoint (POST)

**Purpose**:  
Manages access details for a user in the database.

**Parameters**:  
- `request`: The HTTP request object.
- `customer_key` (Header, required): A base64 encoded string containing `lscode` and `firmcode` for the customer.
- `access_details` (Body, required): A dictionary containing access details for a user.
- `current_user` (str): The current user performing the operation, obtained via dependency injection.

**Request body**:
  - BULK:
    {
      "application_code": "...",
      "user_code": "...",
      "modified_by": "...",
      "tables": [
        {"table_name":"...", "access":0/1, "upload_download":0/1}, ...
      ]
    }
  - SINGLE (legacy):
    {
      "table_name":"...",
      "access":0/1,
      "upload_download":0/1,
      "modified_by":"...",
      "application_code":"...",
      "user_code":"..."
    }

**Returns**:  
A JSON response indicating the success or failure of the operation.

**Exceptions**:  
- `HTTPException`: If any exception occurs during the process, it raises an HTTPException with a 500 status code and the exception message.

## Headers

- `customer-key` string, required

## Request body

- object

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi.md) · [All operations](https://skmtc.dev/leapsurgebi/apis/leapsurgeapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/leapsurgebi/leapsurgeapi/revisions/5a6b1464bfeb/schema)
