> For the complete documentation index, see [llms.txt](https://developer.gyfti.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.gyfti.fr/hubspot-integration/triggers-and-actions-reference.md).

# Triggers and Actions reference

### Contact Resolution (How we identify the contact in HubSpot)

For all triggers, Gyfti ensures that a contact exists in HubSpot before sending any event.

#### General behavior

* If a contact with the given email already exists in HubSpot → we use that contact
* If no contact exists → we create a new one using:
  * Email
  * First name (if available)
  * Last name (if available)

***

### Trigger-specific behavior

#### 1. Signup / Login triggers

When a user signs up or logs in:

* We use the user’s email to find the contact in HubSpot
* If the contact does not exist, it is created
* The contact is then enrolled in the HubSpot workflow

**Data it sends**: `userEmail`, `firstName`, `lastName`, `date`

***

#### 2. Challenge Form Submitted

When a challenge form is submitted:

* Gyfti scans the form answers to find an email address
* If an email is found in the answers → this email is used to resolve the contact in HubSpot
* If no email is found → we fallback to the participant’s email

Then:

* If the contact exists → the event is added to that contact
* If not → a new contact is created and the event is added

**Data it sends:** `challengeName`, `challengeStatus` `challengeId`, `participantName`, `submitted_email`, `ambassadorEmail`, `allAnswers`, `answer1` – `answer10`

{% hint style="info" %}
`challengeStatus` values are "`in_progress` or `to_validate`" .

You can use these values for creating conditions on your HubSpot workflow.
{% endhint %}

***

#### 3. Challenge Form Validated

When a challenge form submission is validated:

* We use the participant's email to find the contact in HubSpot
* If the contact does not exist, it is created
* The event is then added to that contact's timeline

Data it sends: `challengeName` , `challengeStatus` , `challengeFormAnswersId` , `participantName` , `participantEmail` , `submissionDate`

***

### Actions

Actions are available inside HubSpot Workflows. Use them to trigger operations in Gyfti when a workflow condition is met.

**Send a Digital Gyfti**

What it does: Adds the contact to a digital gift campaign in Gyfti.\
Required fields:

* `campaign` — ID of the digital campaign
* `contact_firstname`, `contact_lastname`, `contact_email` — mapped from contact properties
* `user_email` — Gyfti admin email for notifications

Example: Enroll a contact in a digital gift campaign when they reach the "Customer" lifecycle stage.

***

**Send a Postal Gyfti**

What it does: Adds the contact to a physical gift campaign, including shipping details.\
Required fields:

* All fields from *Send a Digital Gyfti*, plus:
* `address`, `zip_code`, `city`, `country`, `phone`
* `additional_address`, `company` *(optional)*

Example: Send a physical gift when a deal is marked Closed Won, using the contact's shipping address.

***

**Validate Challenge Submission**

What it does: Marks a challenge form submission as validated in Gyfti.\
Required fields:

* `challenges_form_answers_id` — unique ID of the submission to validate

Example: Trigger validation automatically and rewarding the user with the challenges points.

***

**Edit a Gyfti User**

What it does: Updates a user's profile, segment, or credit balance in Gyfti.\
Required fields:

* `email` — identifies the user in Gyfti

Optional fields:

* `first_name`, `last_name`
* `cagnotte` — new credit balance
* `segment` — user segment or tag
* `send_email` — `yes` or `no` to trigger a notification

Example: Update a user's segment to "VIP" and add credits when they hit a milestone. The email sent to the user mentions thya have got new points added in their account.&#x20;
