---
title: "Create Admission Rule"
url: "https://public-api-docs.cipherscale.com/apis/cipherscale-api-1/versions/fef69080-6094-4620-8bf0-16fd2de7b598/operations/AdmissionRulesController_create"
---

> Full API specification: https://public-api-docs.cipherscale.com/apis/cipherscale-api-1/versions/fef69080-6094-4620-8bf0-16fd2de7b598.md

# Create Admission Rule

`POST` `/tenants/admission-rules`

Operation ID: `AdmissionRulesController_create`

Creates a new admission rule that defines conditions for allowing or denying access to network resources. Admission rules can include time constraints and custom logic for fine-grained access control.

## Request body (required)

Content types: `application/json`

## Responses

- `201` - Successfully created the admission rule
- `401` - Unauthorized - Invalid or missing authentication token
- `403` - Forbidden - Insufficient permissions to perform this operation.

## OpenAPI definition

```yaml
openapi: 3.0.0
info:
  title: Cipherscale API
  version: "1.0"
servers:
  - url: https://public-api.cipherscale.com/qa
    description: Cipherscale Public API Server
paths:
  /tenants/admission-rules:
    post:
      operationId: AdmissionRulesController_create
      summary: Create Admission Rule
      description: Creates a new admission rule that defines conditions for allowing
        or denying access to network resources. Admission rules can include time
        constraints and custom logic for fine-grained access control.
      requestBody:
        required: true
        description: The admission rule data to create
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/CreateAdmissionRuleDto"
      responses:
        "201":
          description: Successfully created the admission rule
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AdmissionRuleDto"
        "401":
          description: Unauthorized - Invalid or missing authentication token
        "403":
          description: Forbidden - Insufficient permissions to perform this operation.
      tags:
        - Admission Rules
      security:
        - ApiKeyAuth: []
security:
  - ApiKeyAuth: []
components:
  schemas:
    CreateAdmissionRuleDto:
      type: object
      properties:
        rule:
          type: string
        name:
          type: string
        hasTimeConstraint:
          type: boolean
      required:
        - rule
        - name
        - hasTimeConstraint
    AdmissionRuleDto:
      type: object
      properties:
        id:
          type: string
          format: uuid
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        name:
          type: string
        type:
          enum:
            - ALLOW
            - DENY
            - CUSTOM
          type: string
        hasTimeConstraint:
          type: boolean
        rule:
          type: string
      required:
        - id
        - createdAt
        - updatedAt
        - name
        - type
        - hasTimeConstraint
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
```
