Skip to main content
GET
/
api
/
campaigns
/
goals
Get all goals
curl --request GET \
  --url https://apiv1.delightloop.ai/api/campaigns/goals \
  --header 'x-api-key: <x-api-key>'
{
  "success": true,
  "statusCode": 200,
  "message": "Goals retrieved successfully",
  "data": {
    "items": [
      {
        "id": "goal_001",
        "name": "Onboard New Users",
        "isActive": true,
        "motions": [
          {
            "id": "motion_001",
            "name": "Send Welcome Email",
            "motionMetaData": [
              {
                "key": "welcome_campaign_template",
                "label": "Email Template",
                "dataType": "string",
                "placeholder": "Enter your campaign template name",
                "required": false
              }
            ],
            "logo": "https://cdn.delightloop.ai/assets/company-logo-123.png",
            "logoColor": "#FF5733",
            "description": "Automatically sends a welcome email to new subscribers"
          }
        ],
        "createdAt": "2024-01-15T10:30:00.000Z",
        "updatedAt": "2024-01-15T10:30:00.000Z",
        "logo": "https://cdn.delightloop.ai/assets/goal-logo-456.png",
        "logoColor": "#3498DB",
        "description": "Complete onboarding process for new users"
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 12,
      "total": 25,
      "totalPages": 3
    }
  },
  "timestamp": "2023-11-07T05:31:56Z"
}

Headers

x-api-key
string
required

auth key

Query Parameters

page
number

Page number for pagination

Required range: x >= 1
Example:

1

limit
number

Number of items per page

Required range: 1 <= x <= 100
Example:

12

Search term for filtering goals by name or description

Example:

"onboard"

isActive
boolean

Filter by active status

Example:

true

sortBy
enum<string>

Sort by field

Available options:
name,
createdAt,
updatedAt
Example:

"createdAt"

sortOrder
enum<string>

Sort order

Available options:
asc,
desc
Example:

"desc"

Response

Goals retrieved successfully

success
boolean
Example:

true

statusCode
number
Example:

200

message
string
Example:

"Goals retrieved successfully"

data
object
timestamp
string<date-time>