Microsoft Graph directory.directoryObject API

The directory.directoryObject API from Microsoft Graph — 29 operation(s) for directory.directoryobject.

Documentation

📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/admin?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/agreementacceptance?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/agreement?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/teamsapp?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/application?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/applicationtemplate?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/azure-ad-auditlog-overview?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/authenticationmethodconfiguration?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/authenticationmethodspolicy?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/certificatebasedauthconfiguration?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/chat?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/communications-api-overview?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/complianceapioverview?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/externalconnectors-externalconnection?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/contact?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/contract?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/copilot-overview?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/datapolicyoperation?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/intune-apps-conceptual?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/intune-device-conceptual?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/device?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/directory?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/domaindnsrecord?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/domain?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/drive?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/education-overview?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/employee-experience-overview?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/externalconnectors-external?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/filter-query-parameter
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/excel?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/grouplifecyclepolicy?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/groups-overview?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/groupsetting?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/groupsettingtemplate?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/identitycontainer?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/informationprotection?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/invitation?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/users?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/oauth2permissiongrant?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/organization?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/resourcespecificpermissiongrant?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/place?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/planner-overview?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/policy-overview?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/print?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/privacy?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/report?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/rolemanagement?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/schemaextension?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/scopedrolemembership?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/search-api-overview?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/security-api-overview?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/serviceprincipal?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/shares?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/sharepoint?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/solutions-overview?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/filestorage?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/subscribedsku?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/subscription?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/teams-api-overview?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/teamwork?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/tenantrelationship?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/auth/auth-concepts
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/workplace?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0
📖
Documentation
https://learn.microsoft.com/en-us/graph/api/resources/sitepage?view=graph-rest-1.0

Specifications

Other Resources

OpenAPI Specification

microsoft-graph-directory-directoryobject-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Microsoft Graph Admin Admin.admin directory.directoryObject API
  description: 'Microsoft Graph API for managing administrative resources in Microsoft Entra ID.

    This API enables administrators to manage Microsoft Edge browser settings, Internet Explorer mode configurations,

    site lists, shared browser sites, Microsoft 365 Apps installation options, people insights, service announcements,

    SharePoint settings, Copilot administration, directory administrative units, and admin consent policies.'
  version: 1.0.0
  contact:
    name: Microsoft Graph API Support
    url: https://developer.microsoft.com/graph
servers:
- url: https://graph.microsoft.com/v1.0
  description: Microsoft Graph API v1.0 endpoint
