In short: You can easily create a contact in Aivie via the REST API by sending a POST request to the /api/contacts/new endpoint and authenticating via Basic Auth or OAuth2.
Create contact via API
To create a new contact, use the API endpoint:
POST /api/contacts/new
A simple example using curl looks like this:
curl --location 'https://aivie-v6.0.ddev.site/api/contacts/new' \
--header 'Authorization: Basic VVNF***==' \
--header 'Content-Type: application/json' \
--data-raw '{
"email": "aivie@dev.ch",
"firstname": "aivie"
}'
Important:
- The request must be sent as
POST. - Authentication is done via either Basic Auth or OAuth2.
- The
Content-Type: application/jsonheader should be set. - At least the
emailfield is required.
Authentication
Two options are available for accessing the API:
Basic Auth
Suitable for simple integrations or internal systems. Here, a Base64-encoded username and password are sent in the Authorization header.
OAuth2
Recommended for production integrations with external systems. OAuth2 offers more secure and flexibly controllable authentication.
Passing additional fields
In addition to email and firstname, you can also send other fields such as:
- lastname
- company
- phone
- your own custom contact fields
send along. The field names must match the alias of the custom field exactly.
Official documentation
You can find all available fields, response codes, and further examples in the official API documentation:
https://devdocs.mautic.org/en/5.x/rest_api/contacts.html#create-contact
Examples for SDKs and more complex use cases are also described there.
Summary
A contact is created via a POST request to /api/contacts/new. Authentication is done via Basic Auth or OAuth2, and at least one email address must be provided. You can find the full field overview in the official API documentation.

