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

# キャンペーンを一覧取得する

> プロジェクトのキャンペーンを、ステータス、チャネル、配信タイミングの種類で絞り込んで一覧取得します。

> [!NOTE]
>
> Notifly MCPの`list_campaigns`ツールと同じ取得ロジックを使います。MCPを使わずに、サーバーや社内ツールからキャンペーンを一覧取得し、ステータス、チャネル、配信タイミングの種類で絞り込めます。

**取得時の動作**

* キャンペーンは作成日時が新しい順に返されます。
* `status`を省略すると、削除済みを除くすべてのキャンペーンを返します。削除済みのキャンペーンは`status=deleted`を指定した場合にのみ返されます。
* 複数のフィルターを指定すると、すべての条件に一致するキャンペーンのみを返します(AND)。
* レスポンスにはキャンペーンの基本情報と配信タイミングの概要のみが含まれます。メッセージ本文、ターゲティング条件、配信統計は含まれません。
* 定義されていないクエリパラメーター(例: `limit`)を送ると`400`を返します。ページサイズは`page_size`で指定します。

**ページネーション**

1回のリクエストで最大100件(デフォルト20件)を取得します。レスポンスに`data.next_cursor`の値がある場合は、次のリクエストの`next_cursor`クエリパラメーターにそのまま渡します。`next_cursor`が`null`の場合は最後のページです。次のページをリクエストするときは、最初のリクエストと同じフィルターを指定してください。

```bash
# 1) 有効なアプリプッシュキャンペーンの最初のページ
curl -G "https://api.notifly.tech/v1/projects/{projectId}/campaigns" \
  -H "Authorization: Bearer {token}" \
  --data-urlencode "status=active" \
  --data-urlencode "channel=push-notification" \
  --data-urlencode "page_size=50"

# 2) 次のページ: 同じフィルター + 前のレスポンスのnext_cursor
curl -G "https://api.notifly.tech/v1/projects/{projectId}/campaigns" \
  -H "Authorization: Bearer {token}" \
  --data-urlencode "status=active" \
  --data-urlencode "channel=push-notification" \
  --data-urlencode "page_size=50" \
  --data-urlencode "next_cursor={next_cursor}"
```

