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

# Replace a policy's application list

> Replaces the set of applications attached to a policy. The provided list fully overwrites the policy's current applications (it is not additive).



## OpenAPI

````yaml PUT /api/v1/policies/{policy_id}/applications
openapi: 3.0.0
info:
  description: REST API for AccessOwl third-party integrations
  title: AccessOwl API
  version: 1.0.0
servers:
  - url: https://api.accessowl.com
    variables: {}
security:
  - bearer: []
tags: []
paths:
  /api/v1/policies/{policy_id}/applications:
    put:
      tags:
        - policies
      summary: Replace a policy's application list
      description: >-
        Replaces the set of applications attached to a policy. The provided list
        fully overwrites the policy's current applications (it is not additive).
      operationId: AccessOwlApi.PolicyController.set_applications
      parameters:
        - description: >-
            Optional key (1–255 chars) for safely retrying a request. Reusing
            the same key for the same request returns `409 Conflict` and is not
            processed again — this confirms the request was already received.
            Keys are retained for 14 days.
          in: header
          name: Idempotency-Key
          required: false
          schema:
            maxLength: 255
            minLength: 1
            type: string
        - description: ''
          in: path
          name: policy_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetApplications'
        description: Set applications parameters
        required: false
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
          description: Policy
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Stale entry
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          description: Validation error
      callbacks: {}
components:
  schemas:
    SetApplications:
      description: >-
        Replaces a policy's complete application list. `application_ids` fully
        replace the policy's applications (empty list clears them).
      example:
        application_ids:
          - 7488a646-e31f-11e4-aace-600308960670
        elevated: false
      properties:
        application_ids:
          description: The complete set of application IDs for this policy.
          items:
            format: uuid
            type: string
          type: array
        elevated:
          default: false
          description: When true, the policy applies only to elevated access requests.
          type: boolean
      required:
        - application_ids
      title: SetApplications
      type: object
    Policy:
      description: >-
        A policy that gates access requests for a list of applications. When
        elevated, the policy applies only to elevated access requests; otherwise
        it applies to all access requests. Assign applications via PUT
        /policies/{id}/applications.
      example:
        application_ids:
          - 8599b757-f42a-22f5-bbdf-711419071781
        default_policy: false
        elevated: false
        id: 7488a646-e31f-11e4-aace-600308960670
        inserted_at: '2023-01-01T00:00:00Z'
        lock_version: 1
        title: Engineering manager approval
        updated_at: '2023-01-01T00:00:00Z'
      properties:
        application_ids:
          description: IDs of the applications this policy applies to
          items:
            format: uuid
            type: string
          type: array
        default_policy:
          description: Whether this is the default policy
          type: boolean
        elevated:
          description: When true, the policy applies only to elevated access requests
          type: boolean
        id:
          description: Policy ID
          format: uuid
          type: string
        inserted_at:
          format: date-time
          type: string
        lock_version:
          description: Optimistic lock version
          type: integer
        title:
          description: Policy title
          type: string
        updated_at:
          format: date-time
          type: string
      required:
        - id
        - title
        - default_policy
        - elevated
      title: Policy
      type: object
    Error:
      description: Standard error response
      example:
        error: not_found
        message: Resource not found
      properties:
        error:
          description: Error code
          example: not_found
          type: string
        errors:
          additionalProperties:
            items:
              type: string
            type: array
          description: Field-specific validation errors (only for 422 responses)
          example:
            email:
              - has invalid format
            first_name:
              - can't be blank
          type: object
        message:
          description: Human-readable error message
          example: Resource not found
          type: string
      required:
        - error
        - message
      title: Error
      type: object
  securitySchemes:
    bearer:
      description: >-
        Bearer token authentication. Pass your AccessOwl API token in the
        `Authorization` header as `Bearer <token>`.
      scheme: bearer
      type: http

````