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

# Post groups resources

> Adds a resource to a group.



## OpenAPI

````yaml https://app.opal.dev/openapi.yaml post /groups/{group_id}/resources/{resource_id}
openapi: 3.1.0
info:
  contact:
    email: hello@opal.dev
    name: Opal Team
    url: https://www.opal.dev/
  description: >-
    The Opal API is a RESTful API that allows you to interact with the Opal
    Security platform programmatically.
  title: Opal API
  version: '1.0'
servers:
  - description: Production
    url: https://api.opal.dev/v1
security: []
tags:
  - name: access-rules
    description: Operations related to access rules
  - name: apps
    description: Operations related to apps
  - name: bundles
    description: Operations related to bundles
  - name: configuration-templates
    description: Operations related to configuration templates
  - name: delegations
    description: Operations related to request reviewer delegations
  - name: events
    description: Operations related to events
  - name: groups
    description: Operations related to groups
  - name: group-bindings
    description: Operations related to group bindings
  - name: idp-group-mappings
    description: Operations related to IDP group mappings
  - name: message-channels
    description: Operations related to message channels
  - name: non-human-identities
    description: Operations related to non-human identities
  - name: on-call-schedules
    description: Operations related to on-call schedules
  - name: owners
    description: Operations related to owners
  - name: requests
    description: Operations related to requests
  - name: resources
    description: Operations related to resources
  - name: sessions
    description: Operations related to sessions
  - name: tags
    description: Operations related to tags
  - name: tokens
    description: Operations related to API tokens
  - name: uars
    description: Operations related to UARs
  - name: users
    description: Operations related to users
paths:
  /groups/{group_id}/resources/{resource_id}:
    post:
      tags:
        - groups
      description: Adds a resource to a group.
      operationId: add_group_resource
      parameters:
        - description: The ID of the group.
          example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5
          explode: false
          in: path
          name: group_id
          required: true
          schema:
            type: string
            format: uuid
          style: simple
        - description: The ID of the resource.
          example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5
          explode: false
          in: path
          name: resource_id
          required: true
          schema:
            type: string
            format: uuid
          style: simple
        - description: >-
            The remote ID of the access level to grant to this user. If omitted,
            the default access level remote ID value (empty string) is used.
          example: arn:aws:iam::590304332660:role/AdministratorAccess
          explode: true
          in: query
          name: access_level_remote_id
          required: false
          schema:
            type: string
          style: form
          deprecated: true
      requestBody:
        required: false
        content:
          application/json:
            schema:
              example:
                access_level_remote_id: arn:aws:iam::590304332660:role/AdministratorAccess
                duration_minutes: 60
              properties:
                access_level_remote_id:
                  description: >-
                    The remote ID of the access level to grant to this user. If
                    omitted, the default access level remote ID value (empty
                    string) is used.
                  example: arn:aws:iam::590304332660:role/AdministratorAccess
                  type: string
                duration_minutes:
                  description: >-
                    The duration for which the resource can be accessed (in
                    minutes). Use 0 to set to indefinite.
                  example: 60
                  type: integer
                  maximum: 525960
                  minimum: 0
              type: object
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupResource'
          description: The created `GroupResource` object.
      security:
        - BearerAuth: []
components:
  schemas:
    GroupResource:
      description: >-
        # GroupResource Object

        ### Description

        The `GroupResource` object is used to represent a relationship between a
        group and a resource.
      example:
        group_id: f454d283-ca87-4a8a-bdbb-df212eca5353
        resource_id: b5a5ca27-0ea3-4d86-9199-2126d57d1fbd
        access_level_remote_id: write
      properties:
        group_id:
          description: The ID of the group.
          example: f454d283-ca87-4a87-bdbb-df212eca5353
          format: uuid
          type: string
        resource_id:
          description: The ID of the resource.
          example: b5a5ca27-0ea3-4d86-9199-2126d57d1fbd
          format: uuid
          type: string
        group_name:
          description: The name of the group
          example: API Group
          type: string
        resource_name:
          description: The name of the resource
          example: API Group
          type: string
        expiration_date:
          description: The day and time the group's access will expire.
          example: '2022-01-23T04:56:07.000Z'
          format: date-time
          nullable: true
          type: string
        access_level:
          $ref: '#/components/schemas/ResourceAccessLevel'
      required:
        - group_id
        - resource_id
        - access_level
      type: object
    ResourceAccessLevel:
      description: >-
        # Access Level Object

        ### Description

        The `AccessLevel` object is used to represent the level of access that a
        principal has. The "default" access

        level is a `AccessLevel` object whose fields are all empty strings.


        ### Usage Example

        View the `AccessLevel` of a resource/user or resource/group pair to see
        the level of access granted to the resource.
      example:
        access_level_name: AdminRole
        access_level_remote_id: arn:aws:iam::590304332660:role/AdministratorAccess
      properties:
        access_level_name:
          description: The human-readable name of the access level.
          example: AdminRole
          type: string
        access_level_remote_id:
          description: The machine-readable identifier of the access level.
          example: arn:aws:iam::590304332660:role/AdministratorAccess
          type: string
      required:
        - access_level_name
        - access_level_remote_id
      type: object
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````