/
Contact usSee pricingStart building
    Introduction
    Overview
    Postman
    Users
      Create user
      Search users
      Get user
      Update user
      Exchange primary factor
    • Delete

      • Delete user
        Delete user email
        Delete user phone number
        Delete user WebAuthn registration
        Delete user biometric registration
        Delete user TOTP
        Delete user crypto wallet
        Delete user password
        Delete user OAuth registration
    Magic links
    • Via email

      • Send magic link
        Log in or create user
        Invite
        Revoke pending invite
    • Embeddable

      • Create
      Authenticate
    OAuth
      Attach
      Authenticate
    • Start

      • Google
        Amazon
        Apple
        Bitbucket
        Coinbase
        Discord
        Facebook
        Figma
        GitHub
        GitLab
        Linkedin
        Microsoft
        Salesforce
        Slack
        Snapchat
        TikTok
        Twitch
        Twitter
        Yahoo
    Passwords
      Create
      Authenticate
      Strength check
      Migrate
    • Reset options

      • Password reset by email start
        Password reset by email
        Password reset by existing password
        Password reset by session
    One-time passcodes (OTP)
    • Via SMS

      • Send
        Login or create user
    • Via Whatsapp

      • Send
        Login or create user
    • Via email

      • Send
        Login or create user
      Authenticate
    Session management
      Session object
      Get JWKS
      Get sessions
      Authenticate Session
      Revoke session
      Migrate session
      Attest Session
      Exchange Access Token
    Passkeys & WebAuthn
    • Register

      • Start
        Register
    • Authenticate

      • Start
        Authenticate
      Update
      List WebAuthn Credentials
    Time-based one-time passcodes (TOTP)
      Create
      Authenticate
      Get recovery codes
      Recover
    Crypto wallets
      Authenticate start
      Authenticate
    M2M Authentication
      M2M Client Object
    • Token

      • Get Access Token
        Authenticate Access Token
    • M2M Client

      • Create M2M client
        Get M2M client
        Search M2M clients
        Update M2M client
        Delete M2M client
    • Rotate secret

      • Start secret rotation
        Rotate secret
        Cancel secret rotation
    Connected Apps
      Exchange Authorization Code
      Exchange Refresh Token
    • Tokens

      • Connected App ID Token Object
        Connected App Access Token Object
    • Configuration

      • Get JWKS
        Get OpenID Configuration
    • Methods

      • Introspect Token
        Authenticate Access Token (Local)
        Revoke Token
        Get UserInfo
    • Consent Management

      • Start OAuth Authorization
        Submit OAuth Authorization
        Get Authorized Connected Apps for a User
        Revoke Connected App Access to a User
    • Application Management

      • Dynamic Client Registration
        Create Connected App
        Get Connected App
        Search Connected Apps
        Update Connected App
        Delete Connected App
    • Rotate secret

      • Start secret rotation
        Rotate secret
        Cancel secret rotation
    RBAC
      Resource object
      Role object
      Scope object
      Get RBAC Policy
    User Impersonation
      Authenticate Token
    Resources
      Email templates
      URL validation
      Metadata
      User states
    Errors
      Overview
      Error object
      400
      401
      403
      404
      405
      429
      499
      500
      503
Get support on SlackVisit our developer forum

Contact us

Consumer Authentication

/

API reference

/

Connected Apps

/

Application Management

/

Create Connected App

Create Connected App

POST
https://test.stytch.com/v1/connected_apps/clients

Creates a new Connected App. If the Connected App client_type is first_party or third_party a client_secret is returned.

Important: This is the only time you will be able to view the generated client_secret in the API response. Stytch stores a hash of the client_secret and cannot recover the value if lost. Be sure to persist the client_secret in a secure location. If the client_secret is lost, you will need to trigger a secret rotation flow to receive another one.


Body parameters


client_name string

A human-readable name for the client.


client_description string

A human-readable description for the client.


client_type* string

The type of Connected App. Supported values are first_party, first_party_public, third_party, and third_party_public.


