Skip to content
Navigation

checkOrgPolicyExplanation

Explain a simulated decision: each check, each pass, each statement, and each condition term's value on each side. It takes the request channel as a simulation does (Api by default; Mcp explains rules on request.channel === "Mcp"). A decision that read a record you can't read is Withheld, with nothing of why.

POST
/orgs/{org_id}/policy-explanations

Path parameters

  • org_id
    string
    required
    pattern: ^org_[0-7][0-9a-hjkmnp-tv-z]{25}$

Request body JSON required

  • repo_id
    string
    required
    pattern: ^repo_[0-7][0-9a-hjkmnp-tv-z]{25}$
  • user_id
    string
    required
    pattern: ^(?:user|extension)_[0-7][0-9a-hjkmnp-tv-z]{25}$
  • attempt
    required

    One of the following:

    • object
      • kind
        model
        required
      • action
        read
        or
        delete
        or
        tag
        or
        untag
        required
      • record_id
        string
        required
        pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
      • branch
        optional
        string
        minLength: 1
    • object
      • kind
        model
        required
      • action
        update
        required
      • record_id
        string
        required
        pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
      • fields
        object
        required
      • branch
        optional
        string
        minLength: 1
    • object
      • kind
        model
        required
      • action
        create
        required
      • model_api_name
        string
        required
        minLength: 1
      • fields
        object
        required
      • branch
        optional
        string
        minLength: 1
    • object
      • kind
        schema
        required
      • action
        read
        or
        create
        or
        update
        or
        delete
        required
      • model_api_name
        string
        required
        minLength: 1
      • branch
        optional
        string
        minLength: 1
    • object
      • kind
        repo
        required
      • action
        read
        or
        update
        or
        readHistory
        or
        createBranches
        or
        deleteBranches
        or
        restoreBranches
        +13 more
        required
    • object
      • kind
        agentInstructions
        required
      • action
        read
        or
        manage
        required
    • object
      • kind
        agentSkills
        required
      • action
        read
        or
        manage
        required
    • object
      • kind
        extension
        required
      • action
        read
        or
        create
        or
        update
        or
        delete
        or
        publish
        required
      • extension
        string
        required
        maxLength: 129 · pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*\.[a-z0-9]+(?:-[a-z0-9]+)*$
      • branch
        optional
        string
        minLength: 1
    • object
      • kind
        installation
        required
      • action
        read
        or
        manage
        or
        bindConnections
        or
        share
        required
      • extension
        string
        required
        maxLength: 129 · pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*\.[a-z0-9]+(?:-[a-z0-9]+)*$
      • branch
        optional
        string
        minLength: 1
    • object
      • kind
        tool
        required
      • action
        required

        One of the following:

        • string
      • extension
        string
        required
        maxLength: 129 · pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*\.[a-z0-9]+(?:-[a-z0-9]+)*$
      • name
        string
        required
        maxLength: 128 · pattern: ^[A-Za-z_][A-Za-z0-9_]*(?:\.[A-Za-z_][A-Za-z0-9_]*)*$
      • branch
        optional
        string
        minLength: 1
    • object
      • kind
        workflow
        required
      • action
        run
        or
        signal
        or
        terminate
        or
        readRuns
        required
      • extension
        string
        required
        maxLength: 129 · pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*\.[a-z0-9]+(?:-[a-z0-9]+)*$
      • name
        string
        required
        maxLength: 128 · pattern: ^[A-Za-z_][A-Za-z0-9_]*$
      • branch
        optional
        string
        minLength: 1
    • object
      • kind
        schedule
        required
      • action
        manage
        or
        run
        or
        readRuns
        required
      • extension
        string
        required
        maxLength: 129 · pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*\.[a-z0-9]+(?:-[a-z0-9]+)*$
      • name
        string
        required
        maxLength: 128 · pattern: ^[A-Za-z_][A-Za-z0-9_]*$
      • branch
        optional
        string
        minLength: 1
    • object
      • kind
        trigger
        required
      • action
        manage
        or
        run
        or
        readRuns
        required
      • extension
        string
        required
        maxLength: 129 · pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*\.[a-z0-9]+(?:-[a-z0-9]+)*$
      • name
        string
        required
        maxLength: 128 · pattern: ^[A-Za-z_][A-Za-z0-9_]*$
      • branch
        optional
        string
        minLength: 1
  • channel
    optional
    Api
    or
    Mcp
  • draft
    optional
    object
    • source
      string
      required
      minLength: 1
    • repo_id
      optional
      string
      pattern: ^repo_[0-7][0-9a-hjkmnp-tv-z]{25}$
    • policy_id
      optional
      string
      pattern: ^policy_[0-7][0-9a-hjkmnp-tv-z]{25}$

Returns

200

DecisionExplanation

JSON

