# Update an Identity

This endpoint updates the requested Identity of a given Twin. Any optional parameters not provided in the request will be left unchanged. Any optional parameters provided in the request will replace current parameters.

Method Path Operation*
PATCH /twins/{twin}/identities/{identity} update_twin_identity

*

In order for a user to perform the "update_twin_identity" operation, the "update_twin_identity" permission must be included in the list of allowed actions in the statement of the user's role.

# Request

Parameter Type In Description
{twin}
required
string path Twin UUID.
{identity}
required
string path User-defined ID for the Identity. It must match the regular expression (opens new window) [A-Za-z_][0-9A-Za-z_]{0,7}#[0-9A-Za-z_=+-]{1,128}. It is stored in the "identity" field of the creation certificate of the Identity.
validity_ts
optional *
timestamp, DEFAULT=null body Time at which the Identity expires. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch (opens new window). If the value is null, the Identity does not expire.
visibility
optional *
string, DEFAULT=null body Visibility of the Identity. An Identity created in an account is visible to users belonging to that account. If the value of the "visibility" attribute is null, the Identity is private. Private Identities are only visible to users of the account which owns the Identity. If the value is not null, the Identity is public. Public Identities are visible to users of the account which owns the Identity and as well to users of other accounts if the visibility Rule held in the "visibility" attribute evaluates to True.

*

Any optional parameters not provided in the request will be left unchanged. Any optional parameters provided in the request will replace current parameters.

In our example, we want to change the "validity_ts" of the Identity so that the Identity does not expire ("validity_ts": null). We also want to make it a private Identity ("visibility": null) so that it is only visible to users of the account that owns the Identity.

# Response

Attribute Type Description
visibility string Visibility of the Identity. An Identity created in an account is visible to users belonging to that account. If the value of the "visibility" attribute is null, the Identity is private. Private Identities are only visible to users of the account which owns the Identity. If the value is not null, the Identity is public. Public Identities are visible to users of the account which owns the Identity and as well to users of other accounts if the visibility Rule held in the "visibility" attribute evaluates to True.
validity_ts timestamp Time at which the Identity expires. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch (opens new window). If the value is null, the Identity does not expire.
updated_ts timestamp Time at which the Identity was last updated. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch (opens new window).
creation_certificate dictionary
Certificate generated automatically by the system upon creation of the Identity. The creation certificate cannot be modified after it has been generated.
Attribute Type Description
identity string User-defined ID for the Identity. It must match the regular expression (opens new window) [A-Za-z_][0-9A-Za-z_]{0,7}#[0-9A-Za-z_=+-]{1,128}.
creator string account UUID of the account creating the Identity.
created_ts timestamp Time at which the Identity was created. Measured in seconds (to three decimal places) that have elapsed since the Unix epoch (opens new window).

# Status codes

Requests to this endpoint result in generic status codes. For a comprehensive list of status codes, please consult the Status Codes section.