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

# Toggle And Set Activities

> Toggles the first activity and sets the rest of the activities to the result of the first toggle.

However, there are some special rules for appointments that trigger a suggested appointment when they are completed. If more than one appointment in the set of identifiers triggers a suggestion, we will not toggle those appointments. This rule is only active when changing the status of an appointment to complete. There must be more than one appointment that triggers such an event for this rule to take effect.
NsApiSlow threshold: 1000 ms.



## OpenAPI

````yaml /openapi/agent/openapi-v3-AppointmentAgent.json post /api/v1/Agents/Appointment/ToggleAndSetActivities
openapi: 3.0.0
info:
  version: v1-Agents
  title: SuperOffice Agent API v1
  description: SuperOffice Agent API - AppointmentAgent
  contact:
    name: SuperOffice DevNet
    url: https://docs.superoffice.com/en/api/index.html
    email: sdk@superoffice.com
servers:
  - url: http://localhost:56350
  - url: https://localhost:56350
security: []
tags: []
externalDocs:
  description: >-
    The SuperOffice DevNet Community has more documentation, examples, and
    discussion forums.
  url: https://community.superoffice.com/en/developer/
paths:
  /api/v1/Agents/Appointment/ToggleAndSetActivities:
    post:
      tags:
        - Appointment_Agent
      summary: Toggle And Set Activities
      description: "Toggles the first activity and sets the rest of the activities to the result of the first toggle.\n\nHowever, there are some special rules for appointments that trigger a suggested appointment when they are completed. If more than one appointment in the set of identifiers triggers a suggestion, we will not toggle those appointments. This rule is only active when changing the status of an appointment to complete. There must be more than one appointment that triggers such an event for this rule to take effect.\r\nNsApiSlow threshold: 1000 ms."
      operationId: v1AppointmentAgent_ToggleAndSetActivities
      parameters:
        - name: $select
          in: query
          description: >-
            Optional comma separated list of properties to include in the
            result. Other fields are then nulled out to reduce payload size:
            "Name,department,category". Default = show all fields.
          required: false
          schema:
            type: string
        - name: Accept-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code.
          required: false
          schema:
            type: string
        - name: SO-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code. Overrides Accept-Language value.
          required: false
          schema:
            type: string
        - name: SO-Culture
          in: header
          description: >-
            Number, date formatting in a specified culture (iso2 language) code.
            Partially overrides SO-Language/Accept-Language value. Ignored if no
            Language set.
          required: false
          schema:
            type: string
        - name: SO-TimeZone
          in: header
          description: >-
            Specify the timezone code that you would like date/time responses
            converted to.
          required: false
          schema:
            type: string
        - name: SO-AppToken
          in: header
          description: >-
            The application token that identifies the partner app. Used when
            calling Online WebAPI from a server.
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.AppointmentCarriers.ToggleAndSetActivitiesRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.AppointmentCarriers.ToggleAndSetActivitiesRequest
          application/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.AppointmentCarriers.ToggleAndSetActivitiesRequest
          text/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.AppointmentCarriers.ToggleAndSetActivitiesRequest
          application/x-www-form-urlencoded:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.AppointmentCarriers.ToggleAndSetActivitiesRequest
          application/json-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.AppointmentCarriers.ToggleAndSetActivitiesRequest
          application/merge-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.AppointmentCarriers.ToggleAndSetActivitiesRequest
        description: ActivityIdentifiers
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
            text/json:
              schema:
                type: array
                items:
                  type: string
            application/xml:
              schema:
                type: array
                items:
                  type: string
            text/xml:
              schema:
                type: array
                items:
                  type: string
            application/json-patch+json:
              schema:
                type: array
                items:
                  type: string
            application/merge-patch+json:
              schema:
                type: array
                items:
                  type: string
      security:
        - SuperOffice_Password: []
          SuperId_Authentication: []
components:
  schemas:
    SuperOffice.WebApi.v1.Carriers.AppointmentCarriers.ToggleAndSetActivitiesRequest:
      description: >-
        ToggleAndSetActivities: Toggles the first activity and sets the rest of
        the activities to the result of the first toggle. However, there are
        some special rules for appointments that trigger a suggested appointment
        when they are completed. If more than one appointment in the set of
        identifiers triggers a suggestion, we will not toggle those
        appointments. This rule is only active when changing the status of an
        appointment to complete. There must be more than one appointment that
        triggers such an event for this rule to take effect.
      type: object
      properties:
        ActivityIdentifiers:
          type: array
          items:
            type: string

````

## Related topics

- [SuperOffice.WebApi.Data.Appointment ToggleAndSetActivitiesRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.Appointment_ToggleAndSetActivitiesRequest.md)
- [NSAppointmentAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSAppointmentAgent.md)
- [SuperOffice.WebApi.Agents.AppointmentAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.AppointmentAgent.md)
- [SuperOffice.WebApi.Agents.IAppointmentAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IAppointmentAgent.md)
- [Toggle Activities](/en/api/reference/restful/agent/appointment_agent/toggle-activities.md)
- [Toggle Activity](/en/api/reference/restful/agent/appointment_agent/toggle-activity.md)
