Corridor Guardrails API

Manage per-project security guardrails (reports) and packs.

OpenAPI Specification

corridor-guardrails-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Corridor Dashboard Guardrails API
  version: '1.0'
  summary: Programmatic access to Corridor findings, guardrails, PR reviews, team settings, and dashboard data.
  description: 'Corridor exposes a REST API for integrating its AI-coding security platform with CI/CD pipelines, custom dashboards, and other tools. All endpoints are authenticated with API tokens (the `cor_` prefix) passed as an `Authorization: Bearer` header. API tokens carry the same access as the user who created them and cannot perform admin operations (those require a user session). This specification was faithfully generated by the API Evangelist enrichment pipeline from Corridor''s published API reference; it is not a verbatim provider-published machine-readable spec.'
  contact:
    name: Corridor Support
    email: support@corridor.dev
    url: https://docs.corridor.dev/api/reference
  x-apievangelist-generated: '2026-07-18'
  x-apievangelist-method: generated
  x-apievangelist-source: https://docs.corridor.dev/api/reference
servers:
- url: https://app.corridor.dev/api
  description: Corridor production API
security:
- bearerAuth: []
tags:
- name: Guardrails
  description: Manage per-project security guardrails (reports) and packs.
paths:
  /projects/{id}/reports:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
      description: Project ID.
    get:
      operationId: listGuardrails
      tags:
      - Guardrails
      summary: List guardrails for a project
      description: Returns all guardrails (reports) and rulesets attached to a project.
      responses:
        '200':
          description: Guardrails and rulesets.
          content:
            application/json:
              schema:
                type: object
                properties:
                  reports:
                    type: array
                    items:
                      $ref: '#/components/schemas/Guardrail'
                  ruleset:
                    type: array
                    items:
                      type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    post:
      operationId: createGuardrail
      tags:
      - Guardrails
      summary: Create a guardrail
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GuardrailCreate'
      responses:
        '200':
          description: The created guardrail.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Guardrail'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /projects/{id}/guardrails/generate:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
      description: Project ID.
    post:
      operationId: generateGuardrail
      tags:
      - Guardrails
      summary: Generate a guardrail with AI
      description: Returns a taskId you can use to track generation progress.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - description
              properties:
                description:
                  type: string
                  maxLength: 1000
                  description: Plain-language description of the guardrail.
      responses:
        '200':
          description: Generation task accepted.
          content:
            application/json:
              schema:
                type: object
                properties:
                  taskId:
                    type: string
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /projects/{id}/reports/{reportId}:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
      description: Project ID.
    - name: reportId
      in: path
      required: true
      schema:
        type: string
      description: Guardrail report ID.
    put:
      operationId: updateGuardrail
      tags:
      - Guardrails
      summary: Update a guardrail
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                guardrail:
                  type: string
                type:
                  type: string
                  enum:
                  - guardrail
                  - context
      responses:
        '200':
          description: The updated guardrail.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Guardrail'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
    delete:
      operationId: deleteGuardrail
      tags:
      - Guardrails
      summary: Delete a guardrail
      responses:
        '200':
          description: Guardrail deleted.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /projects/{id}/packs:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
      description: Project ID.
    get:
      operationId: listGuardrailPacks
      tags:
      - Guardrails
      summary: List guardrail packs
      description: Returns the security packs (curated guardrail collections) attached to a project.
      responses:
        '200':
          description: Guardrail packs.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  responses:
    Unauthorized:
      description: Unauthorized — invalid or missing token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    BadRequest:
      description: Bad request — check your parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Guardrail:
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        guardrail:
          type: string
          description: The guardrail rule text.
        type:
          type: string
          enum:
          - guardrail
          - context
          default: guardrail
        createdAt:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        error:
          type: string
          description: Description of what went wrong.
      required:
      - error
    GuardrailCreate:
      type: object
      required:
      - name
      - guardrail
      properties:
        name:
          type: string
        guardrail:
          type: string
        type:
          type: string
          enum:
          - guardrail
          - context
          default: guardrail
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API token with the `cor_` prefix, generated from Profile > API Tokens in the Corridor dashboard. Passed as `Authorization: Bearer cor_...`.'