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

# Search activities

> Returns one page of the activities that match the filter, newest occurredAt first. Activities with the same occurredAt come in descending id order, so the order is the same on every page. Filter by type, employee, tag, occurredAt range, and property conditions. Pages start at 1; pageSize defaults to 20 and is limited to 100. To read the next page, send the same request with page increased by 1, and stop when pagination.hasMore is false. Set include.total to true for the count of every match. For counts alone, or counts by type or month, use POST /c/{companyId}/activities/count. A field the request does not define fails validation. No text can contain the NUL character (U+0000) or a lone UTF-16 surrogate (U+D800 to U+DFFF). With permission to manage activities (`activities.manage`), you can read every activity. Otherwise you can read an activity when its access grants you read or write access, for example as an employee on it, as one of their managers, or as the employee who created it. Activities shared with admins can be read with permission to view admin activities (`activities.view_admin`). Access granted to a permission reaches only members who have an employee record; permission to manage activities needs none. Archived activities are never returned.



## OpenAPI

````yaml https://api.gowindmill.com/api/v2/openapi.json post /c/{companyId}/activities/search
openapi: 3.1.0
info:
  title: Windmill API
  version: 2.0.0
  description: >-
    Use the Windmill API to integrate your systems, automate workflows, and
    build applications on your organization's data. Authenticate with an API key
    or OAuth access token. Each request uses the authenticated user's
    permissions within the selected workspace.
servers:
  - url: https://api.gowindmill.com/api/v2
security:
  - bearerAuth: []
paths:
  /c/{companyId}/activities/search:
    post:
      tags:
        - Activities
      summary: Search activities
      description: >-
        Returns one page of the activities that match the filter, newest
        occurredAt first. Activities with the same occurredAt come in descending
        id order, so the order is the same on every page. Filter by type,
        employee, tag, occurredAt range, and property conditions. Pages start at
        1; pageSize defaults to 20 and is limited to 100. To read the next page,
        send the same request with page increased by 1, and stop when
        pagination.hasMore is false. Set include.total to true for the count of
        every match. For counts alone, or counts by type or month, use POST
        /c/{companyId}/activities/count. A field the request does not define
        fails validation. No text can contain the NUL character (U+0000) or a
        lone UTF-16 surrogate (U+D800 to U+DFFF). With permission to manage
        activities (`activities.manage`), you can read every activity. Otherwise
        you can read an activity when its access grants you read or write
        access, for example as an employee on it, as one of their managers, or
        as the employee who created it. Activities shared with admins can be
        read with permission to view admin activities (`activities.view_admin`).
        Access granted to a permission reaches only members who have an employee
        record; permission to manage activities needs none. Archived activities
        are never returned.
      operationId: activities.search
      parameters:
        - schema:
            type: string
            minLength: 1
            maxLength: 128
            description: >-
              Company ID. A URL slug is also accepted. The caller must have
              access to this company.
            title: Company ID
            example: company-acme
          required: true
          description: >-
            Company ID. A URL slug is also accepted. The caller must have access
            to this company.
          name: companyId
          in: path
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchActivitiesRequest'
      responses:
        '200':
          description: A page of matching activities.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchActivitiesResponse'
        '400':
          description: Bad request or request validation failed
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - BAD_REQUEST
                          message:
                            type: string
                          requestId:
                            type: string
                          details:
                            type: array
                            items:
                              type: object
                              properties:
                                path:
                                  type: array
                                  items:
                                    anyOf:
                                      - type: string
                                      - type: number
                                message:
                                  type: string
                                resourceId:
                                  type: string
                              required:
                                - path
                                - message
                            description: >-
                              Each request item that failed, by its path in the
                              request, when the operation identifies them.
                              resourceId names an existing resource the failure
                              concerns.
                        required:
                          - code
                          - message
                          - requestId
                    required:
                      - error
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - VALIDATION_ERROR
                          message:
                            type: string
                          requestId:
                            type: string
                          details:
                            type: array
                            items:
                              type: object
                              properties:
                                path:
                                  type: array
                                  items:
                                    anyOf:
                                      - type: string
                                      - type: number
                                message:
                                  type: string
                              required:
                                - path
                                - message
                        required:
                          - code
                          - message
                          - requestId
                          - details
                    required:
                      - error
        '401':
          description: >-
            Authentication is missing or invalid. Send a valid API key or OAuth
            access token in the Authorization: Bearer <TOKEN> header before
            retrying.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - UNAUTHORIZED
                      message:
                        type: string
                      requestId:
                        type: string
                    required:
                      - code
                      - message
                      - requestId
                required:
                  - error
        '403':
          description: >-
            The API key or OAuth access token cannot access the workspace in the
            URL. A token works only in the workspace it was issued for, and only
            while its user is a member of that workspace.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - FORBIDDEN
                      message:
                        type: string
                      requestId:
                        type: string
                      details:
                        type: array
                        items:
                          type: object
                          properties:
                            path:
                              type: array
                              items:
                                anyOf:
                                  - type: string
                                  - type: number
                            message:
                              type: string
                            resourceId:
                              type: string
                          required:
                            - path
                            - message
                        description: >-
                          Each request item you lack permission for, by its path
                          in the request, when the operation identifies them.
                          resourceId names an existing resource the failure
                          concerns.
                    required:
                      - code
                      - message
                      - requestId
                required:
                  - error
        '429':
          description: >-
            The API-client request budget is exhausted. API keys allow 500
            requests per minute per key; OAuth clients allow 500 per minute per
            client and workspace. Reads and writes share the budget. One HTTP
            request counts once, including bulk requests. Wait for the
            Retry-After delay before retrying.
          headers:
            Retry-After:
              description: Number of seconds to wait before retrying the request.
              required: true
              schema:
                type: integer
                minimum: 0
                example: 42
            RateLimit:
              description: >-
                Current request budget: limit is the maximum count, remaining is
                the unused count, and reset is seconds until the window resets,
                not a timestamp.
              required: true
              schema:
                type: string
                example: limit=500, remaining=0, reset=42
            RateLimit-Policy:
              description: >-
                Request limit and window length in seconds, formatted as
                <limit>;w=<seconds>.
              required: true
              schema:
                type: string
                example: 500;w=60
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - RATE_LIMITED
                      message:
                        type: string
                      requestId:
                        type: string
                    required:
                      - code
                      - message
                      - requestId
                required:
                  - error
      security:
        - bearerAuth: []
