Skip to main content

Quick Start Guide to Testing the SmartThings API

The SmartThings API provides access to devices, the ability to create and manage routines, and more.

To begin exploring the SmartThings API you will need:

  • A token for authentication
  • A method to send HTTPS requests (curl, postman, etc)

Authentication/Tokens

For Testing & Personal Use: Personal Access Token (PAT)

For initial exploration, running personal scripts, or early testing, we recommend using a short-lived Personal Access Token (PAT). PATs are easy to generate and provide quick access to the API without the complexity of a full authorization flow.

For Integration Development: OAuth 2.0

Once you are developing an integration for other people to use, you must switch to OAuth 2.0. This standard, secure method allows your users to grant your service permission to access their SmartThings data.

This flow involves redirecting the user to SmartThings to approve the connection, after which your application receives an authorization code. Exchange this code for an access and refresh token pair, which allows you to make API calls on the user's behalf.

important

Personal access tokens are intended for short-term, initial access to the SmartThings APIs for testing and evaluation purposes. For long-term, production integrations, OAuth2.0 is the only approved authentication method.

A personal access token can be generated for any account you have the login credentials to by following these steps:

  1. Navigate to https://account.smartthings.com/tokens in your web browser.
  2. Sign in with your Samsung account.
  3. Tap the “Generate new token” button, taking you to a “New Access Token” page.
  4. Provide a name for the new token.
  5. Select any functionality you wish to authorize for the token in the “Authorized Scopes” section.
  6. Tap the “Generate Token” button when ready, and you’ll return to the “Personal access tokens” page.
  7. Copy the newly generated token and keep it in a secure place. This is your only opportunity to retrieve the newly generated token value.
info

Personal Access Tokens are only valid for 24 hours unless otherwise stated.

API Feature Overview

Once authenticated, you can make HTTPS requests to the SmartThings API endpoints documented here. The API provides a variety of functionality, but below are some of the most popular features used. Additional functionality, including available query parameters, are detailed in the full developer documentation.

1 Additional device endpoints for device profile, preference and capabilities, intended for device integrators are also available.

2 Routines created in the mobile app will not be accessible in the API and Routines created via the API will not show in the mobile app.

3 Location endpoints are scope dependent - please ensure the token being used is appropriately scoped for your API app or location.

4 Multiple commands for the device can be provided in a single request.

Additional Resources