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

# Update Policy

> Updates an existing data policy.



## OpenAPI

````yaml openapi_v5.yaml put /dataplans/policies/v1
openapi: 3.0.0
info:
  title: ''
  version: 1.0.0
servers:
  - url: https://api.coralogix.com/mgmt/openapi/5
  - url: https://api.eu2.coralogix.com/mgmt/openapi/5
  - url: https://api.coralogix.us/mgmt/openapi/5
  - url: https://api.cx498.coralogix.com/mgmt/openapi/5
  - url: https://api.coralogix.in/mgmt/openapi/5
  - url: https://api.coralogixsg.com/mgmt/openapi/5
  - url: https://api.ap3.coralogix.com/mgmt/openapi/5
security:
  - apiKeyAuth: []
tags:
  - name: AI Applications Service
    description: Manage the catalog of AI applications discovered from spans.
    externalDocs:
      url: ''
  - name: AI Evaluations Service
    description: >-
      Manage AI evaluations and the custom evaluation catalog for AI
      applications.
    externalDocs:
      url: ''
  - name: API Keys Admin Service
    description: Administrative operations for API Keys management.
    externalDocs:
      url: ''
  - name: API Keys Service
    description: Manage your API Keys.
    externalDocs:
      url: ''
  - name: Actions Service
    description: View and manage your Actions.
    externalDocs:
      url: ''
  - name: Alert Scheduler Rule service
    description: Manage your alert scheduler rules.
    externalDocs:
      url: ''
  - name: Alert definitions service
    description: >-
      View and manage your alerts using alert definitions - data structures that
      contain the configuration required to create an alert.
    externalDocs:
      description: Learn more about alerts in our documentation
      url: https://coralogix.com/docs/user-guides/alerting/introduction-to-alerts/
  - name: Alert events service
    description: >-
      Get information regarding your alert events - instances of alerts being
      triggered.
    externalDocs:
      description: Learn more about alert events and incidents in our documentation.
      url: https://coralogix.com/docs/user-guides/alerting/incidents/
  - name: Case Events service
    description: Manage case events, comments, and external thread synchronization.
    externalDocs:
      url: ''
  - name: Case Settings service
    description: Manage case settings team configurations.
    externalDocs:
      url: ''
  - name: Cases notification service
    description: Track notification adjacent data for cases.
    externalDocs:
      url: ''
  - name: Cases service
    description: >-
      Manage cases throughout their lifecycle. Create, view, assign,
      acknowledge, unacknowledge, resolve, and close cases to streamline
      investigations and follow-ups.
    externalDocs:
      description: Learn more about Cases in our documentation
      url: https://coralogix.com/docs/user-guides/cases/
  - name: Connector Schema service
    description: Retrieve connector schemas for notification center integrations
    externalDocs:
      description: Learn more about connectors in our documentation
      url: >-
        https://coralogix.com/docs/user-guides/notification-center/connectors/introduction/
  - name: Connectors service
    description: >-
      View and manage your connectors - integration instances for notification
      destinations
    externalDocs:
      description: Lean more about connectors in our documentation
      url: >-
        https://coralogix.com/docs/user-guides/notification-center/connectors/introduction/
  - name: Contextual data integration service
    description: Query for contextual data integration information.
    externalDocs:
      url: ''
  - name: Custom Enrichments Service
    description: Manage your enrichments.
    externalDocs:
      url: ''
  - name: Dashboard folders service
    description: Manage your dashboard folders.
    externalDocs:
      url: ''
  - name: Dashboard service
    description: Get information about the Coralogix Dashboard catalog.
    externalDocs:
      url: ''
  - name: Data Usage Query service
    description: >-
      Query billable data usage through the public Coralogix API using daily or
      hourly bucketed aggregations over supported labels.
    externalDocs:
      url: ''
  - name: Data Usage Service
    description: A service to manage data usage metrics.
    externalDocs:
      url: ''
  - name: Enrichments Service
    description: Manage your enrichments.
    externalDocs:
      url: ''
  - name: Entities service
    description: Query information about registered entities in the notification center
    externalDocs:
      description: Lean more about the notification center in our documentation
      url: https://coralogix.com/docs/user-guides/notification-center/introduction/
  - name: Events Service
    description: A service for querying events.
    externalDocs:
      description: Learn more about alerts in our documentation
      url: https://coralogix.com/docs/user-guides/alerting/introduction-to-alerts/
  - name: Events2Metrics Service
    description: Manage your events2metrics.
    externalDocs:
      url: ''
  - name: Extension deployment service
    description: A service that enables querying for extension deployment information.
    externalDocs:
      description: Find out more about extensions in our documentation.
      url: https://coralogix.com/docs/integrations/extensions/
  - name: Extension service
    description: A service that enables querying for extension information.
    externalDocs:
      description: Learn more about extensions in our documentation.
      url: https://coralogix.com/docs/integrations/extensions/
  - name: Folders for views service
    description: Create and manage view folders.
    externalDocs:
      url: ''
  - name: Global routers service
    description: >-
      View and manage your global routers - entities that direct notifications
      to configured destinations based on conditions
    externalDocs:
      description: Lean more about global routers in our documentation
      url: >-
        https://coralogix.com/docs/user-guides/notification-center/routing/introduction/
  - name: IP access service
    description: >-
      IP access service provides the API for managing company IP access
      settings.
    externalDocs:
      url: ''
  - name: Incidents service
    description: >-
      Handle all operations related to incident management within Coralogix.
      Identify, manage, and resolve incidents efficiently through automated
      workflows and team collaboration.
    externalDocs:
      description: Find out more about incident management in our documentation
      url: https://coralogix.com/docs/user-guides/alerting/incidents/
  - name: Integration service
    description: A service that enables querying for integration information.
    externalDocs:
      description: Find out more about integrations in our documentation.
      url: https://coralogix.com/docs/integrations/getting-started/
  - name: Metrics Data Archive Service
    description: View and manage your storage targets for metrics.
    externalDocs:
      description: Find out more about archives
      url: >-
        https://coralogix.com/docs/user-guides/data-flow/s3-archive/connect-s3-archive/
  - name: Notifications testing service
    description: >-
      Test your notification center configurations including connectors,
      presets, and templates
    externalDocs:
      description: Lean more about the notification center in our documentation
      url: https://coralogix.com/docs/user-guides/notification-center/introduction/
  - name: Outgoing webhooks service
    externalDocs:
      description: Find out more about outbound webhooks in our documentation.
      url: >-
        https://coralogix.com/docs/user-guides/alerting/outbound-webhooks/generic-outbound-webhooks-alert-webhooks/
  - name: Policies Service
    description: View and manage your TCO policies
    externalDocs:
      url: ''
  - name: Presets service
    description: >-
      View and manage your presets - pre-configured templates for notification
      content rendering
    externalDocs:
      description: Lean more about presets in our documentation
      url: >-
        https://coralogix.com/docs/user-guides/notification-center/presets/introduction/
  - name: Quota Allocation Rule Set service
    description: Manage quota allocation rules for different entity types.
    externalDocs:
      url: ''
  - name: Recording Rules Service
    description: A service to manage recording rules.
    externalDocs:
      url: ''
  - name: Retentions Service
    description: View and manage retentions
    externalDocs:
      url: ''
  - name: Role Management Service
    description: Service for managing system and custom roles.
    externalDocs:
      url: ''
  - name: Rule Groups Service
    description: A service to manage rule groups.
    externalDocs:
      url: ''
  - name: SAML Configuration Service
    description: Manage your SAML configuration
    externalDocs:
      url: ''
  - name: Scopes Service
    description: A service to manage scopes
    externalDocs:
      url: ''
  - name: Slos Service
    description: A service for managing Service Level Objectives (SLOs).
    externalDocs:
      url: ''
  - name: Target Service
    description: View and manage your storage targets for logs.
    externalDocs:
      description: Find out more about archives
      url: >-
        https://coralogix.com/docs/user-guides/data-flow/s3-archive/connect-s3-archive/
  - name: Team Groups Management Service
    description: Manage Team Groups.
    externalDocs:
      url: ''
  - name: Users Management Service
    description: >-
      Manage team members (users) including creation, updates, search, and
      status management.
    externalDocs:
      url: ''
  - name: Views service
    description: Create and manage views.
    externalDocs:
      url: ''
