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

# Test Authzen Policy

> TestAuthzenPolicy evaluates a stored or inline CEL policy against a
 live request tuple and returns the decision and the variables it saw,
 without requiring the policy to be activated on any server.



## OpenAPI

````yaml https://spec.speakeasy.com/conductor-one/conductorone/my-source-with-code-samples post /api/v1/apps/{app_id}/authzen_servers/{authzen_server_id}/test_policy
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_servers/{authzen_server_id}/test_policy:
    post:
      tags:
        - AuthZEN Policies
      summary: Test Authzen Policy
      description: |-
        TestAuthzenPolicy evaluates a stored or inline CEL policy against a
         live request tuple and returns the decision and the variables it saw,
         without requiring the policy to be activated on any server.
      operationId: c1.api.authzen.v1.AuthzenServerService.TestAuthzenPolicy
      parameters:
        - in: path
          name: app_id
          required: true
          schema:
            description: App identifier.
            type: string
        - in: path
          name: authzen_server_id
          required: true
          schema:
            description: AuthZEN server identifier.
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/c1.api.authzen.v1.AuthzenServerServiceTestAuthzenPolicyRequestInput
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/c1.api.authzen.v1.AuthzenServerServiceTestAuthzenPolicyResponse
          description: |-
            AuthzenServerServiceTestAuthzenPolicyResponse returns the evaluation
             outcome for authoring feedback.
components:
  schemas:
    c1.api.authzen.v1.AuthzenServerServiceTestAuthzenPolicyRequestInput:
      description: >
        AuthzenServerServiceTestAuthzenPolicyRequest evaluates a stored or
        inline
         CEL policy against a live request tuple without requiring activation.

        This message contains a oneof named policy. Only a single field of the
        following list may be set at a time:
          - policyId
          - cel
      properties:
        cel:
          oneOf:
            - $ref: '#/components/schemas/c1.api.authzen.v1.AuthzenCelPolicy'
            - type: 'null'
        policyId:
          description: >-
            Test an already-stored policy revision by id.

            This field is part of the `policy` oneof.

            See the documentation for
            `c1.api.authzen.v1.AuthzenServerServiceTestAuthzenPolicyRequest` for
            more details.
          type:
            - string
            - 'null'
        request:
          oneOf:
            - $ref: '#/components/schemas/c1.api.authzen.v1.AuthzenTestRequest'
            - type: 'null'
      title: Authzen Server Service Test Authzen Policy Request
      type: object
      x-speakeasy-name-override: AuthzenServerServiceTestAuthzenPolicyRequest
    c1.api.authzen.v1.AuthzenServerServiceTestAuthzenPolicyResponse:
      description: |-
        AuthzenServerServiceTestAuthzenPolicyResponse returns the evaluation
         outcome for authoring feedback.
      properties:
        decision:
          description: The policy's decision. Only meaningful when `error` is empty.
          type: boolean
        error:
          description: >-
            Compile or runtime error, if evaluation could not produce a
            decision.
          type: string
        variables:
          additionalProperties: true
          type:
            - object
            - 'null'
      title: Authzen Server Service Test Authzen Policy Response
      type: object
      x-speakeasy-name-override: AuthzenServerServiceTestAuthzenPolicyResponse
    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.AuthzenTestRequest:
      description: >-
        AuthzenTestRequest is one AuthZEN access-evaluation request tuple to
        test
         a policy against.
      properties:
        action:
          oneOf:
            - $ref: '#/components/schemas/c1.api.authzen.v1.AuthzenTestAction'
            - type: 'null'
        context:
          additionalProperties: true
          type:
            - object
            - 'null'
        resource:
          oneOf:
            - $ref: '#/components/schemas/c1.api.authzen.v1.AuthzenTestResource'
            - type: 'null'
        subject:
          oneOf:
            - $ref: '#/components/schemas/c1.api.authzen.v1.AuthzenTestSubject'
            - type: 'null'
      title: Authzen Test Request
      type: object
      x-speakeasy-name-override: AuthzenTestRequest
    c1.api.authzen.v1.AuthzenTestAction:
      description: AuthzenTestAction identifies the AuthZEN action for a test evaluation.
      properties:
        name:
          description: Action name supplied by the AuthZEN caller.
          type: string
      title: Authzen Test Action
      type: object
      x-speakeasy-name-override: AuthzenTestAction
    c1.api.authzen.v1.AuthzenTestResource:
      description: >-
        AuthzenTestResource identifies the AuthZEN resource for a test
        evaluation.
      properties:
        id:
          description: Resource identifier.
          type: string
        properties:
          additionalProperties: true
          type:
            - object
            - 'null'
        type:
          description: Resource type, e.g. "app_resource".
          type: string
      title: Authzen Test Resource
      type: object
      x-speakeasy-name-override: AuthzenTestResource
    c1.api.authzen.v1.AuthzenTestSubject:
      description: AuthzenTestSubject identifies the AuthZEN subject for a test evaluation.
      properties:
        id:
          description: Subject identifier.
          type: string
        properties:
          additionalProperties: true
          type:
            - object
            - 'null'
        type:
          description: Subject type, e.g. "user".
          type: string
      title: Authzen Test Subject
      type: object
      x-speakeasy-name-override: AuthzenTestSubject
  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

````