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

# Attach evidence to a rule result

> Attach evidence to a rule result.



## OpenAPI

````yaml post /rule-results/{ruleResultId}/evidence
openapi: 3.0.3
info:
  contact:
    email: support@openlayer.com
    name: Openlayer
    url: https://openlayer.com/
  description: API for interacting with the Openlayer server.
  title: Openlayer API
  version: '1.0'
  x-logo:
    url: https://logo.clearbit.com/openlayer.com
servers:
  - url: https://api.openlayer.com/v1
    description: Our prod backend
security:
  - bearerAuth: []
paths:
  /rule-results/{ruleResultId}/evidence:
    post:
      tags:
        - Governance
      summary: Attach evidence to a rule result
      description: Attach evidence to a rule result.
      operationId: createRuleResultEvidence
      parameters:
        - $ref: '#/components/parameters/ruleResultId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name: 4d34a4a8-09b3-44ec-a8ef-d60bdfcfc6e3
                description: 510ce6a7-bb8f-43a6-bc36-d7f8263d38b4
                storageUri: 42539127-cc1e-45f5-9ce6-605111cf8919
                text: 282d1f3f-75be-4b36-8685-4f579cb7fe72
                url: 2733b641-7edc-4f4e-b59a-15b18c9c7273
      responses:
        '201':
          description: >-
            Evidence created. The rule result is re-evaluated, and its renewal
            window restarts from this evidence.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Evidence'
        default:
          $ref: '#/components/responses/UnexpectedError'
      x-codeSamples:
        - lang: python
          source: |
            from openlayer import Openlayer

            client = Openlayer()

            evidence = client.governance.rule_results.create_evidence(
                "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
                name="Model card",
                url="https://example.com/model-card",
            )
            print(evidence.id)
        - lang: typescript
          source: >
            import Openlayer from 'openlayer';


            const client = new Openlayer();


            const evidence = await
            client.governance.ruleResults.createEvidence('6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c',
            {
              name: 'Model risk assessment 2026',
              url: 'https://example.com/model-risk-assessment.pdf',
            });


            console.log(evidence.id);
        - lang: go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/openlayer-ai/openlayer-go\"\n)\n\nclient := openlayer.NewClient()\nevidence, err := client.Governance.RuleResults.NewEvidence(\n\tcontext.TODO(),\n\t\"6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c\",\n\topenlayer.GovernanceRuleResultNewEvidenceParams{\n\t\tName: openlayer.F(\"Model card v3\"),\n\t\tURL:  openlayer.F(\"https://example.com/model-card-v3.pdf\"),\n\t},\n)\nif err != nil {\n\tpanic(err.Error())\n}\nfmt.Printf(\"%+v\\n\", evidence.ID)\n"
        - lang: java
          source: >
            import com.openlayer.api.client.OpenlayerClient;

            import com.openlayer.api.client.okhttp.OpenlayerOkHttpClient;

            import
            com.openlayer.api.models.governance.ruleresults.RuleResultCreateEvidenceParams;

            import
            com.openlayer.api.models.governance.ruleresults.RuleResultCreateEvidenceResponse;


            OpenlayerClient client = OpenlayerOkHttpClient.fromEnv();


            RuleResultCreateEvidenceParams params =
            RuleResultCreateEvidenceParams.builder()
                .ruleResultId("6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c")
                .name("Model risk assessment 2026")
                .url("https://example.com/model-risk-assessment-2026.pdf")
                .build();
            RuleResultCreateEvidenceResponse evidence =
            client.governance().ruleResults().createEvidence(params);
        - lang: ruby
          source: |
            require "openlayer"

            openlayer = Openlayer::Client.new(api_key: ENV["OPENLAYER_API_KEY"])

            evidence = openlayer.governance.rule_results.create_evidence(
              "6f7a8b9c-0d1e-4f2a-8b3c-4d5e6f7a8b9c",
              name: "Model risk assessment 2026",
              url: "https://openlayer.com/evidence"
            )

            puts(evidence)
        - lang: curl
          source: |
            curl --request POST \
              --url https://api.openlayer.com/v1/rule-results/2c4e6a8b-1d3f-4b5c-9e7a-0f1b2c3d4e5f/evidence \
              --header 'Authorization: Bearer <token>' \
              --header 'Content-Type: application/json' \
              --data '{
                "name": "2026 model risk review",
                "description": "Signed off by the risk committee.",
                "url": "https://example.com/reviews/2026-model-risk.pdf"
              }'
components:
  parameters:
    ruleResultId:
      name: ruleResultId
      in: path
      description: The rule result id.
      required: true
      schema:
        type: string
        format: uuid
  schemas:
    Evidence:
      type: object
      description: >
        Evidence attached to a rule result to satisfy an evidence rule. Which
        field holds it depends on the rule's `evidenceType`: `storageUri` for a
        document, `text` for a written statement, or `url` for a link.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: The evidence id.
        name:
          type: string
          nullable: true
          maxLength: 120
          description: The evidence name.
          example: Model risk assessment 2026
        description:
          type: string
          nullable: true
          description: A description of what the evidence shows.
        storageUri:
          type: string
          nullable: true
          description: >
            Where the uploaded file is stored. Set when the rule's
            `evidenceType` is `document`. Upload the file first with `POST
            /storage/presigned-url` and send the storage URI it returns.
          example: s3://openlayer-evidence/evidence.pdf
        text:
          type: string
          nullable: true
          description: The evidence text. Set when the rule's `evidenceType` is `text`.
        url:
          type: string
          format: uri
          nullable: true
          description: A link to the evidence. Set when the rule's `evidenceType` is `url`.
          example: https://openlayer.com/evidence
        creatorId:
          type: string
          format: uuid
          nullable: true
          readOnly: true
          description: The user who attached the evidence.
        dateCreated:
          type: string
          format: date-time
          readOnly: true
          description: The creation date.
          example: '2026-03-22T11:31:01.185Z'
        dateUpdated:
          type: string
          format: date-time
          readOnly: true
          description: The last update date.
          example: '2026-03-22T11:31:01.185Z'
      required:
        - id
        - creatorId
        - dateCreated
        - dateUpdated
  responses:
    UnexpectedError:
      description: Unexpected error.
      content:
        application/json:
          schema:
            type: object
            required:
              - code
              - error
            properties:
              code:
                type: integer
                format: int32
              error:
                type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >
        Bearer authentication header of the form `Bearer <token>`, where
        `<token>` is your workspace API key. See [Find your API
        key](https://www.openlayer.com/docs/workspace-and-projects/find-your-api-key)
        for more information.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.