# Remove a person's or team's role on a package

> Take a person's (username) or team's (team) role on a package away.

<div class="g1t-endpoint"><span class="g1t-method" data-method="delete">DELETE</span><code>/workspaces/{workspace}/packages/{package_type}/{package_name}/access</code></div>

What its repository or workspace gives them stays. Takes the Admin role on the package. Returns everyone left with a role on it.

Over REST, name who in the query: `?username=dana` or `?team=platform`.

- **Authentication:** Required. Send an [access token](/reference/api/#authentication) as `Authorization: Bearer`.
- **MCP tool:** [`package`](/reference/mcp/#package) with `action` `remove_access`, and the same inputs
- **Scope:** An access token needs [`packages:write`](/guides/authentication/#scopes).

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace` | string | Yes | The workspace's slug, e.g. "flagon-io". |
| `package_type` | string | Yes | The registry: container (also docker), npm, cargo, maven, nuget, rubygems or composer. One of `container`, `npm`, `cargo`, `maven`, `nuget`, `rubygems`, `composer`. |
| `package_name` | string | Yes | The package's name without the workspace: web for g1t.sh/acme/web, web/worker for an image with more parts, group:artifact for Maven. |

## Body parameters

Send a JSON object. Names are `snake_case`, as in responses; the `camelCase` spelling is accepted too.

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `username` | string | No | The person's username. Give this or team. |
| `team` | string | No | The team's slug, or workspace/slug. Give this or username. |

## Example request

```sh
curl -X DELETE "https://api.g1t.sh/workspaces/acme/packages/container/web/access?username=dana" \
  -H "Authorization: Bearer $G1T_TOKEN"
```

## Example response

A successful request answers `200` with:

```json
[
  {
    "type": "team",
    "id": "team_01kq1a3c5e7g9j1l3n5q7s9u1w",
    "name": "acme/platform",
    "role": "admin",
    "created_at": "2026-10-01T09:00:00.000Z"
  }
]
```

## Errors

A failed request answers with one of these statuses and a body like `{"error": {"code": "not_found", "message": "Repository not found."}}`. See [errors](/reference/api/#errors).

| Status | Code | When |
| --- | --- | --- |
| 401 | `unauthenticated` | A token is required, or the one sent is not valid. |
| 403 | `forbidden` | The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository. |
| 404 | `not_found` | It does not exist, or you cannot see it. |
| 409 | `conflict` | The request conflicts with the current state. |
| 422 | `invalid` | The input is not valid. `message` says which field and why. |
