Create schema

Namespace: microsoft.graph.externalConnectors

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Create the schema for a Microsoft Search connection.

Permissions

One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.

Permission type Permissions (from least to most privileged)
Delegated (work or school account) Not supported.
Delegated (personal Microsoft account) Not supported.
Application ExternalConnection.ReadWrite.OwnedBy

HTTP request

POST /external/connections/{id}/schema

Request headers

Name Description
Authorization Bearer {token}. Required.
Content-Type application/json. Required.
Prefer: respond-async Use this to cause the request to execute asynchronously. Optional.

Request body

In the request body, supply a JSON representation of a schema object.

When you register a custom item schema, the schema object must have the baseType property set to microsoft.graph.externalItem and must contain the properties property. The properties object must contain at least one property, up to a maximum of 128.

Response

If successful, this method returns a 202 Accepted response code and a URL in the Location response header that can be used to get the operation status.

Examples

Example: Register custom schema asynchronously

Request

The following is an example of the request.

POST https://graph.microsoft.com/beta/external/connections/contosohr/schema
Content-type: application/json

{
  "baseType": "microsoft.graph.externalItem",
  "properties": [
    {
      "name": "ticketTitle",
      "type": "string",
      "isSearchable": "true",
      "isRetrievable": "true",
      "labels": [
        "title"
      ]
    },
    {
      "name": "priority",
      "type": "string",
      "isQueryable": "true",
      "isRetrievable": "true",
      "isSearchable": "false"
    },
    {
      "name": "assignee",
      "type": "string",
      "isRetrievable": "true"
    }
  ]
}

Response

The following is an example of the response.

HTTP/1.1 202 Accepted
Location: https://graph.microsoft.com/beta/external/connections/contosohr/operations/616bfeed-666f-4ce0-8cd9-058939010bfc