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

# team.user.delegate

> Delegates a deactivated profile (`team_user_id`) to an active member (`target_team_user_id`). The delegated profile's `email` is rewritten to `delegate-xxx@manus.im` and the original email is preserved in `original_email`. Pre-checks: the source must be currently `INACTIVE`, the target must be an active non-delegated member, and the source cannot be the team owner.

<sup>Questions or issues? Contact us at [api-support@manus.ai](mailto:api-support@manus.ai).</sup>

<Tip>
  **Source must be deactivated:** `team_user_id` (the source profile) must currently have `status = USER_STATUS_INACTIVE`. Active members and already-removed users are rejected with `failed_precondition` — call [team.user.update](/enterprise/v2/team.user.update) with `status: USER_STATUS_INACTIVE` first if needed.

  **Target must be active and never delegated:** `target_team_user_id` must be an active team member that is not currently a delegated profile. This prevents cycles and ownership-laundering through chained delegations.

  **Owner cannot be delegated:** The team owner's profile is rejected with `failed_precondition`.

  **Email rewrite:** On success, the source's `email` becomes `delegate-<id>@manus.im` and the original is preserved in `original_email`. Subsequent operations on this profile must use `team_user_id`.

  **Role (required):** uses the `MigratedProfileRole` enum, distinct from the `TeamMemberRole` used elsewhere. Send `MIGRATED_PROFILE_ROLE_MEMBER` to activate as a regular member, `MIGRATED_PROFILE_ROLE_FREE_GUEST` to activate as a free (non-seat-consuming) guest, or `MIGRATED_PROFILE_ROLE_DEACTIVATED` to keep the profile in the deactivated pool under the new assignee. `MIGRATED_PROFILE_ROLE_UNSPECIFIED` is rejected — the field must carry an explicit value.

  **Protocols:** Also callable via Connect RPC. See [Protocols](/enterprise/v2/protocols).
</Tip>


## OpenAPI

````yaml POST /v2/team.user.delegate
openapi: 3.1.0
info:
  title: Manus Team User Management OpenAPI v2
  description: >-
    API for enterprise tenant administrators to manage team members
    programmatically (SailPoint, Okta, custom IDP integrations). All responses
    are wrapped with `{"ok": true, "request_id": "...", ...}` for success and
    `{"ok": false, "request_id": "...", "error": {"code": "...", "message":
    "..."}}` for errors. Every operation is callable via REST (paths below) or
    via Connect RPC at `/team.v2.TeamUserManagementApiV2Service/<Method>`.
  version: 2.0.0
servers:
  - url: https://api.manus.im
security:
  - ApiKeyAuth: []
