# Remove a member

`DELETE /api/v1/team/members/{userId}`

Requires `team.manage`. The last owner cannot be removed (`409 last_owner`). Their API keys keep working until revoked separately.

No API key can call this route: it needs a signed-in dashboard user with the right role. A key answers 403.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `userId` | string | required |  |

## Responses

### 200

The removed member.

JSON Schema:

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "userId": {
          "type": "string",
          "format": "uuid",
          "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "role": {
          "type": "string",
          "enum": [
            "owner",
            "admin",
            "developer",
            "finance",
            "viewer"
          ]
        },
        "isPrimary": {
          "type": "boolean"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        }
      },
      "required": [
        "userId",
        "email",
        "role",
        "isPrimary",
        "createdAt"
      ]
    },
    "_agent": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "ok"
          ]
        },
        "next_actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "summary",
        "status",
        "next_actions",
        "warnings"
      ]
    },
    "api_version": {
      "type": "string",
      "example": "2026-07-01"
    }
  },
  "required": [
    "data",
    "_agent",
    "api_version"
  ]
}
```
