All Collections
Expert Level
⌨️ APIs and Integrations
⌨️ APIs and Integrations
Chris Russell avatar
Written by Chris Russell
Updated over a week ago

Overview

Laylo now offers an API you can use to programmatically sign up fans to your Laylo. In other words, 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

  • Navigate to Settings → Integrations

  • Scroll to the bottom of the page to find ‘API Keyring’

  • Enter a label for the key that describes what you will be using it for, such as “custom website” or “koji”

  • Generate the key

  • Copy your key and store it someplace safe. For security purposes, we do not store your key, so this is your one opportunity to grab it. If you lose it, you’ll have to delete it and create a new one. Do not expose it to your users in your implementation.

API

We use graphql for our API integration. As of now, we only offer one mutation called subscribeToUser, which handles the subscribing a fan to a user.

URL:

https://laylo.com/api/graphql

Schema:

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

Most of the time we recommend only having the user subscribe to one or the other to maximize conversion, but it is possible to do both.

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 }}" }

Did this answer your question?