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

# Update an authorization policy

> Updates a specified authorization policy.



## OpenAPI

````yaml /openapi.json put /policies/{reference}
openapi: 3.0.1
info:
  title: API
  version: '1.0'
servers:
  - url: https://api.smokeball.com
  - url: https://api.smokeball.com.au
  - url: https://api.smokeball.co.uk
  - url: https://stagingapi.smokeball.com
  - url: https://stagingapi.smokeball.com.au
  - url: https://stagingapi.smokeball.co.uk
security:
  - api-key: []
    token: []
paths:
  /policies/{reference}:
    put:
      tags:
        - Authorization
      summary: Update an authorization policy
      description: Updates a specified authorization policy.
      operationId: UpdatePolicy
      parameters:
        - name: reference
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json-patch+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/PolicyDto'
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/PolicyDto'
          application/*+json:
            schema:
              allOf:
                - $ref: '#/components/schemas/PolicyDto'
      responses:
        '202':
          description: >-
            When request is accepted. Returns a hypermedia 'Link' object of the
            authorization policy to be updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Link'
        '400':
          description: When request is invalid.
        '404':
          description: When authorization policy does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    PolicyDto:
      type: object
      properties:
        principalId:
          type: string
          description: "Principal id associated to this policy if it is a principal based policy. This can be either a user id or a group id.\r\n\r\nThis is null if the policy is a resource based policy."
          nullable: true
          example: a7922e80-f833-48f0-8250-c00df1ebbc16
        resourceId:
          type: string
          description: "Resource id associated to this policy if it is a resource based policy.\r\n\r\nThis is null if the policy is a principal based policy."
          nullable: true
          example: matters/54171794-5ca3-472b-889a-c03538d8c89a
        rules:
          type: array
          items:
            $ref: '#/components/schemas/RuleDto'
          description: The rules associated to this policy.
          nullable: true
      additionalProperties: false
    Link:
      type: object
      properties:
        id:
          type: string
          nullable: true
        href:
          type: string
          nullable: true
        relation:
          type: string
          nullable: true
        method:
          type: string
          default: GET
          nullable: true
      additionalProperties: false
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}
    RuleDto:
      type: object
      properties:
        principalId:
          type: string
          description: "Principal id associated to this rule if the rule is associated to a resource based policy. This can be either a user id or a group id.\r\n\r\nThis is null if the policy is a principal based policy."
          nullable: true
          example: a7922e80-f833-48f0-8250-c00df1ebbc16
        resourceId:
          type: string
          description: "Resource id associated to this rule if it is a principal based policy. \r\n\r\nFor matter based policies, use `matters/{matterId}` for a single matter or `matters` for all matters.\r\n\r\nThis is null if the associated policy is a resource based policy."
          nullable: true
          example: matters/69406c65-309d-4e35-a636-ad145e64770a
        operation:
          type: string
          description: "The operation associated to this rule.\r\n\r\nPossible values: 'Access','Execute'."
          example: Access
        type:
          allOf:
            - $ref: '#/components/schemas/AuthorizationPolicyType'
          description: "The type of the rule.\r\n            \r\nPossible values: 'Deny','Allow'."
      additionalProperties: false
    AuthorizationPolicyType:
      enum:
        - 0
        - 1
      type: integer
      format: int32
  securitySchemes:
    api-key:
      type: apiKey
      name: x-api-key
      in: header
    token:
      type: apiKey
      name: Authorization
      in: header
      x-amazon-apigateway-authtype: cognito_user_pools

````