paths:
  /dataplans/policies/v1:
    put:
      tags:
        - Policies Service
      summary: Update Policy
      description: Updates an existing data policy.
      operationId: PoliciesService_UpdatePolicy
      requestBody:
        content:
          application/json:
            schema:
              description: This data structue is used to update an existing policy.
              oneOf:
                - required:
                    - logRules
                  type: object
                - required:
                    - spanRules
                  type: object
                - required:
                    - rumRules
                  type: object
                - type: object
                  not:
                    anyOf:
                      - required:
                          - logRules
                        type: object
                      - required:
                          - spanRules
                        type: object
                      - required:
                          - rumRules
                        type: object
              properties:
                applicationRule:
                  $ref: '#/components/schemas/quota.v1.Rule'
                archiveRetention:
                  $ref: '#/components/schemas/ArchiveRetention'
                description:
                  minLength: 0
                  type: string
                  description: Optional free-text description of the policy's purpose.
                  example: My Policy Description
                enabled:
                  type: boolean
                  description: >-
                    Indicates whether the policy should be actively evaluated
                    and applied.
                  example: true
                id:
                  minLength: 0
                  type: string
                  description: Unique identifier of the policy to update.
                  example: policy_id
                logRules:
                  $ref: '#/components/schemas/LogRules'
                name:
                  minLength: 0
                  type: string
                  description: Human-readable name for the policy.
                  example: My Policy
                priority:
                  $ref: '#/components/schemas/quota.v1.Priority'
                priorityOverride:
                  $ref: '#/components/schemas/PriorityOverride'
                rumRules:
                  $ref: '#/components/schemas/LogRules'
                spanRules:
                  $ref: '#/components/schemas/SpanRules'
                subsystemRule:
                  $ref: '#/components/schemas/quota.v1.Rule'
                targets:
                  minItems: 0
                  type: array
                  items:
                    $ref: '#/components/schemas/v1.Target'
                  description: >-
                    List of data targets/destinations to which this policy
                    routes data.
              required:
                - id
              title: Update Policy Request
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdatePolicyResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unauthorized request
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Internal server error
      externalDocs:
        url: ''
