# Undelete an entity

Undeletes a soft-deleted entity.

Endpoint: POST /v1alpha/entities/{entity}:undelete
Version: v1alpha
Security: oauth2_client_credentials, oauth2_authorization_code

## Security:

  - `oauth2_client_credentials` (unknown)
    oauth2

  - `oauth2_authorization_code` (unknown)
    oauth2

## Path parameters:

  - `entity` (string, required)
    The entity id.

## Response 200:

  - `200` (unknown)
    Success

## Response 200 fields (application/json):

  - `name` (string)
    (IDENTIFIER) The resource name of the entity.
Format: entities/{entity}
string.resource_name = ["entities/*"] // value must be a valid resource name

  - `displayName` (string)
    (OPTIONAL) Optional. A mutable, user-settable field for providing a human-readable
name for the entity, to be used in user interfaces. Must be <= 63
characters.
string.display_name = true // value must be at most 63 characters

  - `contactInfo` (object)

  - `contactInfo.telephone` (array)
    (OPTIONAL)

  - `contactInfo.businessTelephone` (array)
    (OPTIONAL)

  - `contactInfo.emailAddress` (array)
    (OPTIONAL)

  - `contactInfo.primaryContacts` (array)
    (OPTIONAL)

  - `contactInfo.website` (array)
    (OPTIONAL)

  - `contactInfo.registeredBusinessAddresses` (array)
    (OPTIONAL)

  - `contactInfo.registeredBusinessAddresses.revision` (integer)
    The schema revision of the `PostalAddress`. This must be set to 0, which is
the latest revision.
All new revisions **must** be backward compatible with old revisions.

  - `contactInfo.registeredBusinessAddresses.regionCode` (string)
    Required. CLDR region code of the country/region of the address. This
is never inferred and it is up to the user to ensure the value is
correct. See http://cldr.unicode.org/ and
http://www.unicode.org/cldr/charts/30/supplemental/territory_information.html
for details. Example: "CH" for Switzerland.

  - `contactInfo.registeredBusinessAddresses.languageCode` (string)
    Optional. BCP-47 language code of the contents of this address (if
 known). This is often the UI language of the input form or is expected
 to match one of the languages used in the address' country/region, or their
 transliterated equivalents.
 This can affect formatting in certain countries, but is not critical
 to the correctness of the data and will never affect any validation or
 other non-formatting related operations.

 If this value is not known, it should be omitted (rather than specifying a
 possibly incorrect default).

 Examples: "zh-Hant", "ja", "ja-Latn", "en".

  - `contactInfo.registeredBusinessAddresses.postalCode` (string)
    Optional. Postal code of the address. Not all countries use or require
 postal codes to be present, but where they are used, they may trigger
 additional validation with other parts of the address (e.g. state/zip
 validation in the U.S.A.).

  - `contactInfo.registeredBusinessAddresses.sortingCode` (string)
    Optional. Additional, country-specific, sorting code. This is not used
