

# Turn grounding off and on

Grounding and entity resolution share one setting, `entityResolutionConfig.status`. To turn grounding off, set it to `DISABLED`. To turn grounding back on, set it to `ENABLED`, which is the default.

**Important**  
Turning off grounding also turns off entity resolution for the Agent Context.

You can turn grounding off or on with the API.

## Turn grounding off or on with the API
<a name="ontology-grounding-turn-off-api"></a>

To turn grounding off or on with the API, call `UpdateAgentContext` with `entityResolutionConfig.status`. Settings that you leave out of the request don’t change.

The following example shows the inputs for `UpdateAgentContext`. It isn’t a complete request.

```
UpdateAgentContext
  agentContextId: <agent-context-id>
  entityResolutionConfig:
    status: <status>
```

Replace the following values:
+  `<agent-context-id>` – the ID or ARN of your Agent Context.
+  `<status>` – `DISABLED` to turn grounding off, or `ENABLED` to turn it back on.

The following table describes the fields in the example.


| Field | Description and rules | 
| --- | --- | 
|  `agentContextId`  | Required. The Agent Context to update, by its ID or ARN. The Agent Context must be `ACTIVE`. Otherwise, the call fails with a `ConflictException`. | 
|  `status`  | Optional. In `entityResolutionConfig`. `ENABLED` or `DISABLED`. Turns entity resolution and grounding on or off together. If you leave it out, the setting doesn’t change. | 

If `UpdateAgentContext` fails, see [You can’t remove or replace the ontology in an Agent Context](ontology-delete-troubleshooting.md#ontology-delete-find-usage-troubleshoot).

## What happens when you turn grounding off and on
<a name="ontology-grounding-turn-off-results"></a>

 AWS Context reads the setting when each grounding run starts. So a change to the setting affects only the runs that start after it.

When you turn grounding off, the following happens:
+ A run that has already started isn’t interrupted. It finishes, and its proposals arrive in the curation queue.
+ No new run starts. If grounding was still checking every table after an association, it stops before the next batch.
+ Grounding doesn’t check the tables that change while it’s off.

When you turn grounding back on, the following happens:
+ Grounding doesn’t start a run by itself, and it doesn’t check the tables that changed while it was off.
+ Grounding runs again at the next event that starts a run, such as a change to a table. For the events, see [Events that start a grounding run](ontology-grounding-updates.md#ontology-grounding-updates-triggers).
+ You can’t associate an ontology that is already loaded in the Agent Context again. To make grounding check every table again, associate a different published ontology, for example an edited copy that you upload as a new ontology. For more information, see [Bring your own ontology](ontology-byo.md) and [Start grounding by associating an ontology](ontology-grounding-start.md).