> [!TIP]
>
> 取得したキャンペーンの`id`を使って、[キャンペーンをトリガーする](https://docs.notifly.tech/ja/api-reference/trigger-campaign.md)や[キャンペーンの詳細統計を取得する](https://docs.notifly.tech/ja/api-reference/get-campaign-statistics-retrieval.md)を呼び出せます。APIで配信するキャンペーンのみを探す場合は、`timing_type=api`で絞り込んでください。


## OpenAPI

````yaml /ja/api-reference/openapi.yaml get /v1/projects/{projectId}/campaigns
openapi: 3.0.3
info:
  title: Notifly API
  version: 1.0.0
  contact:
    email: contact@notifly.tech
servers:
  - url: https://api.notifly.tech
    description: Notifly APIサーバー
security: []
tags:
  - name: catalog
    x-group: カタログ
paths:
  /v1/projects/{projectId}/campaigns:
    get:
      summary: list-campaigns
      operationId: listCampaigns
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
            pattern: ^[a-f0-9]{32}$
          description: プロジェクトID(32文字の小文字16進数)
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - draft
              - active
              - inactive
              - terminated
              - deleted
          description: |
            キャンペーンのステータスで絞り込みます。省略すると、`deleted`を除くすべてのステータスを返します。
            - `draft`: 下書き
            - `active`: 有効
            - `inactive`: 無効
            - `terminated`: 終了
            - `deleted`: 削除済み
        - name: channel
          in: query
          required: false
          schema:
            type: string
            enum:
              - push-notification
              - web-push-notification
              - in-app-message
              - in-web-message
              - kakao-alimtalk
              - kakao-friendtalk
              - kakao-brand-message
              - text-message
              - rcs
              - email
              - line
              - webhook
              - cafe24-app-push-notification
          description: 配信チャネルで絞り込みます。SMS、LMS、MMSは`text-message`で取得します。
        - name: timing_type
          in: query
          required: false
          schema:
            type: string
            enum:
              - scheduled
              - event-based
              - api
          description: |
            配信タイミングの種類で絞り込みます。
            - `scheduled`: 予約配信(1回または繰り返し)
            - `event-based`: イベントベースの配信
            - `api`: API呼び出しによる配信
        - name: page_size
          in: query
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
          description: 1回のリクエストで取得するキャンペーン数です。
        - name: next_cursor
          in: query
          required: false
          schema:
            type: string
          description: 次のページを取得するときに、前のレスポンスの`data.next_cursor`の値をそのまま渡します。
      responses:
        '200':
          description: キャンペーン一覧を取得しました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignListResponse'
              example:
                data:
                  campaigns:
                    - id: a1B2c3
                      name: 会員登録ウェルカムプッシュ
                      description: 会員登録の1時間後に配信
                      status: active
                      type: standard
                      channel: push-notification
                      segment_type: condition
                      timing:
                        timing_type: event-based
                        interval: null
                        starts:
                          - 1796050800
                        delay: 3600
                        end: 1803826800
                      created_at: '2026-11-28T02:15:30.000Z'
                      updated_at: '2026-11-30T08:40:12.000Z'
                    - id: Xy9Zk2
                      name: 12月プロモーションのアリムトーク
                      description: null
                      status: draft
                      type: standard
                      channel: kakao-alimtalk
                      segment_type: csv
                      timing:
                        timing_type: scheduled
                        interval: null
                        starts:
                          - 1796432400
                        delay: null
                        end: null
                      created_at: '2026-11-25T06:00:00.000Z'
                      updated_at: '2026-11-25T06:10:45.000Z'
                  next_cursor: >-
                    eyJjcmVhdGVkX2F0IjoiMjAyNi0xMS0yNVQwNjowMDowMC4wMDBaIiwiaWQiOiJYeTlaazIifQ
                error: null
        '400':
          description: >-
            プロジェクトIDの形式が正しくない、許可されていないフィルター値やクエリパラメーターが含まれている、または`next_cursor`が無効です。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotiflyV1ErrorResponse'
              example:
                data: null
                error:
                  code: INVALID_ARGUMENT
                  message: >-
                    Invalid campaign list query: page_size: Number must be less
                    than or equal to 100
        '401':
          description: トークンの期限切れまたは無効なトークンにより認証に失敗しました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotiflyV1ErrorResponse'
              example:
                data: null
                error:
                  code: UNAUTHENTICATED
                  message: Invalid Authorization Token.
        '403':
          description: プロジェクトへのアクセス権限がありません。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotiflyV1ErrorResponse'
              example:
                data: null
                error:
                  code: PERMISSION_DENIED
                  message: Invalid Access.
        '500':
          description: サーバー内部エラーが発生しました。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotiflyV1ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    CampaignListResponse:
      type: object
      properties:
        data:
          type: object
          properties:
            campaigns:
              type: array
              description: 取得したキャンペーンの一覧です。作成日時が新しい順に並びます。
              items:
                $ref: '#/components/schemas/CampaignListItem'
            next_cursor:
              type: string
              nullable: true
              description: 次のページの取得に使うカーソルです。最後のページではnullです。
        error:
          type: object
          nullable: true
          description: 成功時はnullです。
    NotiflyV1ErrorResponse:
      type: object
      properties:
        data:
          type: object
          nullable: true
          description: 失敗時はnullです。
        error:
          oneOf:
            - type: string
            - $ref: '#/components/schemas/NotiflyV1ErrorObject'
          description: >-
            v1
            APIのエラーレスポンスです。認証や権限のエラーはcodeとmessageを持つオブジェクト、リクエストの検証エラーは文字列で返される場合があります。
      example:
        data: null
        error:
          code: UNAUTHORIZED
          message: Invalid Authorization Token
    CampaignListItem:
      type: object
      properties:
        id:
          type: string
          description: キャンペーンID(6文字の英数字)
        name:
          type: string
          nullable: true
          description: キャンペーン名
        description:
          type: string
          nullable: true
          description: キャンペーンの説明
        status:
          type: string
          nullable: true
          enum:
            - draft
            - active
            - inactive
            - terminated
            - deleted
          description: キャンペーンのステータス
        type:
          type: string
          nullable: true
          description: キャンペーンの種類です。`standard`は通常のキャンペーン、`experiment`はA/Bテストのキャンペーンです。
        channel:
          type: string
          nullable: true
          description: 配信チャネル(例:`push-notification`、`kakao-alimtalk`、`text-message`)
        segment_type:
          type: string
          nullable: true
          enum:
            - condition
            - csv
            - cohort
          description: >-
            配信対象の指定方法です。`condition`は条件ベース、`csv`はCSVアップロード、`cohort`はAIアシスタントで作成したセグメントです。
        timing:
          $ref: '#/components/schemas/CampaignListTiming'
        created_at:
          type: string
          format: date-time
          nullable: true
          description: 作成日時(UTC、ISO 8601)
        updated_at:
          type: string
          format: date-time
          nullable: true
          description: 最終更新日時(UTC、ISO 8601)
    NotiflyV1ErrorObject:
      type: object
      properties:
        code:
          type: string
          description: エラーコードです。
        message:
          type: string
          description: エラーメッセージです。
    CampaignListTiming:
      type: object
      description: 配信タイミングの概要です。時刻の値はすべてUnixタイムスタンプ(秒)です。
      properties:
        timing_type:
          type: string
          nullable: true
          enum:
            - scheduled
            - event-based
            - api
          description: 配信タイミングの種類
        interval:
          type: integer
          nullable: true
          description: 繰り返し予約配信の間隔(秒)です。例えば毎日は`86400`、毎週は`604800`です。1回のみの配信ではnullです。
        starts:
          type: array
          nullable: true
          items:
            type: integer
          description: 予約配信では配信日時(繰り返し配信では初回の配信日時)、イベントベースの配信ではキャンペーン期間の開始日時です。
        delay:
          type: integer
          nullable: true
          description: イベントベースの配信で、イベント発生から配信までの遅延時間(秒)です。
        end:
          type: integer
          nullable: true
          description: 繰り返し予約配信またはイベントベースの配信の終了日時です。終了日時がない場合はnullです。
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: '`POST /authenticate`で発行したトークンをBearer形式で送信します。'

````

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