beehiiv subpackage_subscriptionTags API

The subpackage_subscriptionTags API from beehiiv — 1 operation(s) for subpackage_subscriptiontags.

OpenAPI Specification

beehiiv-subpackage-subscriptiontags-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: API Reference subpackage_advertisement_opportunities subpackage_subscriptionTags API
  version: 1.0.0
servers:
- url: https://api.beehiiv.com/v2
tags:
- name: subpackage_subscriptionTags
paths:
  /publications/{publicationId}/subscriptions/{subscriptionId}/tags:
    post:
      operationId: create
      summary: 'Add subscription tag <Badge intent="info" minimal outlined>OAuth Scope: subscriptions:write</Badge>'
      description: Adds tags to a subscription. If the tag does not exist on the publication, it will be created automatically.
      tags:
      - subpackage_subscriptionTags
      parameters:
      - name: publicationId
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/type_ids:PublicationId'
      - name: subscriptionId
        in: path
        required: true
        schema:
          $ref: '#/components/schemas/type_ids:SubscriptionId'
      - name: Authorization
        in: header
        description: Bearer authentication
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_subscriptionTags:SubscriptionTagsCreateResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_:Error'
        '404':
          description: Resource Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_:Error'
        '429':
          description: Rate Limit Exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_:Error'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/type_:Error'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                tags:
                  type: array
                  items:
                    type: string
                  description: Tags that can be used to group subscribers
components:
  schemas:
    type_:SubscriptionExpandedSubscriptionTier:
      type: string
      enum:
      - free
      - premium
      description: The current tier of the subscription.
      title: SubscriptionExpandedSubscriptionTier
    type_:SubscriptionTags:
      type: array
      items:
        type: string
      description: 'Optional list of tags for a subscription. Retrievable by including `expand: [tags]` in the request body.

        Max limit of 100 unique tags per publication.'
      title: SubscriptionTags
    type_:SubscriptionTierList:
      type: array
      items:
        $ref: '#/components/schemas/type_:SubscriptionTierInfo'
      description: 'Optional list of tiers for a subscription. Retrievable by including `expand: [subscription_premium_tiers]` in the request body.'
      title: SubscriptionTierList
    type_:SubscriptionExpandedStatus:
      type: string
      enum:
      - validating
      - invalid
      - pending
      - active
      - inactive
      - needs_attention
      - paused
      description: The status of the subscription.<br>`validating` - The email address is being validated.<br>`invalid` - The email address is invalid.<br>`pending` - The email address is valid, but the subscription is pending double opt-in.<br>`active` - The email was valid and the subscription is active.<br>`inactive` - The subscription was made inactive, possibly due to an unsubscribe.<br>`needs_attention` - The subscription requires approval or denial.<br>`paused` - The subscriber has paused their subscription.
      title: SubscriptionExpandedStatus
    type_:SubscriptionExpandedUtmChannel:
      type: string
      enum:
      - ''
      - website
      - import
      - embed
      - api
      - referral
      - recommendation
      - magic_link
      - boost
      - boost_send
      - boost_direct_link
      - integration
      - product
      description: The acquisition channel
      title: SubscriptionExpandedUtmChannel
    type_:CustomField:
      type: object
      properties:
        name:
          type: string
          description: The name of the existing custom field
        kind:
          $ref: '#/components/schemas/type_:CustomFieldType'
          description: The type of value being stored in the custom field.
        value:
          $ref: '#/components/schemas/type_:CustomFieldDataType'
          description: The value stored for the subscription
      title: CustomField
    type_:SubscriptionStats:
      type: object
      properties:
        emails_received:
          type: integer
          description: The total number of emails that have been sent to this subscriber
        open_rate:
          type: number
          format: double
          description: The percentage of emails that the subscriber has opened
        click_through_rate:
          type: number
          format: double
          description: The percentage of emails that the subscriber has clicked a link in
      description: 'Optional list of stats for a subscription. Retrievable by including `expand: [stats]` in the request body.'
      title: SubscriptionStats
    type_:SubscriptionCustomFieldList:
      type: array
      items:
        $ref: '#/components/schemas/type_:CustomField'
      description: 'Optional list of custom fields for a subscription. Retrievable by including `expand: [custom_field]` in the request body.'
      title: SubscriptionCustomFieldList
    type_:ErrorDetail:
      type: object
      properties:
        message:
          type: string
        code:
          type: string
      required:
      - message
      - code
      title: ErrorDetail
    type_:CustomFieldDataType:
      oneOf:
      - type: string
      - type: number
        format: double
      - type: boolean
      - type: array
        items:
          type: string
      title: CustomFieldDataType
    type_:Subscription:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/type_ids:SubscriptionId'
          description: The prefixed subscription id
        email:
          type: string
          format: email
        status:
          $ref: '#/components/schemas/type_:SubscriptionExpandedStatus'
          description: The status of the subscription.<br>`validating` - The email address is being validated.<br>`invalid` - The email address is invalid.<br>`pending` - The email address is valid, but the subscription is pending double opt-in.<br>`active` - The email was valid and the subscription is active.<br>`inactive` - The subscription was made inactive, possibly due to an unsubscribe.<br>`needs_attention` - The subscription requires approval or denial.
        created:
          type: integer
          description: The date the subscription was created. Measured in seconds since the Unix epoch
        subscription_tier:
          $ref: '#/components/schemas/type_:SubscriptionExpandedSubscriptionTier'
          description: The current tier of the subscription.
        subscription_premium_tier_names:
          type: array
          items:
            type: string
          description: The current premium tiers of the subscription. Empty if the subscriber is not associated with any premium tiers.
        utm_source:
          type: string
          description: The acquisition source; where the subscriber came from
        utm_medium:
          type: string
          description: The acquisition medium; how the subscriber got to your publication
        utm_channel:
          $ref: '#/components/schemas/type_:SubscriptionExpandedUtmChannel'
          description: The acquisition channel
        utm_campaign:
          type: string
          description: The acquisition campaign
        utm_term:
          type: string
          description: The acquisition term; typically the keyword or search term
        utm_content:
          type: string
          description: The acquisition content; typically used for A/B testing or ad variations
        referring_site:
          type: string
          description: The website that the subscriber was referred from
        referral_code:
          type: string
          description: The code associated to this subscriber to refer others. When a new subscription is created with this referral code, credit for the referral goes to this subscription.
        subscription_premium_tiers:
          $ref: '#/components/schemas/type_:SubscriptionTierList'
        custom_fields:
          $ref: '#/components/schemas/type_:SubscriptionCustomFieldList'
        tags:
          $ref: '#/components/schemas/type_:SubscriptionTags'
        stats:
          $ref: '#/components/schemas/type_:SubscriptionStats'
        newsletter_list_ids:
          type: array
          items:
            type: string
          description: The prefixed IDs of the newsletter lists this subscription is actively subscribed to. Requires `expand[]=newsletter_lists`. <Badge intent="warning" minimal outlined>Beta</Badge>
      required:
      - id
      - email
      - status
      - created
      - subscription_tier
      - subscription_premium_tier_names
      - utm_source
      - utm_medium
      - utm_channel
      - utm_campaign
      - utm_term
      - utm_content
      - referring_site
      - referral_code
      description: The subscription object
      title: Subscription
    type_ids:PublicationId:
      type: string
      description: The prefixed ID of the publication.
      title: PublicationId
    type_:CustomFieldType:
      type: string
      enum:
      - string
      - integer
      - boolean
      - date
      - datetime
      - list
      - double
      description: The type of value being stored in the custom field.
      title: CustomFieldType
    type_:SubscriptionTierInfoStatus:
      type: string
      enum:
      - active
      - archived
      description: Returns whether or not the tier has any active prices.
      title: SubscriptionTierInfoStatus
    type_subscriptionTags:SubscriptionTagsCreateResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/type_:Subscription'
      title: SubscriptionTagsCreateResponse
    type_ids:SubscriptionId:
      type: string
      description: The prefixed ID of the subscription.
      title: SubscriptionId
    type_:SubscriptionTierInfo:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/type_ids:TierId'
        name:
          type: string
        status:
          $ref: '#/components/schemas/type_:SubscriptionTierInfoStatus'
          description: Returns whether or not the tier has any active prices.
      required:
      - id
      - name
      - status
      title: SubscriptionTierInfo
    type_:Error:
      type: object
      properties:
        status:
          type: integer
        statusText:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/type_:ErrorDetail'
      required:
      - status
      - statusText
      - errors
      description: The top level error response.
      title: Error
    type_ids:TierId:
      type: string
      description: The prefixed ID of the tier.
      title: TierId
  securitySchemes:
    BearerAuthScheme:
      type: http
      scheme: bearer