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

# Aggiorna la pianificazione

> Aggiorna una pianificazione esistente.

<div id="permissions">
  ## Autorizzazioni
</div>

Richiede un service user con l'autorizzazione `ManageOrgSchedules` a livello di organizzazione.

<div id="notes">
  ## Note
</div>

Tutti i campi sono facoltativi. Verranno aggiornati solo i campi forniti nel corpo della richiesta. Per disabilitare una pianificazione, imposta `enabled` su `false`.

Impostare `playbook_id` su `null` rimuoverà il playbook associato.

Puoi modificare `schedule_type` tra `recurring` e `one_time`. Quando lo imposti su `one_time`, fornisci `scheduled_at` con una data e ora futura nel formato ISO 8601. Quando lo imposti su `recurring`, fornisci `frequency` con una espressione cron valida.

<div id="execution-identity">
  ## Identità di esecuzione
</div>

Il parametro `run_as_user_id` controlla con quale identità utente viene eseguita la pianificazione. Quando una pianificazione viene attivata, le sessioni vengono create con questo utente: riceve le notifiche e la sessione appare nella sua cronologia.

* **Imposta un utente**: Fornisci un ID utente valido per modificare l’identità di esecuzione. Questo richiede:
  1. L’utente di servizio deve avere l’autorizzazione `ImpersonateOrgSessions`
  2. L’utente di destinazione deve essere un membro dell’organizzazione
  3. L’utente di destinazione deve avere l’autorizzazione `UseDevinSessions`
* **Reimposta (imposta a `null`)**: Fa sì che la pianificazione venga nuovamente eseguita come utente bot predefinito
* **Ometti il campo**: Lascia invariata l’identità di esecuzione corrente


## OpenAPI

````yaml it/v3-openapi.json PATCH /v3/organizations/{org_id}/schedules/{schedule_id}
openapi: 3.1.0
info:
  description: API Devin v3 con autenticazione tramite utente di servizio e RBAC
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/organizations/{org_id}/schedules/{schedule_id}:
    patch:
      tags:
        - schedules
      summary: Aggiorna la pianificazione
      description: Aggiorna una pianificazione esistente.
      operationId: >-
        handle_update_schedule_v3_organizations__org_id__schedules__schedule_id__patch
      parameters:
        - description: 'ID della pianificazione (prefisso: sched-)'
          in: path
          name: schedule_id
          required: true
          schema:
            example: sched-abc123def456
            title: Schedule Id
            type: string
        - description: 'ID dell''organizzazione (prefisso: org-)'
          in: path
          name: org_id
          required: true
          schema:
            example: org-abc123def456
            title: Org Id
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ScheduleUpdateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduleResponse'
          description: Risposta di successo
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Errore di convalida
components:
  schemas:
    ScheduleUpdateRequest:
      properties:
        agent:
          anyOf:
            - enum:
                - devin
                - data_analyst
              type: string
            - type: 'null'
          title: Agent
        bypass_approval:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Bypass Approval
        enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Enabled
        frequency:
          anyOf:
            - type: string
            - type: 'null'
          title: Frequency
        interval_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Interval Count
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        notify_on:
          anyOf:
            - enum:
                - always
                - failure
                - never
              type: string
            - type: 'null'
          title: Notify On
        platform:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Piattaforma VM per le sessioni generate da questa pianificazione (ad
            es. 'windows'). Se omessa, la piattaforma rimane invariata. Il
            valore deve corrispondere a una piattaforma configurata per
            l'organizzazione (senza distinzione tra maiuscole e minuscole); i
            valori sconosciuti vengono rifiutati con un 400 che elenca le
            etichette di piattaforma disponibili.
          title: Platform
        playbook_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Playbook Id
        prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt
        run_as_user_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Imposta l'ID utente con cui verrà eseguita questa pianificazione.
            Richiede l'autorizzazione ImpersonateOrgSessions. Se impostato su
            null, viene ripristinato l'utente bot predefinito. Se il campo viene
            omesso, l'identità corrente rimane invariata.
          title: Run As User Id
        schedule_type:
          anyOf:
            - enum:
                - recurring
                - one_time
              type: string
            - type: 'null'
          title: Schedule Type
        scheduled_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Scheduled At
        slack_channel_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Slack Channel Id
        slack_team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Slack Team Id
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
        target_devin_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Devin Id
      title: ScheduleUpdateRequest
      type: object
    ScheduleResponse:
      properties:
        agent:
          enum:
            - devin
            - data_analyst
          title: Agent
          type: string
        bypass_approval:
          default: false
          title: Bypass Approval
          type: boolean
        consecutive_failures:
          title: Consecutive Failures
          type: integer
        created_at:
          format: date-time
          title: Created At
          type: string
        created_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Created By
        enabled:
          title: Enabled
          type: boolean
        frequency:
          anyOf:
            - type: string
            - type: 'null'
          title: Frequency
        interval_count:
          default: 1
          title: Interval Count
          type: integer
        last_edited_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Edited By
        last_error_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Last Error At
        last_error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Error Message
        last_executed_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Last Executed At
        name:
          title: Name
          type: string
        notify_on:
          enum:
            - always
            - failure
            - never
          title: Notify On
          type: string
        org_id:
          title: Org Id
          type: string
        platform:
          anyOf:
            - type: string
            - type: 'null'
          title: Platform
        playbook:
          anyOf:
            - $ref: '#/components/schemas/PlaybookInfo'
            - type: 'null'
        prompt:
          title: Prompt
          type: string
        schedule_type:
          default: recurring
          enum:
            - recurring
            - one_time
          title: Schedule Type
          type: string
        scheduled_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Scheduled At
        scheduled_session_id:
          title: Scheduled Session Id
          type: string
        slack_channel_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Slack Channel Id
        slack_team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Slack Team Id
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
        target_devin_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Devin Id
        updated_at:
          format: date-time
          title: Updated At
          type: string
      required:
        - scheduled_session_id
        - org_id
        - created_by
        - name
        - prompt
        - playbook
        - frequency
        - enabled
        - last_executed_at
        - created_at
        - updated_at
        - last_error_at
        - last_error_message
        - consecutive_failures
        - notify_on
        - agent
      title: ScheduleResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    PlaybookInfo:
      properties:
        playbook_id:
          title: Playbook Id
          type: string
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
      required:
        - playbook_id
        - title
      title: PlaybookInfo
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    bearerAuth:
      description: 'Credenziale utente di servizio (prefisso: cog_)'
      scheme: bearer
      type: http

````