> Documentation index for AI agents: https://docs.pagerduty.com/llms.txt

# Create a ServiceNow integration

`POST https://api.pagerduty.com/enrichment/integrations/servicenow`

Creates a ServiceNow enrichment integration with one or more CMDB table configurations. Only one integration is allowed per account. Each CMDB table must define between 2 and 20 field mappings, and an integration may contain at most 8 tables. Credentials are managed separately through the credentials endpoints.

<!-- theme: warning -->

> ### Early Access
> This API is in Early Access and may change at any time. Contact your PagerDuty account team to request access.

Scoped OAuth requires: `contextual_data.write`

## Authorization

- **api_key** (apiKey) — `Authorization` header. The API Key with format `Token token=<API_KEY>`

## Header parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `Accept` | string | yes | The `Accept` header is used as a versioning header. Default: `application/vnd.pagerduty+json;version=2`. |

## Request body (`application/json`) — required

The ServiceNow enrichment integration to create. Credentials are added separately through the credentials endpoint.

| Field | Type | Required | Description |
|---|---|---|---|
| `name` | string | yes | The name of the integration. Max length: 100. |
| `description` | string |  | An optional description of the integration. Max length: 500. |
| `cmdb_tables` | array of object | yes | The ServiceNow CMDB table configurations. An integration must have between 1 and 8 tables. Min items: 1. Max items: 8. |
| `cmdb_tables[].display_name` | string | yes | A human-readable name for the CMDB table configuration. This name is used to identify the generated enrichment schema in the Event Enrichment rule editor. |
| `cmdb_tables[].ci_table_name` | string | yes | The name of the ServiceNow CMDB table to synchronize (for example, `cmdb_ci_server` or `cmdb_ci_ip_switch`). Table names are case-sensitive. |
| `cmdb_tables[].query_filter` | string \| null |  | An optional ServiceNow encoded query used to limit which records are synchronized from the table (for example, `operational_status=1^u_environment=production`). Set to `null` to synchronize all records. |
| `cmdb_tables[].field_mappings` | array of object | yes | The mappings between ServiceNow fields and event fields. Must contain between 2 and 20 mappings, including at least one enrichment field. At most 3 mappings may be marked as query fields. Min items: 2. Max items: 20. |
| `cmdb_tables[].field_mappings[].servicenow_field` | string | yes | The ServiceNow field (column) to read the value from. Dot-walked fields are supported to traverse relationships (for example, `support_group.manager.email`). |
| `cmdb_tables[].field_mappings[].event_field` | string | yes | The event field that the ServiceNow value is mapped to. |
| `cmdb_tables[].field_mappings[].type` | string |  | Set to `query` to use this mapping as a lookup key for matching incoming events to Configuration Items. Omit it for enrichment fields (the default). At most 3 mappings may be marked `query`, and at least one mapping must be left as an enrichment field. When no mapping is marked `query`, the `name` field is used as the query field automatically. Only `query` is accepted here — any other value is rejected. One of: `query`. |

Example: Create a ServiceNow enrichment integration

```json
{
  "name": "Production CMDB Integration",
  "description": "Enrichment data from production ServiceNow instance",
  "cmdb_tables": [
    {
      "display_name": "Network Switches",
      "ci_table_name": "cmdb_ci_ip_switch",
      "query_filter": "operational_status=1",
      "field_mappings": [
        {
          "servicenow_field": "name",
          "event_field": "source"
        },
        {
          "servicenow_field": "operational_status",
          "event_field": "Operational Status"
        },
        {
          "servicenow_field": "support_group",
          "event_field": "Support Group"
        },
        {
          "servicenow_field": "sys_class_name",
          "event_field": "CI Class"
        }
      ]
    }
  ]
}
```

Example: Match on multiple query fields

