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

# Actualizar programación

> Actualizar una programación existente.

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

Se requiere un usuario de servicio con el permiso `ManageOrgSchedules` a nivel de organización.

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

Todos los campos son opcionales. Solo se actualizarán los campos incluidos en el cuerpo de la solicitud. Para desactivar una programación, establece `enabled` en `false`.

Establecer `playbook_id` en `null` eliminará el playbook asociado.

Puedes cambiar el `schedule_type` entre `recurring` y `one_time`. Al cambiar a `one_time`, indica `scheduled_at` con una fecha y hora futura en formato ISO 8601. Al cambiar a `recurring`, indica `frequency` con una expresión cron válida.

<div id="execution-identity">
  ## Identidad de ejecución
</div>

El parámetro `run_as_user_id` controla con la identidad de qué usuario se ejecuta la programación. Cuando se activa una programación, las sesiones se crean bajo ese usuario: este recibe las notificaciones y la sesión aparece en su historial.

* **Establecer un usuario**: Proporciona un ID de usuario válido para cambiar la identidad de ejecución. Esto requiere:
  1. El usuario de servicio debe tener el permiso `ImpersonateOrgSessions`
  2. El usuario de destino debe ser miembro de la organización
  3. El usuario de destino debe tener el permiso `UseDevinSessions`
* **Borrar (establecer en `null`)**: Hace que la programación vuelva a ejecutarse como el usuario bot predeterminado
* **Omitir el campo**: Deja la identidad de ejecución actual sin cambios


## OpenAPI

````yaml es/v3-openapi.json PATCH /v3/organizations/{org_id}/schedules/{schedule_id}
openapi: 3.1.0
info:
  description: API v3 de Devin con autenticación de usuario de servicio y RBAC
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/organizations/{org_id}/schedules/{schedule_id}:
    patch:
      tags:
        - schedules
      summary: Actualizar programación
      description: Actualizar una programación existente.
      operationId: >-
        handle_update_schedule_v3_organizations__org_id__schedules__schedule_id__patch
      parameters:
        - description: 'ID de la programación (prefijo: sched-)'
          in: path
          name: schedule_id
          required: true
          schema:
            example: sched-abc123def456
            title: Schedule Id
            type: string
        - description: 'ID de la organización (prefijo: 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: Respuesta exitosa
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Error de validación
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: >-
            Plataforma de VM para las sesiones generadas por esta programación
            (p. ej., 'windows'). Si se omite, la plataforma no cambia. El valor
            debe coincidir con una plataforma configurada para la organización
            (sin distinguir mayúsculas de minúsculas); los valores desconocidos
            se rechazan con un 400 que enumera las etiquetas de plataforma
            disponibles.
          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: >-
            Establece el ID de usuario con el que se ejecutará esta
            programación. Requiere el permiso ImpersonateOrgSessions.
            Establecerlo en null revierte al usuario bot predeterminado. Omitir
            el campo deja la identidad actual sin cambios.
          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: 'Credencial de usuario de servicio (prefijo: cog_)'
      scheme: bearer
      type: http

````