Skip to content

[SDK: Python] Add Webhook endpoints/interface#8

Merged
infinityplusone merged 1 commit intomainfrom
issue-1274/webhooks
Feb 9, 2026
Merged

[SDK: Python] Add Webhook endpoints/interface#8
infinityplusone merged 1 commit intomainfrom
issue-1274/webhooks

Conversation

@infinityplusone
Copy link
Contributor

@infinityplusone infinityplusone commented Jan 21, 2026

Changes

Adds comprehensive Webhooks v2 client support and multiple new API endpoints to the tango-python SDK.

Webhooks v2 Support

  • Event type discovery: list_webhook_event_types() to discover supported event types and subject types
  • Subscription management: Full CRUD operations for webhook subscriptions
    • list_webhook_subscriptions() - List subscriptions with tier-capped pagination (page + page_size)
    • get_webhook_subscription() - Get a single subscription by ID
    • create_webhook_subscription() - Create a new subscription
    • update_webhook_subscription() - Update subscription name and/or payload
    • delete_webhook_subscription() - Delete a subscription
  • Endpoint management: Full CRUD operations for webhook endpoints
    • list_webhook_endpoints() - List endpoints with standard pagination
    • get_webhook_endpoint() - Get a single endpoint by ID
    • create_webhook_endpoint() - Create a new endpoint (one per user)
    • update_webhook_endpoint() - Update endpoint callback URL and/or active status
    • delete_webhook_endpoint() - Delete an endpoint
  • Testing utilities:
    • test_webhook_delivery() - Send a test webhook to verify endpoint connectivity
    • get_webhook_sample_payload() - Fetch sample payloads for development/testing
  • Type definitions: Complete dataclasses for all webhook models (WebhookSubscription, WebhookEndpoint, WebhookEventType, etc.)

New API Endpoints

  • Offices: list_offices(), get_office() - Office hierarchy data
  • Organizations: list_organizations(), get_organization() - Organization structure with response shaping
  • OTAs: list_otas(), get_ota() - Other Transaction Agreements
  • OTIDVs: list_otidvs(), get_otidv() - Other Transaction IDVs
  • Subawards: list_subawards() - Subaward data with response shaping
  • NAICS: list_naics() - NAICS code lookup
  • Assistance: list_assistance() - Federal assistance awards

Other Changes

  • HTTP client: Added _patch() and _delete() helper methods for webhook management endpoints
  • Search support: Added search parameter to list_agencies()
  • New model schemas: Organization, OTA, OTIDV, Subaward
  • Default shapes: Shape configurations for all new endpoints
  • Explicit schemas: Response shaping support for new endpoints

Why

This implements:

  1. The full Webhooks v2 API surface area from the Tango server, enabling SDK users to discover event types, manage subscriptions/endpoints, and test webhook delivery
  2. Coverage for additional Tango API endpoints (Offices, Organizations, OTAs, OTIDVs, Subawards, NAICS, Assistance)

Testing

  • Comprehensive test suite covering all webhook endpoints
  • Integration tests with VCR cassettes for new endpoints
  • Production smoke tests for all new functionality
  • New check_filter_shape_conformance.py script for validating filter/shape support

Documentation

  • Updated API reference with all new endpoints
  • Updated developer guide with new endpoint examples
  • Updated SHAPES.md with new shape configurations

Notes

  • Pagination: Subscriptions use page + page_size (tier-capped), while endpoints use page + limit
  • Tier gating: "Catch-all" subscriptions (empty subject_ids) require Enterprise tier
  • Deliveries/redelivery: The server API does not currently expose public endpoints for listing deliveries or redelivery operations
  • Signature verification: Documentation includes Python code snippet for verifying webhook signatures (HMAC-SHA256)

Related

Resolves makegov/tango#1274

…and endpoints, including event type discovery and test delivery functionality. Update documentation and README to reflect new features.
@vdavez vdavez force-pushed the issue-1274/webhooks branch from b8284ff to f49271b Compare February 3, 2026 01:15
@infinityplusone infinityplusone merged commit 2436d35 into main Feb 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant