Create schema

Namespace: microsoft.graph.externalConnectors

Create a new schema object.

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) ExternalConnection.ReadWrite.OwnedBy, ExternalConnection.ReadWrite.All
Delegated (personal Microsoft account) Not applicable
Application ExternalConnection.ReadWrite.OwnedBy, ExternalConnection.ReadWrite.All

HTTP request

POST /external/connections/{id}/schema

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/v1.0/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/v1.0/external/connections/contosohr/operations/616bfeed-666f-4ce0-8cd9-058939010bfc