One of the following:

  • object
    • _tag
      Owner
      required
  • object
    • _tag
      Policies
      required
    • verdict
      allowed
      or
      forbidden
      or
      hidden
      required
    • checks
      array of
      object
      required
      • step
        repoRead
        or
        recordRead
        or
        action
        required
      • action
        string
        required
        pattern: ^[a-z][A-Za-z]*$
      • outcome
        allow
        or
        deny
        required
      • org_pass
        object
        required
        • outcome
          allow
          or
          deny
          required
        • statements
          array of
          required

          One of the following:

          • object
            • _tag
              Allow
              required
            • policy_id
              string
              required
              pattern: ^policy_[0-7][0-9a-hjkmnp-tv-z]{25}$
            • version_id
              string
              required
              pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
            • policy_name
              string
              required
              minLength: 1
            • index
              integer
              required
              maximum: 9007199254740991 · minimum: 0
            • applied
              boolean
              required
            • runs
              array of
              object
              required
              • side
                record
                or
                before
                or
                after
                required
              • terms
                array of
                object
                required
                • at
                  array of
                  integer
                  required
                  maximum: 9007199254740991 · minimum: 0
                • value
                  required

                  One of the following:

                  • object
                    • _tag
                      True
                      required
                    • operands
                      array of
                      required

                      One of the following:

                      • object
                        • _tag
                          Value
                          required
                        • value
                          unknown
                          required
                      • object
                        • _tag
                          Missing
                          required
                  • object
                    • _tag
                      False
                      required
                    • operands
                      array of
                      required

                      One of the following:

                      • object
                        • _tag
                          Value
                          required
                        • value
                          unknown
                          required
                      • object
                        • _tag
                          Missing
                          required
                  • object
                    • _tag
                      Unknown
                      required
                    • operands
                      array of
                      required

                      One of the following:

                      • object
                        • _tag
                          Value
                          required
                        • value
                          unknown
                          required
                      • object
                        • _tag
                          Missing
                          required
                  • object
                    • _tag
                      Error
                      required
                    • reason
                      unresolvedName
                      or
                      crossRepo
                      or
                      canReadDepth
                      or
                      canReadCycle
                      or
                      readBudget
                      or
                      unsupportedValue
                      required
          • object
            • _tag
              Deny
              required
            • policy_id
              string
              required
              pattern: ^policy_[0-7][0-9a-hjkmnp-tv-z]{25}$
            • version_id
              string
              required
              pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
            • policy_name
              string
              required
              minLength: 1
            • index
              integer
              required
              maximum: 9007199254740991 · minimum: 0
            • applied
              boolean
              required
            • runs
              array of
              object
              required
              • side
                record
                or
                before
                or
                after
                required
              • terms
                array of
                object
                required
                • at
                  array of
                  integer
                  required
                  maximum: 9007199254740991 · minimum: 0
                • value
                  required

                  One of the following:

                  • object
                    • _tag
                      True
                      required
                    • operands
                      array of
                      required

                      One of the following:

                      • object
                        • _tag
                          Value
                          required
                        • value
                          unknown
                          required
                      • object
                        • _tag
                          Missing
                          required
                  • object
                    • _tag
                      False
                      required
                    • operands
                      array of
                      required

                      One of the following:

                      • object
                        • _tag
                          Value
                          required
                        • value
                          unknown
                          required
                      • object
                        • _tag
                          Missing
                          required
                  • object
                    • _tag
                      Unknown
                      required
                    • operands
                      array of
                      required

                      One of the following:

                      • object
                        • _tag
                          Value
                          required
                        • value
                          unknown
                          required
                      • object
                        • _tag
                          Missing
                          required
                  • object
                    • _tag
                      Error
                      required
                    • reason
                      unresolvedName
                      or
                      crossRepo
                      or
                      canReadDepth
                      or
                      canReadCycle
                      or
                      readBudget
                      or
                      unsupportedValue
                      required
      • repo_pass
        required

        One of the following:

        • PassExplanation
        • null
  • object
    • _tag
      Withheld
      required

400

InvalidRequest | RequestBodyTooDeep
JSON

One of the following:

  • InvalidRequestEncoded
    • _tag
      InvalidRequest
      required
    • part
      path
      or
      query
      or
      headers
      or
      body
      required
    • issues
      array of
      object
      required
      • path
        array of
        required

        One of the following:

        • string
        • integer
      • message
        string
        required
  • RequestBodyTooDeepEncoded
    • _tag
      RequestBodyTooDeep
      required
    • max_depth
      integer
      required
      maximum: 9007199254740991 · minimum: -9007199254740991

401

InvalidCredentials
JSON
  • _tag
    InvalidCredentials
    required

403

Forbidden | ForbiddenOrigin | RequiresPersonalSession | RunBranchRequired
JSON

