Create a new trigger source (QR code, NFC tag, webhook, geofence, etc.) for a campaign
PERS-api Documentation (2.0.10)
PERS API Documentation
This RESTful API enables seamless integration of Web3 loyalty, token management, and engagement features into your applications.
Usage Guidelines:
- RESTful Design: Resources are accessed via standard HTTP methods (GET, POST, PUT, DELETE) with predictable, resource-oriented URLs.
- Authentication: Secure access is enforced via Bearer Tokens (JWT) and Project Keys (defining the Tenant context).
- Data Format: All requests and responses utilize standard JSON formatting.
Explore the modules below for detailed endpoint specifications, schemas, and testing capabilities.
Optional description explaining this trigger source
- Mock serverhttps://docs.pers.ninja/_mock/swagger/trigger-sources
- https://api.pers.ninja/v2/trigger-sources
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://docs.pers.ninja/_mock/swagger/trigger-sources \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"type": "QR_CODE",
"name": "Main Entrance QR Code",
"description": "QR code located at the main entrance for visitor check-in",
"metadata": {
"tokenConfig": {
"tokenId": "1"
}
},
"businessId": "business-uuid-123"
}'Trigger source created successfully
Optional description explaining this trigger source
Reference to the business that owns this trigger source. Optional - can be tenant-wide trigger sources
Whether this trigger source is currently active. Inactive sources won't trigger any flows
Timestamp when the trigger source was created
{ "type": "QR_CODE", "name": "Main Entrance QR Code", "description": "QR code located at the main entrance for visitor check-in", "metadata": { "tokenConfig": { … } }, "businessId": "business-uuid-123", "id": "source-12345", "isActive": true, "analytics": { "totalEngagements": 42, "uniqueUsers": 28, "lastEngagedAt": "2024-01-15T12:00:00.000Z", "firstEngagedAt": "2024-01-01T08:30:00.000Z", "averageEngagementsPerDay": 2.1 }, "createdAt": "2024-01-01T12:00:00.000Z", "updatedAt": "2024-01-10T12:00:00.000Z" }
- Mock serverhttps://docs.pers.ninja/_mock/swagger/trigger-sources
- https://api.pers.ninja/v2/trigger-sources
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.pers.ninja/_mock/swagger/trigger-sources?type=QR_CODE&businessId=string&campaignId=string&active=true&limit=0&offset=0&sort=name&order=ASC' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'List of trigger sources
Optional description explaining this trigger source
Reference to the business that owns this trigger source. Optional - can be tenant-wide trigger sources
Whether this trigger source is currently active. Inactive sources won't trigger any flows
Timestamp when the trigger source was created
Timestamp when the trigger source was last updated
[ { "type": "QR_CODE", "name": "Main Entrance QR Code", "description": "QR code located at the main entrance for visitor check-in", "metadata": { … }, "businessId": "business-uuid-123", "id": "source-12345", "isActive": true, "analytics": { … }, "createdAt": "2024-01-01T12:00:00.000Z", "updatedAt": "2024-01-10T12:00:00.000Z" } ]
- Mock serverhttps://docs.pers.ninja/_mock/swagger/trigger-sources/{id}
- https://api.pers.ninja/v2/trigger-sources/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
'https://docs.pers.ninja/_mock/swagger/trigger-sources/{id}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'Trigger source retrieved successfully
Optional description explaining this trigger source
Reference to the business that owns this trigger source. Optional - can be tenant-wide trigger sources
Whether this trigger source is currently active. Inactive sources won't trigger any flows
Timestamp when the trigger source was created
{ "type": "QR_CODE", "name": "Main Entrance QR Code", "description": "QR code located at the main entrance for visitor check-in", "metadata": { "tokenConfig": { … } }, "businessId": "business-uuid-123", "id": "source-12345", "isActive": true, "analytics": { "totalEngagements": 42, "uniqueUsers": 28, "lastEngagedAt": "2024-01-15T12:00:00.000Z", "firstEngagedAt": "2024-01-01T08:30:00.000Z", "averageEngagementsPerDay": 2.1 }, "createdAt": "2024-01-01T12:00:00.000Z", "updatedAt": "2024-01-10T12:00:00.000Z" }
Trigger source update data
Optional description explaining this trigger source
- Mock serverhttps://docs.pers.ninja/_mock/swagger/trigger-sources/{id}
- https://api.pers.ninja/v2/trigger-sources/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
'https://docs.pers.ninja/_mock/swagger/trigger-sources/{id}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"type": "QR_CODE",
"name": "Main Entrance QR Code",
"description": "QR code located at the main entrance for visitor check-in",
"metadata": {
"tokenConfig": {
"tokenId": "1"
}
},
"businessId": "business-uuid-123"
}'Trigger source updated successfully
Optional description explaining this trigger source
Reference to the business that owns this trigger source. Optional - can be tenant-wide trigger sources
Whether this trigger source is currently active. Inactive sources won't trigger any flows
Timestamp when the trigger source was created
{ "type": "QR_CODE", "name": "Main Entrance QR Code", "description": "QR code located at the main entrance for visitor check-in", "metadata": { "tokenConfig": { … } }, "businessId": "business-uuid-123", "id": "source-12345", "isActive": true, "analytics": { "totalEngagements": 42, "uniqueUsers": 28, "lastEngagedAt": "2024-01-15T12:00:00.000Z", "firstEngagedAt": "2024-01-01T08:30:00.000Z", "averageEngagementsPerDay": 2.1 }, "createdAt": "2024-01-01T12:00:00.000Z", "updatedAt": "2024-01-10T12:00:00.000Z" }
- Mock serverhttps://docs.pers.ninja/_mock/swagger/trigger-sources/{id}
- https://api.pers.ninja/v2/trigger-sources/{id}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
'https://docs.pers.ninja/_mock/swagger/trigger-sources/{id}' \
-H 'Authorization: Bearer <YOUR_JWT_HERE>'