```json
{
  "name": "Production CMDB Integration",
  "description": "Match CIs on both host name and CI class",
  "cmdb_tables": [
    {
      "display_name": "Servers",
      "ci_table_name": "cmdb_ci_server",
      "query_filter": "operational_status=1",
      "field_mappings": [
        {
          "servicenow_field": "name",
          "event_field": "host",
          "type": "query"
        },
        {
          "servicenow_field": "sys_class_name",
          "event_field": "ci_class",
          "type": "query"
        },
        {
          "servicenow_field": "support_group",
          "event_field": "Support Group"
        },
        {
          "servicenow_field": "location",
          "event_field": "Location"
        }
      ]
    }
  ]
}
```

## Response 201

The ServiceNow enrichment integration was created successfully.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `integration` | object |  |  |
| `integration.id` | string |  | Base32-encoded UUID v7 (26 uppercase alphanumeric characters) identifying the integration. Read-only. |
| `integration.name` | string |  | The name of the integration. |
| `integration.description` | string \| null |  | An optional description of the integration. |
| `integration.cmdb_tables` | array of object |  | The ServiceNow CMDB table configurations belonging to this integration. An integration must have at least 1 and at most 8 tables. |
| `integration.cmdb_tables[].id` | string |  | Base32-encoded UUID v7 (26 uppercase alphanumeric characters) identifying the CMDB table configuration. Read-only. |
| `integration.cmdb_tables[].display_name` | string |  | A human-readable name for the CMDB table configuration. This name is used to identify the generated enrichment schema in the Event Enrichment rule editor. |
| `integration.cmdb_tables[].ci_table_name` | string |  | The name of the ServiceNow CMDB table to synchronize (for example, `cmdb_ci_server` or `cmdb_ci_ip_switch`). Table names are case-sensitive. |
| `integration.cmdb_tables[].query_filter` | string \| null |  | An optional ServiceNow encoded query used to limit which records are synchronized from the table (for example, `operational_status=1^u_environment=production`). Set to `null` to synchronize all records. |
| `integration.cmdb_tables[].field_mappings` | array of object |  | The mappings between ServiceNow fields and event fields. Must contain between 2 and 20 mappings, including at least one enrichment field. At most 3 mappings may be designated as query fields. |
| `integration.cmdb_tables[].field_mappings[].servicenow_field` | string | yes | The ServiceNow field (column) to read the value from. Dot-walked fields are supported to traverse relationships (for example, `support_group.manager.email`). |
| `integration.cmdb_tables[].field_mappings[].event_field` | string | yes | The event field that the ServiceNow value is mapped to. |
| `integration.cmdb_tables[].field_mappings[].type` | string |  | Determines how the field is used during enrichment. `enriched` fields add contextual data to a matched event, while `query` fields are used to match incoming events to Configuration Items. When no mapping specifies a `type`, the field defaults to `enriched` and the `name` field is automatically used as the single query field. To match on a different field — or on more than one field — set `type: query` on those mappings; in that mode `name` is no longer used as a query field unless it is itself marked `query`. Up to 3 query fields may be configured, and when more than one is set an event must contain a matching value for every query field to be enriched (logical AND). At least one mapping must be an enriched field. In responses, a mapping's `type` is `query`, `enriched`, or `discriminator`. `discriminator` is assigned automatically to the `sys_id` field of `cmdb_rel_ci` relationship tables to distinguish relationship types; it appears in responses but cannot be set on requests. One of: `query`, `enriched`, `discriminator`. |
| `integration.cmdb_tables[].status` | string |  | The current data synchronization status of the table. `disabled`: sync is not enabled (the default for newly created tables). `syncing`: an initial sync is in progress. `active`: sync is healthy and incremental updates are running. `error`: sync failed (check the credentials or table configuration). Read-only. One of: `disabled`, `syncing`, `active`, `error`. |
| `integration.cmdb_tables[].created_at` | string (date-time) |  | The date/time the table configuration was created. Read-only. |
| `integration.cmdb_tables[].updated_at` | string (date-time) |  | The date/time the table configuration was last updated. Read-only. |
| `integration.cmdb_tables[].deleted_at` | string \| null (date-time) |  | The date/time the table configuration was deleted, or `null` if it has not been deleted. Read-only. |
| `integration.credentials` | object, nullable |  | The ServiceNow credentials associated with the account, or `null` if no credentials have been configured. Credentials are managed through the credentials endpoints, not through this object. Read-only. |
| `integration.credentials.id` | string |  | Base32-encoded UUID v7 (26 uppercase alphanumeric characters) identifying the credentials. Read-only. |
| `integration.credentials.instance_endpoint` | string |  | The ServiceNow instance URL (for example, `https://your-instance.service-now.com`). |
| `integration.credentials.user` | string |  | The ServiceNow username used to authenticate API requests. The user must have read access to the configured CMDB tables. |
| `integration.credentials.password` | string |  | The ServiceNow password. Only accepted in requests and never returned in responses. Write-only. |
| `integration.credentials.created_at` | string (date-time) |  | The date/time the credentials were created. Read-only. |
| `integration.credentials.updated_at` | string (date-time) |  | The date/time the credentials were last updated. Read-only. |
| `integration.credentials.deleted_at` | string \| null (date-time) |  | The date/time the credentials were deleted, or `null` if they have not been deleted. Read-only. |
| `integration.created_at` | string (date-time) |  | The date/time the integration was created. Read-only. |
| `integration.updated_at` | string (date-time) |  | The date/time the integration was last updated. Read-only. |

