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

# Desactivar política

> Desactiva una política por ID.



## OpenAPI

````yaml /es/api-reference/openapi.json delete /policies/{policy_id}
openapi: 3.0.0
info:
  title: API de Corgea
  version: 1.0.0
  description: >-
    API para interactuar con las funciones de escaneo y gestión de
    vulnerabilidades de Corgea
servers:
  - url: https://www.corgea.app/api/v1
    description: Servidor de producción
security:
  - CorgeaToken: []
  - BearerAuth: []
paths:
  /policies/{policy_id}:
    delete:
      tags:
        - Políticas
      summary: Desactivar política
      description: Desactiva una política por ID.
      operationId: deactivatePolicy
      parameters:
        - $ref: '#/components/parameters/PolicyId'
      responses:
        '200':
          description: Política desactivada correctamente
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
                  policy:
                    $ref: '#/components/schemas/Policy'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    PolicyId:
      name: policy_id
      in: path
      required: true
      schema:
        type: integer
      description: ID de la política
  schemas:
    Policy:
      type: object
      properties:
        id:
          type: integer
        policy_type:
          type: string
          enum:
            - BLAST
            - scan
            - false_positive
            - fix
        description:
          type: string
        cwes:
          type: array
          nullable: true
          items:
            type: string
        excludes:
          type: array
          nullable: true
          items:
            type: string
        projects:
          type: array
          nullable: true
          items:
            type: string
          description: >-
            Nombres de proyectos que definen el ámbito de la política. Un valor
            vacío o null significa que se aplica a toda la empresa.
        company:
          type: integer
        active:
          type: boolean
        approved:
          type: boolean
        approved_by:
          type: integer
          nullable: true
        created_at:
          type: string
          format: date-time
        glob_pattern:
          type: string
          nullable: true
        source_type:
          type: string
          example: Web
        repo_policy_file:
          type: integer
          nullable: true
        name:
          type: string
        guidance_text:
          type: string
          nullable: true
        version:
          type: integer
        archived:
          type: boolean
        parent_policy:
          type: integer
          nullable: true
        instruction_type:
          type: string
          enum:
            - overwrite
            - append
        read_only:
          type: boolean
        created_by_corgea:
          type: boolean
  responses:
    Unauthorized:
      description: Token no válido o ausente
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Missing or invalid authorization header
    Forbidden:
      description: Permiso denegado o función no disponible
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Permission denied
    NotFound:
      description: Recurso no encontrado
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Policy not found
  securitySchemes:
    CorgeaToken:
      type: apiKey
      in: header
      name: CORGEA-TOKEN
      description: Clave de API para la autenticación
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Token de acceso OAuth2 (JWT) en el encabezado Authorization

````