The official Loops SDK for Ruby.
limit
and remaining
attributes.
id
email
firstName
lastName
source
subscribed
userGroup
userId
Name | Type | Required | Notes |
---|---|---|---|
email | string | Yes | If a contact already exists with this email address, an error response will be returned. |
properties | object | No | An object containing default and any custom properties for your contact. Please add custom properties in your Loops account before using them with the SDK. Values can be of type string , number , nil (to reset a value), boolean or date (see allowed date formats). |
mailing_lists | object | No | An object of mailing list IDs and boolean subscription statuses. |
userId
value. Then you can make a request with their userId
and an updated email address.
API Reference
Name | Type | Required | Notes |
---|---|---|---|
email | string | Yes | The email address of the contact to update. If there is no contact with this email address, a new contact will be created using the email and properties in this request. |
properties | object | No | An object containing default and any custom properties for your contact. Please add custom properties in your Loops account before using them with the SDK. Values can be of type string , number , nil (to reset a value), boolean or date (see allowed date formats). |
mailing_lists | object | No | An object of mailing list IDs and boolean subscription statuses. |
Name | Type | Required | Notes |
---|---|---|---|
email | string | No | |
user_id | string | No |
Name | Type | Required | Notes |
---|---|---|---|
email | string | No | |
user_id | string | No |
Name | Type | Required | Notes |
---|---|---|---|
name | string | Yes | The name of the property. Should be in camelCase, like planName or favouriteColor . |
type | string | Yes | The property’s value type. Can be one of string , number , boolean or date . |
Name | Type | Required | Notes |
---|---|---|---|
list | string | No | Use “custom” to retrieve only your account’s custom properties. |
key
, label
and type
attributes.
id
, name
, description
and isPublic
attributes.
If your account has no mailing lists, an empty list will be returned.
Name | Type | Required | Notes |
---|---|---|---|
event_name | string | Yes | |
email | string | No | The contact’s email address. Required if user_id is not present. |
user_id | string | No | The contact’s unique user ID. If you use user_id without email , this value must have already been added to your contact in Loops. Required if email is not present. |
contact_properties | object | No | An object containing contact properties, which will be updated or added to the contact when the event is received. Please add custom properties in your Loops account before using them with the SDK. Values can be of type string , number , nil (to reset a value), boolean or date (see allowed date formats). |
event_properties | object | No | An object containing event properties, which will be made available in emails that are triggered by this event. Values can be of type string , number , boolean or date (see allowed date formats). |
mailing_lists | object | No | An object of mailing list IDs and boolean subscription statuses. |
headers | object | No | Additional headers to send with the request. |
Name | Type | Required | Notes |
---|---|---|---|
transactional_id | string | Yes | The ID of the transactional email to send. |
email | string | Yes | The email address of the recipient. |
add_to_audience | boolean | No | If true , a contact will be created in your audience using the email value (if a matching contact doesn’t already exist). |
data_variables | object | No | An object containing data as defined by the data variables added to the transactional email template. Values can be of type string or number . |
attachments | object[] | No | A list of attachments objects. Please note: Attachments need to be enabled on your account before using them with the API. Read more |
attachments[].filename | string | No | The name of the file, shown in email clients. |
attachments[].content_type | string | No | The MIME type of the file. |
attachments[].data | string | No | The base64-encoded content of the file. |
headers | object | No | Additional headers to send with the request. |
Name | Type | Required | Notes |
---|---|---|---|
perPage | integer | No | How many results to return per page. Must be between 10 and 50. Defaults to 20 if omitted. |
cursor | string | No | A cursor, to return a specific page of results. Cursors can be found from the pagination.nextCursor value in each response. |
v1.2.1
(May 22, 2025) - Fixed an issue with GET
API requests.v1.2.0
(May 15, 2025)
Events.send()
and Transactional.send()
, enabling support for the Idempotency-Key header.v1.1.0
(Feb 27, 2025) - Added support for new List transactionals endpoint with Transactional.list()
.v1.0.0
(Feb 26, 2025)
APIError
class.ContactProperties.create()
and ContactProperties.list()
.CustomFields.list()
method (you can now use ContactProperties.list()
instead).v0.2.0
(Oct 29, 2024) - Added rate limit handling with RateLimitError
.v0.1.2
(Aug 16, 2024) - Support for resetting contact properties with nil
.v0.1.1
(Aug 16, 2024) - Added ApiKey.test
method for testing API keys.v0.1.0
(Aug 16, 2024) - Initial release.