---
title: "Remove a specific user from script access control list."
method: DELETE
path: "/api/v1/script/{script_id}/access/users/{user_id}"
---

# Remove a specific user from script access control list.

`DELETE /api/v1/script/{script_id}/access/users/{user_id}`

**Authentication**: JWT token required
**Authorization**: Admin level access required (ADMIN or SUPERADMIN)
**Purpose**: Revoke script access from an individual user

**Path Parameters**:
- `script_id`: Script identifier/slug or numeric ID
- `user_id`: User identifier (numeric ID or email address)

**Request**: No request body required

**Response Schema**:
```json
{
  "data": {
    "script_id": "12345",
    "restricted": true,
    "allowed_roles": [],
    "allowed_users": ["user123"],
    "access_type": "user_restricted"
  }
}
```

**Behavior**:
- Removes user from script's allowed users list
- User immediately loses access to script
- Does not affect other users' access
- Gracefully handles removal of non-existent users

**Access Effect**:
- User can no longer see script in listings
- User cannot execute script
- Existing executions continue to completion
- User may regain access through role-based permissions

**Cleanup Logic**:
- If user list becomes empty, user restrictions may be removed
- Script may become unrestricted if no other access controls exist
- Access type is recalculated based on remaining restrictions

**Use Cases**:
- Remove access when user leaves project
- Revoke access due to security concerns
- Clean up outdated user permissions
- Manage temporary access grants

**Error Responses**:
- `401 Unauthorized`: JWT token required
- `403 Forbidden`: Admin privileges required
- `404 Not Found`: Script does not exist
- `500 Internal Server Error`: Failed to remove user access

## Path parameters

- `script_id` string, required
- `user_id` string, required

## Response `200`

Success

- object

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.dev/trends/apis/trends-earth-api.md) · [All operations](https://skmtc.dev/trends/apis/trends-earth-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/trends/trends-earth-api/revisions/6bdbc0b84666/schema)
