> ## 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.

<RequestExample>
  ```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
    }'
  ```
</RequestExample>

Use this endpoint to find campaign or journey IDs before [querying analytics](/api-reference/analytics/journeys-campaigns). 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](/api-reference/authentication/api-client-v2#base-url).

## Required access

Use an [API client v2 token](/api-reference/authentication/api-client-v2) 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

<ParamField body="dataset" type="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.
</ParamField>

<ParamField body="dimension" type="string" required>
  Use `campaign_id` or `journey_id`. Other dimensions are rejected for marketing/outbound datasets.
</ParamField>

<ParamField body="search" type="string">
  Optional case-insensitive name search. Omit to list names in alphabetical order.
</ParamField>

<ParamField body="limit" type="integer" default="20">
  Maximum matches, from 1 to 50. There is no cursor; narrow your search if several entities have similar names.
</ParamField>

## Example request

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

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

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`.
