arazzo: 1.0.1
info:
title: ActiveCampaign Create Contact and Associate to an Account by Name
summary: Resolve an account by name, create a contact, then associate them.
description: >-
A B2B contact intake flow. The workflow searches accounts by name, confirms
a match was returned, creates a new contact, and then associates that
contact with the matched account along with a job title. 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: accountsApi
url: ../openapi/activecampaign-accounts-api-openapi.yml
type: openapi
- name: contactsApi
url: ../openapi/activecampaign-contacts-api-openapi.yml
type: openapi
workflows:
- workflowId: create-contact-associate-account-by-name
summary: Resolve an account by name, create a contact, then associate them.
description: >-
Searches accounts by name, creates a contact, and associates the new
contact with the matched account.
inputs:
type: object
required:
- apiToken
- accountName
- email
properties:
apiToken:
type: string
description: ActiveCampaign API token sent in the Api-Token header.
accountName:
type: string
description: Name used to resolve the target account.
email:
type: string
description: Email address of the contact to create.
firstName:
type: string
description: Optional first name of the contact.
lastName:
type: string
description: Optional last name of the contact.
jobTitle:
type: string
description: Optional job title of the contact within the account.
steps:
- stepId: findAccount
description: Search accounts by the supplied name.
operationId: $sourceDescriptions.accountsApi.list-all-accounts
parameters:
- name: Api-Token
in: header
value: $inputs.apiToken
- name: search
in: query
value: $inputs.accountName
successCriteria:
- condition: $statusCode == 200
- context: $response.body
condition: $.accounts[0]
type: jsonpath
outputs:
accountId: $response.body#/accounts/0/id
- stepId: createContact
description: Create the contact from the supplied email and name fields.
operationId: $sourceDescriptions.contactsApi.create-a-new-contact
parameters:
- name: Api-Token
in: header
value: $inputs.apiToken
requestBody:
contentType: application/json
payload:
contact:
email: $inputs.email
firstName: $inputs.firstName
lastName: $inputs.lastName
successCriteria:
- condition: $statusCode == 201
outputs:
contactId: $response.body#/contact/id
- stepId: associateContact
description: Associate the new contact with the matched account.
operationId: $sourceDescriptions.accountsApi.create-an-account-1
parameters:
- name: Api-Token
in: header
value: $inputs.apiToken
requestBody:
contentType: application/json
payload:
accountContact:
account: $steps.findAccount.outputs.accountId
contact: $steps.createContact.outputs.contactId
jobTitle: $inputs.jobTitle
successCriteria:
- condition: $statusCode == 201
outputs:
accountContactId: $response.body#/accountContact/id
outputs:
accountId: $steps.findAccount.outputs.accountId
contactId: $steps.createContact.outputs.contactId
accountContactId: $steps.associateContact.outputs.accountContactId
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.