REST API

Your Loops API key should never be used client side or exposed to your end users.

Authentication

Start here if you want to use the Loops API to add contacts to your Loops audience, update their attributes, and send events to Loops.

Rate Limiting

To ensure the quality of service for all users, our API is rate limited. This means there’s a limit to the number of requests your application can make to our API in a certain time frame. The baseline rate limit is 10 requests per second per team.

Debugging

Sometimes things go wrong. Here are some tips to help you debug your API requests.

Contacts

Add

You can add contacts to your Loops audience by making a POST to the https://app.loops.so/api/v1/contacts/create endpoint. You can submit the following object for the body:

{
  "email": "[email protected]",
  "firstName": "Adam",
  "lastName": "Kaczmarek",
  "favoriteColor": "blue",
  "userGroup": "Founders",
  "source": "Signup form Service"
}

Update

You can update contacts to your Loops audience by making a PUT to the https://app.loops.so/api/v1/contacts/update endpoint. You can submit the following object for the body:

{
  "email": "[email protected]",
  "firstName": "Adam",
  "lastName": "Kaczmarek",
  "favoriteColor": "blue",
  "userGroup": "Founders",
  "source": "Signup form Service"
}

The only required field is “email”. If there is no contact with this email, one will be created. You can add additional fields as you need for the contact (favoriteColor is not a standard field).

Find

You can search your existing contacts by email using a GET request to the https://app.loops.so/api/v1/contacts/find?email=URI_ENCODED_EMAIL endpoint.

Be sure to replace URI_ENCODED_EMAIL with the email you are looking for. For example, searching your list for [email protected] would use https://app.loops.so/api/v1/contacts/find?email=adam%40loops.so

Note that this endpoint will always return an array. If no contact is found, you will receive an empty array. If the contact is found, you will receive an array with a single contact object.

Delete

You can remove existing contacts by email or userId using a POST request to the https://app.loops.so/api/v1/contacts/delete endpoint.

Be sure to supply either an email:

{
    "email": "[email protected]"
}

Or a user id:

{
    "userId": "someUserId"
}

Events

A record of all events fired is available on The Events Page

Send

You can send an event to Loops audience by making a POST to the https://app.loops.so/api/v1/events/send endpoint. You can submit the following object for the body:

{
  "email": "[email protected]",
  "eventName": "conversion"
}

Both fields are required. If no contact with that email address exists, one will be added to your list. You can add additional fields as you need to update the contact attributes, similar to the contact update API.

You may also include contact properties in the event payload. These properties will be updated on the contact record when the event is received.

{
  "email": "[email protected]",
  "eventName": "conversion",
  "plan": "pro",
  "price": 99
}