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

# Change access policies



## OpenAPI

````yaml /api-reference/openapi.json put /api/v1/access-control
openapi: 3.1.0
info:
  description: >-
    Airship runs every GitHub Actions job on a fresh machine in your own cloud
    account, configured by an `airship.yaml` in each repository.


    This reference covers the token-authenticated API for scripting Airship
    itself: activating repositories, connecting clouds and editing runner access
    policies. Create a token under **API keys** in the dashboard and send it as
    `Authorization: Bearer asa_...`.
  title: Airship developer API
  version: 1.0.0
servers:
  - description: Airship
    url: https://api.airshipci.com
  - description: A control plane you run yourself
    url: https://{host}
    variables:
      host:
        default: api.example.com
security:
  - apiToken: []
tags:
  - description: Scripting Airship with a token from the dashboard.
    name: Developer API
paths:
  /api/v1/access-control:
    put:
      tags:
        - Developer API
      summary: Change access policies
      operationId: compatUpdateAccessControl
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAccessControl'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccessControlUpdate'
          description: OK
        default:
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ErrorModel'
          description: Error
      security:
        - apiToken: []
components:
  schemas:
    UpdateAccessControl:
      additionalProperties: false
      properties:
        org:
          description: Organization; must match the token's
          maxLength: 100
          type: string
        repository_resource_access:
          description: Changes to apply
          items:
            $ref: '#/components/schemas/RepositoryResourceAccess'
          maxItems: 50
          minItems: 1
          type:
            - array
            - 'null'
      required:
        - repository_resource_access
      type: object
    AccessControlUpdate:
      additionalProperties: false
      properties:
        access_yml:
          $ref: '#/components/schemas/AccessDocument'
          description: The file as proposed
        branch:
          description: Branch the change was pushed to
          type: string
        pull_request_url:
          description: Pull request to review and merge
          type: string
      required:
        - pull_request_url
        - branch
        - access_yml
      type: object
    ErrorModel:
      additionalProperties: false
      properties:
        detail:
          description: >-
            A human-readable explanation specific to this occurrence of the
            problem.
          examples:
            - Property foo is required but is missing.
          type: string
        errors:
          description: Optional list of individual error details
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type:
            - array
            - 'null'
        instance:
          description: >-
            A URI reference that identifies the specific occurrence of the
            problem.
          examples:
            - https://example.com/error-log/abc123
          format: uri
          type: string
        status:
          description: HTTP status code
          examples:
            - 400
          format: int64
          type: integer
        title:
          description: >-
            A short, human-readable summary of the problem type. This value
            should not change between occurrences of the error.
          examples:
            - Bad Request
          type: string
        type:
          default: about:blank
          description: A URI reference to human-readable documentation for the error.
          examples:
            - https://example.com/errors/example
          format: uri
          type: string
      type: object
    RepositoryResourceAccess:
      additionalProperties: false
      properties:
        action:
          default: add
          description: add grants, remove revokes
          enum:
            - add
            - remove
          type: string
        policy_args:
          additionalProperties: {}
          description: 'Policy options, such as {"pull_request": true}'
          maxProperties: 5
          type: object
        repository:
          description: Repository name, with or without the organization
          maxLength: 200
          minLength: 1
          type: string
        resources:
          description: Runner names from airship.global.yaml
          items:
            type: string
          maxItems: 100
          minItems: 1
          type:
            - array
            - 'null'
        roles:
          description: Repository roles allowed
          items:
            type: string
          maxItems: 20
          type:
            - array
            - 'null'
        teams:
          description: Team slugs allowed
          items:
            type: string
          maxItems: 100
          type:
            - array
            - 'null'
        users:
          description: GitHub logins allowed
          items:
            type: string
          maxItems: 500
          type:
            - array
            - 'null'
        users_from_json:
          description: Not supported; refused
          type: string
      required:
        - repository
        - resources
      type: object
    AccessDocument:
      additionalProperties: false
      properties:
        access_control:
          items:
            $ref: '#/components/schemas/AccessRule'
          type:
            - array
            - 'null'
        policies:
          items:
            $ref: '#/components/schemas/PolicyDocument'
          type:
            - array
            - 'null'
        version:
          format: int64
          type: integer
      required:
        - version
        - policies
        - access_control
      type: object
    ErrorDetail:
      additionalProperties: false
      properties:
        location:
          description: >-
            Where the error occurred, e.g. 'body.items[3].tags' or
            'path.thing-id'
          type: string
        message:
          description: Error message text
          type: string
        value:
          description: The value at the given location
      type: object
    AccessRule:
      additionalProperties: false
      properties:
        policies:
          items:
            type: string
          type:
            - array
            - 'null'
        resource:
          type: string
      required:
        - resource
        - policies
      type: object
    PolicyDocument:
      additionalProperties: false
      properties:
        id:
          type: string
        pull_request:
          type: boolean
        repo:
          type: string
        roles:
          items:
            type: string
          type:
            - array
            - 'null'
        teams:
          items:
            type: string
          type:
            - array
            - 'null'
        users:
          items:
            type: string
          type:
            - array
            - 'null'
      required:
        - id
        - repo
      type: object
  securitySchemes:
    apiToken:
      description: >-
        Developer API token (asa_...), created by an organization owner in the
        dashboard.
      scheme: bearer
      type: http

````

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