redirect_urls array

Array of redirect URI values for use in OAuth Authorization flows.


post_logout_redirect_urls array[strings]

Array of redirect URI values for use in OIDC Logout flows.


full_access_allowed boolean

Valid for first party clients only. If true, an authorization token granted to this Client can be exchanged for a full Stytch session.


access_token_expiry_minutes number

The number of minutes before the access token expires. The default is 60 minutes.


access_token_custom_audience string

The custom audience for the access token.


access_token_template_content string

The content of the access token custom claims template. The template must be a valid JSON object.


logo_url string

The logo URL of the Connected App, if any.


bypass_consent_for_offline_access boolean

Valid for first party clients only. If true, the client does not need to request explicit user consent for the offline_access scope.


Response fields


status_code int

The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.


request_id string

Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.


connected_app object

The Connected App created by this API call.

client_id string

The ID of the Connected App client.

client_type string

The type of Connected App. Supported values are first_party, first_party_public, third_party, and third_party_public.

client_description string

A human-readable description for the client.

client_name string

A human-readable name for the client.

client_secret_last_four string

The last four characters of the client secret.

next_client_secret_last_four string

The last four characters of the next_client_secret. Null if no next_client_secret exists.

full_access_allowed boolean

Valid for first party clients only. If true, an authorization token granted to this Client can be exchanged for a full Stytch session.

logo_url string

The logo URL of the Connected App, if any.

redirect_uris array

Array of redirect URI values for use in OAuth Authorization flows.

post_logout_redirect_urls array[strings]

Array of redirect URI values for use in OIDC Logout flows.

redirect_uris array

Array of redirect URI values for use in OAuth Authorization flows.

response_types array

Array of OAuth 2.0 response types that the client may use.

token_endpoint_auth_method string

Authentication method used by the client for the token endpoint.

bypass_consent_for_offline_access boolean

Valid for first party clients only. If true, the client does not need to request explicit user consent for the offline_access scope.

client_secret string

The secret of the Connected App client. Required for confidential clients

const stytch = require('stytch');

const client = new stytch.Client({
  project_id: 'PROJECT_ID',
  secret: 'SECRET',
});

const params = {
  client_type: "first_party",
  client_name: "My Sample Client",
  client_description: "My sample client for testing out Connected Apps",
  redirect_urls: ["https://example.com/callback"],
  full_access_allowed: false,
};

client.connectedApp.clients.create(params)
  .then(resp => { console.log(resp) })
  .catch(err => { console.log(err) });
RESPONSE 200
200
​
{
  "connected_app": {
    "client_id": "connected-app-test-d731954d-dab3-4a2b-bdee-07f3ad1be888",
    "client_name": "My Connected App",
    "client_description": "App for internal tools",
    "status": "active",
    "client_secret": "s3cr3t_v4lu3",
    "client_secret_last_four": "v4lu3",
    "next_client_secret_last_four": null,
    "full_access_allowed": false,
    "client_type": "first_party",
    "redirect_urls": ["https://myapp.com/callback"],
    "access_token_expiry_minutes": 60,
    "access_token_custom_audience": "https://api.myapp.com",
    "access_token_template_content": "{}",
    "post_logout_redirect_urls": ["https://myapp.com/logout"],
    "logo_url": "https://myapp.com/logo.png",
    "bypass_consent_for_offline_access": false
  }
}
RESPONSE 401
200
​
{
  "status_code": 401,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "unauthorized_credentials",
  "error_message": "Unauthorized credentials.",
  "error_url": "https://stytch.com/docs/api/errors/401"
}
RESPONSE 429
200
​
{
  "status_code": 429,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "too_many_requests",
  "error_message": "Too many requests have been made.",
  "error_url": "https://stytch.com/docs/api/errors/429"
}
RESPONSE 500
200
​
{
  "status_code": 500,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "internal_server_error",
  "error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.",
  "error_url": "https://stytch.com/docs/api/errors/500"
}