> ## 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 requests

> Create an access request



## OpenAPI

````yaml https://app.opal.dev/openapi.yaml post /requests
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:
  /requests:
    post:
      tags:
        - requests
      description: Create an access request
      operationId: createRequest
      requestBody:
        description: Resources to be updated
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRequestInfo'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  id:
                    format: uuid
                    type: string
                    example: 4baf8423-db0a-4037-a4cf-f79c60cb67a5
          description: The resulting request.
      security:
        - BearerAuth: []
components:
  schemas:
    CreateRequestInfo:
      description: All the information needed for creating a request
      properties:
        resources:
          type: array
          items:
            type: object
            properties:
              id:
                description: >-
                  The ID of the resource requested. Should not be specified if
                  group_id is specified.
                example: group283-ca87-4a8a-bdbb-df212eca5353
                format: uuid
                type: string
              access_level_remote_id:
                description: The ID of the access level requested on the remote system.
                example: arn:aws:iam::490306337630:role/SupportUser
                type: string
              access_level_name:
                description: >-
                  The ID of the access level requested on the remote system.
                  This field is deprecated and no longer required. We will
                  populate based on the access_level_remote_id.
                example: arn:aws:iam::490306337630:role/SupportUser
                type: string
                deprecated: true
        groups:
          type: array
          items:
            type: object
            properties:
              id:
                description: >-
                  The ID of the group requested. Should not be specified if
                  resource_id is specified.
                example: f454d283-ca87-4a8a-bdbb-df212eca5353
                format: uuid
                type: string
              access_level_remote_id:
                description: The ID of the access level requested on the remote system.
                example: arn:aws:iam::490306337630:role/SupportUser
                type: string
              access_level_name:
                description: The ID of the access level requested on the remote system.
                example: arn:aws:iam::490306337630:role/SupportUser
                type: string
            required:
              - id
        target_user_id:
          description: >-
            The ID of the user to be granted access. Should not be specified if
            target_group_id is specified.
          example: userd283-ca87-4a8a-bdbb-df212eca5353
          format: uuid
          type: string
        target_group_id:
          description: >-
            The ID of the group the request is for.  Should not be specified if
            target_user_id is specified.
          example: userd283-ca87-4a8a-bdbb-df212eca5353
          format: uuid
          type: string
        reason:
          type: string
        support_ticket:
          type: object
          properties:
            ticketing_provider:
              $ref: '#/components/schemas/TicketingProviderEnum'
            remote_id:
              type: string
            identifier:
              type: string
            url:
              type: string
          required:
            - ticketing_provider
            - remote_id
            - identifier
            - url
        duration_minutes:
          description: >-
            The duration of the request in minutes. -1 represents an indefinite
            duration
          type: integer
          minimum: -1
        custom_metadata:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              type:
                $ref: '#/components/schemas/RequestTemplateCustomFieldTypeEnum'
              value:
                type: string
            required:
              - name
              - type
              - value
      required:
        - reason
        - duration_minutes
        - resources
        - groups
    TicketingProviderEnum:
      description: The third party ticketing platform provider.
      enum:
        - JIRA
        - LINEAR
        - SERVICE_NOW
      example: LINEAR
      type: string
    RequestTemplateCustomFieldTypeEnum:
      description: The type of the custom request field.
      enum:
        - SHORT_TEXT
        - LONG_TEXT
        - BOOLEAN
        - MULTI_CHOICE
      type: string
  securitySchemes:
    BearerAuth:
      scheme: bearer
      type: http

````