# Mark Records as Recently Viewed

To mark a record as recently viewed using REST API, use the Query resource with a `FOR VIEW` or `FOR REFERENCE` clause. Use SOQL to mark records as recently viewed to ensure that information such as the date and time the record was viewed is correctly set.

Use `FOR VIEW` to notify Salesforce when a record is viewed from a custom interface, such as a mobile application or from a custom page. Use `FOR REFERENCE` when a record is referenced from a custom interface. A record is referenced every time a related record is viewed. For more information, see “FOR VIEW” and “FOR REFERENCE” in the *SOQL and SOSL Reference*.

## Example usage for executing a query that marks one Account record as recently viewed

```nolang
curl https://MyDomainName.my.salesforce.com/services/data/v68.0/query/?q=SELECT+Name+FROM+Account+LIMIT+1+FOR+VIEW -H "Authorization: Bearer token"
```

## Example request body for executing a query

none required

## Example response body for executing a query

```nolang
{
    "done" : true,
    "totalSize" : 1,
    "records" : 
    [ 
        {  
            "attributes" : 
            {    
                "type" : "Account",    
                "url" : "/services/data/v68.0/sobjects/Account/001D000000IRFmaIAH"  
            },  
            "Name" : "Acme"
        }, 

    ]
}
```

**See Also**

- [Query](/docs/platform/api-rest/guide/resources-query.md)