paths:
  /v2/team.user.delegate:
    post:
      summary: DelegateProfile
      description: >-
        Delegates a deactivated profile (`team_user_id`) to an active member
        (`target_team_user_id`). The delegated profile's `email` is rewritten to
        `delegate-xxx@manus.im` and the original email is preserved in
        `original_email`. Pre-checks: the source must be currently `INACTIVE`,
        the target must be an active non-delegated member, and the source cannot
        be the team owner.
      operationId: team.v2.TeamUserManagementApiV2Service.DelegateProfile
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - team_user_id
                - target_team_user_id
                - role
              properties:
                team_user_id:
                  type: string
                  minLength: 1
                  maxLength: 64
                  description: ID of the deactivated profile being delegated.
                  example: '123456'
                target_team_user_id:
                  type: string
                  minLength: 1
                  maxLength: 64
                  description: ID of the active member receiving the delegation.
                  example: '654321'
                role:
                  $ref: '#/components/schemas/MigratedProfileRole'
                  description: >-
                    Post-delegation role for the source profile. Required —
                    `MIGRATED_PROFILE_ROLE_UNSPECIFIED` is rejected. Use
                    `MIGRATED_PROFILE_ROLE_MEMBER` to activate as a regular
                    member, `MIGRATED_PROFILE_ROLE_FREE_GUEST` to activate as a
                    free guest, or `MIGRATED_PROFILE_ROLE_DEACTIVATED` to keep
                    the profile deactivated under the new assignee.
      responses:
        '200':
          description: Profile delegated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    example: true
                  request_id:
                    type: string
                  user:
                    $ref: '#/components/schemas/User'
        4XX:
          description: >-
            Error response. `failed_precondition` if the source is not
            deactivated, the target is itself a delegated profile, or the source
            is the team owner.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    MigratedProfileRole:
      type: string
      description: >-
        Post-delegation role used by
        [team.user.delegate](/enterprise/v2/team.user.delegate) to decide what
        the source profile becomes after the assignee takes it over.
        `MIGRATED_PROFILE_ROLE_MEMBER` activates as a regular member;
        `MIGRATED_PROFILE_ROLE_FREE_GUEST` activates as a free guest;
        `MIGRATED_PROFILE_ROLE_DEACTIVATED` keeps the profile deactivated.
      enum:
        - MIGRATED_PROFILE_ROLE_MEMBER
        - MIGRATED_PROFILE_ROLE_FREE_GUEST
        - MIGRATED_PROFILE_ROLE_DEACTIVATED
    User:
      type: object
      description: A team member.
      properties:
        email:
          type: string
          description: >-
            Email address. After delegation this field becomes
            `delegate-xxx@manus.im` — the pre-delegation address is preserved in
            `original_email`.
        status:
          $ref: '#/components/schemas/UserStatus'
        role:
          $ref: '#/components/schemas/TeamMemberRole'
        user_name:
          type: string
          description: >-
            Display name. Sourced from `team_user_relation.Name` (set via
            [team.user.rename](/enterprise/v2/team.user.rename)) when present,
            otherwise falls back to the underlying user's name. Omitted when
            neither is set.
        team_user_id:
          type: string
          description: >-
            Stable identifier for the team member, unique within the team. Use
            this (not `email`) for any subsequent profile-management call.
        delegated_to:
          type: string
          description: >-
            If this profile is currently delegated, the `team_user_id` of the
            assignee.
        delegated_profiles:
          type: array
          items:
            $ref: '#/components/schemas/DelegatedProfile'
          description: >-
            Profiles delegated to this user. Only populated by single-record
            responses ([team.user.detail](/enterprise/v2/team.user.detail),
            [team.user.update](/enterprise/v2/team.user.update), etc.).
            [team.user.list](/enterprise/v2/team.user.list) omits this field to
            avoid N+1 fan-out.
        original_email:
          type: string
          description: Pre-delegation email. Only present for currently-delegated profiles.
    ErrorResponse:
      type: object
      description: Standard error response format returned when a request fails.
      properties:
        ok:
          type: boolean
          example: false
          description: Always false for error responses.
        request_id:
          type: string
          description: >-
            Unique identifier for this API request, useful for debugging with
            support.
        error:
          type: object
          description: Error details.
          properties:
            code:
              type: string
              description: >-
                Machine-readable error code: `invalid_argument`, `not_found`,
                `already_exists`, `permission_denied`, `failed_precondition`, or
                `internal`.
            message:
              type: string
              description: Human-readable error description.
    UserStatus:
      type: string
      description: Status of a team member.
      enum:
        - USER_STATUS_ACTIVE
        - USER_STATUS_INACTIVE
        - USER_STATUS_REMOVED
    TeamMemberRole:
      type: string
      description: >-
        Team role. `TEAM_MEMBER_ROLE_OWNER` is read-only and cannot be granted
        via API (transfer ownership in the UI). Guest members do not consume a
        paid seat.
      enum:
        - TEAM_MEMBER_ROLE_OWNER
        - TEAM_MEMBER_ROLE_ADMIN
        - TEAM_MEMBER_ROLE_MEMBER
        - TEAM_MEMBER_ROLE_SUPER_ADMIN
        - TEAM_MEMBER_ROLE_GUEST
    DelegatedProfile:
      type: object
      description: A profile delegated to another team member.
      properties:
        team_user_id:
          type: string
          description: ID of the delegated profile.
        display_name:
          type: string
          description: >-
            Display name. Falls back to the original (pre-delegation) email when
            the profile has no name set.
        role:
          $ref: '#/components/schemas/TeamMemberRole'
        delegated_at:
          type: string
          format: date-time
          description: When the delegation was created.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````