Creating activities
Activities must be created from an existing claim using the following endpoint:
- POST
claim/v1/claims/{claimId}/activities
Activity patterns
Activities are created from activity patterns. An activity pattern is a set of
default values for fields in the activity (such as description, subject, and priority).
Every activity pattern has a code, such as contact_insured
or
legal_review
.
When creating an activity through Cloud API, the only required field is
activityPattern
, which must specify the activity pattern's code. Because
the activity pattern typically contains all the necessary default values, the activity
pattern is often the only field the caller application needs to specify.
You can retrieve a list of activity patterns using the following:
- GET
/claim/v1/claims/{claimId}/activity-patterns
You can optionally specify values for the following fields, each of which overrides the value coming from the activity pattern:
Field | Datatype | Description | Default |
---|---|---|---|
description |
string | The activity's description | Typically comes from the activity pattern |
dueDate |
datetime | The date by which the activity is expected to be completed | Typically calculated based on values in the activity pattern |
escalationDate |
datetime | The date on which the activity will be escalated if it has not yet been completed | Typically calculated based on values in the activity pattern |
externallyOwned |
Boolean | Whether the activity is to be assigned to an external group or external user | Typically comes from the activity pattern |
importance |
Typekey (a value from the ImportanceLevel typelist) |
The activity's importance, as reflected on the user's calendar | Typically comes from the activity pattern |
mandatory |
Boolean | Whether the activity must be completed (true) or can be skipped (false) | Typically comes from the activity pattern |
priority |
Typekey (a value from the Priority typelist) |
The activity's priority | Typically comes from the activity pattern |
recurring |
Boolean | Whether the activity repeats. If true, completing the activity creates a new one. | Typically comes from the activity pattern |
subject |
String | The activity's subject | Typically comes from the activity pattern |
AutomatedOnly activity patterns
Activity patterns have an AutomatedOnly field. This field designates whether or not a user can create activities through the user interface using that activity pattern.
false
- users can create activities with this activity pattern through the user interfacetrue
- users cannot create activities with this activity pattern through the user interface
When a caller attempts to create an activity through Cloud API, the default behavior is to prohibit the use of any activity pattern whose AutomatedOnly field is set to true.
There is a system permission named restcreateautomatedactivity
that can be
used to override this behavior. If a caller has some association with this permission, then
that caller can create activities from AutomatedOnly activity patterns. There are two ways
this association can exist.
For more information on how to associate this permission with different types of callers, see Cloud API Developer Guide.
Examples of creating activities
The following is an example of creating a contact_insured
activity for
claim cc:102. The activity defaults to all values in the contact_insured
activity pattern.
Command
POST /claim/v1/claims/cc:102/activities
Request
{
"data": {
"attributes": {
"activityPattern": "contact_insured"
}
}
}
The following is an example of creating a legal_review
activity for claim
cc:102. In this case, two activity pattern values are overridden: the activity is
mandatory
(it cannot be skipped) and the priority
is
urgent.
Command
POST /claim/v1/claims/cc:102/activities
Request
{
"data": {
"attributes": {
"activityPattern": "legal_review",
"mandatory": true,
"priority": {
"code": "urgent"
}
}
}
}