API Reference

reward-triggers

6 endpoints

GET/api/v1/reward-triggers/reward-slug/{reward_slug}

Get Triggers By Reward Slug

Get reward triggers by the associated reward template's slug.

Intended for public/frontend use to check if a claimable reward trigger exists for a given reward slug.

Path parameters

reward_slug*string

Responses

200Successful Response
FieldTypeDescription
total_items*integer

Total number of items available

total_pages*integer

Total number of pages available

current_page*integer

Current page number

items*RewardTriggerResponse[]

List of items on the current page

array items · RewardTriggerResponse

FieldTypeDescription
uuid*string
created_at*string (date-time)
updated_atstring (date-time) | null
name*string
descriptionstring | null
enabled*boolean
reward_template_uuid*string
trigger_scopes*string[]
reward_metadata*object
organization_uuidstring | null
deduplication_window_secondsinteger | null
401Authentication failed
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

403Insufficient permissions
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

422Validation error
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

Example request

curl -X GET "https://api.davi.social/api/v1/reward-triggers/reward-slug/{reward_slug}" \
  -H "Authorization: Bearer <token>"
GET/api/v1/reward-triggers/{trigger_uuid}

Get Reward Trigger

Get a reward trigger by UUID.

Path parameters

trigger_uuid*string (uuid)

Responses

200Successful Response
FieldTypeDescription
uuid*string
created_at*string (date-time)
updated_atstring (date-time) | null
name*string
descriptionstring | null
enabled*boolean
reward_template_uuid*string
trigger_scopes*string[]
reward_metadata*object
organization_uuidstring | null
deduplication_window_secondsinteger | null
401Authentication failed
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

403Insufficient permissions
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

404Resource not found
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

422Validation error
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

Example request

curl -X GET "https://api.davi.social/api/v1/reward-triggers/{trigger_uuid}" \
  -H "Authorization: Bearer <token>"
PATCH/api/v1/reward-triggers/{trigger_uuid}

Update Reward Trigger

Update a reward trigger.

Requires an org-scoped token for the reward's organization.

Path parameters

trigger_uuid*string (uuid)

Request body*application/json

FieldTypeDescription
namestring | null

Name of the trigger

descriptionstring | null

Optional description

trigger_scopesstring[] | null

List of scope patterns

reward_metadataobject | null

Metadata to pass with the reward distribution

enabledboolean | null

Whether the trigger is enabled

deduplication_window_secondsinteger | null

Deduplication window in seconds

Responses

200Successful Response
FieldTypeDescription
uuid*string
created_at*string (date-time)
updated_atstring (date-time) | null
name*string
descriptionstring | null
enabled*boolean
reward_template_uuid*string
trigger_scopes*string[]
reward_metadata*object
organization_uuidstring | null
deduplication_window_secondsinteger | null
400Invalid request
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

401Authentication failed
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

403Insufficient permissions
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

404Resource not found
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

422Validation error
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

Example request

curl -X PATCH "https://api.davi.social/api/v1/reward-triggers/{trigger_uuid}" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ /* request body */ }'
DELETE/api/v1/reward-triggers/{trigger_uuid}

Delete Reward Trigger

Delete a reward trigger.

Requires an org-scoped token for the reward's organization.

Path parameters

trigger_uuid*string (uuid)

Responses

200Successful Response
FieldTypeDescription
message*string

Success or status message

401Authentication failed
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

403Insufficient permissions
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

404Resource not found
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

422Validation error
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

Example request

curl -X DELETE "https://api.davi.social/api/v1/reward-triggers/{trigger_uuid}" \
  -H "Authorization: Bearer <token>"
GET/api/v1/organizations/{organization_slug}/reward-triggers

List Organization Reward Triggers

List all reward triggers for an organization.

Path parameters

organization_slug*string

Query parameters

default_backendstring

default: "primary"

Responses

200Successful Response
FieldTypeDescription
total_items*integer

Total number of items available

total_pages*integer

Total number of pages available

current_page*integer

Current page number

items*RewardTriggerResponse[]

List of items on the current page

array items · RewardTriggerResponse

FieldTypeDescription
uuid*string
created_at*string (date-time)
updated_atstring (date-time) | null
name*string
descriptionstring | null
enabled*boolean
reward_template_uuid*string
trigger_scopes*string[]
reward_metadata*object
organization_uuidstring | null
deduplication_window_secondsinteger | null
401Authentication failed
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

403Insufficient permissions
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

422Validation error
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

Example request

curl -X GET "https://api.davi.social/api/v1/organizations/{organization_slug}/reward-triggers" \
  -H "Authorization: Bearer <token>"
POST/api/v1/organizations/{organization_slug}/reward-triggers

Create Reward Trigger

Create a new reward trigger for an organization.

Requires an org-scoped token for the target organization.

Path parameters

organization_slug*string

Query parameters

default_backendstring

default: "primary"

Request body*application/json

FieldTypeDescription
name*string

Name of the trigger

descriptionstring | null

Optional description

reward_template_uuid*string | string (uuid)

UUID of the reward template to distribute

trigger_scopes*string[]

List of scope patterns (e.g., ['activity.checked_in:count:5', 'activity.registered:first'])

reward_metadataobject

Metadata to pass with the reward distribution

organization_uuidstring | string (uuid) | null

Organization UUID (optional, for organization-specific triggers)

enabledboolean

Whether the trigger is enabled

default: true

deduplication_window_secondsinteger | null

Deduplication window in seconds, null = no deduplication

Responses

200Successful Response
FieldTypeDescription
uuid*string
created_at*string (date-time)
updated_atstring (date-time) | null
name*string
descriptionstring | null
enabled*boolean
reward_template_uuid*string
trigger_scopes*string[]
reward_metadata*object
organization_uuidstring | null
deduplication_window_secondsinteger | null
400Invalid request
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

401Authentication failed
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

403Insufficient permissions
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

409Resource already exists
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

422Validation error
FieldTypeDescription
errors*object

Map of field names to error messages. Use '_root' for form-level errors.

message*string

Human-readable error summary

codestring | null

Machine-readable error code

Example request

curl -X POST "https://api.davi.social/api/v1/organizations/{organization_slug}/reward-triggers" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{ /* request body */ }'