@@ -2,17 +2,19 @@ openapi: 3.0.3
22info :
33 description : " This is the OpenAPI Spec for the [Loops API](https://loops.so/docs/api)."
44 title : Loops OpenAPI Spec
5- version : 1.0.1
5+ version : 1.3.0
66servers :
77- url : https://app.loops.so/api/v1
88tags :
99- description : Manage contacts in your audience
1010 name : Contacts
11+ - description : View mailing lists
12+ name : Mailing lists
1113- description : Trigger email sending with events
1214 name : Events
1315- description : Send transactional emails
1416 name : Transactional emails
15- - description : Custom contact properties
17+ - description : View custom contact properties
1618 name : Custom fields
1719paths :
1820 /contacts/create :
8082 application/json :
8183 schema :
8284 $ref : ' #/components/schemas/ContactSuccessResponse'
83- description : Successful update
85+ description : Successful update.
8486 " 400 " :
8587 content :
8688 application/json :
@@ -100,13 +102,21 @@ paths:
100102 - Contacts
101103 /contacts/find :
102104 get :
103- description : Search for a contact by `email`.
105+ description : Search for a contact by `email` or `userId`. Only one parameter
106+ is allowed.
104107 parameters :
105108 - description : Email address (URI-encoded)
106109 explode : true
107110 in : query
108111 name : email
109- required : true
112+ required : false
113+ schema :
114+ type : string
115+ style : form
116+ - explode : true
117+ in : query
118+ name : userId
119+ required : false
110120 schema :
111121 type : string
112122 style : form
@@ -149,7 +159,7 @@ paths:
149159 application/json :
150160 schema :
151161 $ref : ' #/components/schemas/ContactDeleteResponse'
152- description : Successful delete
162+ description : Successful delete.
153163 " 400 " :
154164 content :
155165 application/json :
@@ -175,6 +185,25 @@ paths:
175185 summary : Delete a contact
176186 tags :
177187 - Contacts
188+ /lists :
189+ get :
190+ description : Retrieve a list of your account's mailing lists.
191+ responses :
192+ " 200 " :
193+ content :
194+ application/json :
195+ schema :
196+ items :
197+ $ref : ' #/components/schemas/MailingList'
198+ type : array
199+ description : Successful.
200+ " 405 " :
201+ description : Wrong HTTP request method.
202+ security :
203+ - apiKey : []
204+ summary : Get a list of mailing lists
205+ tags :
206+ - Mailing lists
178207 /events/send :
179208 post :
180209 description : Send events to trigger emails in Loops.
@@ -185,9 +214,12 @@ paths:
185214 $ref : ' #/components/schemas/EventRequest'
186215 description : " Provide either `email` or `userId` to identify the contact ([read\
187216 \ more](https://loops.so/docs/api-reference/send-event#body)).<br>You can\
188- \ add custom contact properties as keys in this request (of type `string`,\
189- \ `number`, `boolean` or `date` ([see available date formats](https://loops.so/docs/contacts/properties#dates))).<br>Make\
190- \ sure to create the properties in Loops before using them in API calls."
217+ \ add event properties, which will be available in emails sent by this event.\
218+ \ Values can be of type string, number, boolean or date ([see allowed date\
219+ \ formats](https://loops.so/docs/events/properties#important-information-about-event-properties)).<br>Make\
220+ \ sure to create the properties in Loops before using them in API calls.<br>You\
221+ \ can add contact properties as keys in this request (of type `string`,\
222+ \ `number`, `boolean` or `date` ([see available date formats](https://loops.so/docs/contacts/properties#dates)))."
191223 required : true
192224 responses :
193225 " 200 " :
@@ -255,7 +287,7 @@ paths:
255287 items :
256288 $ref : ' #/components/schemas/CustomField'
257289 type : array
258- description : Successful send .
290+ description : Successful.
259291 " 405 " :
260292 description : Wrong HTTP request method.
261293 security :
@@ -301,6 +333,8 @@ components:
301333 userGroup : userGroup
302334 userId : userId
303335 email : email
336+ mailingLists :
337+ list_123 : true
304338 properties :
305339 email :
306340 type : string
@@ -314,6 +348,11 @@ components:
314348 type : string
315349 userId :
316350 type : string
351+ mailingLists :
352+ description : An object of mailing list IDs and boolean subscription statuses.
353+ example :
354+ list_123 : true
355+ type : object
317356 required :
318357 - email
319358 type : object
@@ -329,6 +368,9 @@ components:
329368 type : string
330369 type : object
331370 ContactFailureResponse :
371+ example :
372+ success : false
373+ message : message
332374 properties :
333375 success :
334376 example : false
@@ -363,13 +405,25 @@ components:
363405 eventName : eventName
364406 userId : userId
365407 email : email
408+ eventProperties : " {}"
409+ mailingLists :
410+ list_123 : true
366411 properties :
367412 email :
368413 type : string
369414 userId :
370415 type : string
371416 eventName :
372417 type : string
418+ eventProperties :
419+ description : " An object containing event property data for the event, available\
420+ \ in emails sent by the event."
421+ type : object
422+ mailingLists :
423+ description : An object of mailing list IDs and boolean subscription statuses.
424+ example :
425+ list_123 : true
426+ type : object
373427 required :
374428 - eventName
375429 type : object
@@ -382,6 +436,9 @@ components:
382436 type : boolean
383437 type : object
384438 EventFailureResponse :
439+ example :
440+ success : false
441+ message : message
385442 properties :
386443 success :
387444 example : false
@@ -391,6 +448,7 @@ components:
391448 type : object
392449 TransactionalRequest :
393450 example :
451+ addToAudience : true
394452 dataVariables : " {}"
395453 transactionalId : transactionalId
396454 email : email
@@ -400,6 +458,10 @@ components:
400458 transactionalId :
401459 description : The ID of the transactional email to send.
402460 type : string
461+ addToAudience :
462+ description : " If `true`, a contact will be created in your audience using\
463+ \ the `email` value (if a matching contact doesn't already exist)."
464+ type : boolean
403465 dataVariables :
404466 description : An object containing contact data as defined by the data variables
405467 added to the transactional email template.
@@ -417,6 +479,10 @@ components:
417479 type : boolean
418480 type : object
419481 TransactionalFailureResponse :
482+ example :
483+ path : path
484+ success : false
485+ message : message
420486 properties :
421487 success :
422488 example : false
@@ -427,6 +493,11 @@ components:
427493 type : string
428494 type : object
429495 TransactionalFailure2Response :
496+ example :
497+ success : false
498+ error :
499+ path : path
500+ message : message
430501 properties :
431502 success :
432503 example : false
@@ -446,7 +517,7 @@ components:
446517 example :
447518 key : favoriteColor
448519 label : Favorite color
449- type : string
520+ type : type
450521 properties :
451522 key :
452523 type : string
@@ -455,7 +526,19 @@ components:
455526 type :
456527 type : string
457528 type : object
529+ MailingList :
530+ example :
531+ id : list_123
532+ name : Main mailing list
533+ properties :
534+ id :
535+ type : string
536+ name :
537+ type : string
538+ type : object
458539 _contacts_delete_post_500_response :
540+ example :
541+ success : false
459542 properties :
460543 success :
461544 example : false
@@ -467,6 +550,9 @@ components:
467550 - $ref : ' #/components/schemas/TransactionalFailure2Response'
468551 - $ref : ' #/components/schemas/TransactionalFailure3Response'
469552 TransactionalFailure2Response_error :
553+ example :
554+ path : path
555+ message : message
470556 properties :
471557 path :
472558 type : string
0 commit comments