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

# List activities

> ワークスペースで発生したアクティビティ（ミーティング・メッセージ・CRMオブジェクト変更）を一覧で取得します。
`occurred_at` の降順（新しい順）で返却されます。
`context_id` を指定する場合は `context_type` を併せて指定してください。
公開範囲が `PUBLIC` な Company / Contact / Deal に紐づくアクティビティのみが対象です。
`context_id` が非公開または存在しないレコードを指す場合、空の `data` を返します（404にはなりません）。
なお一覧は公開 context に紐づくアクティビティのみを対象としますが、`GET /v2/activities/{activityId}`
は発生源が公開対象であれば `links` が空でも返します（一覧との非対称は意図的です）。
ページングの継続判定は `page_info.has_next_page` だけで行ってください。`page_info.end_cursor` は
最終ページでも `null` になりません（差分同期の checkpoint token として使えるようにするためです）。




## OpenAPI

````yaml /openapi.yaml get /v2/activities
openapi: 3.1.0
info:
  title: Frictio Public API
  version: 1.0.0-beta
servers:
  - url: https://public-api.frictio.ai
security:
  - ApiKeyAuth: []
paths:
  /v2/activities:
    get:
      summary: List activities
      description: >
        ワークスペースで発生したアクティビティ（ミーティング・メッセージ・CRMオブジェクト変更）を一覧で取得します。

        `occurred_at` の降順（新しい順）で返却されます。

        `context_id` を指定する場合は `context_type` を併せて指定してください。

        公開範囲が `PUBLIC` な Company / Contact / Deal に紐づくアクティビティのみが対象です。

        `context_id` が非公開または存在しないレコードを指す場合、空の `data` を返します（404にはなりません）。

        なお一覧は公開 context に紐づくアクティビティのみを対象としますが、`GET /v2/activities/{activityId}`

        は発生源が公開対象であれば `links` が空でも返します（一覧との非対称は意図的です）。

        ページングの継続判定は `page_info.has_next_page` だけで行ってください。`page_info.end_cursor`
        は

        最終ページでも `null` になりません（差分同期の checkpoint token として使えるようにするためです）。
      operationId: listV2Activities
      parameters:
        - $ref: '#/components/parameters/workspaceId'
        - name: limit
          in: query
          required: false
          description: 1–100（デフォルト30）
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 30
        - name: cursor
          in: query
          required: false
          description: 次ページ取得用カーソル
          schema:
            type: string
        - name: context_type
          in: query
          required: false
          description: |
            紐づくCRMコンテキストの種別でフィルタします（`GET /v2/objects` の object名と同様に小文字）。
            `context_id` を指定する場合は必須です。
          schema:
            type: string
            enum:
              - company
              - contact
              - deal
        - name: context_id
          in: query
          required: false
          description: 紐づくCRMコンテキストのIDでフィルタします。`context_type` と併せて指定してください。
          schema:
            type: string
        - name: source_type
          in: query
          required: false
          description: アクティビティの発生元でフィルタします。
          schema:
            type: string
            enum:
              - MEETING
              - MESSAGE
              - OBJECT_CHANGE_EVENT
        - name: occurred_from
          in: query
          required: false
          description: 取得範囲の開始日時（以上）。ISO 8601 形式で指定してください。
          schema:
            type: string
            format: date-time
          example: '2026-08-01T00:00:00.000Z'
        - name: occurred_to
          in: query
          required: false
          description: 取得範囲の終了日時（以下）。ISO 8601 形式で指定してください。
          schema:
            type: string
            format: date-time
          example: '2026-08-18T00:00:00.000Z'
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/V2ActivityListResponse'
        '400':
          $ref: '#/components/responses/V2BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  parameters:
    workspaceId:
      name: X-Workspace-Id
      in: header
      required: true
      description: ワークスペースID
      schema:
        type: string
      example: e1f2a3b4-...
  schemas:
    V2ActivityListResponse:
      type: object
      required:
        - data
        - page_info
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/V2Activity'
        page_info:
          $ref: '#/components/schemas/V2PageInfo'
      example:
        data:
          - id: 01J9Z0P8Q2K3M4N5P6R7S8T9V0
            type: ENGAGEMENT
            source_type: MEETING
            source_id: 01J9Y8X7W6V5U4T3S2R1Q0P9N8
            occurred_at: '2026-08-21T04:12:33.000Z'
            created_via: UI:WEB
            actor:
              kind: member
              id: 01J9WABCDEF0123456789GHJKM
            links:
              - context_type: deal
                context_id: 01J9V0N1M2L3K4J5H6G7F8D9S0
                origin: DIRECT
        page_info:
          end_cursor: >-
            eyJ0eXBlIjoiYWN0aXZpdHktdGltZWxpbmUiLCJ2IjoxLCJvY2N1cnJlZEF0IjoiMjAyNi0wOC0yMVQwNDoxMjozMy4wMDBaIiwiYWN0aXZpdHlJZCI6IjAxSjlaMFA4UTJLM000TjVQNlI3UzhUOVYwIn0=
          has_next_page: false
    V2Activity:
      type: object
      required:
        - id
        - type
        - source_type
        - source_id
        - occurred_at
        - created_via
        - actor
        - links
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          description: アクティビティ種別の識別子です。
        source_type:
          type: string
          enum:
            - MEETING
            - MESSAGE
            - OBJECT_CHANGE_EVENT
        source_id:
          type: string
          description: 発生元レコードのID（`source_type` に応じたリソースのID）です。
        occurred_at:
          type: string
          format: date-time
        created_via:
          type:
            - string
            - 'null'
          description: 'アクティビティの作成経路（例: `UI:WEB`）。取得できない場合は `null` です。'
          example: UI:WEB
        actor:
          oneOf:
            - $ref: '#/components/schemas/V2ActivityActor'
            - type: 'null'
        links:
          type: array
          description: >
            アクティビティに紐づくCRMコンテキスト。公開範囲が `PUBLIC` なCompany / Contact /
            Dealのみ含まれます。
          items:
            $ref: '#/components/schemas/V2ActivityLink'
    V2PageInfo:
      type: object
      description: |
        v2 のカーソルページネーション情報。**継続判定は `has_next_page` だけで行ってください。**
        v1 の `pagination.next_cursor` と異なり、`end_cursor` は最終ページでも `null` になりません。
      required:
        - end_cursor
        - has_next_page
      properties:
        end_cursor:
          type:
            - string
            - 'null'
          description: |
            この page の最終行を指すカーソル。`data` が空のときだけ `null` になります。
            `has_next_page` が `false` でも値が入るため、差分同期の checkpoint token として保存できます。
            「`end_cursor` が非 `null` だから次ページがある」と解釈すると、同じページを取り続ける無限ループになります。
        has_next_page:
          type: boolean
          description: |
            次ページの有無。次を取得するかはこの値だけで判断してください。
    V2Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            request_id:
              type: string
    Error:
      type: object
      required:
        - statusCode
        - message
      properties:
        statusCode:
          type: integer
          description: HTTPステータスコード
          example: 404
        message:
          type: string
          description: エラーメッセージ
          example: Meeting not found
        error:
          type: string
          description: |
            エラー種別。メッセージ文字列付きで例外が生成された場合のみ含まれます。
          example: Not Found
    V2ActivityActor:
      type: object
      required:
        - kind
        - id
      description: |
        アクティビティの発生元。`activities.actor_type` が `MEMBER` かつメンバーが解決できた場合は
        `kind: member` で `id` にワークスペースメンバーの公開ID（`/v1/members` の `id` と同じ）を返します。
        それ以外（システム起因や解決できないメンバー）は `kind: system` で `id` は `null` になります。
      properties:
        kind:
          type: string
          enum:
            - member
            - system
        id:
          type:
            - string
            - 'null'
    V2ActivityLink:
      type: object
      description: |
        `context_type` は小文字（`GET /v2/objects` の object名に合わせています）、`origin` は大文字
        （webhook `record.activity_link.*` の `origin` に合わせています）です。フィールドごとに正本となる
        契約が異なるため、`source_type` や `actor.kind` を含めペイロード全体のcasingは意図的に統一していません。
      required:
        - context_type
        - context_id
        - origin
      properties:
        context_type:
          type: string
          enum:
            - company
            - contact
            - deal
        context_id:
          type: string
        origin:
          type: string
          enum:
            - DIRECT
            - DERIVED
          description: |
            CRMコンテキストとの紐付け経路です。`DIRECT` はアクティビティ自体が指すレコード、
            `DERIVED` は紐づく別レコード（例: Contactに紐づくCompany）から推論された関連であることを示します。
  responses:
    V2BadRequest:
      description: 不正なリクエスト
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/V2Error'
    Unauthorized:
      description: APIキーが無効、失効、期限切れ、または未指定です
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalidApiKey:
              summary: 無効な API キー
              value:
                statusCode: 401
                message: Invalid API key
                error: Unauthorized
            missingApiKey:
              summary: API キー未指定
              value:
                statusCode: 401
                message: Missing X-Api-Key header
                error: Unauthorized
    Forbidden:
      description: 権限エラー
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 403
            message: Forbidden
    TooManyRequests:
      description: レートリミット超過
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            statusCode: 429
            message: Too Many Requests
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key

````

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