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

# Set an Organization policy

> Replaces all bindings when `If-Match` is the current etag; removing a member removes their access. Only an owner adds or removes `roles/owner`, and the last owner stays (422). Requests in its Workspaces see the change within 30 seconds.



## OpenAPI

````yaml /openapi-public.json post /organizations/{id}:setIamPolicy
openapi: 3.1.0
info:
  title: Akua API
  version: 1.0.0
  description: >-
    Manage installs and their asynchronous operations. Authenticate with a
    session bearer token and select a Workspace using Akua-Context.
  contact:
    name: Akua API support
    email: support@akua.dev
    url: https://docs.akua.dev/
servers:
  - url: https://api.akua.dev/v1
security: []
tags:
  - name: operations
  - name: installs
  - name: Organizations
  - name: Billing accounts
  - name: workspaces
  - name: regions
  - name: Dashboard Overview
  - name: products
  - name: offers
  - name: Order Drafts
  - name: packages
  - name: Auth
  - name: API Tokens
  - name: Quota adjustments
  - name: Workspace services
  - name: Vault connections
  - name: clusters
  - name: Node pools
  - name: Nodes
  - name: machines
  - name: Sandboxes
  - name: OpenCode Servers
  - name: vaults
  - name: vaultSecrets
paths:
  /organizations/{id}:setIamPolicy:
    post:
      tags:
        - Organizations
      summary: Set an Organization policy
      description: >-
        Replaces all bindings when `If-Match` is the current etag; removing a
        member removes their access. Only an owner adds or removes
        `roles/owner`, and the last owner stays (422). Requests in its
        Workspaces see the change within 30 seconds.
      operationId: organizations.setIamPolicy
      parameters:
        - name: id
          in: path
          schema:
            type: string
            minLength: 3
            maxLength: 54
          required: true
        - name: idempotency-key
          in: header
          schema:
            type: string
            minLength: 1
            maxLength: 64
            description: >-
              Optional caller-supplied idempotency key. Any non-empty key up to
              64 characters is accepted. Endpoint-specific documentation
              describes how the key is used.
            examples:
              - create-prod-2026-05-07
          required: false
        - name: if-match
          in: header
          schema:
            type: string
            minLength: 1
            maxLength: 256
            description: >-
              The `etag` of the resource version the client last read. Required
              on writes when the resource exposes an `etag` field. Mismatch
              returns 409 `ABORTED` with the current etag in the error metadata.
            examples:
              - '42'
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SetOrganizationIamPolicyRequest'
        required: true
      responses:
        '200':
          description: Policy
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Policy'
        '400':
          description: The request is malformed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiBadRequest'
        '401':
          description: Missing, invalid or expired credential.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnauthorized'
        '403':
          description: The credential may not act in this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiForbidden'
        '404':
          description: The resource was not found in this workspace.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiNotFound'
        '409':
          description: >-
            The resource changed since the etag the client sent; the current
            etag is in the metadata. | The idempotency key was already used for
            a different request.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ApiPreconditionFailed'
                  - $ref: '#/components/schemas/ApiIdempotencyConflict'
        '422':
          description: The request is well-formed but cannot be processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiUnprocessable'
        '503':
          description: The service is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiServiceUnavailable'
      security:
        - BearerAuth: []
components:
  schemas:
    SetOrganizationIamPolicyRequest:
      type: object
      properties:
        bindings:
          type: array
          items:
            $ref: '#/components/schemas/Binding'
          maxItems: 100
      required:
        - bindings
      additionalProperties: false
    Policy:
      type: object
      properties:
        bindings:
          type: array
          items:
            $ref: '#/components/schemas/Binding'
          maxItems: 100
        etag:
          type: string
          maxLength: 64
          description: Pass as `If-Match` on `setIamPolicy`. OUTPUT_ONLY.
      required:
        - bindings
        - etag
      additionalProperties: false
    ApiBadRequest:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Validation
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiUnauthorized:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Unauthorized
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiForbidden:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Forbidden
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiNotFound:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - NotFound
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiPreconditionFailed:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - PreconditionFailed
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - type: object
              properties:
                code:
                  type: number
                  enum:
                    - 7006
                message:
                  type: string
                metadata:
                  type: object
                  properties:
                    current_etag:
                      type: string
                  required:
                    - current_etag
                  allOf:
                    - type: object
                      additionalProperties:
                        type: string
              required:
                - code
                - message
                - metadata
              additionalProperties: false
          maxItems: 1
          minItems: 1
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiIdempotencyConflict:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - IdempotencyConflict
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiUnprocessable:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - Unprocessable
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    ApiServiceUnavailable:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - ServiceUnavailable
        success:
          type: boolean
          enum:
            - false
        errors:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/ApiErrorEntry'
          minItems: 1
          items:
            $ref: '#/components/schemas/ApiErrorEntry'
        result:
          type: object
          additionalProperties: false
      required:
        - _tag
        - success
        - errors
        - result
      additionalProperties: false
    Binding:
      type: object
      properties:
        role:
          $ref: '#/components/schemas/RoleName'
        members:
          type: array
          prefixItems:
            - $ref: '#/components/schemas/Member'
          minItems: 1
          items:
            $ref: '#/components/schemas/Member'
          maxItems: 64
        condition:
          $ref: '#/components/schemas/BindingCondition'
      required:
        - role
        - members
      additionalProperties: false
    ApiErrorEntry:
      type: object
      properties:
        code:
          type: integer
          minimum: -9007199254740991
          maximum: 9007199254740991
          description: Machine-readable error code
          examples:
            - 7002
        message:
          type: string
          description: Human-readable error message
          examples:
            - Resource not found
        path:
          type: array
          items:
            type: string
          description: Field path that caused the error, when applicable
          examples:
            - - body
              - name
        metadata:
          type: object
          additionalProperties:
            type: string
      required:
        - code
        - message
      additionalProperties: false
    RoleName:
      type: string
      pattern: >-
        ^roles\/(owner|admin|member|viewer|[a-z][a-z0-9-]{0,62}\.[a-z][A-Za-z]{0,62})$
      title: RoleName
      description: >-
        A basic role `roles/<name>` or a predefined role
        `roles/<service>.<role>`
      examples:
        - roles/admin
        - roles/vault.secretAccessor
    Member:
      type: string
      pattern: >-
        ^(user:[^\s]{1,64}|service:[a-z][a-z0-9-]{0,62}|(?:workload|workforce):[a-z][a-z0-9-]{0,62}\/[A-Za-z0-9_-]{1,128})$
      title: Member
      description: >-
        A person (`user:<id>`), service agent (`service:<name>`), workload
        (`workload:<pool>/<id>`) or workforce identity
        (`workforce:<pool>/<subject>`)
      examples:
        - user:usr_j572abc
        - service:placement
    BindingCondition:
      type: object
      properties:
        title:
          type: string
          minLength: 1
          maxLength: 100
        description:
          type: string
          maxLength: 512
        expires_at:
          type: integer
          minimum: 0
          maximum: 9007199254740991
          description: Unix timestamp (seconds)
        operations:
          type: array
          prefixItems:
            - type: string
              pattern: ^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$
              maxLength: 96
          minItems: 1
          items:
            type: string
            pattern: ^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$
            maxLength: 96
          maxItems: 100
      required:
        - title
      additionalProperties: false
  securitySchemes:
    BearerAuth:
      description: Bearer token for the authenticated caller.
      type: http
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.