components:
  schemas:
    quota.v1.Rule:
      type: object
      properties:
        name:
          minLength: 0
          type: string
          description: Display name.
        ruleTypeId:
          $ref: '#/components/schemas/RuleTypeId'
      description: Rule.
      externalDocs:
        url: ''
    ArchiveRetention:
      type: object
      properties:
        id:
          minLength: 0
          type: string
          description: Unique identifier.
      description: Archive retention.
      externalDocs:
        url: ''
    LogRules:
      title: Log Rules
      required:
        - severities
      type: object
      properties:
        dpxlExpression:
          minLength: 0
          type: string
          description: The dpxl expression.
        severities:
          minItems: 0
          type: array
          items:
            $ref: '#/components/schemas/quota.v1.Severity'
          description: The severities.
      description: Log rules for a policy.
      externalDocs:
        description: Find out more about quota management.
        url: >-
          https://coralogix.com/docs/user-guides/account-management/payment-and-billing/quota-management/
    quota.v1.Priority:
      enum:
        - PRIORITY_TYPE_UNSPECIFIED
        - PRIORITY_TYPE_BLOCK
        - PRIORITY_TYPE_LOW
        - PRIORITY_TYPE_MEDIUM
        - PRIORITY_TYPE_HIGH
      type: string
      description: >-
        TCO priority level assigned to a policy, controlling how data is routed
        and archived.
    PriorityOverride:
      type: object
      properties:
        quotaBased:
          $ref: '#/components/schemas/QuotaBased'
      description: Priority override.
      externalDocs:
        url: ''
    SpanRules:
      type: object
      properties:
        actionRule:
          $ref: '#/components/schemas/quota.v1.Rule'
        dpxlExpression:
          maxLength: 4096
          minLength: 1
          pattern: ^[\s\S]*$
          type: string
          description: The dpxl expression.
        serviceRule:
          $ref: '#/components/schemas/quota.v1.Rule'
        tagRules:
          minItems: 0
          type: array
          items:
            $ref: '#/components/schemas/TagRule'
          description: The tag rules.
      description: Span rules.
      externalDocs:
        url: ''
    v1.Target:
      title: Target
      type: object
      properties:
        archiveRetention:
          $ref: '#/components/schemas/ArchiveRetention'
        dataset:
          minLength: 0
          type: string
          description: The dataset.
          example: dataset1
        dataspace:
          maxLength: 50
          minLength: 1
          pattern: ^[A-Za-z](?:[A-Za-z0-9_]|\.[A-Za-z0-9_])*$
          type: string
          description: The dataspace.
          example: dataspace1
        priority:
          $ref: '#/components/schemas/quota.v1.Priority'
        priorityOverride:
          $ref: '#/components/schemas/PriorityOverride'
      description: >-
        This data structure represents a target for quota policies. It defines a
        named group of datasets with a priority level and optional archive
        retention configuration.
      externalDocs:
        description: Find out more about quota management.
        url: >-
          https://coralogix.com/docs/user-guides/account-management/payment-and-billing/quota-management/
    UpdatePolicyResponse:
      title: Update Policy Response
      required:
        - policy
      type: object
      properties:
        policy:
          $ref: '#/components/schemas/Policy'
      description: This data structue is obtained when updating a policy.
      externalDocs:
        description: Find out more about quota management.
        url: >-
          https://coralogix.com/docs/user-guides/account-management/payment-and-billing/quota-management/
    Error:
      type: object
      properties:
        code:
          maximum: 599
          minimum: 100
          type: integer
          description: HTTP status code of the error (for example 400, 404, 500).
          format: int32
        message:
          maxLength: 4096
          minLength: 0
          pattern: ^[\s\S]*$
          type: string
          description: Human-readable description of the error.
      description: Standard error response body returned for a failed request.
    RuleTypeId:
      enum:
        - RULE_TYPE_ID_UNSPECIFIED
        - RULE_TYPE_ID_IS
        - RULE_TYPE_ID_IS_NOT
        - RULE_TYPE_ID_START_WITH
        - RULE_TYPE_ID_INCLUDES
      type: string
      description: Rule type id.
    quota.v1.Severity:
      enum:
        - SEVERITY_UNSPECIFIED
        - SEVERITY_DEBUG
        - SEVERITY_VERBOSE
        - SEVERITY_INFO
        - SEVERITY_WARNING
        - SEVERITY_ERROR
        - SEVERITY_CRITICAL
      type: string
    QuotaBased:
      type: object
      properties:
        usageTiers:
          minItems: 0
          type: array
          items:
            $ref: '#/components/schemas/UsageTier'
          description: >-
            Ordered list of usage tiers that map daily quota consumption
            percentages to priority levels.
      description: Quota based.
      externalDocs:
        url: ''
    TagRule:
      title: Tag Rule
      required:
        - ruleTypeId
        - tagName
        - tagValue
      type: object
      properties:
        ruleTypeId:
          $ref: '#/components/schemas/RuleTypeId'
        tagName:
          minLength: 0
          type: string
          description: The tag name.
          example: tag_name
        tagValue:
          minLength: 0
          type: string
          description: The tag value.
          example: tag_value
      description: Tag rule for a policy.
      externalDocs:
        description: Find out more about quota management.
        url: >-
          https://coralogix.com/docs/user-guides/account-management/payment-and-billing/quota-management/
    Policy:
      title: Policy
      required:
        - id
        - companyId
        - name
        - priority
        - deleted
        - enabled
        - order
      type: object
      oneOf:
        - required:
            - logRules
          type: object
        - required:
            - spanRules
          type: object
        - required:
            - rumRules
          type: object
        - type: object
          not:
            anyOf:
              - required:
                  - logRules
                type: object
              - required:
                  - spanRules
                type: object
              - required:
                  - rumRules
                type: object
      properties:
        applicationRule:
          $ref: '#/components/schemas/quota.v1.Rule'
        archiveRetention:
          $ref: '#/components/schemas/ArchiveRetention'
        companyId:
          type: integer
          description: Internal Coralogix company/team identifier that owns this policy.
          format: int32
          example: 1234
        createdAt:
          minLength: 0
          type: string
          description: Timestamp (RFC 3339) when the policy was created.
          example: '2021-01-01T00:00:00.000Z'
        deleted:
          type: boolean
          description: >-
            Soft-delete marker; when true the policy has been deleted and is no
            longer applied.
          example: false
        description:
          minLength: 0
          type: string
          description: Optional free-text description of the policy's purpose.
          example: My Policy Description
        enabled:
          type: boolean
          description: Indicates whether the policy is actively evaluated and applied.
          example: true
        id:
          minLength: 0
          type: string
          description: Unique identifier for the policy.
          example: policy_id
        logRules:
          $ref: '#/components/schemas/LogRules'
        name:
          minLength: 0
          type: string
          description: Human-readable name for the policy.
          example: My Policy
        order:
          type: integer
          description: >-
            Ordering priority that determines the sequence in which policies are
            evaluated.
          format: int32
          example: 1
        priority:
          $ref: '#/components/schemas/quota.v1.Priority'
        priorityOverride:
          $ref: '#/components/schemas/PriorityOverride'
        priorityOverrideStatus:
          $ref: '#/components/schemas/PriorityOverrideStatus'
        rumRules:
          $ref: '#/components/schemas/LogRules'
        spanRules:
          $ref: '#/components/schemas/SpanRules'
        subsystemRule:
          $ref: '#/components/schemas/quota.v1.Rule'
        targets:
          minItems: 0
          type: array
          items:
            $ref: '#/components/schemas/v1.Target'
          description: List of data targets/destinations to which this policy routes data.
        updatedAt:
          minLength: 0
          type: string
          description: Timestamp (RFC 3339) when the policy was last updated.
          example: '2021-01-01T00:00:00.000Z'
      description: >-
        A policy is a set of rules that define the behavior of the Coralogix
        system for a specific company.
      externalDocs:
        description: Find out more about quota management.
        url: >-
          https://coralogix.com/docs/user-guides/account-management/payment-and-billing/quota-management/
    UsageTier:
      type: object
      properties:
        dailyQuotaPercentage:
          type: number
          description: The daily quota percentage.
          format: double
          example: 80
        priority:
          $ref: '#/components/schemas/quota.v1.Priority'
    PriorityOverrideStatus:
      type: object
      properties:
        quotaBased:
          $ref: '#/components/schemas/QuotaBasedStatus'
      description: Priority override status.
      externalDocs:
        url: ''
    QuotaBasedStatus:
      type: object
      properties:
        currentPriority:
          $ref: '#/components/schemas/quota.v1.Priority'
        currentUsage:
          type: number
          description: The current usage.
          format: double
        dailyLimit:
          type: number
          description: The daily limit.
          format: double
      description: Quota based status.
      externalDocs:
        url: ''
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: API key authentication

````