/entity.replace

Replace part of an entity with a value. The entity.replace call can be destructive. Any object attributes that you do not specify are replaced with null values. Plural values are replaced, and all new elements are automatically assigned ids. For an additive operation, use entity.update.

Refer to the Registration Error Codes section for details on error codes.

This endpoint includes the following methods:

  • POST

POST

Authentication

This endpoint supports Basic authentication (recommended) as well as janrain-oauth and janrain-signed authentication.

How to Create an Authentication String

Base URL

The base URL for this endpoint is your Janrain Capture domain; for example:

https://educationcenter.us-dev.janraincapture.com

Your Capture domains (also known as Registration domains) can be found in the Janrain Console on the Manage Application page:

Example: Replace an entity by UUID

This example shows how to request the replacement of an entityType of 'user' by UUID with a new set of attributes.


curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk="\
    --data-urlencode type_name=user \
    --data-urlencode uuid=0987098709870987 \
    --data-urlencode attributes='{"givenName":"Bob","familyName":"Smith"}'\
    https://my-app.janraincapture.com/entity.replace
          
      Running this command in Postman

Example Response


{
  "stat": "ok"
}        
                                                    

Example: Replace an entity by email

This example shows how to request the replacement of an entityType of 'user' by email with a new set of attributes.


curl -X POST \
    -H "Authorization: Basic aW1fYV...NfbXk="\
    --data-urlencode type_name=user \
    --data-urlencode key_attribute=email \
    --data-urlencode key_value='"parkerm@example.com"' \
    --data-urlencode attributes='{"givenName":"Mathew","familyName":"Parkerson",
    "email":"parkerm@example.com"}' \
    https://my-app.janraincapture.com/entity.replace
          
      Running this command in Postman

Example Response


{
  "stat": "ok"
}        
                                                    

Authorized Clients

  • owner 
  • direct_access

Query Parameters

Parameter Type Required Description
id string ID of the user record. Required unless you are using the uuid or key_attribute parameter.
 
uuid string UUID of the user record. Required unless you are using the id or key_attribute parameter.
 
key_attribute string Name of a unique attribute in the schema. This parameter is required unless you are using the uuid or id parameter, and must be used in conjunction with the key_value parameter.
key_value string Value assigned to the key_attribute parameter.
 
type_name string Yes Name of the entity type.
 
value string Yes JSON-formatted value assigned to the attribute_name parameter. For backward compatibility, this attribute can also be referred to as the attributes parameter.
 
attribute_name string Yes Path of the attribute to be updated. This value path contains ids for each plural element. The default is the root path, which results in the entire record being updated.
 
created string Timestamp generated when the entity was created. If this parameter is present but te value is incorrect, the command will fail. 
 
lastUpdated string Timestamp generated when the entity was last updated. If this parameter is present but te value is incorrect, the command will fail. 
 
include_record string When set to true, the newly-updated user record is returned as part of the API response. Note that, if the attribute_name is pointed to root, the entire record is returned. If it points to a subset of the record, only that data will be returned.