> ## 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.

# Crea pianificazione

> Crea una nuova sessione pianificata.

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

Richiede un utente di servizio con l'autorizzazione `ManageOrgSchedules` a livello di organizzazione.

<div id="schedule-type">
  ## Tipo di pianificazione
</div>

Il campo `schedule_type` determina se la pianificazione è ricorrente o una tantum:

* `recurring` (valore predefinito) — Richiede il campo `frequency` con un'espressione cron
* `one_time` — Richiede il campo `scheduled_at` con una data e ora future in formato ISO 8601

<div id="frequency">
  ## Frequenza
</div>

Per le pianificazioni ricorrenti, il campo `frequency` accetta un'espressione cron standard (ad esempio `0 9 * * 1-5` per i giorni feriali alle 9:00 UTC).

<div id="scheduled-at">
  ## Programmato alle
</div>

Per le pianificazioni singole, il campo `scheduled_at` accetta una data e ora in formato ISO 8601 con fuso orario (ad esempio `2026-03-01T09:00:00Z`). La data e l'ora devono essere nel futuro. Dopo l'esecuzione, la pianificazione viene disabilitata automaticamente.

<div id="agent-types">
  ## Tipi di agenti
</div>

| Agente         | Descrizione                         |
| -------------- | ----------------------------------- |
| `devin`        | Agente Devin standard (predefinito) |
| `data_analyst` | Agente analista dati                |
| `advanced`     | Agente avanzato                     |

<div id="user-impersonation">
  ## Impersonificazione utente
</div>

Il parametro `create_as_user_id` consente di creare una pianificazione per conto di un altro utente. Ciò richiede che:

1. L'utente di servizio disponga dell'autorizzazione `ImpersonateOrgSessions`
2. L'utente di destinazione sia membro dell'organizzazione
3. L'utente di destinazione disponga dell'autorizzazione `UseDevinSessions`


## OpenAPI

````yaml it/v3-openapi.yaml POST /v3/organizations/{org_id}/schedules
openapi: 3.1.0
info:
  description: API Devin v3 con autenticazione utente di servizio e RBAC
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/organizations/{org_id}/schedules:
    post:
      tags:
        - schedules
      summary: Crea pianificazione
      description: Crea una nuova sessione pianificata.
      operationId: handle_create_schedule_v3_organizations__org_id__schedules_post
      parameters:
        - 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/ScheduleCreateRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduleResponse'
          description: Risposta positiva
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Errore di validazione
components:
  schemas:
    ScheduleCreateRequest:
      properties:
        agent:
          default: devin
          enum:
            - devin
            - data_analyst
          title: Agent
          type: string
        bypass_approval:
          default: false
          title: Bypass Approval
          type: boolean
        create_as_user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Create As User Id
        frequency:
          anyOf:
            - type: string
            - type: 'null'
          title: Frequency
        interval_count:
          default: 1
          title: Interval Count
          type: integer
        name:
          title: Name
          type: string
        notify_on:
          default: failure
          enum:
            - always
            - failure
            - never
          title: Notify On
          type: string
        platform:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Piattaforma VM per le sessioni generate da questa pianificazione (ad
            es. 'windows'). Se omessa, le sessioni usano la piattaforma
            predefinita dell'org al momento dell'attivazione. 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 delle
            piattaforme disponibili.
          title: Platform
        playbook_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Playbook Id
        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
        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
      required:
        - name
        - prompt
      title: ScheduleCreateRequest
      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 dell''utente del servizio (prefisso: cog_)'
      scheme: bearer
      type: http

````