tags:
- name: directory.directoryObject
paths:
  /directory/deletedItems:
    description: Provides operations to manage the deletedItems property of the microsoft.graph.directory entity.
    get:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Get deleted item (directory object)
      description: "Retrieve the properties of a recently deleted application, group, servicePrincipal, administrative unit, or user object from deleted items. Retrieve the properties of a recently deleted directory object from deleted items. The following types are supported:\r\n- administrativeUnit\r\n- application\r\n- certificateBasedAuthPki\r\n- certificateAuthorityDetail\r\n- group\r\n- servicePrincipal\r\n- user"
      operationId: directory.ListDeletedItems
      parameters:
      - $ref: '#/components/parameters/top'
      - $ref: '#/components/parameters/skip'
      - $ref: '#/components/parameters/search'
      - $ref: '#/components/parameters/filter'
      - $ref: '#/components/parameters/count'
      - name: $orderby
        in: query
        description: Order items by property values
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      - name: $select
        in: query
        description: Select properties to be returned
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      - name: $expand
        in: query
        description: Expand related entities
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      responses:
        2XX:
          $ref: '#/components/responses/microsoft.graph.directoryObjectCollectionResponse'
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
      x-ms-pageable:
        nextLinkName: '@odata.nextLink'
        operationName: listMore
      x-ms-docs-operation-type: operation
  /directory/deletedItems/{directoryObject-id}:
    description: Provides operations to manage the deletedItems property of the microsoft.graph.directory entity.
    parameters:
    - name: directoryObject-id
      in: path
      description: The unique identifier of directoryObject
      required: true
      schema:
        type: string
      x-ms-docs-key-type: directoryObject
    get:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Get deleted item (directory object)
      description: "Retrieve the properties of a recently deleted application, group, servicePrincipal, administrative unit, or user object from deleted items. Retrieve the properties of a recently deleted directory object from deleted items. The following types are supported:\r\n- administrativeUnit\r\n- application\r\n- certificateBasedAuthPki\r\n- certificateAuthorityDetail\r\n- group\r\n- servicePrincipal\r\n- user"
      externalDocs:
        description: Find more info here
        url: https://learn.microsoft.com/graph/api/directory-deleteditems-get?view=graph-rest-1.0
      operationId: directory.GetDeletedItems
      parameters:
      - name: $select
        in: query
        description: Select properties to be returned
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      - name: $expand
        in: query
        description: Expand related entities
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      responses:
        2XX:
          description: Retrieved navigation property
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/microsoft.graph.directoryObject'
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
      x-ms-docs-operation-type: operation
    delete:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Permanently delete an item (directory object)
      description: "Permanently delete a recently deleted application, group, servicePrincipal, or user object from deleted items. After an item is permanently deleted, it cannot be restored. Permanently delete a recently deleted directory object from deleted items. The following types are supported:\r\n- certificateBasedAuthPki\r\n- certificateAuthorityDetail After an item is permanently deleted, it cannot be restored. Administrative units cannot be permanently deleted by using the deletedItems API. Soft-deleted administrative units will be permanently deleted 30 days after initial deletion unless they are restored."
      externalDocs:
        description: Find more info here
        url: https://learn.microsoft.com/graph/api/directory-deleteditems-delete?view=graph-rest-1.0
      operationId: directory.DeleteDeletedItems
      parameters:
      - name: If-Match
        in: header
        description: ETag
        schema:
          type: string
      responses:
        '204':
          description: Success
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
      x-ms-docs-operation-type: operation
  /directory/deletedItems/{directoryObject-id}/graph.administrativeUnit:
    description: Casts the previous resource to administrativeUnit.
    parameters:
    - name: directoryObject-id
      in: path
      description: The unique identifier of directoryObject
      required: true
      schema:
        type: string
      x-ms-docs-key-type: directoryObject
    get:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Get the item of type microsoft.graph.directoryObject as microsoft.graph.administrativeUnit
      operationId: directory.GetDeletedItems.AsAdministrativeUnit
      parameters:
      - name: $select
        in: query
        description: Select properties to be returned
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      - name: $expand
        in: query
        description: Expand related entities
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      responses:
        2XX:
          description: Entity result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/microsoft.graph.administrativeUnit'
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
  /directory/deletedItems/{directoryObject-id}/graph.application:
    description: Casts the previous resource to application.
    parameters:
    - name: directoryObject-id
      in: path
      description: The unique identifier of directoryObject
      required: true
      schema:
        type: string
      x-ms-docs-key-type: directoryObject
    get:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Get the item of type microsoft.graph.directoryObject as microsoft.graph.application
      operationId: directory.GetDeletedItems.AsApplication
      parameters:
      - name: $select
        in: query
        description: Select properties to be returned
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      - name: $expand
        in: query
        description: Expand related entities
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      responses:
        2XX:
          description: Entity result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/microsoft.graph.application'
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
  /directory/deletedItems/{directoryObject-id}/checkMemberGroups:
    description: Provides operations to call the checkMemberGroups method.
    parameters:
    - name: directoryObject-id
      in: path
      description: The unique identifier of directoryObject
      required: true
      schema:
        type: string
      x-ms-docs-key-type: directoryObject
    post:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Invoke action checkMemberGroups
      description: "Check for membership in a specified list of group IDs, and return from that list the IDs of groups where a specified object is a member. The specified object can be of one of the following types:\r\n- user\r\n- group\r\n- service principal\r\n- organizational contact\r\n- device\r\n- directory object This function is transitive. You can check up to a maximum of 20 groups per request. This function supports all groups provisioned in Microsoft Entra ID. Because Microsoft 365 groups cannot contain other groups, membership in a Microsoft 365 group is always direct."
      externalDocs:
        description: Find more info here
        url: https://learn.microsoft.com/graph/api/directoryobject-checkmembergroups?view=graph-rest-1.0
      operationId: directory.deletedItems.directoryObject.checkMemberGroups
      requestBody:
        description: Action parameters
        content:
          application/json:
            schema:
              type: object
              properties:
                groupIds:
                  type: array
                  items:
                    type: string
        required: true
      responses:
        2XX:
          description: Success
          content:
            application/json:
              schema:
                type: object
                allOf:
                - $ref: '#/components/schemas/BaseCollectionPaginationCountResponse'
                - type: object
                  properties:
                    value:
                      type: array
                      items:
                        type: string
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
      x-ms-docs-operation-type: action
      x-ms-pageable:
        nextLinkName: '@odata.nextLink'
        operationName: listMore
  /directory/deletedItems/{directoryObject-id}/checkMemberObjects:
    description: Provides operations to call the checkMemberObjects method.
    parameters:
    - name: directoryObject-id
      in: path
      description: The unique identifier of directoryObject
      required: true
      schema:
        type: string
      x-ms-docs-key-type: directoryObject
    post:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Invoke action checkMemberObjects
      operationId: directory.deletedItems.directoryObject.checkMemberObjects
      requestBody:
        description: Action parameters
        content:
          application/json:
            schema:
              type: object
              properties:
                ids:
                  type: array
                  items:
                    type: string
        required: true
      responses:
        2XX:
          description: Success
          content:
            application/json:
              schema:
                type: object
                allOf:
                - $ref: '#/components/schemas/BaseCollectionPaginationCountResponse'
                - type: object
                  properties:
                    value:
                      type: array
                      items:
                        type: string
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
      x-ms-docs-operation-type: action
      x-ms-pageable:
        nextLinkName: '@odata.nextLink'
        operationName: listMore
  /directory/deletedItems/{directoryObject-id}/graph.device:
    description: Casts the previous resource to device.
    parameters:
    - name: directoryObject-id
      in: path
      description: The unique identifier of directoryObject
      required: true
      schema:
        type: string
      x-ms-docs-key-type: directoryObject
    get:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Get the item of type microsoft.graph.directoryObject as microsoft.graph.device
      operationId: directory.GetDeletedItems.AsDevice
      parameters:
      - name: $select
        in: query
        description: Select properties to be returned
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      - name: $expand
        in: query
        description: Expand related entities
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      responses:
        2XX:
          description: Entity result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/microsoft.graph.device'
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
  /directory/deletedItems/{directoryObject-id}/getMemberGroups:
    description: Provides operations to call the getMemberGroups method.
    parameters:
    - name: directoryObject-id
      in: path
      description: The unique identifier of directoryObject
      required: true
      schema:
        type: string
      x-ms-docs-key-type: directoryObject
    post:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Invoke action getMemberGroups
      description: Return all the group IDs for the groups that the specified user, group, service principal, organizational contact, device, or directory object is a member of. This function is transitive. This API returns up to 11,000 group IDs. If more than 11,000 results are available, it returns a 400 Bad Request error with the DirectoryResultSizeLimitExceeded error code. If you get the DirectoryResultSizeLimitExceeded error code, use the List group transitive memberOf API instead.
      externalDocs:
        description: Find more info here
        url: https://learn.microsoft.com/graph/api/directoryobject-getmembergroups?view=graph-rest-1.0
      operationId: directory.deletedItems.directoryObject.getMemberGroups
      requestBody:
        description: Action parameters
        content:
          application/json:
            schema:
              type: object
              properties:
                securityEnabledOnly:
                  type: boolean
                  default: false
                  nullable: true
        required: true
      responses:
        2XX:
          description: Success
          content:
            application/json:
              schema:
                type: object
                allOf:
                - $ref: '#/components/schemas/BaseCollectionPaginationCountResponse'
                - type: object
                  properties:
                    value:
                      type: array
                      items:
                        type: string
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
      x-ms-docs-operation-type: action
      x-ms-pageable:
        nextLinkName: '@odata.nextLink'
        operationName: listMore
  /directory/deletedItems/{directoryObject-id}/getMemberObjects:
    description: Provides operations to call the getMemberObjects method.
    parameters:
    - name: directoryObject-id
      in: path
      description: The unique identifier of directoryObject
      required: true
      schema:
        type: string
      x-ms-docs-key-type: directoryObject
    post:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Invoke action getMemberObjects
      description: "Return all IDs for the groups, administrative units, and directory roles that an object of one of the following types is a member of:\r\n- user\r\n- group\r\n- service principal\r\n- organizational contact\r\n- device\r\n- directory object This function is transitive. Only users and role-enabled groups can be members of directory roles."
      externalDocs:
        description: Find more info here
        url: https://learn.microsoft.com/graph/api/directoryobject-getmemberobjects?view=graph-rest-1.0
      operationId: directory.deletedItems.directoryObject.getMemberObjects
      requestBody:
        description: Action parameters
        content:
          application/json:
            schema:
              type: object
              properties:
                securityEnabledOnly:
                  type: boolean
                  default: false
                  nullable: true
        required: true
      responses:
        2XX:
          description: Success
          content:
            application/json:
              schema:
                type: object
                allOf:
                - $ref: '#/components/schemas/BaseCollectionPaginationCountResponse'
                - type: object
                  properties:
                    value:
                      type: array
                      items:
                        type: string
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
      x-ms-docs-operation-type: action
      x-ms-pageable:
        nextLinkName: '@odata.nextLink'
        operationName: listMore
  /directory/deletedItems/{directoryObject-id}/graph.group:
    description: Casts the previous resource to group.
    parameters:
    - name: directoryObject-id
      in: path
      description: The unique identifier of directoryObject
      required: true
      schema:
        type: string
      x-ms-docs-key-type: directoryObject
    get:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph List deletedItems (directory objects)
      description: "Retrieve a list of recently deleted directory objects. Currently, deleted items functionality is only supported for the application, servicePrincipal, group, administrative unit, and user resources. Retrieve a list of recently deleted directory objects from deleted items. The following types are supported:\r\n- administrativeUnit\r\n- application\r\n- certificateBasedAuthPki\r\n- certificateAuthorityDetail\r\n- group\r\n- servicePrincipal\r\n- user"
      externalDocs:
        description: Find more info here
        url: https://learn.microsoft.com/graph/api/directory-deleteditems-list?view=graph-rest-1.0
      operationId: directory.GetDeletedItems.AsGroup
      parameters:
      - name: $select
        in: query
        description: Select properties to be returned
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      - name: $expand
        in: query
        description: Expand related entities
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      responses:
        2XX:
          description: Entity result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/microsoft.graph.group'
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
  /directory/deletedItems/{directoryObject-id}/restore:
    description: Provides operations to call the restore method.
    parameters:
    - name: directoryObject-id
      in: path
      description: The unique identifier of directoryObject
      required: true
      schema:
        type: string
      x-ms-docs-key-type: directoryObject
    post:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Invoke action restore
      description: "Restore a recently deleted application, group, servicePrincipal, administrative unit, or user object from deleted items.  Restore a recently deleted directory object from deleted items. The following types are supported:\r\n- administrativeUnit\r\n- application\r\n- certificateBasedAuthPki\r\n- certificateAuthorityDetail\r\n- group\r\n- servicePrincipal\r\n- user If an item is accidentally deleted, you can fully restore the item. Additionally, restoring an application doesn't automatically restore the associated service principal automatically. You must call this API to explicitly restore the deleted service principal. A recently deleted item remains available for up to 30 days. After 30 days, the item is permanently deleted."
      externalDocs:
        description: Find more info here
        url: https://learn.microsoft.com/graph/api/directory-deleteditems-restore?view=graph-rest-1.0
      operationId: directory.deletedItems.directoryObject.restore
      responses:
        2XX:
          description: Success
          content:
            application/json:
              schema:
                anyOf:
                - $ref: '#/components/schemas/microsoft.graph.directoryObject'
                - type: object
                  nullable: true
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
      x-ms-docs-operation-type: action
  /directory/deletedItems/{directoryObject-id}/graph.servicePrincipal:
    description: Casts the previous resource to servicePrincipal.
    parameters:
    - name: directoryObject-id
      in: path
      description: The unique identifier of directoryObject
      required: true
      schema:
        type: string
      x-ms-docs-key-type: directoryObject
    get:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Get the item of type microsoft.graph.directoryObject as microsoft.graph.servicePrincipal
      operationId: directory.GetDeletedItems.AsServicePrincipal
      parameters:
      - name: $select
        in: query
        description: Select properties to be returned
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      - name: $expand
        in: query
        description: Expand related entities
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      responses:
        2XX:
          description: Entity result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/microsoft.graph.servicePrincipal'
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
  /directory/deletedItems/{directoryObject-id}/graph.user:
    description: Casts the previous resource to user.
    parameters:
    - name: directoryObject-id
      in: path
      description: The unique identifier of directoryObject
      required: true
      schema:
        type: string
      x-ms-docs-key-type: directoryObject
    get:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Get the item of type microsoft.graph.directoryObject as microsoft.graph.user
      operationId: directory.GetDeletedItems.AsUser
      parameters:
      - name: $select
        in: query
        description: Select properties to be returned
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      - name: $expand
        in: query
        description: Expand related entities
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      responses:
        2XX:
          description: Entity result.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/microsoft.graph.user'
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
  /directory/deletedItems/$count:
    description: Provides operations to count the resources in the collection.
    get:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Get the number of the resource
      operationId: directory.deletedItems.GetCount-665f
      parameters:
      - $ref: '#/components/parameters/search'
      - $ref: '#/components/parameters/filter'
      responses:
        2XX:
          $ref: '#/components/responses/ODataCountResponse'
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
  /directory/deletedItems/graph.administrativeUnit:
    description: Casts the previous resource to administrativeUnit.
    get:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Get the items of type microsoft.graph.administrativeUnit in the microsoft.graph.directoryObject collection
      operationId: directory.ListDeletedItems.AsAdministrativeUnit
      parameters:
      - $ref: '#/components/parameters/top'
      - $ref: '#/components/parameters/skip'
      - $ref: '#/components/parameters/search'
      - $ref: '#/components/parameters/filter'
      - $ref: '#/components/parameters/count'
      - name: $orderby
        in: query
        description: Order items by property values
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      - name: $select
        in: query
        description: Select properties to be returned
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      - name: $expand
        in: query
        description: Expand related entities
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      responses:
        2XX:
          $ref: '#/components/responses/microsoft.graph.administrativeUnitCollectionResponse'
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
      x-ms-pageable:
        nextLinkName: '@odata.nextLink'
        operationName: listMore
  /directory/deletedItems/graph.administrativeUnit/$count:
    description: Provides operations to count the resources in the collection.
    get:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Get the number of the resource
      operationId: directory.DeletedItems.GetCount.AsAdministrativeUnit-0f56
      parameters:
      - $ref: '#/components/parameters/search'
      - $ref: '#/components/parameters/filter'
      responses:
        2XX:
          $ref: '#/components/responses/ODataCountResponse'
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
  /directory/deletedItems/graph.application:
    description: Casts the previous resource to application.
    get:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Get the items of type microsoft.graph.application in the microsoft.graph.directoryObject collection
      operationId: directory.ListDeletedItems.AsApplication
      parameters:
      - $ref: '#/components/parameters/top'
      - $ref: '#/components/parameters/skip'
      - $ref: '#/components/parameters/search'
      - $ref: '#/components/parameters/filter'
      - $ref: '#/components/parameters/count'
      - name: $orderby
        in: query
        description: Order items by property values
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      - name: $select
        in: query
        description: Select properties to be returned
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      - name: $expand
        in: query
        description: Expand related entities
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      responses:
        2XX:
          $ref: '#/components/responses/microsoft.graph.applicationCollectionResponse'
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
      x-ms-pageable:
        nextLinkName: '@odata.nextLink'
        operationName: listMore
  /directory/deletedItems/graph.application/$count:
    description: Provides operations to count the resources in the collection.
    get:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Get the number of the resource
      operationId: directory.DeletedItems.GetCount.AsApplication-09ac
      parameters:
      - $ref: '#/components/parameters/search'
      - $ref: '#/components/parameters/filter'
      responses:
        2XX:
          $ref: '#/components/responses/ODataCountResponse'
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
  /directory/deletedItems/graph.device:
    description: Casts the previous resource to device.
    get:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Get the items of type microsoft.graph.device in the microsoft.graph.directoryObject collection
      operationId: directory.ListDeletedItems.AsDevice
      parameters:
      - $ref: '#/components/parameters/top'
      - $ref: '#/components/parameters/skip'
      - $ref: '#/components/parameters/search'
      - $ref: '#/components/parameters/filter'
      - $ref: '#/components/parameters/count'
      - name: $orderby
        in: query
        description: Order items by property values
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      - name: $select
        in: query
        description: Select properties to be returned
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      - name: $expand
        in: query
        description: Expand related entities
        style: form
        explode: false
        schema:
          uniqueItems: true
          type: array
          items:
            type: string
      responses:
        2XX:
          $ref: '#/components/responses/microsoft.graph.deviceCollectionResponse'
        4XX:
          $ref: '#/components/responses/error'
        5XX:
          $ref: '#/components/responses/error'
      x-ms-pageable:
        nextLinkName: '@odata.nextLink'
        operationName: listMore
  /directory/deletedItems/graph.device/$count:
    description: Provides operations to count the resources in the collection.
    get:
      tags:
      - directory.directoryObject
      summary: Microsoft Graph Get the number of the resource
      operationId: directory.DeletedItems.GetCount.AsDevice-6f35
      parameters:
      - $ref: '#/components/parameters/search'
      - $ref: '#/components/parameters/filter'
      responses:
        2XX:
          $ref: '#/components/responses/ODa

# --- truncated at 32 KB (1176 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/microsoft-graph/refs/heads/main/openapi/microsoft-graph-directory-directoryobject-api-openapi.yml