Skip to main content

⌨️ Laylo API

Programmatically sign fans up to your Laylo with the GraphQL API — key creation, the subscribeToUser mutation, and optional Drop and location attribution.

Written by Chris

Overview

Laylo offers an API you can use to programmatically sign up fans to your Laylo. Hitting this API is the same as a fan signing up through the usual profile page or embed. Use it to connect with third-party integrations, or add it to a custom widget on your website.

🚨 IMPORTANT — You must include links to Laylo's terms and conditions and privacy policy wherever you collect phone numbers using our API for opt-in.

Key creation & user instructions

  • Navigate to Settings → Integrations.

  • Scroll to the bottom of the page to find API Keyring.

  • Label the key so you know what it's for (e.g. "custom website," "set.live," "koji").

  • Generate the key.

  • Copy the key and store it somewhere safe. We don't store it, so this is your only chance to grab it — if you lose it, delete it and create a new one. Never expose it to your users.

  • Paste it into the integration's back end. (Not sure where? Ask the destination platform.)

💬 Note: when fans sync from the API they will be sent a welcome message. You can update the message fans receive in Laylo under Settings → SMS, in the Welcome Message field.

API dev instructions

Our API uses GraphQL. It currently offers one mutation, subscribeToUser, which subscribes a fan to your account.

URL

https://laylo.com/api/graphql

Schema

subscribeToUser(email: String, phoneNumber: String): Boolean

Send exactly one identifier per call — email or phone. We recommend collecting just one to maximize conversion. If you send both, the email is used and the phone is silently ignored (the call still succeeds).

Mutation

mutation($email: String, $phoneNumber: String) {
  subscribeToUser(email: $email, phoneNumber: $phoneNumber)
}

Authentication

Include the following authentication header when sending HTTP requests:

{ "Authorization": "Bearer {{ your_token_here }}" }

Optional advanced — location + Drop sync

Attributing signups and capturing location. Two optional arguments add richer reporting to the same subscribeToUser mutation. Neither changes its basic behavior.

Updated schema

subscribeToUser(email: String, phoneNumber: String, productId: String, ipAddress: String): Boolean

Example mutation

mutation($email: String, $phoneNumber: String, $productId: String, $ipAddress: String) {
  subscribeToUser(
    email: $email,
    phoneNumber: $phoneNumber,
    productId: $productId,
    ipAddress: $ipAddress
  )
}

What each argument does

  • productId (String) — associates a signup with a specific Laylo Drop. The fan is added to your fanbase and recorded as an RSVP/conversion in that Drop's analytics. If omitted, the signup is added to your default profile and main audience only. To find a Drop's Product ID, copy it from that Drop's embed code in the Sharing tab of the Drop settings. Public API keys cannot retrieve a list of Drops.

  • ipAddress (String) — the fan's IP address. Pass it and Laylo resolves their location for your reporting. Omit it and no location is captured.

  • Both are optional — send one, both, or neither.

Not yet supported: source/UTM/campaign parameters, and sandbox/test mode. Every successful call creates a real signup.

Notes

  • Format phone numbers as +1234567890, including the + and the country code. For a UK number, for example, you'd include +44.

  • Once a fan successfully signs up, they'll receive a confirmation message you can set under Settings → Phone/SMS → Welcome message.

  • Send exactly one of phoneNumber or email per call. If you send both, the call still succeeds but the email is used and the phone is silently dropped — so don't rely on passing both at once.

Did this answer your question?