Skip to main content
The OAuth spec has moved toward the authorization code grant with PKCE for browser-based apps, so use that flow for new apps. Text still supports the implicit grant for Web app clients that already depend on it. With the implicit grant, the user is redirected to the Text OAuth server and, after authorizing your app, redirected back with access_token included directly in the URL fragment. This flow never issues a refresh token — when the token expires, the user has to authorize your app again.

Implementing the implicit grant

Step 1: Create an OAuth client

Go to Settings → API access → OAuth clients and create a new OAuth client. Configure:
  • Display name — a name to identify your OAuth client.
  • Redirect URI whitelist — where users are redirected after authorization. See Redirect URIs for the rules governing this value.
  • Access scopes — the scopes your app needs. See OAuth scopes for the full list.
  • Client type — Web app.
After creation, Text shows your Client ID once — you don’t need a Client Secret for this flow.

Step 2: Redirect to the authorization endpoint

Example redirection to the Text OAuth server

Step 3: Get the access token from the URL

After the user clicks Allow, Text redirects them back to your redirect_uri with access_token in the URL fragment:
Example redirection back to the app
Compare the returned state with the value you sent in Step 2, and reject the response if they don’t match.

Step 4: Use the token in API calls

Extract access_token from the URL fragment and keep it in memory. Storing it in localStorage or a cookie leaves it readable by any script that runs on your page, including through XSS. Caching an in-memory token still avoids redirecting the user to the Text OAuth server on every visit within the same page session.