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

# File a contact's past activities under its accounts

> What the app's "Apply to past meetings" prompt does after a change of a contact's accounts: files the contact's activities of the last `window_days` days (those it took part in: meetings, emails, chats) under each account in `accounts` as well, so they show on those accounts' timelines and in their AI answers. It adds and never removes: an activity stays filed where it was (its primary account too), so it is not taken off an account the contact left. Each account must be one the contact is on now (set them with PATCH /v1/objects/contact/records/{contact_id}); others are skipped, and the answer lists the accounts it used. None of them on the contact, or every id blank, is a 422. `window_days` is 1 to 365 (the app offers 15, 90 or a number of days; there is no "all time"). Answers 202 at once: the filing runs in the background and no call reports when it ends; GET /v1/activities?filter[account][eq]=<account id> lists them once filed. A run after an earlier one has ended files nothing twice. A teammate, vendor or digital worker is not a contact: a 404. Where your role sees only your book, the contact must be on an account in it, and so must each account it files under (else a 403), as for an update of the contact; the app's own action has no book check. Send an `Idempotency-Key` header to make a retry safe: the same key replays the first answer and sends nothing again.



## OpenAPI

````yaml /api/statisfy-api.openapi.json post /v1/objects/contact/records/{contact_id}/refile-activities
openapi: 3.1.0
info:
  description: >-
    The agent-first Statisfy API. Authenticate with an API key (`Authorization:
    Bearer stfy_live_…`), then call `GET /v1/meta/capabilities` to discover
    every operation and its schemas.
  title: Statisfy API
  version: 1.0.0
servers:
  - url: https://api.statisfy.com
    description: Production
security: []
paths:
  /v1/objects/contact/records/{contact_id}/refile-activities:
    post:
      tags:
        - contacts
      summary: File a contact's past activities under its accounts
      description: >-
        What the app's "Apply to past meetings" prompt does after a change of a
        contact's accounts: files the contact's activities of the last
        `window_days` days (those it took part in: meetings, emails, chats)
        under each account in `accounts` as well, so they show on those
        accounts' timelines and in their AI answers. It adds and never removes:
        an activity stays filed where it was (its primary account too), so it is
        not taken off an account the contact left. Each account must be one the
        contact is on now (set them with PATCH
        /v1/objects/contact/records/{contact_id}); others are skipped, and the
        answer lists the accounts it used. None of them on the contact, or every
        id blank, is a 422. `window_days` is 1 to 365 (the app offers 15, 90 or
        a number of days; there is no "all time"). Answers 202 at once: the
        filing runs in the background and no call reports when it ends; GET
        /v1/activities?filter[account][eq]=<account id> lists them once filed. A
        run after an earlier one has ended files nothing twice. A teammate,
        vendor or digital worker is not a contact: a 404. Where your role sees
        only your book, the contact must be on an account in it, and so must
        each account it files under (else a 403), as for an update of the
        contact; the app's own action has no book check. Send an
        `Idempotency-Key` header to make a retry safe: the same key replays the
        first answer and sends nothing again.
      operationId: contacts_refile_activities
      parameters:
        - description: The contact's id
          in: path
          name: contact_id
          required: true
          schema:
            examples:
              - p_5f2c9a
            type: string
      requestBody:
        content:
          application/json:
            schema:
              additionalProperties: false
              properties:
                accounts:
                  description: >-
                    The ids of the accounts to file the contact's past
                    activities under, up to 100: accounts the contact is on now.
                    Others are skipped
                  examples:
                    - - 0015g00000AbCdEAAV
                  items:
                    type: string
                  maxItems: 100
                  minItems: 1
                  title: Accounts
                  type: array
                window_days:
                  description: How many days back to reach, from 1 to 365
                  examples:
                    - 90
                  maximum: 365
                  minimum: 1
                  title: Window Days
                  type: integer
              required:
                - accounts
                - window_days
              type: object
        required: true
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefiledActivities'
          description: Successful Response
      security:
        - HTTPBearer: []
components:
  schemas:
    RefiledActivities:
      properties:
        accounts:
          description: >-
            The accounts the contact's activities are filed under: those sent
            that the contact is on, in the order sent
          items:
            type: string
          title: Accounts
          type: array
        contact_id:
          description: The contact's id
          title: Contact Id
          type: string
        status:
          const: accepted
          description: The re-filing started; it runs in the background
          title: Status
          type: string
        window_days:
          description: How many days back it reaches
          title: Window Days
          type: integer
      required:
        - status
        - contact_id
        - accounts
        - window_days
      title: RefiledActivities
      type: object
  securitySchemes:
    HTTPBearer:
      scheme: bearer
      type: http
      description: >-
        An API key, sent as `Authorization: Bearer stfy_live_…`. See
        [Authentication](/rest-api/authentication) for how to get one and which
        scopes it needs.

````

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