> ## Documentation Index
> Fetch the complete documentation index at: https://conductorone-docs-api-common-tasks-cookbook.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Authzen Policy

> CreateAuthzenPolicy validates the CEL syntax (requiring a bool result)
 and stores a new, immutable policy revision for the app. The revision
 has no effect until a server's active_policy_id is set to it via
 Update.



## OpenAPI

````yaml https://spec.speakeasy.com/conductor-one/conductorone/my-source-with-code-samples post /api/v1/apps/{app_id}/authzen_policies
openapi: 3.1.0
info:
  description: The C1 API is a HTTP API for managing C1 resources.
  title: C1 API
  version: 0.1.0-alpha
servers:
  - description: The C1 API server for the current tenant.
    url: https://{tenantDomain}.conductor.one
    variables:
      tenantDomain:
        default: example
        description: The domain of the tenant to use for this request.
security:
  - bearerAuth: []
    oauth: []
paths:
  /api/v1/apps/{app_id}/authzen_policies:
    post:
      tags:
        - AuthZEN Policies
      summary: Create Authzen Policy
      description: |-
        CreateAuthzenPolicy validates the CEL syntax (requiring a bool result)
         and stores a new, immutable policy revision for the app. The revision
         has no effect until a server's active_policy_id is set to it via
         Update.
      operationId: c1.api.authzen.v1.AuthzenServerService.CreateAuthzenPolicy
      parameters:
        - in: path
          name: app_id
          required: true
          schema:
            description: App identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/c1.api.authzen.v1.AuthzenServerServiceCreateAuthzenPolicyRequestInput
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/c1.api.authzen.v1.AuthzenServerServiceCreateAuthzenPolicyResponse
          description: >-
            AuthzenServerServiceCreateAuthzenPolicyResponse returns the newly
            created
             policy revision.
components:
  schemas:
    c1.api.authzen.v1.AuthzenServerServiceCreateAuthzenPolicyRequestInput:
      description: >
        AuthzenServerServiceCreateAuthzenPolicyRequest creates a new CEL policy
         revision for an app.

        This message contains a oneof named engine. Only a single field of the
        following list may be set at a time:
          - cel
      properties:
        cel:
          oneOf:
            - $ref: '#/components/schemas/c1.api.authzen.v1.AuthzenCelPolicy'
            - type: 'null'
        description:
          description: Free-text description of what this revision changes or is for.
          type: string
        displayName:
          description: Display name for the policy revision.
          type: string
      title: Authzen Server Service Create Authzen Policy Request
      type: object
      x-speakeasy-name-override: AuthzenServerServiceCreateAuthzenPolicyRequest
    c1.api.authzen.v1.AuthzenServerServiceCreateAuthzenPolicyResponse:
      description: >-
        AuthzenServerServiceCreateAuthzenPolicyResponse returns the newly
        created
         policy revision.
      properties:
        authzenPolicy:
          oneOf:
            - $ref: '#/components/schemas/c1.api.authzen.v1.AuthzenPolicy'
            - type: 'null'
      title: Authzen Server Service Create Authzen Policy Response
      type: object
      x-speakeasy-name-override: AuthzenServerServiceCreateAuthzenPolicyResponse
    c1.api.authzen.v1.AuthzenCelPolicy:
      description: AuthzenCelPolicy holds the CEL source for a policy revision.
      properties:
        environment:
          description: >-
            The CEL environment name+version this expression was validated
            against
             (e.g. "authzen_policy/v1"). Set by the server; not accepted from callers.
          type: string
        expression:
          description: >-
            CEL expression, evaluated against `environment`. Validated for
            syntax
             and required to yield bool on create; invalid or non-bool CEL is
             rejected.
          type: string
      title: Authzen Cel Policy
      type: object
      x-speakeasy-name-override: AuthzenCelPolicy
    c1.api.authzen.v1.AuthzenPolicy:
      description: >
        AuthzenPolicy is one immutable CEL policy revision scoped to an app. A
         revision is never edited in place; activate it by setting a server's
         active_policy_id.

        This message contains a oneof named engine. Only a single field of the
        following list may be set at a time:
          - cel
      properties:
        appId:
          description: App identifier.
          type: string
        cel:
          oneOf:
            - $ref: '#/components/schemas/c1.api.authzen.v1.AuthzenCelPolicy'
            - type: 'null'
        createdAt:
          format: date-time
          type:
            - string
            - 'null'
        createdByUserId:
          description: The ID of the user who created this revision.
          type: string
        description:
          description: Free-text description of what this revision changes or is for.
          type: string
        displayName:
          description: Display name for the policy revision.
          type: string
        id:
          description: Policy identifier.
          type: string
      title: Authzen Policy
      type: object
      x-speakeasy-name-override: AuthzenPolicy
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http
    oauth:
      description: >-
        This API uses OAuth2 with the Client Credential flow.

        Client Credentials must be sent in the BODY, not the headers.

        For an example of how to implement this, refer to the
        [c1TokenSource.Token()](https://github.com/ConductorOne/conductorone-sdk-go/blob/3375fe7c0126d17e7ec4e711693dee7b791023aa/token_source.go#L101-L187)
        function.
      flows:
        clientCredentials:
          scopes: {}
          tokenUrl: /auth/v1/token
      type: oauth2

````