PydanticAI Channels API

The Channels API from PydanticAI — 2 operation(s) for channels.

OpenAPI Specification

pydantic-ai-channels-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Pydantic API Discovery Alerts Channels API
  version: 1.0.0
  summary: Discovery document for Pydantic's region-partitioned APIs.
  description: 'Pydantic Logfire is region-partitioned. This document does not describe the Logfire API directly — it advertises a single discovery endpoint that lists the per-region OpenAPI specifications.


    - **US region**: https://logfire-us.pydantic.dev/api/openapi.json

    - **EU region**: https://logfire-eu.pydantic.dev/api/openapi.json


    ## Versioning


    This discovery API uses URL path versioning. The current major version is `v1` and is served from `https://pydantic.dev/api/v1/`. Unversioned requests to `https://pydantic.dev/api` and `https://pydantic.dev/api/` are permanently redirected (HTTP 308) to the current major version. Breaking changes will be released under a new major version (e.g. `/api/v2/`) and the previous version will be supported for at least 12 months after the new version ships, with the deprecation date advertised in the `Deprecation` and `Sunset` response headers (RFC 8594, RFC 9745).


    Responses include an `X-API-Version` header identifying the version that served the request.


    Related discovery resources:


    - [`/.well-known/api-catalog`](https://pydantic.dev/.well-known/api-catalog) — RFC 9727 Linkset of available API descriptions.

    - [`/.well-known/openapi-specs`](https://pydantic.dev/.well-known/openapi-specs) — JSON list of per-region OpenAPI specs.

    - [`/.well-known/oauth-protected-resource`](https://pydantic.dev/.well-known/oauth-protected-resource) — RFC 9728 OAuth protected resource metadata.'
  contact:
    name: Pydantic
    url: https://pydantic.dev
    email: hello@pydantic.dev
  license:
    name: Pydantic Terms of Service
    url: https://pydantic.dev/legal/terms-of-service
servers:
- url: https://pydantic.dev/api/v1
  description: Host Discovery — version 1
tags:
- name: Channels
paths:
  /v1/channels/:
    get:
      tags:
      - Channels
      summary: List Channels
      description: List all notification channels for the organization the project belongs to.
      operationId: list_channels_v1_channels__get
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/ChannelRead'
                type: array
                title: Response List Channels V1 Channels  Get
        '429':
          description: Rate limit exceeded
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionError'
      security:
      - OAuth2AuthorizationCodeBearer:
        - organization:read_channel
    post:
      tags:
      - Channels
      summary: Create Channel
      description: Create a notification channel.
      operationId: create_channel_v1_channels__post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChannelCreate'
        required: true
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChannelRead'
        '429':
          description: Rate limit exceeded
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
      - OAuth2AuthorizationCodeBearer:
        - organization:write_channel
  /v1/channels/{channel_id}/:
    get:
      tags:
      - Channels
      summary: Get Channel
      description: Get a single notification channel by ID
      operationId: get_channel_v1_channels__channel_id___get
      security:
      - OAuth2AuthorizationCodeBearer:
        - organization:read_channel
      parameters:
      - name: channel_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Channel Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChannelRead'
        '429':
          description: Rate limit exceeded
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    put:
      tags:
      - Channels
      summary: Update Channel
      description: Update a notification channel.
      operationId: update_channel_v1_channels__channel_id___put
      security:
      - OAuth2AuthorizationCodeBearer:
        - organization:write_channel
      parameters:
      - name: channel_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Channel Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChannelUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChannelRead'
        '429':
          description: Rate limit exceeded
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
    delete:
      tags:
      - Channels
      summary: Delete Channel
      description: Delete a notification channel.
      operationId: delete_channel_v1_channels__channel_id___delete
      security:
      - OAuth2AuthorizationCodeBearer:
        - organization:write_channel
      parameters:
      - name: channel_id
        in: path
        required: true
        schema:
          type: string
          format: uuid
          title: Channel Id
      responses:
        '204':
          description: Successful Response
        '429':
          description: Rate limit exceeded
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: string
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPExceptionError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPExceptionError:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
      - detail
      title: HTTPExceptionError
    ChannelRead:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        organization_id:
          type: string
          format: uuid
          title: Organization Id
        label:
          type: string
          title: Label
        active:
          type: boolean
          title: Active
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          anyOf:
          - type: string
            format: date-time
          - type: 'null'
          title: Updated At
        created_by_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Created By Name
        updated_by_name:
          anyOf:
          - type: string
          - type: 'null'
          title: Updated By Name
        config:
          oneOf:
          - $ref: '#/components/schemas/Webhook'
          - $ref: '#/components/schemas/Opsgenie'
          - $ref: '#/components/schemas/Notification'
          title: Config
          discriminator:
            propertyName: type
            mapping:
              notification: '#/components/schemas/Notification'
              opsgenie: '#/components/schemas/Opsgenie'
              webhook: '#/components/schemas/Webhook'
      type: object
      required:
      - id
      - organization_id
      - label
      - active
      - created_at
      - updated_at
      - created_by_name
      - updated_by_name
      - config
      title: ChannelRead
    ChannelCreate:
      properties:
        label:
          type: string
          title: Label
        config:
          oneOf:
          - $ref: '#/components/schemas/Webhook'
          - $ref: '#/components/schemas/Opsgenie'
          - $ref: '#/components/schemas/Notification'
          title: Config
          discriminator:
            propertyName: type
            mapping:
              notification: '#/components/schemas/Notification'
              opsgenie: '#/components/schemas/Opsgenie'
              webhook: '#/components/schemas/Webhook'
      type: object
      required:
      - label
      - config
      title: ChannelCreate
    Opsgenie:
      properties:
        type:
          type: string
          enum:
          - opsgenie
          title: Type
        auth_key:
          type: string
          title: Auth Key
        base_url:
          type: string
          title: Base Url
      type: object
      required:
      - type
      - auth_key
      title: Opsgenie
    WebhookFormat:
      type: string
      enum:
      - auto
      - slack-blockkit
      - slack-legacy
      - raw-data
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
            - type: string
            - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
      - loc
      - msg
      - type
      title: ValidationError
    WebhookUpdate:
      properties:
        type:
          type: string
          enum:
          - webhook
          title: Type
        format:
          $ref: '#/components/schemas/WebhookFormat'
        url:
          type: string
          title: Url
      type: object
      required:
      - type
      - format
      - url
      title: WebhookUpdate
      description: Webhook config variant for updates that allows empty URL (signals "keep existing credential").
    Webhook:
      properties:
        type:
          type: string
          enum:
          - webhook
          title: Type
        format:
          $ref: '#/components/schemas/WebhookFormat'
        url:
          type: string
          title: Url
      type: object
      required:
      - type
      - format
      - url
      title: Webhook
    Notification:
      properties:
        type:
          type: string
          enum:
          - notification
          title: Type
        recipients:
          items:
            type: string
            format: uuid
          type: array
          title: Recipients
      type: object
      required:
      - type
      - recipients
      title: Notification
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ChannelUpdate:
      properties:
        label:
          anyOf:
          - type: string
          - type: 'null'
          title: Label
        config:
          anyOf:
          - oneOf:
            - $ref: '#/components/schemas/WebhookUpdate'
            - $ref: '#/components/schemas/Opsgenie'
            - $ref: '#/components/schemas/Notification'
            discriminator:
              propertyName: type
              mapping:
                notification: '#/components/schemas/Notification'
                opsgenie: '#/components/schemas/Opsgenie'
                webhook: '#/components/schemas/WebhookUpdate'
          - type: 'null'
          title: Config
        active:
          anyOf:
          - type: boolean
          - type: 'null'
          title: Active
      type: object
      title: ChannelUpdate