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

# Create subscription

> **Required scopes:** `notification:subscription:write`



## OpenAPI

````yaml /.tooling/schemas/rest/tags/product-embedded-banking.json post /subscriptions
openapi: 3.1.0
info:
  title: Tesouro Partner API
  version: '2025-06-23'
  description: The Tesouro REST API, for Tesouro partners to integrate with our solution.
  termsOfService: https://tesouro.com/terms
  contact:
    name: Tesouro team
    url: https://tesouro.com/about/
    email: developers@tesouro.com
servers:
  - url: https://api.sandbox.tesouro.com
    description: Sandbox
security: []
tags:
  - name: Applications
  - name: Authorization Controls
  - name: Bank Accounts
  - name: Beneficial Owners
  - name: Checks
  - name: Debit Cards
  - name: Departments
  - name: Disclosures
  - name: Embedded Banking
  - name: External Bank Accounts
  - name: Instant Payment Eligibility
  - name: Instant Payment Limits
  - name: Locations
  - name: Money Movement
  - name: OIDC applications
  - name: Organization Summary
  - name: Organizations
  - name: Roles
  - name: Subscriptions
  - name: Transfers
  - name: Users
paths:
  /subscriptions:
    servers:
      - url: https://api.sandbox.tesouro.com/api/v1/notifications
        description: Sandbox
    post:
      tags:
        - Subscriptions
      summary: Create subscription
      description: '**Required scopes:** `notification:subscription:write`'
      operationId: CreateSubscription
      parameters:
        - name: api-version
          in: query
          schema:
            type: string
      requestBody:
        description: Cancellation token.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSubscriptionRequest'
          application/*+json:
            schema:
              $ref: '#/components/schemas/CreateSubscriptionRequest'
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
      security:
        - HTTPBearer: []
components:
  schemas:
    CreateSubscriptionRequest:
      required:
        - eventType
        - channelType
        - channelConfig
      type: object
      properties:
        channelConfig:
          $ref: '#/components/schemas/ChannelConfigRequest'
        channelType:
          $ref: '#/components/schemas/ChannelType'
        eventType:
          $ref: '#/components/schemas/WebhookEventType'
        scope:
          $ref: '#/components/schemas/SubscriptionScope'
          description: Defaults to SELF when omitted.
    SubscriptionResponse:
      required:
        - id
        - organizationId
        - eventType
        - channelType
        - channelConfig
        - scope
        - isActive
      type: object
      properties:
        id:
          type: string
          description: Unique identifier for the subscription.
          format: uuid
        channelConfig:
          $ref: '#/components/schemas/ChannelConfigResponse'
          description: |-
            Channel-specific configuration (e.g., webhook URL).
            Sensitive fields like signingSecret are excluded.
        channelType:
          $ref: '#/components/schemas/ChannelType'
          description: Channel through which notifications are sent.
        createdAt:
          type:
            - 'null'
            - string
          description: When the subscription was created.
          format: date-time
        eventType:
          $ref: '#/components/schemas/WebhookEventType'
          description: Type of event that triggers this notification.
        isActive:
          type: boolean
          description: Whether this subscription is active.
        organizationId:
          type: string
          description: Organization that owns this subscription.
          format: uuid
        scope:
          $ref: '#/components/schemas/SubscriptionScope'
          description: >-
            SELF delivers only the subscriber's own events; DESCENDANTS also
            delivers events of every organization below it.
        updatedAt:
          type:
            - 'null'
            - string
          description: When the subscription was last updated.
          format: date-time
      description: Response model for a notification subscription.
    ProblemDetails:
      type: object
      properties:
        detail:
          type:
            - 'null'
            - string
        instance:
          type:
            - 'null'
            - string
        status:
          pattern: ^-?(?:0|[1-9]\d*)$
          type:
            - 'null'
            - integer
            - string
          format: int32
        title:
          type:
            - 'null'
            - string
        type:
          type:
            - 'null'
            - string
    ChannelConfigRequest:
      required:
        - type
      type: object
      anyOf:
        - $ref: '#/components/schemas/ChannelConfigRequestWebhookChannelConfigRequest'
      discriminator:
        propertyName: type
        mapping:
          webhook: '#/components/schemas/ChannelConfigRequestWebhookChannelConfigRequest'
    ChannelType:
      enum:
        - EMAIL
        - WEBHOOK
      type: string
    WebhookEventType:
      enum:
        - UNDERWRITING_APPLICATION_UPDATED
        - ACCEPTOR_APPLICATION_APPROVED
        - ACCEPTOR_APPLICATION_SUBMITTED
        - IDENTITY_VERIFICATION_STATUS_CHANGED
        - BANK_ACCOUNT_APPLICATION_STATUS_CHANGED
        - BANK_ACCOUNT_APPLICATION_KYC_STATUS_CHANGED
        - BANK_ACCOUNT_TRANSFER_STATUS_CHANGED
        - EXTERNAL_BANK_ACCOUNT_CHANGED
        - LEDGER_TRANSACTION
        - LEDGER_POSTING_EXCEPTION
        - LEDGER_ACCOUNT_EXCEPTION
        - ACCOUNT_STATUS_CHANGED
        - ACCOUNT_RESTRICTION_CHANGED
        - PAYMENT_LINK_AUTHORIZED
        - PAYMENT_LINK_DECLINED
        - PAYMENT_LINK_EXPIRED
        - PAYMENT_LINK_CANCELLED
        - PAYMENT_LINK_REFUND_REQUESTED
        - DEBIT_CARD_CREATED
      type: string
    SubscriptionScope:
      enum:
        - SELF
        - DESCENDANTS
      type: string
    ChannelConfigResponse:
      required:
        - type
      type: object
      anyOf:
        - $ref: >-
            #/components/schemas/ChannelConfigResponseWebhookChannelConfigResponse
      description: Base response model for channel configuration (excludes sensitive data).
      discriminator:
        propertyName: type
        mapping:
          webhook: >-
            #/components/schemas/ChannelConfigResponseWebhookChannelConfigResponse
    ChannelConfigRequestWebhookChannelConfigRequest:
      required:
        - url
      properties:
        mtls:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/MtlsConfigRequest'
        type:
          enum:
            - webhook
          type: string
        url:
          type: string
    ChannelConfigResponseWebhookChannelConfigResponse:
      required:
        - url
      properties:
        mtlsEnabled:
          type:
            - 'null'
            - boolean
          description: |-
            Whether mTLS is enabled for this webhook endpoint.
            Uses the organization's active certificate configuration.
        type:
          enum:
            - webhook
          type: string
        url:
          type: string
          description: The webhook endpoint URL.
      description: >-
        Webhook channel configuration response (excludes signingSecret, headers,
        and mTLS secrets).
    MtlsConfigRequest:
      required:
        - enabled
      type: object
      properties:
        enabled:
          type: boolean
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

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