in most regions. Where it is used, the value is either a string like
"CEDEX", optionally followed by a number (e.g. "CEDEX 7"), or just a number
alone, representing the "sector code" (Jamaica), "delivery area indicator"
(Malawi) or "post office indicator" (e.g. Côte d'Ivoire).

  - `contactInfo.registeredBusinessAddresses.administrativeArea` (string)
    Optional. Highest administrative subdivision which is used for postal
 addresses of a country or region.
 For example, this can be a state, a province, an oblast, or a prefecture.
 Specifically, for Spain this is the province and not the autonomous
 community (e.g. "Barcelona" and not "Catalonia").
 Many countries don't use an administrative area in postal addresses. E.g.
 in Switzerland this should be left unpopulated.

  - `contactInfo.registeredBusinessAddresses.locality` (string)
    Optional. Generally refers to the city/town portion of the address.
Examples: US city, IT comune, UK post town.
In regions of the world where localities are not well defined or do not fit
into this structure well, leave locality empty and use address_lines.

  - `contactInfo.registeredBusinessAddresses.sublocality` (string)
    Optional. Sublocality of the address.
 For example, this can be neighborhoods, boroughs, districts.

  - `contactInfo.registeredBusinessAddresses.addressLines` (array)
    Unstructured address lines describing the lower levels of an address.
Because values in address_lines do not have type information and may
sometimes contain multiple values in a single field (e.g.
"Austin, TX"), it is important that the line order is clear. The order of
address lines should be "envelope order" for the country/region of the
address. In places where this can vary (e.g. Japan), address_language is
used to make it explicit (e.g. "ja" for large-to-small ordering and
"ja-Latn" or "en" for small-to-large). This way, the most specific line of
an address can be selected based on the language.
The minimum permitted structural representation of an address consists
of a region_code with all remaining information placed in the
address_lines. It would be possible to format such an address very
approximately without geocoding, but no semantic reasoning could be
made about any of the address components until it was at least
partially resolved.
Creating an address only containing a region_code and address_lines, and
then geocoding is the recommended way to handle completely unstructured
addresses (as opposed to guessing which parts of the address should be
localities or administrative areas).

  - `contactInfo.registeredBusinessAddresses.recipients` (array)
    Optional. The recipient at the address.
 This field may, under certain circumstances, contain multiline information.
 For example, it might contain "care of" information.

  - `contactInfo.registeredBusinessAddresses.organization` (string)
    Optional. The name of the organization at the address.

  - `contactInfo.principalBusinessAddresses` (array)
    (OPTIONAL)

  - `contactInfo.residentialAddresses` (array)
    (OPTIONAL)

  - `registration` (object)
    (OPTIONAL)

  - `riskDetails` (object)

  - `riskDetails.riskStatus` (string)
    Enum: "RISK_STATUS_UNSPECIFIED", "ACTIVE", "PENDING_REVIEW", "SUSPENDED", "OFFBOARDED", "INACTIVE"

  - `riskDetails.riskStatusReason` (string)
    Enum: "RISK_STATUS_REASON_UNSPECIFIED", "NA", "SUSPECTED_FRAUD", "CONFIRMED_FRAUD", "NON_COMPLIANCE", "OUTSIDE_RISK_APPETITE", "EXCESSIVE_COMPLAINTS_OR_DISPUTES_CHARGEBACKS", "EXCESSIVE_ACTIVITY_OR_UNPLANNED_CHANGES_IN_VOLUME", "BUSINESS_CLOSED_OR_NO_LONGER_PROVIDING_SERVICES", "OTHER"

  - `riskDetails.riskRating` (string)
    (OPTIONAL) The risk rating label (e.g., "LOW", "MEDIUM", "HIGH", "CRITICAL").
 This is a tenant-configurable value from the RiskRatingLevels resource.

  - `entityRelationships` (array)
    (OPTIONAL)

  - `entityRelationships.id` (string)

  - `entityRelationships.sourceEntity` (string)
    (OPTIONAL) Not validated as an entity resource name: the server populates this
and target_entity with the bare entity ID, and callers echo it back
on UpdateEntity.

  - `entityRelationships.targetEntity` (string)
    (OPTIONAL)

  - `entityRelationships.type` (string)
    Enum: "RELATIONSHIP_TYPE_UNSPECIFIED", "DIRECTOR_OF", "INVERSE_DIRECTOR_OF", "SHAREHOLDER_OF", "INVERSE_SHAREHOLDER_OF", "BENEFICIAL_OWNER_OF", "INVERSE_BENEFICIAL_OWNER_OF", "OWNER_OF", "INVERSE_OWNER_OF", "UBO_OF", "INVERSE_UBO_OF", "EMPLOYEE_OF", "INVERSE_EMPLOYEE_OF", "SUPPLIER_OF", "INVERSE_SUPPLIER_OF", "AUTHORIZED_REPRESENTATIVE_OF", "INVERSE_AUTHORIZED_REPRESENTATIVE_OF", "CUSTOMER_OF", "INVERSE_CUSTOMER_OF", "TRUSTEE_OF", "INVERSE_TRUSTEE_OF", "SETTLOR_OF", "INVERSE_SETTLOR_OF", "BENEFICIARIES_OF", "INVERSE_BENEFICIARIES_OF", "PROTECTORS_OF", "INVERSE_PROTECTORS_OF", "TRUST_ADMINISTRATOR_OF", "INVERSE_TRUST_ADMINISTRATOR_OF", "FAMILY", "FRIEND", "SAME_AS"

  - `entityRelationships.displayName` (string)

  - `entityRelationships.entityType` (string)

  - `externalIds` (object)
    External ID mappings for an entity.

  - `externalIds.cherryhub` (string)
    (OPTIONAL) CherryHub external identifier.

  - `externalIds.custom` (object)
    (OPTIONAL) Custom external identifiers as key-value pairs.

  - `tags` (array)
    (OPTIONAL) Optional. Tags associated with the entity.

  - `tags.tagType` (string, required)
    Required. The tag type resource name.
Format: tagTypes/{tag_type}

  - `tags.tagDefinitionId` (string, required)
    Required. The ID of the tag definition within the tag type.
 This must match one of the TagDefinition IDs in the referenced TagType.

  - `customFieldSettingRevision` (string)
    (OPTIONAL) The resource name of the schema revision this request was filled against.
Format: tenants/{tenant}/customFieldSettings/{custom_field_setting}/revisions/{revision}

  - `customFieldValues` (object)
    (OPTIONAL) The field values organised by group.
Each outer map key is the group key; each inner Struct holds field_key → value pairs.
Values are raw JSON types matching FormKit output: string, number, bool, or list of strings.
The backend validates value types against the field definitions at runtime.

  - `createTime` (string)
    A Timestamp represents a point in time independent of any time zone or local
calendar, encoded as a count of seconds and fractions of seconds at
nanosecond resolution. The count is relative to an epoch at UTC midnight on
January 1, 1970, in the proleptic Gregorian calendar which extends the
Gregorian calendar backwards to year one.
All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
second table is needed for interpretation, using a [24-hour linear
smear](https://developers.google.com/time/smear).
The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
restricting to that range, we ensure that we can convert to and from [RFC
3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
# Examples
Example 1: Compute Timestamp from POSIX `time()`.
Timestamp timestamp;
timestamp.set_seconds(time(NULL));
timestamp.set_nanos(0);
Example 2: Compute Timestamp from POSIX `gettimeofday()`.
struct timeval tv;
gettimeofday(&tv, NULL);
Timestamp timestamp;
timestamp.set_seconds(tv.tv_sec);
timestamp.set_nanos(tv.tv_usec * 1000);
Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
FILETIME ft;
GetSystemTimeAsFileTime(&ft);
UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
// A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
// is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
Timestamp timestamp;
timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
long millis = System.currentTimeMillis();
Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
.setNanos((int) ((millis % 1000) * 1000000)).build();
Example 5: Compute Timestamp from Java `Instant.now()`.
Instant now = Instant.now();
Timestamp timestamp =
Timestamp.newBuilder().setSeconds(now.getEpochSecond())
.setNanos(now.getNano()).build();
Example 6: Compute Timestamp from current time in Python.
timestamp = Timestamp()
timestamp.GetCurrentTime()
# JSON Mapping
In JSON format, the Timestamp type is encoded as a string in the
[RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
where {year} is always expressed using four digits while {month}, {day},
{hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
is required. A proto3 JSON serializer should always use UTC (as indicated by
"Z") when printing the Timestamp type and a proto3 JSON parser should be
able to accept both UTC and other timezones (as indicated by an offset).
For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
01:30 UTC on January 15, 2017.
In JavaScript, one can convert a Date object to this format using the
standard
[toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
method. In Python, a standard `datetime.datetime` object can be converted
to this format using
[`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
the Joda Time's [`ISODateTimeFormat.dateTime()`](http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()) to obtain a formatter capable of generating timestamps in this format.

  - `annotations` (object)
    (OPTIONAL) Optional. Annotations for arbitrary metadata.
 See AIP-148.

  - `etag` (string)
    (OPTIONAL) Optional. The etag of the resource. Used for optimistic concurrency control
as per AIP-154.
string.etag = true // etag must be at most 256 characters

  - `company` (object, required)

  - `company.type` (string, required)
    Enum: "COMPANY_TYPE_UNSPECIFIED", "PUBLIC_COMPANY", "PRIVATE_COMPANY", "NON_PROFIT", "GOVERNMENTAL_ORG", "ASSOCIATION_INCORPORATION"

  - `company.industry` (string)
    (OPTIONAL)

  - `company.contacts` (array)
    (OPTIONAL) Key contact details for the company.

  - `company.contacts.role` (string)
    (OPTIONAL) The role of the contact point such as CTO or Support Team.

  - `company.contacts.displayName` (string)
    (OPTIONAL) Human-readable display name of the contact such as John Doe

  - `company.contacts.contactType` (string)
    (OPTIONAL) The type of contact e.g. 'Risk Contact', 'Primary Contact', 'Sales Contact'.

  - `company.contacts.emailAddress` (string)
    (OPTIONAL) Email address for the contact.

  - `company.contacts.phoneNumber` (string)
    (OPTIONAL) Phone number for the contact.

  - `individual` (object, required)

  - `individual.title` (string)
    (OPTIONAL) Optional. The individual's title, e.g., "Mr.", "Dr.".

  - `individual.givenName` (string)
    (OPTIONAL) Optional. The individual's given name.

  - `individual.middleName` (string)
    (OPTIONAL) Optional. The individual's middle name or initial.

  - `individual.familyName` (string)
    (OPTIONAL) Optional. The individual's family name.

  - `individual.birthDate` (object)
    Represents a whole or partial calendar date, such as a birthday. The time of
day and time zone are either specified elsewhere or are insignificant. The
date is relative to the Gregorian Calendar. This can represent one of the
following:
* A full date, with non-zero year, month, and day values
* A month and day value, with a zero year, such as an anniversary
* A year on its own, with zero month and day values
* A year and month value, with a zero day, such as a credit card expiration
date

Related types are [google.type.TimeOfDay][google.type.TimeOfDay] and
`google.protobuf.Timestamp`.

  - `individual.birthDate.year` (integer)
    Year of the date. Must be from 1 to 9999, or 0 to specify a date without
 a year.

  - `individual.birthDate.month` (integer)
    Month of a year. Must be from 1 to 12, or 0 to specify a year without a
 month and day.

  - `individual.birthDate.day` (integer)
    Day of a month. Must be from 1 to 31 and valid for the year and month, or 0
 to specify a year by itself or a year and month where the day isn't
 significant.

  - `individual.birthPlace` (string)
    (OPTIONAL)

  - `individual.gender` (string)
    Enum: "GENDER_UNSPECIFIED", "MALE", "FEMALE", "OTHER"

  - `individual.nationality` (string)
    (OPTIONAL) string.cldr_region_code = true // value must be a valid Unicode CLDR region code (e.g. 'AU')

  - `individual.residenceCountry` (string)
    (OPTIONAL) string.cldr_region_code = true // value must be a valid Unicode CLDR region code (e.g. 'AU')

  - `individual.citizenshipCountry` (array)
    (OPTIONAL)

  - `individual.occupation` (string)
    (OPTIONAL)

  - `individual.employer` (string)
    (OPTIONAL)

  - `individual.alias` (string)
    (OPTIONAL)

  - `individual.governmentId` (object)
    (OPTIONAL) Deprecated: use entities/{entity}/documents instead.

  - `trust` (object, required)

  - `trust.type` (string)
    Enum: "TRUST_TYPE_UNSPECIFIED", "SPECIAL_DISABILITY", "DECEASED_ESTATE", "HYBRID_TRUST", "FIXED_TRUST", "DISCRETIONARY_TRUST", "CASH_MANAGEMENT_UNIT_TRUST", "PUBLIC_UNIT_TRUST", "FIXED_UNIT_TRUST"

  - `trust.trust` (string)
    (OPTIONAL)

  - `trust.settler` (string)
    (OPTIONAL)

  - `trust.trustee` (string)
    (OPTIONAL)

  - `trust.deed` (string)
    (OPTIONAL)

