> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sagepilot.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Find campaigns and journeys

> Resolve campaign and journey names to IDs for analytics filters.

```bash cURL theme={null}
curl --request POST \
  --url https://app.sagepilot.ai/platform-api/v1/analytics/v2/members \
  --header "Authorization: Bearer $SAGEPILOT_API_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
    "dataset": "marketing_attribution",
    "dimension": "journey_id",
    "search": "Welcome",
    "limit": 20
  }'
```

Use this endpoint to find campaign or journey IDs before [querying analytics](https://docs.sagepilot.ai/api-reference/analytics/journeys-campaigns.md). Results include names and IDs from your workspace, including entities with no activity during a reporting period.

Set `SAGEPILOT_API_TOKEN` to your API client token before running the cURL example, and use your [regional base URL](https://docs.sagepilot.ai/api-reference/authentication/api-client-v2.md#base-url).

## Required access

Use an [API client v2 token](https://docs.sagepilot.ai/api-reference/authentication/api-client-v2.md) with `analytics.query` and the dataset named in your request: `marketing_attribution` or `outbound_messages`.

These grants allow campaign and journey lookup. They do not grant access to ticket member lists, ticket SQL, or journey flow definitions.

## Body

**dataset** `string` (default: tickets)

Set `marketing_attribution` for revenue/ROAS reports or `outbound_messages` for delivery reports. If omitted, the endpoint defaults to `tickets` and requires that dataset's access.

**dimension** `string` *required*

Use `campaign_id` or `journey_id`. Other dimensions are rejected for marketing/outbound datasets.

**search** `string`

Optional case-insensitive name search. Omit to list names in alphabetical order.

**limit** `integer` (default: 20)

Maximum matches, from 1 to 50. There is no cursor; narrow your search if several entities have similar names.

## Example request

```json theme={null}
{
  "dataset": "marketing_attribution",
  "dimension": "journey_id",
  "search": "Welcome",
  "limit": 20
}
```

```json 200 theme={null}
{
  "dimension": "journey_id",
  "members": [
    {
      "value": "33333333-3333-4333-8333-333333333333",
      "label": "Welcome journey"
    }
  ]
}
```

Use a returned `value` in `filters.journey_ids` or `filters.campaign_ids`. No matches returns an empty `members` array. A missing scope or dataset grant returns `403`; an unsupported dimension returns `400`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.