One of the following:

  • ForbiddenEncoded
    • _tag
      Forbidden
      required
    • message
      string
      required
  • ForbiddenOriginEncoded
    • _tag
      ForbiddenOrigin
      required
  • RequiresPersonalSessionEncoded
    • _tag
      RequiresPersonalSession
      required
  • RunBranchRequiredEncoded
    • _tag
      RunBranchRequired
      required
    • branch
      string
      required
      minLength: 1
    • message
      string
      required

404

OrgNotFound | RepoNotFound | PolicyNotFound | MemberNotFound | BranchNotFound | CustomModelNotFound | CustomRecordNotFound | ExtensionNotFound | ExtensionInstallationNotFound | ExtensionToolNotFound | ExtensionWorkflowNotFound
JSON

One of the following:

  • OrgNotFoundEncoded
    • _tag
      OrgNotFound
      required
  • RepoNotFoundEncoded
    • _tag
      RepoNotFound
      required
  • PolicyNotFoundEncoded
    • _tag
      PolicyNotFound
      required
  • MemberNotFoundEncoded
    • _tag
      MemberNotFound
      required
  • BranchNotFoundEncoded
    • _tag
      BranchNotFound
      required
    • branch
      string
      required
      minLength: 1
  • CustomModelNotFoundEncoded
    • _tag
      CustomModelNotFound
      required
    • api_name
      string
      required
      minLength: 1
  • CustomRecordNotFoundEncoded
    • _tag
      CustomRecordNotFound
      required
    • record_id
      string
      required
      pattern: ^[a-z](?:[a-z_]{0,61}[a-z])?_[0-7][0-9a-hjkmnp-tv-z]{25}$
  • ExtensionNotFoundEncoded
    • _tag
      ExtensionNotFound
      required
    • extension_name
      string
      required
      minLength: 1
  • ExtensionInstallationNotFoundEncoded
    • _tag
      ExtensionInstallationNotFound
      required
    • extension_name
      string
      required
      minLength: 1
    • message
      string
      required
  • ExtensionToolNotFoundEncoded
    • _tag
      ExtensionToolNotFound
      required
    • extension_name
      string
      required
      minLength: 1
    • tool
      string
      required
      minLength: 1
  • ExtensionWorkflowNotFoundEncoded
    • _tag
      ExtensionWorkflowNotFound
      required
    • extension_name
      string
      required
      minLength: 1
    • workflow
      string
      required
      minLength: 1
    • message
      string
      required

409

PolicyLevelMismatch
JSON
  • _tag
    PolicyLevelMismatch
    required

413

RequestBodyTooLarge
JSON
  • _tag
    RequestBodyTooLarge
    required
  • max_bytes
    integer
    required
    maximum: 9007199254740991 · minimum: -9007199254740991

422

PolicyInvalid | InvalidCustomRecord | ExtensionScheduleNotDeclared | ExtensionTriggerNotDeclared
JSON

One of the following:

  • PolicyInvalidEncoded
    • _tag
      PolicyInvalid
      required
    • problems
      array of
      object
      required
      • severity
        error
        or
        warning
        required
      • code
        syntax
        or
        unsupported
        or
        truthiness
        or
        duplicate
        or
        unknownModel
        or
        unknownField
        +14 more
        required
      • message
        string
        required
      • fix
        required

        One of the following:

        • string
        • null
      • location
        required

        One of the following:

        • object
          • line
            integer
            required
            maximum: 9007199254740991 · minimum: -9007199254740991
          • column
            integer
            required
            maximum: 9007199254740991 · minimum: -9007199254740991
        • null
      • policy
        required

        One of the following:

        • string
        • null
      • statement
        required

        One of the following:

        • integer
        • null
      • term
        required

        One of the following:

        • array<integer>
        • null
  • InvalidCustomRecordEncoded
    • _tag
      InvalidCustomRecord
      required
    • reason
      string
      required
      minLength: 1
  • ExtensionScheduleNotDeclaredEncoded
    • _tag
      ExtensionScheduleNotDeclared
      required
    • extension_name
      string
      required
      minLength: 1
    • version
      string
      required
      minLength: 1
    • schedule
      string
      required
      minLength: 1
    • message
      string
      required
  • ExtensionTriggerNotDeclaredEncoded
    • _tag
      ExtensionTriggerNotDeclared
      required
    • extension_name
      string
      required
      minLength: 1
    • version
      string
      required
      minLength: 1
    • trigger
      string
      required
      minLength: 1

429

RateLimited
JSON
  • _tag
    RateLimited
    required

500

OrgFailure | RepoFailure
JSON

One of the following:

  • OrgFailureEncoded
    • _tag
      OrgFailure
      required
    • reason
      string
      required
  • RepoFailureEncoded
    • _tag
      RepoFailure
      required
    • reason
      string
      required

503

SessionUnavailable | RateLimitUnavailable
JSON

One of the following:

  • SessionUnavailableEncoded
    • _tag
      SessionUnavailable
      required
  • RateLimitUnavailableEncoded
    • _tag
      RateLimitUnavailable
      required

Type to search…

↑↓ navigate↵ selectEsc close