---
title: Create claim activity
summary: Posts a new activity request against a Guidewire claim.
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data.Guidewire
reference_type: package
operation_id: OP-SDG-02
trigger: Caller invokes ActivityDataApiClient.CreateActivityRequest
---

# Create claim activity

This operation posts a new `Activity` record against a Guidewire claim through `ActivityDataApiClient.CreateActivityRequest`, using the shared base-URL/auth pipeline and throwing on a non-success response.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-SDG-02 |
| **Trigger** | Caller invokes `CreateActivityRequest(claimId, Activity)` |
| **Inputs** | Claim id, `Activity` |
| **Outputs** | HTTP 2xx response, or a thrown exception |
| **Primary components** | `ActivityDataApiClient.CreateActivityRequest` |
| **Entry point** | `Data/SAIF.Data.Guidewire/Clients/ActivityDataApiClient.cs` |

## Steps

1. Resolve the client's base URL (`cc.activitydata.api.url.v1`) and Basic-auth header (`cc.gwcreds`).
   - Set `BaseAddress` from `GetConfigSetting(UrlKey)`.
   - On first request, compute the system hash and set the `Authorization: Basic` header from `GetSecureConfigSetting(AuthKey, hash)`.

   > **Origin**: Step 1 is implemented in [Resolve base URL and authenticate](resolve-base-url-and-authenticate.md) (`SAIF.Data.Guidewire`) and executed on behalf of this operation.
2. Serialize the `Activity` payload with null properties ignored. ([SDG-BR-010](../business-rules.md#sdg-br-010-null-activity-properties-omitted-from-serialized-request))
3. POST the serialized payload to `activity/claim/{claimId}`.
4. If the response is non-success, throw an exception including the HTTP status code and response content. Other exceptions raised during the call are wrapped. ([SDG-BR-011](../business-rules.md#sdg-br-011-non-success-responses-throw-with-status-and-content))
   - On failure: caller receives the wrapped/thrown exception; no partial activity is assumed created.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([Caller invokes CreateActivityRequest]) --> S1["Resolve base URL and<br>Basic-auth header"]
	S1 --> S2["Serialize Activity,<br>omit null properties"]
	S2 --> S3["POST activity/claim/{claimId}"]
	S3 --> S4{"Non-success status?"}
	S4 -->|Yes| EndErr([Throw with status and content])
	S4 -->|No| EndOk([Return success])
```

## Failure and edge-case behavior
- A non-success HTTP status throws with the status code and response content, and other exceptions are wrapped, so callers must handle exceptions rather than inspect a return status.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

## Sources
- `Data/SAIF.Data.Guidewire/Clients/ActivityDataApiClient.cs`
- `Data/SAIF.Data.Guidewire/Clients/HttpClientBase.cs`
- `Data/SAIF.Data.Guidewire/Models/ActvityDataApi/Activity.cs`
