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

# Grant scenario access

> Grant a user access to a specific scenario with a specified permission level.




## OpenAPI

````yaml /api-reference/openapi.yaml post /scenarios/{scenario_id}/access
openapi: 3.0.3
info:
  title: Exec API
  version: '1.0'
  description: >
    REST API for programmatic access to your Exec workspace.


    Use the Exec API to read workspace data, list members, retrieve group
    information,

    and create interactive scenario creation sessions.


    ## Authentication

    All requests require a valid API key passed in the Authorization header:

    ```

    Authorization: Bearer exec_live_...

    ```


    Create API keys in your workspace settings under **Settings > API**.
servers:
  - url: https://api.exec.com/rest/v1
    description: Production
security:
  - bearerAuth: []
paths:
  /scenarios/{scenario_id}/access:
    post:
      tags:
        - Scenarios
      summary: Grant scenario access
      description: >
        Grant a user access to a specific scenario with a specified permission
        level.
      operationId: grantScenarioAccess
      parameters:
        - name: scenario_id
          in: path
          required: true
          description: Scenario identifier
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - user_email
                - permission_level
              properties:
                user_email:
                  type: string
                  format: email
                  description: Email of the user to grant access to
                permission_level:
                  type: string
                  enum:
                    - view
                    - share
                    - monitor
                    - edit
                  description: Permission level to grant
            example:
              user_email: jane@acme.com
              permission_level: edit
      responses:
        '200':
          description: Access granted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GrantAccessResponse'
              example:
                user_email: jane@acme.com
                scenario_id: s1c2e3n4a5r6
                permission_level: edit
                granted: true
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    GrantAccessResponse:
      type: object
      properties:
        user_email:
          type: string
          format: email
          description: Email of the user granted access
        scenario_id:
          type: string
          description: Scenario identifier
        permission_level:
          type: string
          enum:
            - view
            - share
            - monitor
            - edit
          description: Permission level granted
        granted:
          type: boolean
          description: Whether the access was successfully granted
    ValidationErrorDetail:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              description: Error category (e.g., "invalid_request")
            code:
              type: string
              description: Specific error code (e.g., "user_not_found")
            message:
              type: string
              description: Human-readable error message
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorDetail'
          example:
            error:
              type: invalid_request
              code: invalid_pagination
              message: Invalid pagination parameters
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorDetail'
          example:
            error:
              type: authentication_error
              code: invalid_api_key
              message: Invalid or inactive API key
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationErrorDetail'
          example:
            error:
              type: not_found
              message: 'Scenario not found: abc123'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        API key created in Settings > API.

        Format: `exec_live_` followed by 40 alphanumeric characters.

````