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

# Create Subscriber

> Create or resubscribe one newsletter subscriber from a server-side integration. Keep the API key on your backend server; do not call this endpoint from browser JavaScript.



## OpenAPI

````yaml /openapi.json post /newsletter/subscribers
openapi: 3.0.3
info:
  title: Maito API Reference
  version: 0.1.0
  description: Supported endpoints for external Maito integrations.
servers:
  - url: https://api.getmaito.com/v1
    description: Maito Cloud
security:
  - bearerAuth: []
tags:
  - name: Newsletter
    description: Manage newsletter settings, subscribers, issues, and analytics.
  - name: Media Uploads
    description: Upload media assets for social and newsletter content.
paths:
  /newsletter/subscribers:
    post:
      tags:
        - Newsletter
      summary: Create Subscriber
      description: >-
        Create or resubscribe one newsletter subscriber from a server-side
        integration. Keep the API key on your backend server; do not call this
        endpoint from browser JavaScript.
      operationId: createNewsletterSubscriber
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateNewsletterSubscriberPayload'
            examples:
              basic:
                summary: Server-side subscribe form
                value:
                  email: reader@example.com
                  sourceType: api
                  source: custom_website
                  optInAttestation: true
      responses:
        '201':
          description: Subscriber created or updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NewsletterSubscriberResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/ValidationError'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateNewsletterSubscriberPayload:
      type: object
      required:
        - email
        - optInAttestation
      properties:
        email:
          type: string
          format: email
        tags:
          type: array
          items:
            type: string
        customFields:
          $ref: '#/components/schemas/JsonObject'
        sourceType:
          $ref: '#/components/schemas/NewsletterSubscriberSourceType'
        source:
          type: string
          maxLength: 160
        sourceIssueId:
          type: string
        sourcePostId:
          type: string
        sourceCtaLinkId:
          type: string
        sourcePlatform:
          $ref: '#/components/schemas/NewsletterSourcePlatform'
        optInAttestation:
          type: boolean
          enum:
            - true
      description: >-
        Use from a backend server only. optInAttestation must be true to confirm
        the subscriber explicitly opted in.
    NewsletterSubscriberResponse:
      allOf:
        - $ref: '#/components/schemas/ApiSuccess'
        - type: object
          properties:
            data:
              $ref: '#/components/schemas/NewsletterSubscriber'
    JsonObject:
      type: object
      additionalProperties: true
    NewsletterSubscriberSourceType:
      type: string
      enum:
        - manual
        - subscribe_page
        - social_post
        - embed
        - import
        - api
        - referral
    NewsletterSourcePlatform:
      type: string
      enum:
        - x
        - linkedin
    ApiSuccess:
      type: object
      required:
        - ok
        - data
      properties:
        ok:
          type: boolean
          enum:
            - true
        data: {}
    NewsletterSubscriber:
      type: object
      required:
        - id
        - workspaceId
        - accountSetId
        - emailNormalized
        - emailOriginal
        - status
        - sourceType
        - subscribedAt
        - createdAt
        - updatedAt
      properties:
        id:
          type: string
        workspaceId:
          type: string
        accountSetId:
          type: string
          format: uuid
        emailNormalized:
          type: string
          format: email
        emailOriginal:
          type: string
        status:
          $ref: '#/components/schemas/NewsletterSubscriberStatus'
        sourceType:
          $ref: '#/components/schemas/NewsletterSubscriberSourceType'
        source:
          type: string
          nullable: true
        sourceIssueId:
          type: string
          nullable: true
        sourcePostId:
          type: string
          nullable: true
        sourceCtaLinkId:
          type: string
          nullable: true
        sourcePlatform:
          allOf:
            - $ref: '#/components/schemas/NewsletterSourcePlatform'
          nullable: true
        sourceVisitorId:
          type: string
          nullable: true
        subscribedAt:
          type: string
        unsubscribedAt:
          type: string
          nullable: true
        createdAt:
          type: string
        updatedAt:
          type: string
    ErrorResponse:
      type: object
      required:
        - ok
        - error
      properties:
        ok:
          type: boolean
          enum:
            - false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details: {}
          additionalProperties: true
    NewsletterSubscriberStatus:
      type: string
      enum:
        - subscribed
        - unsubscribed
        - bounced
        - complained
        - blocked
  responses:
    Unauthorized:
      description: The API key is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            ok: false
            error:
              code: UNAUTHORIZED
              message: Authentication required.
    Forbidden:
      description: Forbidden.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ValidationError:
      description: The request failed validation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            ok: false
            error:
              code: VALIDATION_ERROR
              message: Invalid document query.
              details: []
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      x-default: your-api-key

````