# How to use REST APIs Use the REST API to find devices, read their state, and send commands. ## Get a token Sign in to get a temporary API token. Select **Copy token** to use it in your terminal. The examples on this page use it too. The token is short-lived, so keep it private and copy a fresh one when it expires. For your own app, use [OAuth authorization](/docs/user-guides/how-to-set-up-an-oauth-client-for-port-os/). ## Create a simulator light The commands on this page use the endpoint ID of your simulator light. Select **Add simulator light** to create a test light in your account. It starts on. ## Explore your endpoints You can also try it live below. Click **Run** to list the endpoints available to your token. Each result is an endpoint, such as a light, speaker, or sensor. If the list is empty, [add a device](/docs/user-guides/how-to-add-devices-through-provider-linking/) or [create a simulator](/docs/user-guides/how-to-manage-simulator-devices/), then run the command again. ## Try a light command Use **Turn off** to switch off your simulator light. Choose Bash or PowerShell to copy the command for your terminal. You can turn the light on again with **Turn on**. ## What just happened? You used a token to turn off a simulator light with the Port OS API. You can send the same requests from your own app. ## Next steps