# Common API calls

## Overview

This page covers the most commonly used API calls for integrating external systems with UbiQuity. Whether you're syncing contact data, recording transactions, or triggering communications, these endpoints cover the majority of real-world integration needs.

For the full list of available endpoints, see the [API reference](https://resources.ubiquity.co.nz/api).

***

### Contact management

Managing contacts is typically the starting point for any integration. Use these endpoints to look up, create, update, and remove contacts in your UbiQuity database.

**Look up a contact** Retrieve an existing contact using a unique identifier such as an email address or contact ID. Useful for checking whether a contact already exists before making changes. \
👉 [API reference — look up contact](https://resources.ubiquity.co.nz/api#POST-database-contacts-query)

**Add a contact** Create a new contact in your database. Use this when capturing leads, sign-ups, or new customer records from an external system. \
👉 [API reference — add contact](https://resources.ubiquity.co.nz/api#POST-database-contacts)

**Edit a contact** Update an existing contact's details, such as their name, email address, tags, or custom fields, without creating a duplicate record. \
👉 [API reference — edit contact](https://resources.ubiquity.co.nz/api#PUT-database-contacts-referenceID)

**Delete a contact** Remove a contact from your database. Useful for routine data cleanups or fulfilling data deletion requests. \
👉 [API reference — delete contact](https://resources.ubiquity.co.nz/api#DELETE-database-contacts-referenceID)

***

### Transaction management

Use these endpoints to record and manage transactional activity against your contacts, such as purchases, donations, bookings, or memberships.

**Look up a transaction** Search for existing transactions using filters such as date, contact ID, or transaction type. Useful for reporting, auditing, or triggering follow-up activity. \
👉 [API reference — look up transaction](https://resources.ubiquity.co.nz/api#GET-database-contacts-referenceID-transactions-transactionalDatabaseID-transactionID)

**Add a transaction** Record a new transaction against a contact. This can represent any type of activity — a purchase, a new membership, a booking, and so on. \
👉 [API reference — add transaction](https://resources.ubiquity.co.nz/api#POST-database-contacts-referenceID-transactions-transactionalDatabaseID)

**Edit a transaction** Update an existing transaction record, such as correcting an amount or reclassifying the activity type. \
👉 [API reference — edit transaction](https://resources.ubiquity.co.nz/api#PUT-database-contacts-referenceID-transactions-transactionalDatabaseID-transactionID)

**Delete a transaction** Remove a transaction record. Use this to correct errors, remove test data, or fulfil data removal requests. \
👉 [API reference — delete transaction](https://resources.ubiquity.co.nz/api#DELETE-database-contacts-referenceID-transactions-transactionalDatabaseID-transactionID)

***

### Send communications

Once contact or transaction data has been added or updated, you can use the API to trigger communications. This could be a confirmation email, a booking summary, a voucher, or the start of an automated journey.

**Submit a form** Submit data into a predefined UbiQuity form to trigger an email to a contact. The email can include data merged from UbiQuity, such as purchase details, booking information, or a redemption voucher. You can also use this to notify internal teams for follow-up. \
👉 [API reference — submit form](https://resources.ubiquity.co.nz/api#POST-forms-formID-submit)

**Run an automated mailout** Trigger a predefined automated mailout via API rather than on its usual schedule. Useful when you need to send at a specific time based on activity in an external system.\
👉 [API reference — run automated mailout](https://resources.ubiquity.co.nz/api#POST-mail-automatedmailouts-automatedMailoutID-trigger)

***

If you need guidance on which approach is right for your integration, contact your UbiQuity consultant or reach out to the support team.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ubiquity.co.nz/documentation/data-and-integrations/api/common-api-calls.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
