Piggy connects to a Nagent workspace with an API key. Once it is connected, agents can call 14 Piggy actions, such as "Create Contact Attribute", "Create Credit Reception" and "Create Vouchers Batch". Nothing is enabled on connect: each action is allowed one at a time, and an action with side effects runs or waits for a person according to the agent's level.
Every operation an agent can call against Piggy, with input parameters and output schema.
PIGGY_CLAIM_ANONYMOUS_CONTACTTool to claim an anonymous contact by associating it with a real email address. Use when converting an anonymous contact (with a fictional email) into a verified contact with a real email address.
Input parameters
The real email address for the Contact that is about to be not anonymous anymore
The anonymous Contact's UUID containing the fictional email address
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
PIGGY_CREATE_CONTACT_ATTRIBUTETool to create a custom Contact Attribute. Use when you need to define new fields for contacts after initial setup.
Input parameters
Unique internal identifier for the Contact Attribute
Display label for the Contact Attribute
List of options for select or multi_select types. Each option has label and value
Data type of the attribute. Determines how values are validated and rendered
Human-readable description of the Contact Attribute
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
PIGGY_CREATE_CREDIT_RECEPTIONTool to create a credit reception for a contact. Use when awarding credits to customers based on purchases or fixed amounts.
Input parameters
Fixed number of credits to award. Either unit_value or credits must be provided
UUID of the shop where the transaction occurred
Unit value (e.g., purchase amount in cents) for calculating credits. Either unit_value or credits must be provided
UUID of the contact to receive credits
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
PIGGY_CREATE_VOUCHERS_BATCHTool to create a batch of vouchers for a promotion. Use when you need to generate multiple vouchers at once for a specific promotion. Batch processing is asynchronous and returns a PENDING status initially.
Input parameters
The number of Vouchers you want to generate (min: 1, max: 500)
The Contact's UUID to be linked to the batch of Vouchers
UUID of the Promotion for which the Vouchers are to be created
The activation date for the batch of Vouchers in ISO 8601 format
The expiration date for the batch of Vouchers in ISO 8601 format
Additional Custom Attributes for the Vouchers
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
PIGGY_FIND_OR_CREATE_PRODUCTSTool to find an existing product by external_identifier or create a new one if it doesn't exist. Use when you need to ensure a product exists in Piggy's system for loyalty programs or rewards.
Input parameters
The name of the Product. Required when creating a new product
List of Categories that the product belongs to. Each category can be referenced by uuid or external_identifier
The description of the Product
A unique identifier from your system to find or create the product
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
PIGGY_FIND_VOUCHER_BY_CODETool to find a voucher by its unique code. Use when you need to retrieve voucher details, check redemption status, or validate a voucher code.
Input parameters
The unique code of the Voucher, which serves as its identifier
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
PIGGY_GET_CONTACT_AUTH_TOKENTool to get an auth token for a Contact. Use after obtaining a Contact UUID and needing to verify identity for secure operations.
Input parameters
UUID of the Contact for which to retrieve an auth token
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
PIGGY_GET_CONTACTS_CREDIT_BALANCETool to get a Contact's credit balance. Use when you need to check a contact's current credit balance before processing rewards or promotions.
Input parameters
The UUID of the Contact for which to retrieve the credit balance
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
PIGGY_LIST_FORMSTool to list all forms in the Piggy account. Use when you need to retrieve available forms for customer interactions.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
PIGGY_LIST_PERKSTool to list all available perks in Piggy. Use when you need to retrieve the catalog of perks that can be associated with contacts or transactions.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
PIGGY_MERGE_CONTACTSMerges a source contact into a destination contact in Piggy's CRM. The source contact's data (attributes, balances, transactions) is transferred to the destination contact, and the source contact is removed. This operation is irreversible and processed asynchronously via a job queue. Use this when consolidating duplicate customer records.
Input parameters
UUID of the source contact to merge. This contact will be removed after the merge, and all its data will be transferred to the destination contact.
UUID of the destination contact. This contact will remain active and receive all data from the source contact after the merge.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
PIGGY_SEND_CONTACT_VERIFICATION_EMAILSend a verification email to a Piggy contact for identity verification. The contact must exist in the system with a configured Contacts Portal. Returns success message with email sent confirmation. Use this when implementing email-based authentication workflows or when contacts need to verify their email address to access the Contacts Portal.
Input parameters
Email address of the Contact to send the verification email to. The contact must already exist in the Piggy system.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
PIGGY_UPDATE_BOOKINGSTool to update an existing booking in Piggy. Use when you need to modify booking details such as party size, status, or company name. Note: Shop and contact cannot be updated after creation.
Input parameters
Source from where the Booking was created
Booking status values.
The end date and time of the Booking in ISO 8601 format
The start date and time of the Booking in ISO 8601 format
External identifier for the Booking
The UUID of the Booking to update
Company name associated with the booking
The date and time when the party checked into the booking in ISO 8601 format
Amount prepaid (in cents) prior to booking start
Party size for the booking
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
PIGGY_UPDATE_CONTACT_IDENTIFIERSTool to update a contact identifier in Piggy. Use when you need to modify the display name or active state of an existing contact identifier. Only the name and active properties can be updated; the identifier value itself cannot be changed.
Input parameters
Display name of the contact identifier. Use this to update the human-readable label.
The unique value of the contact identifier to update. This is the identifier of the contact identifier record itself.
Active state of the contact identifier. Set to false to deactivate, true to activate.
Output
Data from the action execution
Error if any occurred during the execution of the action
Whether or not the action execution was successful or not
Agents can call 14 Piggy actions on Nagent, including "Create Contact Attribute", "Create Credit Reception" and "Create Vouchers Batch". Create Contact Attribute: Create a custom Contact Attribute. Each action is listed on this page with its input parameters and its output.
Piggy connects with an API key, under your workspace's own connection. Nothing is enabled on connect: each action is allowed one at a time and can be scoped to the agents that need it.
Create Contact Attribute takes 2 required inputs: name and data_type. It also takes 3 optional inputs: label, options and description. It returns data, error and successful.