components:
  schemas:
    SearchActivitiesRequest:
      type: object
      properties:
        filter:
          $ref: '#/components/schemas/ActivityFilter'
        page:
          type: integer
          minimum: 1
          default: 1
          description: One-based page number. Defaults to 1.
        pageSize:
          type: integer
          minimum: 1
          maximum: 100
          default: 20
          description: Maximum results per page, from 1 to 100. Defaults to 20.
        include:
          type: object
          properties:
            total:
              type: boolean
              description: >-
                Set true to count all matching items and include
                pagination.total. False or omission skips the count.
              title: Include total count
              example: true
          additionalProperties: false
      additionalProperties: false
      example:
        filter:
          types:
            - call-score
          occurredAt:
            from:
              at: '2026-10-01T00:00:00Z'
          properties:
            - key: score
              op: gte
              value: 80
        page: 2
        pageSize: 1
        include:
          total: true
    SearchActivitiesResponse:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/Activity'
        pagination:
          $ref: '#/components/schemas/SearchPaginationResponse'
      required:
        - results
        - pagination
      example:
        results:
          - id: 019a2f7c-8842-7e3f-9a4b-5c6d7e8f9a0b
            type: call-score
            externalId: call-8842
            employees:
              - employeeId: employee-jane
                email: jane@acme.example
            title: Discovery call with Northwind scored 82/100
            body: null
            url: https://calls.example/call?id=8842
            occurredAt: '2026-10-20T15:30:00.000Z'
            properties:
              score: 82
              callType: Discovery
              account.name: Northwind
            tags:
              - q4-push
            integrationId: null
            access:
              companyAccess: none
              allManagersAccess: none
              employeeAccess:
                - employeeId: employee-jane
                  access: read
                - employeeId: employee-omar
                  access: write
              groupAccess: []
              subtreeAccess: []
              capabilitiesAccess:
                - capability: activities.manage
                  access: write
              automationAccess: []
              relationshipAccess:
                - relationship: EMPLOYEE_AND_MANAGER_HIERARCHY
                  employeeId: employee-jane
                  access: read
            createdByEmployeeId: employee-omar
            lastUpdatedByEmployeeId: employee-omar
            createdAt: '2026-10-20T16:00:00.000Z'
            updatedAt: '2026-10-20T16:00:00.000Z'
        pagination:
          page: 2
          pageSize: 1
          hasMore: true
          total: 3
    ActivityFilter:
      type: object
      properties:
        types:
          type: array
          items:
            type: string
        employeeIds:
          type: array
          items:
            type: string
          description: >-
            Activities about at least one of these employees, or of the
            employees in emails. An empty list matches no activity unless emails
            names an employee.
        emails:
          type: array
          items:
            type: string
        tags:
          type: array
          items:
            type: string
        tagsMatch:
          type: string
          enum:
            - any
            - all
          default: any
          description: >-
            How tags match. any: the activity has at least one listed tag. all:
            it has every listed tag. Defaults to any.
        occurredAt:
          type: object
          properties:
            from:
              type: object
              properties:
                at:
                  type: string
                  format: date-time
                inclusive:
                  type: boolean
                includeNull:
                  type: boolean
              required:
                - at
              additionalProperties: false
            to:
              type: object
              properties:
                at:
                  type: string
                  format: date-time
                inclusive:
                  type: boolean
                includeNull:
                  type: boolean
              required:
                - at
              additionalProperties: false
          additionalProperties: false
          description: >-
            Activities whose occurredAt falls in this range. Each bound's at is
            an RFC 3339 date-time with seconds and `Z` or a `±HH:MM` offset.
            Either bound can be left out, and each bound is inclusive unless you
            set inclusive to false.
        properties:
          type: array
          items:
            $ref: '#/components/schemas/ActivityPropertyCondition'
          maxItems: 49
          description: >-
            Activities whose properties match every condition. At most 49
            conditions; more fail validation.
          example:
            - key: score
              op: gte
              value: 80
      additionalProperties: false
      description: >-
        Which activities to match. Every supplied field must match, and the
        values in one list match when any one does, except tags with tagsMatch
        all and properties, where every condition must match. An omitted or
        empty list leaves its field unfiltered, except employeeIds.
    Activity:
      type: object
      properties:
        id:
          type: string
          description: Windmill's identifier for the activity.
          example: 019a2f7c-8842-7e3f-9a4b-5c6d7e8f9a0b
        type:
          type: string
          description: The externalId of the activity's type.
          example: call-score
        externalId:
          type: string
          description: Your identifier for the event, unique within its type.
          example: call-8842
        employees:
          type: array
          items:
            type: object
            properties:
              employeeId:
                type: string
                description: Windmill's identifier for the employee.
              email:
                type:
                  - string
                  - 'null'
                description: >-
                  The employee's primary email address, or null when they have
                  none.
            required:
              - employeeId
              - email
          description: Every employee the activity is about.
        title:
          type: string
          description: A short summary of the event.
        body:
          type:
            - string
            - 'null'
          description: Longer text about the event, or null.
        url:
          type:
            - string
            - 'null'
          description: A URL to the event in its source system, or null.
        occurredAt:
          type: string
          format: date-time
          description: When the event happened.
        properties:
          $ref: '#/components/schemas/ActivityProperties'
        tags:
          type: array
          items:
            type: string
          description: Tag names, in ascending order.
        integrationId:
          type:
            - string
            - 'null'
          description: The integration the event came from, or null.
        access:
          $ref: '#/components/schemas/ActivityAccess'
        createdByEmployeeId:
          type:
            - string
            - 'null'
          description: The employee who created the activity, or null when unknown.
        lastUpdatedByEmployeeId:
          type:
            - string
            - 'null'
          description: The employee who last changed the activity, or null when unknown.
        createdAt:
          type: string
          format: date-time
          description: When the activity was first written.
        updatedAt:
          type: string
          format: date-time
          description: When the activity was last written.
      required:
        - id
        - type
        - externalId
        - employees
        - title
        - body
        - url
        - occurredAt
        - properties
        - tags
        - integrationId
        - access
        - createdByEmployeeId
        - lastUpdatedByEmployeeId
        - createdAt
        - updatedAt
    SearchPaginationResponse:
      type: object
      properties:
        page:
          type: integer
          minimum: 1
          default: 1
          description: One-based page number. Defaults to 1.
          title: Page number
          example: 1
        pageSize:
          type: integer
          minimum: 1
          maximum: 100
          default: 20
          description: Maximum results per page, from 1 to 100. Defaults to 20.
          title: Page size
          example: 20
        hasMore:
          type: boolean
          description: Whether there are more matching results after this page.
          title: Has another page
          example: false
        total:
          type: integer
          minimum: 0
          description: >-
            Total matching items, independent of pagination. The route
            determines the item type.
          title: Total matches
          example: 1
      required:
        - page
        - pageSize
        - hasMore
    ActivityPropertyCondition:
      oneOf:
        - type: object
          properties:
            key:
              type: string
              maxLength: 128
            op:
              type: string
              enum:
                - eq
            value:
              anyOf:
                - type: string
                  maxLength: 128
                - type: number
                - type: boolean
          required:
            - key
            - op
            - value
          additionalProperties: false
          description: >-
            eq: the property is a text, number, or boolean equal to value. Text
            matches exactly and case-sensitively.
        - type: object
          properties:
            key:
              type: string
              maxLength: 128
            op:
              type: string
              enum:
                - in
                - notIn
            value:
              anyOf:
                - type: array
                  items:
                    type: string
                    maxLength: 128
                  minItems: 1
                  maxItems: 1000
                - type: array
                  items:
                    type: number
                  minItems: 1
                  maxItems: 1000
              description: 1 to 1,000 texts, or 1 to 1,000 numbers.
          required:
            - key
            - op
            - value
          additionalProperties: false
          description: >-
            in: the property is a text or number equal to one of the values,
            matched exactly and case-sensitively. notIn: the property has no
            value, or is a text, number, or boolean equal to none of the values.
        - type: object
          properties:
            key:
              type: string
              maxLength: 128
            op:
              type: string
              enum:
                - contains
                - startsWith
            value:
              anyOf:
                - type: string
                  maxLength: 128
                - type: array
                  items:
                    type: string
                    maxLength: 128
                  minItems: 1
                  maxItems: 1000
              description: One text, or 1 to 1,000 texts.
          required:
            - key
            - op
            - value
          additionalProperties: false
          description: >-
            contains: the property is a text that contains one of the texts.
            startsWith: the property is a text that starts with one of the
            texts. Both ignore case.
        - type: object
          properties:
            key:
              type: string
              maxLength: 128
            op:
              type: string
              enum:
                - gte
                - lte
            value:
              anyOf:
                - type: string
                  maxLength: 128
                - type: number
          required:
            - key
            - op
            - value
          additionalProperties: false
          description: >-
            gte: at least value. lte: at most value. With a number, the property
            must be a number. With a text, the property must be a text, compared
            by character code, so ISO 8601 timestamps in the same format compare
            in time order and uppercase letters come before lowercase ones.
        - type: object
          properties:
            key:
              type: string
              maxLength: 128
            op:
              type: string
              enum:
                - overlaps
                - containsAll
                - notOverlaps
            value:
              anyOf:
                - type: array
                  items:
                    type: string
                    maxLength: 128
                  minItems: 1
                  maxItems: 1000
                - type: array
                  items:
                    type: number
                  minItems: 1
                  maxItems: 1000
              description: 1 to 1,000 texts, or 1 to 1,000 numbers.
          required:
            - key
            - op
            - value
          additionalProperties: false
          description: >-
            For a list property. overlaps: the list holds at least one of the
            values. containsAll: it holds every value. notOverlaps: the property
            has no value, or is a list that holds none of the values. Items
            match exactly and case-sensitively.
        - type: object
          properties:
            key:
              type: string
              maxLength: 128
            op:
              type: string
              enum:
                - isEmpty
                - isNotEmpty
          required:
            - key
            - op
          additionalProperties: false
          description: >-
            isEmpty: the property has no value. isNotEmpty: the property has a
            value.
      description: >-
        A condition on one property. A property has no value when it is missing
        or is null, an empty text, or an empty list. Values are never converted:
        the text "82" does not equal the number 82. The operators for a single
        value (eq, in, notIn, contains, startsWith, gte, lte) never match a
        non-empty list, and the list operators (overlaps, containsAll,
        notOverlaps) never match a single value. Keys and texts are limited to
        128 characters.
      example:
        key: callType
        op: eq
        value: Discovery
    ActivityProperties:
      type: object
      additionalProperties:
        anyOf:
          - type: string
          - type: number
          - type: boolean
          - type: 'null'
          - type: array
            items:
              anyOf:
                - type: string
                - type: number
                - type: boolean
                - type: 'null'
      description: >-
        Structured details of the event as a flat object. Each value is a
        string, number, boolean, or null, or an array of those. An object value,
        or an array that holds an object or an array, fails validation. To group
        related details, put a `.` in the key, for example `account.name`; the
        whole key is one name.
      example:
        score: 82
        callType: Discovery
        account.name: Northwind
    ActivityAccess:
      type: object
      properties:
        companyAccess:
          type: string
          enum:
            - none
            - read
            - write
          default: none
          description: '`write` can read and edit; `none` removes the grant.'
        allManagersAccess:
          type: string
          enum:
            - none
            - read
            - write
          default: none
          description: Every employee with at least one report.
        employeeAccess:
          type: array
          items:
            type: object
            properties:
              employeeId:
                type: string
                minLength: 1
              access:
                type: string
                enum:
                  - none
                  - read
                  - write
                description: '`write` can read and edit; `none` removes the grant.'
            required:
              - employeeId
              - access
          default: []
        groupAccess:
          type: array
          items:
            type: object
            properties:
              groupId:
                type: string
                minLength: 1
              access:
                type: string
                enum:
                  - none
                  - read
                  - write
                description: '`write` can read and edit; `none` removes the grant.'
            required:
              - groupId
              - access
          default: []
        subtreeAccess:
          type: array
          items:
            type: object
            properties:
              employeeId:
                type: string
                minLength: 1
              access:
                type: string
                enum:
                  - none
                  - read
                  - write
                description: '`write` can read and edit; `none` removes the grant.'
            required:
              - employeeId
              - access
          default: []
          description: Everyone who reports to the employee, directly or not.
        capabilitiesAccess:
          type: array
          items:
            type: object
            properties:
              capability:
                type: string
                minLength: 1
                description: A workspace member capability.
              access:
                type: string
                enum:
                  - none
                  - read
                  - write
                description: '`write` can read and edit; `none` removes the grant.'
            required:
              - capability
              - access
          default: []
        automationAccess:
          type: array
          items:
            type: object
            properties:
              companyAutomationId:
                type: string
                minLength: 1
              access:
                type: string
                enum:
                  - none
                  - read
                  - write
                description: '`write` can read and edit; `none` removes the grant.'
            required:
              - companyAutomationId
              - access
          default: []
        relationshipAccess:
          type: array
          items:
            type: object
            properties:
              relationship:
                type: string
                enum:
                  - DIRECT_MANAGER
                  - MANAGER_HIERARCHY
                  - EMPLOYEE_AND_MANAGER_HIERARCHY
              employeeId:
                type: string
                minLength: 1
              access:
                type: string
                enum:
                  - none
                  - read
                  - write
                description: '`write` can read and edit; `none` removes the grant.'
            required:
              - relationship
              - employeeId
              - access
          default: []
          description: A grant to whoever holds a reporting relationship to the employee.
      description: >-
        Who can read and edit the activity, as grants. A preset comes back as
        the grants it stands for, and shareWithEmployees as a read grant for
        each employee on the activity. Access always includes write access for
        members with permission to manage activities (`activities.manage`) and,
        when known, for the employee who created the activity.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Use an API key or OAuth access token. Enter only the token in the
        authorization dialog; requests send it as `Authorization: Bearer
        <TOKEN>`.


        Create an API key in your workspace's **Settings → API keys**. Keys
        start with `wm_api_` and only work in the workspace where they were
        created. Read-only keys can read data; creating, updating, or deleting
        data requires a read-write key.


        ```http

        Authorization: Bearer wm_api_example

        ```


        OAuth access tokens are issued for connected Windmill applications.


        ```http

        Authorization: Bearer <OAUTH_ACCESS_TOKEN>

        ```


        Both token types use the authenticated user's workspace permissions.
        Each endpoint's permission requirements and the sharing settings of the
        requested items still apply.

````

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