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

# Delete delegation

> Stop a machine identity from starting Agent Vault sessions on behalf of users. Sessions it already started stop working.



## OpenAPI

````yaml DELETE /api/v1/agent-vault/delegations/{machineIdentityId}
openapi: 3.0.3
info:
  title: Infisical API
  description: List of all available APIs that can be consumed
  version: 0.0.1
servers:
  - url: https://us.infisical.com
    description: Production server (US)
  - url: https://eu.infisical.com
    description: Production server (EU)
  - url: http://localhost:8080
    description: Local server
security: []
paths:
  /api/v1/agent-vault/delegations/{machineIdentityId}:
    delete:
      tags:
        - Agent Vault Delegations
      description: >-
        Stop a machine identity from starting Agent Vault sessions on behalf of
        users. Sessions it already started stop working.
      operationId: deleteAgentVaultDelegation
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 36
          in: query
          name: projectId
          required: false
          description: The ID of the Agent Vault project.
        - schema:
            type: string
            format: uuid
          in: path
          name: machineIdentityId
          required: true
          description: The ID of the machine identity the delegation belongs to.
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  delegation:
                    type: object
                    properties:
                      machineIdentity:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                            description: >-
                              The ID of the machine identity the delegation
                              belongs to.
                          name:
                            type: string
                            description: The name of the machine identity.
                        required:
                          - id
                          - name
                        additionalProperties: false
                        description: >-
                          The machine identity that can start sessions on behalf
                          of users.
                      scope:
                        type: string
                        enum:
                          - all-members
                          - selected
                        description: >-
                          Which users the machine identity can start sessions on
                          behalf of: every member of the project (all-members),
                          or only the users and the members of the groups in the
                          delegation (selected).
                        example: selected
                      users:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              description: The ID of the user.
                            username:
                              type: string
                              description: The username of the user.
                            email:
                              type: string
                              nullable: true
                              description: The email address of the user.
                            firstName:
                              type: string
                              nullable: true
                              description: The first name of the user.
                            lastName:
                              type: string
                              nullable: true
                              description: The last name of the user.
                            addedAt:
                              type: string
                              format: date-time
                              description: >-
                                When the user or group was added to the
                                delegation.
                          required:
                            - id
                            - username
                            - email
                            - firstName
                            - lastName
                            - addedAt
                          additionalProperties: false
                        description: The users in the delegation.
                      groups:
                        type: array
                        items:
                          type: object
                          properties:
                            id:
                              type: string
                              format: uuid
                              description: The ID of the group.
                            name:
                              type: string
                              description: The name of the group.
                            addedAt:
                              type: string
                              format: date-time
                              description: >-
                                When the user or group was added to the
                                delegation.
                          required:
                            - id
                            - name
                            - addedAt
                          additionalProperties: false
                        description: >-
                          The groups in the delegation. Their members are
                          covered while they stay in the group.
                      createdAt:
                        type: string
                        format: date-time
                        description: When the delegation was set up.
                      updatedAt:
                        type: string
                        format: date-time
                        description: When the delegation was last saved.
                    required:
                      - machineIdentity
                      - scope
                      - users
                      - groups
                      - createdAt
                      - updatedAt
                    additionalProperties: false
                required:
                  - delegation
                additionalProperties: false
        '400':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 400
                  message:
                    type: string
                  error:
                    type: string
                  details: {}
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 401
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 403
                  message:
                    type: string
                  details: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 404
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false
        '422':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 422
                  message: {}
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - error
                additionalProperties: false
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  reqId:
                    type: string
                  statusCode:
                    type: number
                    enum:
                      - 500
                  message:
                    type: string
                  error:
                    type: string
                required:
                  - reqId
                  - statusCode
                  - message
                  - error
                additionalProperties: false

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.