> ## Documentation Index
> Fetch the complete documentation index at: https://pure.saauf.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Trace Lua API - Exceptions, Zones, and Integrations

> Complete reference for the Trace Lua API. Authorize movement exceptions, manage zones, and register chat integrations from trusted server scripts.

The Trace Lua API is exposed as `_G.Trace` on the server after the Trace loader initializes. You can use it to authorize intentional player movement so the anticheat system does not flag it as cheating, register persistent movement zones, and add slash commands to Trace Chat. All calls must originate from **trusted server scripts** - client scripts have no access to this API.

## Resolving the API

If your script runs after Trace has already initialized, access the API directly:

```lua theme={null}
local Trace = _G.Trace
assert(Trace, "Trace must be initialized before using the API")
```

If your script may run concurrently with Trace initialization, wait for it to become available:

```lua theme={null}
local Trace
repeat task.wait() until _G.Trace
Trace = _G.Trace
```

<Note>
  `_G.Trace` is only populated after Trace has fully initialized on the server. Scripts that run
  immediately at game start should use the wait-loop pattern above to avoid receiving `nil`.
</Note>

## Security model

All API functions must be called from **trusted server scripts** only. Client scripts cannot call this API - any attempt by a client to grant itself a movement exception is treated as a violation by the anticheat system, not as a legitimate request.

## API surface

The following functions are available on `_G.Trace`. Click the linked pages for full parameter documentation.

| Name                                                           | Description                                                                    |
| -------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| [`Notify`](/api/notify)                                        | Send a normal Trace notification to a specific player                          |
| [`NotifyImportant`](/api/notify-important)                     | Send an important-level Trace notification                                     |
| [`CriticalAlert`](/api/critical-alert)                         | Send a critical-level Trace alert                                              |
| [`Punish`](/api/punish)                                        | Apply a Trace warning or ban to a player through the moderation pipeline       |
| [`BeginMovementException`](/api/begin-movement-exception)      | Start a named movement exception for a player and receive a token              |
| [`EndMovementException`](/api/end-movement-exception)          | End an active movement exception using the token from `BeginMovementException` |
| [`ClearMovementExceptions`](/api/end-movement-exception)       | Clear all active movement exceptions for a player at once                      |
| [`IsMovementExempt`](/api/end-movement-exception)              | Check whether a player currently holds any (or a specific) movement exception  |
| [`WithMovementException`](/api/with-movement-exception)        | Run a callback inside a scoped movement exception that is always cleaned up    |
| [`AllowTeleport`](/api/allow-teleport)                         | Shorthand to open a brief teleport window before using `PivotTo` or similar    |
| [`AllowMovement`](/api/begin-movement-exception)               | Alias of `BeginMovementException`                                              |
| [`RevokeMovementException`](/api/end-movement-exception)       | Alias of `EndMovementException`                                                |
| [`RegisterMovementZone`](/api/movement-zones)                  | Register a Workspace part or model as a persistent movement zone               |
| [`UnregisterMovementZone`](/api/movement-zones)                | Permanently remove a zone registration                                         |
| [`SetMovementZoneEnabled`](/api/movement-zones)                | Enable or disable a zone without removing it                                   |
| [`GetMovementZones`](/api/movement-zones)                      | Return a list of all currently registered zone summaries                       |
| [`RegisterChatIntegration`](/integrations/chat-integrations)   | Add a slash command to Trace Chat                                              |
| [`UnregisterChatIntegration`](/integrations/chat-integrations) | Remove a previously registered slash command                                   |

<Tip>
  Each method page contains full parameter documentation, return value descriptions, and copy-ready
  code examples. Use the sidebar or the links in the table above to navigate to the page you need.
</Tip>
