API ReferenceCredential
credential.create
Type: Mutation · Auth: Workspace-aware
Input
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| workspaceId | string | No | — | ID of the associated workspace |
| siteId | string | Yes | — | ID of the associated site |
| systemId | string | No | — | ID of the associated system |
| credentialType | enum(card, pin, fob, biometric, master_code, installer_code, other) | Yes | — | Credential type |
| credentialIdentifier | string | Yes | — | Credential identifier |
| assignedPersonName | string | Yes | — | Assigned person name |
| assignedPersonType | enum(employee, customer_contact, vendor, temporary, system_account) | Yes | — | Assigned person type |
| contactId | string | No | — | ID of the associated contact |
| accessGroups | unknown | Yes | [] | Access groups |
| activationDate | string.date-time | Yes | — | Activation date |
| expirationDate | string.date-time | No | — | Expiration date |
| approvalStatus | enum(pending, approved, denied) | Yes | "pending" | Approval status |
| revocationStatus | enum(active, revoked, suspended, expired) | Yes | "active" | Revocation status |
| requestedBy | string | No | — | Requested by |
| approvedBy | string | No | — | Approved by |
| revokedBy | string | No | — | Revoked by |
| revokedAt | string.date-time | No | — | Revoked at |
| revocationReason | string | No | — | Revocation reason |
| auditNotes | string | No | — | Audit notes |
| metadata | unknown | No | — | Metadata |
| visibilityMode | enum(global, workspace_local, shared) | Yes | "workspace_local" | Visibility mode |
Example
{
"workspaceId": "550e8400-e29b-41d4-a716-446655440000",
"siteId": "550e8400-e29b-41d4-a716-446655440000",
"systemId": "550e8400-e29b-41d4-a716-446655440000",
"credentialType": "card",
"credentialIdentifier": "example",
"assignedPersonName": "example",
"assignedPersonType": "employee",
"accessGroups": [],
"activationDate": "2024-01-15T09:00:00.000Z",
"approvalStatus": "pending",
"revocationStatus": "active",
"visibilityMode": "global"
}