Example: Example Response

```json
{
  "integration": {
    "id": "01HQXYZ9ABCDEFGHIJKLMNOPQR",
    "name": "Production CMDB Integration",
    "description": "Enrichment data from production ServiceNow instance",
    "cmdb_tables": [
      {
        "id": "01HTABC8DEFGHIJKLMNOPQRSTU",
        "display_name": "Network Switches",
        "ci_table_name": "cmdb_ci_ip_switch",
        "query_filter": "operational_status=1",
        "field_mappings": [
          {
            "servicenow_field": "name",
            "event_field": "source",
            "type": "query"
          },
          {
            "servicenow_field": "operational_status",
            "event_field": "Operational Status",
            "type": "enriched"
          },
          {
            "servicenow_field": "support_group",
            "event_field": "Support Group",
            "type": "enriched"
          },
          {
            "servicenow_field": "sys_class_name",
            "event_field": "CI Class",
            "type": "enriched"
          }
        ],
        "status": "disabled",
        "created_at": "2026-06-30T18:24:00Z",
        "updated_at": "2026-06-30T18:24:00Z",
        "deleted_at": null
      }
    ],
    "credentials": {
      "id": "01HV2C3D4E5F6G7H8J9K0LMNPQ",
      "instance_endpoint": "https://your-instance.service-now.com",
      "user": "integration_user",
      "created_at": "2026-06-30T18:20:00Z",
      "updated_at": "2026-06-30T18:20:00Z",
      "deleted_at": null
    },
    "created_at": "2026-06-30T18:24:00Z",
    "updated_at": "2026-06-30T18:24:00Z"
  }
}
```

## Response 400

Caller provided invalid arguments. Please review the response for error details. Retrying with the same arguments will *not* work.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 401

Caller did not supply credentials or did not provide the correct credentials.
If you are using an API key, it may be invalid or your Authorization header may be malformed.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 403

Caller is not authorized to view the requested resource.
While your authentication is valid, the authenticated user or token does not have permission to perform this action.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 429

Too many requests have been made, the rate limit has been reached.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Response 500

Internal Server Error the PagerDuty server experienced an error.

### `application/json`

| Field | Type | Required | Description |
|---|---|---|---|
| `error` | object |  |  |
| `error.code` | integer |  | Read-only. |
| `error.message` | string |  | Error message string. Read-only. |
| `error.errors` | array of string |  | Read-only. |

## Developer Agreement

Your access to and use of the PagerDuty Developer Services is governed by the [PagerDuty Developer Agreement](https://docs.pagerduty.com/developer/pagerduty-developer-agreement).
