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

# Set Agent Allow List

> Set the list of projects the Agent will be restricted to only when the agent has the property `restrictedAccess` set to true. If projects are empty, this will remove all projects the agent is restricted to, effectively making the agent inaccessible to any project when the agent property has `restrictedAccess` set to true.

Please keep in mind that by using endpoint you are setting the allow list and so this will overwrite any previously set values, if you want to simply update the existing allow list please refer to the PATCH endpoint.

NOTE: Whilst the Agent property `restrictedAccess` is set to false, any amendments will not be enforced until `restrictedAccess` is set to true.



## OpenAPI

````yaml /openapi/public-api-endpoint-reference.yaml put /v1/agents/{agentId}/allowlist
openapi: 3.1.0
info:
  title: Maia Public REST API
  version: '1.0'
servers:
  - description: EU1
    url: https://eu1.api.matillion.com/dpc
  - description: US1
    url: https://us1.api.matillion.com/dpc
security:
  - bearerAuth: []
tags:
  - description: Manage Schedules
    name: Schedules
  - description: Manage Connections
    name: Connections
  - description: Operations for managing Project Variables
    name: Project Variables
  - description: Manage Pipelines
    name: Pipelines
  - description: Review pipelines against quality rules
    name: Pipeline Quality Review
  - description: Execute tests within a project
    name: Test Execution
  - description: Manage your AI agent tasks
    name: AI Agent Tasks
  - description: SCIM endpoints for user/group permission management
    name: Directory Integration
  - description: Publish shared pipeline artifacts
    name: Shared Pipeline Artifacts
  - description: Manage Repositories
    name: Repositories
  - description: Report on Credit Consumption
    name: Consumption
  - description: Manage Artifacts
    name: Artifacts
  - description: Operations for data lineage and governance
    name: Data Lineage
  - description: Manage Streaming Pipelines
    name: Streaming Pipelines
  - description: Execute a pipeline
    name: Pipeline Execution
  - description: ''
    name: Environments
  - description: ''
    name: Projects
  - description: Manage Agents
    name: Agents
  - description: Operations for managing Environment-level Overrides of Project Variables
    name: Project Variable Environment Overrides
  - description: Query audit events
    name: Audit Events
  - description: Connector Profiles
    name: Connectors
paths:
  /v1/agents/{agentId}/allowlist:
    put:
      tags:
        - Agents
      summary: Set Agent Allow List
      description: >-
        Set the list of projects the Agent will be restricted to only when the
        agent has the property `restrictedAccess` set to true. If projects are
        empty, this will remove all projects the agent is restricted to,
        effectively making the agent inaccessible to any project when the agent
        property has `restrictedAccess` set to true.


        Please keep in mind that by using endpoint you are setting the allow
        list and so this will overwrite any previously set values, if you want
        to simply update the existing allow list please refer to the PATCH
        endpoint.


        NOTE: Whilst the Agent property `restrictedAccess` is set to false, any
        amendments will not be enforced until `restrictedAccess` is set to true.
      operationId: setAgentAccessList
      parameters:
        - description: The ID of the agent having the allow list set
          in: path
          name: agentId
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            examples:
              Mixed projects:
                description: >-
                  An example request to set two projects: one with environments,
                  one without
                value:
                  projects:
                    3fa85f64-5717-4562-b3fc-2c963f66afa6:
                      environments:
                        - dev
                        - prod
                    1398aa31-af57-4a6a-9752-27c2e8556c3f: {}
              Project with environments:
                description: An example request to set a project with specific environments
                value:
                  projects:
                    3fa85f64-5717-4562-b3fc-2c963f66afa6:
                      environments:
                        - dev
                        - prod
              Project with no environments:
                description: >-
                  An example request to set a project with no specific
                  environments (empty object)
                value:
                  projects:
                    3fa85f64-5717-4562-b3fc-2c963f66afa6: {}
              Set Agent Access Request Without Projects:
                description: An empty request to clear the Agent's Allow list
                value:
                  projects: {}
            schema:
              $ref: '#/components/schemas/SetAgentAccessRequest'
        required: true
      responses:
        '202':
          description: Agent allow list successfully updated
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
                example:
                  type: https://api.matillion.com/problems/bad-request
                  title: Bad request
                  status: 400
                  detail: Invalid request format. Please check your request body.
                  instance: /v1/agents/{agentId}/allowlist
          description: Invalid request body used
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
                example:
                  type: https://api.matillion.com/problems/forbidden
                  title: Forbidden
                  status: 403
                  detail: You do not have permission to access this resource.
                  instance: /v1/agents/{agentId}/allowlist
          description: Forbidden
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
                example:
                  type: https://api.matillion.com/problems/not-found
                  title: Not Found
                  status: 404
                  detail: None found
                  instance: /v1/agents/{agentId}/allowlist
          description: Agent not found
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
                example:
                  type: https://api.matillion.com/problems/internal-server-error
                  title: Internal Server Error
                  status: 500
                  detail: Unexpected error occurred while processing the request.
                  instance: /v1/agents/{agentId}/allowlist
          description: Unexpected error occurred
components:
  schemas:
    SetAgentAccessRequest:
      type: object
      properties:
        projects:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ProjectDetails'
          description: >-
            The list of projects the Agent is allowed to be scoped to. Each
            project should be provided as an object with the Project ID, or the
            list can be left empty.
          example:
            projects:
              3fa85f64-5717-4562-b3fc-2c963f66afa6:
                environments:
                  - dev
                  - prod
              1398aa31-af57-4a6a-9752-27c2e8556c3f: {}
      required:
        - projects
    ProblemDetail:
      type: object
      properties:
        detail:
          type: string
        instance:
          type: string
        status:
          type: integer
          format: int32
        title:
          type: string
        type:
          type: string
          format: uri
        violations:
          type: array
          items:
            type: string
    ProjectDetails:
      type: object
      properties:
        environments:
          type: array
          description: >-
            The list of environments that the agent can access within this
            project
          example:
            - dev
            - prod
          items:
            type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: a valid bearer token
      scheme: bearer
      type: http

````