> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectdiscovery.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Default Team Members

> Set (replace) the list of default team members

Configure a list of members that will be automatically added to any new team/workspace you create. This endpoint replaces any existing default member configuration.

## How It Works

When you set default members:

* **Replaces** any existing default member configuration
* **Validates** each member against your workspace plan limits
* **Deduplicates** members by email (keeps first occurrence)
* **Applies** to all future teams created by the owner

<Warning>
  This operation **replaces** the entire default members list. To add or remove individual members, retrieve the current list, modify it, and send the updated version.
</Warning>

## Request Body

Send an array of member objects, each containing:

* `email` (string, required): Member's email address
* `role` (string, required): One of `ADMIN`, `MEMBER`, `VIEWER`, or `GUEST`

<Note>
  The `OWNER` role cannot be assigned as a default member. Owner is always assigned automatically during team creation.
</Note>

## Examples

### Set Multiple Default Members

```bash theme={null}
curl -X POST "https://api.projectdiscovery.io/v1/user/team/default-members" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "X-Team-Id: YOUR_TEAM_ID" \
  -d '{
    "members": [
      { "email": "security-lead@example.com", "role": "ADMIN" },
      { "email": "team-member@example.com", "role": "MEMBER" },
      { "email": "auditor@example.com", "role": "VIEWER" }
    ]
  }'
```

**Response:**

```json theme={null}
{
  "message": "default team members updated successfully (3 members)"
}
```

### Clear All Default Members

```bash theme={null}
curl -X POST "https://api.projectdiscovery.io/v1/user/team/default-members" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "X-Team-Id: YOUR_TEAM_ID" \
  -d '{ "members": [] }'
```

**Response:**

```json theme={null}
{
  "message": "default team members updated successfully (0 members)"
}
```

## Validation Rules

### Email Validation

* Must be valid email format
* Invalid emails return `400` error: `"invalid email format: bad-email"`

### Role Validation

* Must be one of: `ADMIN`, `MEMBER`, `VIEWER`, `GUEST`
* Invalid roles return `400` error: `"invalid role: INVALID. Valid roles are: ADMIN, MEMBER, VIEWER, GUEST"`

### Plan Limits

* Default members count is validated against your workspace plan's `MaxTeamMembers` limit (minus 1 for owner)
* Exceeding limit returns `400` error: `"default members count (15) exceeds your plan limit of 10 members"`

## Common Errors

| Status | Scenario             | Solution                                           |
| ------ | -------------------- | -------------------------------------------------- |
| `400`  | Invalid email format | Verify email addresses are properly formatted      |
| `400`  | Invalid role         | Use only: `ADMIN`, `MEMBER`, `VIEWER`, `GUEST`     |
| `400`  | Exceeds plan limit   | Reduce number of default members or upgrade plan   |
| `403`  | Not owner/admin      | Only team owners and admins can configure defaults |

## Behavior During Team Creation

When a new team is created:

1. System checks if the owner has configured default members
2. Each default member's email **must exist** in the system
3. If any email doesn't correspond to an existing user, team creation returns `400` error
4. Default members are **directly added** to the new team (no invitation flow)
5. Owner is automatically skipped if present in default members list

<Tip>
  Default members streamline team provisioning, especially when creating multiple teams or workspaces with consistent access patterns.
</Tip>


## OpenAPI

````yaml post /v1/user/team/default-members
openapi: 3.1.0
info:
  title: PDCP API
  version: '1.0'
  summary: ProjectDiscovery Cloud Platform
  description: >-
    For more details, checkout
    https://docs.projectdiscovery.io/api-reference/editor/scan
servers:
  - url: https://api.projectdiscovery.io
    description: Production
  - url: https://api.dev.projectdiscovery.io
    description: Development
  - url: http://localhost:8085
    description: Localhost
security:
  - X-API-Key: []
paths:
  /v1/user/team/default-members:
    post:
      tags:
        - internal
      summary: Set Default Team Members
      description: Set (replace) the list of default team members
      operationId: post-v1-user-team-default-members
      parameters:
        - schema:
            type: string
          in: header
          description: >-
            Retrieve the Team ID from:
            https://cloud.projectdiscovery.io/settings/team
          name: X-Team-Id
          required: true
      requestBody:
        $ref: '#/components/requestBodies/SetDefaultTeamMembersRequest'
      responses:
        '200':
          $ref: '#/components/responses/MessageResponse'
        '400':
          $ref: '#/components/responses/MessageResponse'
        '401':
          $ref: '#/components/responses/MessageResponse'
        '403':
          $ref: '#/components/responses/MessageResponse'
        '500':
          $ref: '#/components/responses/MessageResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
      security:
        - X-API-Key: []
components:
  requestBodies:
    SetDefaultTeamMembersRequest:
      content:
        application/json:
          schema:
            type: object
            properties:
              members:
                type: array
                items:
                  type: object
                  properties:
                    email:
                      type: string
                    role:
                      type: string
                      enum:
                        - ADMIN
                        - MEMBER
                        - VIEWER
                        - GUEST
                  required:
                    - email
                    - role
            required:
              - members
  responses:
    MessageResponse:
      description: Example response
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
            required:
              - message
    ErrorResponse:
      description: Example response
      content:
        application/json:
          schema:
            type: object
            required:
              - message
            properties:
              message:
                type: string
              kind:
                type: string
              code:
                type: string
              error:
                type: string
              error_id:
                type: string
              param:
                type: string
              status:
                type: integer
  securitySchemes:
    X-API-Key:
      name: X-API-Key
      type: apiKey
      in: header

````