# Claims (single claim) \[PATCH]

The `PATCH` request to the `/parties/{partyId}/claims/{claimId}` endpoint can be used to update a claim for a party in the Participant Registry.

{% hint style="info" %}
The `PATCH` request to the `/parties/{partyId}/claims/{claimId}` is an **OPTIONAL** endpoint.
{% endhint %}

## Update claim information

> Used to partially update a specific claim of an iSHARE participant in the Participant  Registry. This flexible update mechanism allows updating any claim property using a key-value structure in the request body.\
> The key represents the property path within the claim (using dot notation for  nested properties), and the value is the new value to set. Only the provided  fields will be updated, other fields remain unchanged.\
> Examples of property paths: - "status" - Update claim status - "validFrom" - Update validity start time (ISO 8601 date-time) - "validUntil" - Update validity end time (ISO 8601 date-time) - "role.roleId" - Update role ID in role claim - "role.status" - Update role status - "role.loa" - Update level of assurance - "agreement.agreementId" - Update agreement ID - "agreement.status" - Update agreement status - "agreement.title" - Update agreement title - "additionalInfo.companyEmail" - Update company email in additional info\
> The claim ID and type cannot be changed through this operation.\
> Server response is an iSHARE signed JSON Web Token. Please refer to the models 'jwtHeader' and 'jwtPayloadClaimToken' which indicate what the decoded response will look like.

```json
{"openapi":"3.0.0","info":{"title":"iSHARE API specifications","version":"3.0"},"tags":[{"name":"Participant Registry (Optional)","description":"Optional endpoints for the iSHARE Participant Registry API."}],"servers":[{"description":"iSHARE test network base domain","url":"https://isharetest.net"}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"OAuth 2.0 authorization based on bearer token. MUST contain “Bearer “ + access token value. Must be provided if restricted endpoints are needed."}},"schemas":{"claimUpdate":{"title":"ClaimUpdate","type":"object","description":"Schema for partial updates to a claim. This flexible schema allows updating any claim property by using a key-value structure. The key represents the property path within the claim, and the value is the new value to set.\nFor nested properties, use dot notation (e.g., \"frameworkRole.roleId\"). The claim type, registrarId and ID cannot be changed through this operation.\nCommon claim properties that can be updated: - status: Claim status (active, inactive, suspended, revoked) - validFrom: ISO 8601 date-time when claim becomes valid - validUntil: ISO 8601 date-time when claim expires\nType-specific properties can also be updated using the appropriate property paths.\nNote that claims cannot be deleted, but instead the status can be set to revoked or inactive.\nBecause the claimId must be provided in the URL, only the properties of that  specific claim may be updated in one request.","additionalProperties":{"oneOf":[{"type":"string"},{"type":"integer"},{"type":"boolean"},{"type":"object"},{"type":"array"}]}},"claimResponse":{"title":"ClaimResponse","type":"object","properties":{"claimToken":{"type":"string","format":"application/jwt"}}}}},"paths":{"/parties/{partyId}/claims/{claimId}":{"patch":{"tags":["Participant Registry (Optional)"],"parameters":[{"style":"simple","name":"partyId","description":"The id of the party whose claim must be updated. Can be anyone of  the party id from id or alsoKnownAs attributes of that participant. Since all participants are automatically allocated the derived  ishare did, that id is always an option to search for a participant.\nWhen updating alsKnownAs all existing values must also be provided.  Implementations should raise an error if any of the existing values  are missing (meaning deletion) as Ids in this field cannot be  deleted once registered.","schema":{"type":"string"},"in":"path","required":true},{"style":"simple","name":"claimId","description":"The id of the claim that must be updated.","schema":{"type":"string"},"in":"path","required":true}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/claimUpdate"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/claimResponse"}}},"description":"OK"},"400":{"description":"Bad Request - Invalid input data"},"404":{"description":"Not Found - Party or claim not found"},"500":{"description":"Internal Server Error"}},"deprecated":false,"operationId":"update-claim-information","summary":"Update claim information","description":"Used to partially update a specific claim of an iSHARE participant in the Participant  Registry. This flexible update mechanism allows updating any claim property using a key-value structure in the request body.\nThe key represents the property path within the claim (using dot notation for  nested properties), and the value is the new value to set. Only the provided  fields will be updated, other fields remain unchanged.\nExamples of property paths: - \"status\" - Update claim status - \"validFrom\" - Update validity start time (ISO 8601 date-time) - \"validUntil\" - Update validity end time (ISO 8601 date-time) - \"role.roleId\" - Update role ID in role claim - \"role.status\" - Update role status - \"role.loa\" - Update level of assurance - \"agreement.agreementId\" - Update agreement ID - \"agreement.status\" - Update agreement status - \"agreement.title\" - Update agreement title - \"additionalInfo.companyEmail\" - Update company email in additional info\nThe claim ID and type cannot be changed through this operation.\nServer response is an iSHARE signed JSON Web Token. Please refer to the models 'jwtHeader' and 'jwtPayloadClaimToken' which indicate what the decoded response will look like."}}}}
```

### Request model

The following URL parameters must be used.

* `partyId` {url}/parties/{**partyId**} <mark style="color:red;">(Required)</mark>\
  **String**. The id of the party for who a claim must be updated. Can be anyone of the party id from id or alsoKnownAs attributes of that participant. Since all participants are automatically allocated the derived ishare did, that id is always an option to search for a participant.
* `claimId` {url}/parties/{partyId}/claims/{**claimId**} <mark style="color:red;">(Required)</mark>\
  **String**. The id of the claims that must be updated.

The body may contain any number of key/value pairs that define what properties must be updated **in the specified claimId only**.

* The **key** represents the property path within the claim (using dot notation for nested properties)
* The **value** is the new value to set.

Take into account the following:

* Only the provided fields will be updated, other fields remain unchanged.
* Note that claims cannot be deleted, but instead the status can be set to revoked or inactive.
* Because the {claimId} must be provided in the URL, only the properties of that\
  specific claim may be updated in one request. If you want to update multiple claims, you must make multiple requests.
* The claim ID and type cannot be changed through this operation.

Examples of property paths:

* "status" - Update claim status
* "validFrom" - Update validity start time (ISO 8601 date-time)
* "validUntil" - Update validity end time (ISO 8601 date-time)
* "roleId" - Update role ID in role claim
* "additionalInfo.companyEmail" - Update contact email in additional info

The request must be passed as JWT. The JSON body must contain a claim. Refer to [claim-models](https://dev.ishare.eu/participant-registry-role/claim-models "mention") for an overview of available claims.

### Example request

The following is an example request to update a frameworkRole claim.

```json
POST /parties/ HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json

{
  "status": "active",
  "startDate": "2024-01-01T00:00:00.000Z",
  "endDate": "2024-12-31T23:59:59.999Z",
  "roleId": "ServiceProvider",
  "loa": 2,
}
```

### Response model

The response will be equal to the response of the [GET request for retrieving a single claim](https://dev.ishare.eu/participant-registry-role/claims-single-claim-get). Refer to the response model as defined here.

### Example response

Refer to the example response under the [GET request](https://dev.ishare.eu/participant-registry-role/claims-single-claim-get) definition.
