Zetect Connector Guide Back to zetect.inSwitch portal ⇄

Requests and Responses

Every request arrives as a ConnectorCommand and is answered with a ConnectorResult or a ProvisioningResult. This page lists the shared fields, then each request type with the fields Zetect fills in, what your result must contain, and an example of both. Only connectionInfo and the attribute names change from one target system to another.

Request fields

ConnectorCommand ignores unknown JSON fields, so a request may contain keys that the model doesn't expose. Fields Zetect leaves out are null.

FieldTypeDescription
actionStringThe request type, for example ADD_TO_GROUP. Constants are in Operation.
runIdStringIdentifies an aggregation or identity sync run. Every chunk of the result must carry it; the factory methods copy it for you.
requestIdStringIdentifies a provisioning request. Starts with pr- for applications and pa- for privileged access.
tenantIdStringThe tenant that sent the request.
sourceIdStringThe application or identity source the request is for. Empty for privileged access aggregation.
sourceTypeStringIDENTITY_SYNC only. The identity source type.
connectorNameStringThe connector the agent routed the request to.
connectionInfoObjectConnection settings, with secrets decrypted. For applications, grouped by provisioning XML field set name, then keyed by field name. Never log it or return it.
attributeMappingsObject or arrayFor provisioning, an object of account attribute name to value, resolved from the identity through the application's attribute mappings. For IDENTITY_SYNC, an array describing the source field mappings.
payloadObjectFree-form extra data. IDENTITY_SYNC uses it for group import settings.
chunkSizeIntegerAggregation and identity sync only. The maximum number of records per result. Missing, null or 0 means publish one result.
triggerSourceStringWhy the request was sent, for example ACCESS_REQUEST, CERTIFICATION, BIRTHRIGHT, ADMIN_SUSPEND or PASSWORD_ROTATION. Informational; don't branch on it.
accessRequestId, certificationItemIdStringThe access request or certification item behind the request, when there is one.
requestedAt, accessExpiresAtStringISO-8601 times. accessExpiresAt is set when granted access has an end date; Zetect revokes it itself when it expires.
subjectObjectuserId (the Zetect identity), correlatedAccountId (Zetect's account record) and nativeAccountIdentifier (the account's identifier on the target, or null if the identity has no account yet).
entitlementsArrayEach item has entitlementId, nativeIdentifier (the group's identifier on the target), displayName, entitlementType, and objectType when aggregation reported one.
entitlementObjectLegacy single entitlement. Zetect now sends entitlements instead.
passwordStringA plaintext credential, sent when the connector may need to create an account or set a password. Never log it; it is never echoed in a result.

Result fields

Both result types leave out null fields when serialised.

ConnectorResult fieldDescription
runId, tenantId, connectorName, actionCopied from the request.
successtrue or false.
errorThe failure message. Empty on success.
recordsArray of account, group or identity records, each a flat object of attribute name to value.
resultA single result object, for actions that don't return records.
chunkIndex, chunkCount, lastChunkPresent only on a chunked result. See Publishing a chunked aggregation.
timestampSet by the factory method.
ProvisioningResult fieldDescription
action, requestId, sourceId, tenantId, connectorName, triggerSource, accessRequestId, certificationItemId, requestedAt, accessExpiresAt, subject, entitlement, entitlements, attributeMappingsCopied from the request. connectionInfo and password are never copied.
statusSUCCESS or ERROR.
messageThe failure message. Empty on success.
nativeAccountIdentifierThe account's identifier on the target. Required on success.
accountDisplayNameThe account's display name. Optional.
completedAtSet by the factory method.

In the examples below, connectionInfo is shortened after the first one.

IDENTITY_SYNC

Purpose: read people from a source of truth for an identity source. Handled by handle(); arrives on the import queue.

Request: runId, sourceId, sourceType, connectionInfo (a flat object whose keys depend on the source type), attributeMappings (an array of sourceField, targetAttributeId, targetAttributeName and isIdentifier), chunkSize, and payload.groupSync when group import is on.

Result: a ConnectorResult with one record per person, keyed by source field name. Publish a failure to fail the whole run.

{
  "action": "IDENTITY_SYNC",
  "runId": "0b6d2c4e-5a1f-4e2b-9c3d-7f8e1a2b3c4d",
  "tenantId": "northwind",
  "sourceId": "src-hr-01",
  "sourceType": "REST",
  "connectorName": "PeopleApi",
  "connectionInfo": { "baseUrl": "https://hr.northwind.example/api", "authType": "BEARER_TOKEN", "auth": { "token": "…" } },
  "attributeMappings": [
    { "sourceField": "employeeId", "targetAttributeName": "employeeNumber", "isIdentifier": true },
    { "sourceField": "email", "targetAttributeName": "email", "isIdentifier": false }
  ],
  "chunkSize": null
}
{
  "runId": "0b6d2c4e-5a1f-4e2b-9c3d-7f8e1a2b3c4d",
  "tenantId": "northwind",
  "connectorName": "PeopleApi",
  "action": "IDENTITY_SYNC",
  "success": true,
  "records": [
    { "employeeId": "E10442", "email": "maya.patel@northwind.example", "department": "Finance" }
  ],
  "timestamp": "2026-11-14T09:30:12Z"
}

SYNC_USER

Purpose: list every account on the target for account aggregation. Handled by handle(). Privileged access assets use the same request.

Request: runId, sourceId, connectorName, connectionInfo and chunkSize. There are no attributeMappings; return every attribute the provisioning XML declares for accounts.

Result: a ConnectorResult with one record per account. Each record must contain the account identity attribute. Include a multi-valued membership attribute, such as groups, if the application's account-to-entitlement correlation uses it. Return every account in the run: accounts missing from a successful run are deactivated.

{
  "action": "SYNC_USER",
  "runId": "5b2e1a30-8c4d-4f1e-a7b2-3c9d0e1f2a3b",
  "sourceId": "app-helpdesk",
  "tenantId": "northwind",
  "connectorName": "Helpdesk",
  "connectionInfo": {
    "Connection Settings": { "baseUrl": "https://helpdesk.northwind.example", "apiToken": "…" },
    "Sync Settings": { "pageSize": "200" }
  },
  "chunkSize": 1000
}
{
  "runId": "5b2e1a30-8c4d-4f1e-a7b2-3c9d0e1f2a3b",
  "tenantId": "northwind",
  "connectorName": "Helpdesk",
  "action": "SYNC_USER",
  "success": true,
  "records": [
    { "username": "mpatel", "email": "maya.patel@northwind.example", "status": "active", "groups": ["Finance Approvers"] }
  ],
  "chunkIndex": 1,
  "chunkCount": 3,
  "lastChunk": false,
  "timestamp": "2026-11-14T09:31:05Z"
}

SYNC_GROUP

Purpose: list every group, role or other grantable item on the target for entitlement aggregation. Handled by handle().

Request: the same fields as SYNC_USER.

Result: a ConnectorResult with one record per group. Include the group identity attribute and a display name (displayName, cn or name). If the provisioning XML declares several group blocks, add objectType to each record so Zetect knows which block it belongs to.

{
  "action": "SYNC_GROUP",
  "runId": "9c4f2b10-1d2e-4a3b-8c5d-6e7f8a9b0c1d",
  "sourceId": "app-helpdesk",
  "tenantId": "northwind",
  "connectorName": "Helpdesk",
  "connectionInfo": { "Connection Settings": { "…": "…" } },
  "chunkSize": null
}
{
  "runId": "9c4f2b10-1d2e-4a3b-8c5d-6e7f8a9b0c1d",
  "tenantId": "northwind",
  "connectorName": "Helpdesk",
  "action": "SYNC_GROUP",
  "success": true,
  "records": [
    { "groupId": "fin-approvers", "displayName": "Finance Approvers", "objectType": "role", "members": ["mpatel", "jchen"] }
  ],
  "timestamp": "2026-11-14T09:32:40Z"
}

CREATE_ACCOUNT

Purpose: create an account for an identity. Handled by handleProvisioning().

Request: requestId, subject (with nativeAccountIdentifier usually null), attributeMappings holding the mappings that apply on create, and password, an initial password generated from the application's password policy. entitlements is empty.

Result: ProvisioningResult.success(cmd, nativeId, displayName). Zetect creates the account, links it to the identity and stores the result's attributeMappings as the account's attributes, so you may replace them with a fresh read from the target. If the account already exists, either fail or adopt it and return its identifier.

{
  "action": "CREATE_ACCOUNT",
  "requestId": "pr-3f9a6c21-7b4e-4d8a-9e1f-2a3b4c5d6e7f",
  "sourceId": "app-helpdesk",
  "tenantId": "northwind",
  "connectorName": "Helpdesk",
  "triggerSource": "BIRTHRIGHT",
  "requestedAt": "2026-11-14T10:02:11Z",
  "connectionInfo": { "Connection Settings": { "…": "…" } },
  "subject": { "userId": "usr-5521", "correlatedAccountId": null, "nativeAccountIdentifier": null },
  "entitlements": null,
  "attributeMappings": { "username": "mpatel", "email": "maya.patel@northwind.example", "displayName": "Maya Patel" },
  "password": "Wq7#rLm2!xTe9vBk"
}
{
  "action": "CREATE_ACCOUNT",
  "requestId": "pr-3f9a6c21-7b4e-4d8a-9e1f-2a3b4c5d6e7f",
  "sourceId": "app-helpdesk",
  "tenantId": "northwind",
  "connectorName": "Helpdesk",
  "triggerSource": "BIRTHRIGHT",
  "subject": { "userId": "usr-5521", "correlatedAccountId": null, "nativeAccountIdentifier": null },
  "attributeMappings": { "username": "mpatel", "email": "maya.patel@northwind.example", "status": "active" },
  "status": "SUCCESS",
  "nativeAccountIdentifier": "mpatel",
  "accountDisplayName": "Maya Patel",
  "completedAt": "2026-11-14T10:02:13Z"
}

UPDATE_ACCOUNT

Purpose: change attributes of an existing account. Handled by handleProvisioning(). The agent accepts it, but Zetect doesn't currently send it; implementing it is optional.

Request: subject.nativeAccountIdentifier identifies the account, and attributeMappings holds the mappings that apply on update.

Result: ProvisioningResult.success(cmd, nativeId, displayName).

{
  "action": "UPDATE_ACCOUNT",
  "requestId": "pr-8d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
  "connectorName": "Helpdesk",
  "connectionInfo": { "Connection Settings": { "…": "…" } },
  "subject": { "userId": "usr-5521", "nativeAccountIdentifier": "mpatel" },
  "attributeMappings": { "department": "Finance", "title": "Senior Analyst" }
}
{
  "action": "UPDATE_ACCOUNT",
  "requestId": "pr-8d1c2b3a-4e5f-4a6b-8c7d-9e0f1a2b3c4d",
  "status": "SUCCESS",
  "nativeAccountIdentifier": "mpatel",
  "accountDisplayName": "Maya Patel",
  "completedAt": "2026-11-14T10:05:40Z"
}

ADD_TO_GROUP

Purpose: grant one or more entitlements to an account. Handled by handleProvisioning().

Request: entitlements lists the groups to add: one item for an access request, possibly several for a provisioning policy. If subject.nativeAccountIdentifier is null, the identity has no account yet: attributeMappings then holds the create mappings and password an initial password, and your connector must create the account before adding it to the groups. Otherwise attributeMappings holds the update mappings and password is empty.

Result: ProvisioningResult.success(cmd, nativeId, displayName), with the account's identifier even when you just created it. Zetect records each membership in entitlements.

{
  "action": "ADD_TO_GROUP",
  "requestId": "pr-7c1e5d4a-2b3c-4d5e-8f9a-0b1c2d3e4f5a",
  "sourceId": "app-helpdesk",
  "tenantId": "northwind",
  "connectorName": "Helpdesk",
  "triggerSource": "ACCESS_REQUEST",
  "accessRequestId": "ar-20931",
  "requestedAt": "2026-11-14T11:20:00Z",
  "accessExpiresAt": "2027-02-14T00:00:00Z",
  "connectionInfo": { "Connection Settings": { "…": "…" } },
  "subject": { "userId": "usr-5521", "correlatedAccountId": null, "nativeAccountIdentifier": null },
  "entitlements": [
    { "entitlementId": "ent-0f3a", "nativeIdentifier": "fin-approvers", "displayName": "Finance Approvers", "entitlementType": "GROUP", "objectType": "role" }
  ],
  "attributeMappings": { "username": "mpatel", "email": "maya.patel@northwind.example" },
  "password": "Tz4!pQ8m#Lw2cRy6"
}
{
  "action": "ADD_TO_GROUP",
  "requestId": "pr-7c1e5d4a-2b3c-4d5e-8f9a-0b1c2d3e4f5a",
  "accessRequestId": "ar-20931",
  "entitlements": [ { "entitlementId": "ent-0f3a", "nativeIdentifier": "fin-approvers", "displayName": "Finance Approvers" } ],
  "status": "SUCCESS",
  "nativeAccountIdentifier": "mpatel",
  "accountDisplayName": "Maya Patel",
  "completedAt": "2026-11-14T11:20:03Z"
}

REMOVE_FROM_GROUP

Purpose: remove one or more entitlements from an existing account. Handled by handleProvisioning().

Request: subject.nativeAccountIdentifier identifies the account, entitlements lists the groups, and attributeMappings holds the update mappings. The account must already exist.

Result: ProvisioningResult.success(cmd, nativeId, null). Consider treating "not a member" as success, so a repeated revoke doesn't show as a failure.

{
  "action": "REMOVE_FROM_GROUP",
  "requestId": "pr-1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "connectorName": "Helpdesk",
  "triggerSource": "CERTIFICATION",
  "certificationItemId": "ci-88213",
  "connectionInfo": { "Connection Settings": { "…": "…" } },
  "subject": { "userId": "usr-5521", "correlatedAccountId": "acc-7710", "nativeAccountIdentifier": "mpatel" },
  "entitlements": [ { "entitlementId": "ent-0f3a", "nativeIdentifier": "fin-approvers", "displayName": "Finance Approvers" } ],
  "attributeMappings": {}
}
{
  "action": "REMOVE_FROM_GROUP",
  "requestId": "pr-1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
  "certificationItemId": "ci-88213",
  "status": "SUCCESS",
  "nativeAccountIdentifier": "mpatel",
  "completedAt": "2026-11-14T12:00:41Z"
}

DELETE_ACCOUNT

Purpose: remove an account from the target. Handled by handleProvisioning().

Request: subject.nativeAccountIdentifier identifies the account. There are no attributeMappings or entitlements.

Result: ProvisioningResult.success(cmd, nativeId, null). If the account is already gone, returning success keeps Zetect consistent with the target.

{
  "action": "DELETE_ACCOUNT",
  "requestId": "pr-6e7f8a9b-0c1d-4e2f-8a3b-4c5d6e7f8a9b",
  "connectorName": "Helpdesk",
  "triggerSource": "ADMIN_DELETE",
  "connectionInfo": { "Connection Settings": { "…": "…" } },
  "subject": { "userId": "usr-5521", "correlatedAccountId": "acc-7710", "nativeAccountIdentifier": "mpatel" },
  "attributeMappings": null
}
{
  "action": "DELETE_ACCOUNT",
  "requestId": "pr-6e7f8a9b-0c1d-4e2f-8a3b-4c5d6e7f8a9b",
  "status": "SUCCESS",
  "nativeAccountIdentifier": "mpatel",
  "completedAt": "2026-11-14T13:15:09Z"
}

SUSPEND_ACCOUNT

Purpose: make an account unusable without removing Zetect's record of it. Handled by handleProvisioning(). Your connector decides how: disable or lock the account where the target supports it, or delete it where the target has no disabled state.

Request: the same shape as DELETE_ACCOUNT. subject.nativeAccountIdentifier identifies the account; attributeMappings is empty.

Result: ProvisioningResult.success(cmd, nativeId, null). Zetect marks the account as suspended only after your success result arrives.

{
  "action": "SUSPEND_ACCOUNT",
  "requestId": "pr-2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "connectorName": "Helpdesk",
  "triggerSource": "ADMIN_SUSPEND",
  "connectionInfo": { "Connection Settings": { "…": "…" } },
  "subject": { "userId": "usr-5521", "correlatedAccountId": "acc-7710", "nativeAccountIdentifier": "mpatel" },
  "attributeMappings": null
}
{
  "action": "SUSPEND_ACCOUNT",
  "requestId": "pr-2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "status": "SUCCESS",
  "nativeAccountIdentifier": "mpatel",
  "completedAt": "2026-11-14T14:01:27Z"
}

RESTORE_ACCOUNT

Purpose: reverse a suspension. Handled by handleProvisioning().

Request: subject.nativeAccountIdentifier, plus everything needed to re-create the account if your suspend deleted it: attributeMappings with the create mappings, a new password, and entitlements listing the account's direct memberships before it was suspended.

Result: ProvisioningResult.success(cmd, nativeId, null). If your connector re-enables the account, ignore password and entitlements. If it re-creates the account, add every item in entitlements back before you publish.

{
  "action": "RESTORE_ACCOUNT",
  "requestId": "pr-4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b",
  "connectorName": "Helpdesk",
  "triggerSource": "ADMIN_RESTORE",
  "connectionInfo": { "Connection Settings": { "…": "…" } },
  "subject": { "userId": "usr-5521", "correlatedAccountId": "acc-7710", "nativeAccountIdentifier": "mpatel" },
  "entitlements": [ { "entitlementId": "ent-0f3a", "nativeIdentifier": "fin-approvers", "displayName": "Finance Approvers", "entitlementType": "GROUP" } ],
  "attributeMappings": { "username": "mpatel", "email": "maya.patel@northwind.example" },
  "password": "Hv3$kN9q!Ue5mWa1"
}
{
  "action": "RESTORE_ACCOUNT",
  "requestId": "pr-4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b",
  "status": "SUCCESS",
  "nativeAccountIdentifier": "mpatel",
  "completedAt": "2026-11-14T15:44:02Z"
}

RESET_PASSWORD

Purpose: set a new password on an existing account. Handled by handleProvisioning(). Zetect sends it when privileged access rotates a managed account's password.

Request: subject.nativeAccountIdentifier identifies the account and password holds the new password. The requestId starts with pa-.

Result: ProvisioningResult.success(cmd, nativeId, null) only after the target has accepted the new password. Zetect stores the new password only on success; on failure it keeps the old one.

{
  "action": "RESET_PASSWORD",
  "requestId": "pa-9b0c1d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e",
  "sourceId": "asset-db-prod-02",
  "tenantId": "northwind",
  "connectorName": "Helpdesk",
  "triggerSource": "PASSWORD_ROTATION",
  "requestedAt": "2026-11-14T02:00:00Z",
  "connectionInfo": { "Connection Settings": { "…": "…" } },
  "subject": { "userId": null, "correlatedAccountId": "pacc-311", "nativeAccountIdentifier": "svc_reports" },
  "password": "q8#Vt2!mLz5Rx0Pe"
}
{
  "action": "RESET_PASSWORD",
  "requestId": "pa-9b0c1d2e-3f4a-4b5c-8d6e-7f8a9b0c1d2e",
  "triggerSource": "PASSWORD_ROTATION",
  "status": "SUCCESS",
  "nativeAccountIdentifier": "svc_reports",
  "completedAt": "2026-11-14T02:00:04Z"
}

Legacy user actions

Purpose: CREATE_USER, UPDATE_USER, DISABLE_USER, ENABLE_USER and DELETE_USER come from an older protocol. The agent still accepts them and routes them to handle(), but Zetect doesn't send them. New connectors don't need to implement them.

Result: a ConnectorResult. Return ConnectorResult.notSupported(cmd) if you don't implement them.

{
  "runId": "legacy-0001",
  "tenantId": "northwind",
  "connectorName": "Helpdesk",
  "action": "DISABLE_USER",
  "success": false,
  "error": "actionNotSupported: DISABLE_USER",
  "timestamp": "2026-11-14T16:00:00Z"
}