arazzo: 1.0.1
info:
title: ActiveCampaign Subscribe Contact to a List Resolved by Name
summary: Resolve a list by name then subscribe an existing contact to it.
description: >-
A find-then-act subscription flow. The workflow searches lists by name,
confirms a match was returned, and subscribes the supplied contact to the
matched list by activating its list status. Every step spells out its
request inline, including the Api-Token authentication header, so the flow
can be read and executed without opening the underlying OpenAPI description.
version: 1.0.0
sourceDescriptions:
- name: contactsApi
url: ../openapi/activecampaign-contacts-api-openapi.yml
type: openapi
- name: listsApi
url: ../openapi/activecampaign-lists-api-openapi.yml
type: openapi
workflows:
- workflowId: subscribe-contact-to-list-by-name
summary: Resolve a list by name and subscribe a contact to it.
description: >-
Searches lists by name and subscribes the supplied contact to the first
matched list.
inputs:
type: object
required:
- apiToken
- listName
- contactId
properties:
apiToken:
type: string
description: ActiveCampaign API token sent in the Api-Token header.
listName:
type: string
description: Name used to resolve the target list.
contactId:
type: integer
description: Identifier of the contact to subscribe.
steps:
- stepId: findList
description: Search lists by the supplied name.
operationId: $sourceDescriptions.listsApi.retrieve-all-lists
parameters:
- name: Api-Token
in: header
value: $inputs.apiToken
- name: filters[name]
in: query
value: $inputs.listName
successCriteria:
- condition: $statusCode == 200
- context: $response.body
condition: $.lists[0]
type: jsonpath
outputs:
listId: $response.body#/lists/0/id
- stepId: subscribeContact
description: Subscribe the supplied contact to the matched list.
operationId: $sourceDescriptions.contactsApi.update-list-status-for-contact
parameters:
- name: Api-Token
in: header
value: $inputs.apiToken
requestBody:
contentType: application/json
payload:
contactList:
list: $steps.findList.outputs.listId
contact: $inputs.contactId
status: 1
successCriteria:
- condition: $statusCode == 200
outputs:
contactListId: $response.body#/contacts/0/id
outputs:
listId: $steps.findList.outputs.listId
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.