ServicePresenceStatus defines an Omni-Channel presence status and the service channels assigned to it. It is reusable configuration, not a record of an agent's current presence or remaining work capacity. The type is available only when Omni-Channel is enabled in the org.
The status label, metadata component name, and runtime record ID serve different purposes. Channel membership determines whether Salesforce marks the status as Away; a label such as "Available" does not make a status available for work.
Key Elements
The table distinguishes the configurable metadata elements from IsAway, which is a resulting state rather than an exposed XML element.
| Element | What the Element Controls |
|---|---|
fullName |
Identifies the metadata component. Inherited from Metadata; it is not the runtime record ID passed to Omni-Channel toolkit methods. |
channels |
Contains the service-channel assignments. If no service channels are included, Salesforce automatically marks the status as Away. |
channel |
Nested under channels. Each entry references a ServiceChannel component. |
label |
Supplies the presence status label. The label does not override the behavior caused by channel membership. |
IsAway |
Resulting state, not a separately exposed element in this metadata definition. Salesforce sets it to true when no service channels are assigned. |
Behavior and Constraints
Channel membership determines Away behavior
A status without service channels is automatically an Away status. This applies even if its label says "Available" or otherwise suggests that the agent can receive work. To diagnose this mismatch, inspect channels, not just label. There is no independent IsAway setting to edit in this metadata definition.
Channel assignments do not establish user access
PermissionSet and MutingPermissionSet can reference the status through servicePresenceStatus. Those permission-related dependencies are separate from channel membership. Deploying the status definition alone does not establish a user's effective access to it.
PresenceUserConfig can also select the status through presenceStatusOnDecline and presenceStatusOnPushTimeout. A status can therefore affect decline and push-timeout handling as well as the service channels assigned directly to it.
Metadata identity is not a runtime status ID
An Omni-Channel toolkit call that requires a status ID uses the runtime ServicePresenceStatus record's Id, not the metadata component's fullName or label. A 2018 community example avoided hard-coding that ID by querying the runtime object by DeveloperName: SELECT Id FROM ServicePresenceStatus WHERE DeveloperName = 'Busy'. This assumes the developer name is Busy; DeveloperName and Id are not additional fields in this metadata definition. See the runtime ID lookup example.
Deployment and Retrieval
Metadata API components use the .servicePresenceStatus suffix and reside in the servicePresenceStatuses folder. In package.xml, use ServicePresenceStatus as the type name. The type supports the wildcard * in the manifest's members element.
The target org must have Omni-Channel enabled for this metadata type to be available. Channel assignments reference ServiceChannel components, so the channel configuration is part of the dependency analysis for a deployment.
For changes or removals, include the incoming references in the impact analysis: permission-related references can affect access, while PresenceUserConfig references select the status for decline or push-timeout handling. Reviewing only the status's assigned channels misses these uses.
Metadata deployment is separate from Apex DML, the insert, update, and delete operations used for records. A runtime error saying that DML is not allowed on ServicePresenceStatus does not mean that the metadata component cannot be deployed.
Relationships
The status references its assigned service channels. Permission configuration and presence user configuration can reference the status in turn. These connections describe possible dependencies; they do not establish which components actually use a particular status in an org.
References
-
ServiceChannel:channel, nested underchannels.
Referenced By
-
MutingPermissionSet:servicePresenceStatus. -
PermissionSet:servicePresenceStatus. -
PresenceUserConfig:presenceStatusOnDecline,presenceStatusOnPushTimeout.
Reported Issues
-
A toolkit status change reportedly succeeded only after an ID-format change. In October 2022, an Aura component using
lightning:omniToolkitAPI.setServicePresenceStatusreturned "invalid ServicePresenceStatus Id" despite the author's reported profile access. The author reported success after changing an 18-character ID to its 15-character form. This is a conditional runtime workaround, not a general Metadata API identifier rule or a confirmed current requirement. See the Aura toolkit ID-format report. -
Creating runtime test data with DML failed. In an August 2018 Apex test discussion, an attempt to insert the runtime
ServicePresenceStatusobject produced "DML not allowed on ServicePresenceStatus". The response proposed mockingUserServicePresencequery results for tests that need live-presence data. The report concerns runtime test-data creation, not metadata deployment. See the Apex presence test discussion. -
A deployment containing Apex references to the runtime object failed when Omni-Channel was disabled. A 2019 community report described "Invalid type: Schema.ServicePresenceStatus" during an SFDX push to an org without Omni-Channel enabled. The code included a statically typed query against
ServicePresenceStatus, even though it also attempted a runtime schema check. See the disabled Omni-Channel deployment report.
Common Questions
Why is my "Available" presence status marked as Away?
If the status has no service channels in channels, Salesforce automatically sets IsAway to true. The label does not override that behavior.
How do I retrieve all ServicePresenceStatus components?
Use ServicePresenceStatus as the type name and * as the member in package.xml. Components use the .servicePresenceStatus suffix in the servicePresenceStatuses folder. Omni-Channel must be enabled.
Does deploying a presence status give agents access to it?
The status definition alone does not establish effective user access. Its channel assignments are separate from the references in PermissionSet and MutingPermissionSet.
What ID should I pass to setServicePresenceStatus?
Use the runtime ServicePresenceStatus record's Id, not its metadata name or label. The community lookup example queries that ID by DeveloperName.
Does "DML not allowed on ServicePresenceStatus" mean metadata deployment is unsupported?
No. The reported error came from inserting the runtime object in an Apex test. Metadata deployment and runtime DML are separate operations; the test discussion proposed mocking UserServicePresence query results instead.