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

# Subscribe (Id)

> This endpoint subscribes an existing contact to a newsletter using their **contact_id**.

It also allows updating name, email, and custom input fields. If automation is configured for the newsletter, an automation instance will be created.



## OpenAPI

````yaml POST /workspaces/{workspace}/newsletters/{newsletter}/subscribe
openapi: 3.1.0
info:
  title: Lancepilot API
  description: API for Lancepilot
  version: 1.0.0
  license:
    name: MIT
servers:
  - url: https://lancepilot.com/api/v3
security:
  - bearerAuth: []
paths:
  /workspaces/{workspace}/newsletters/{newsletter}/subscribe:
    post:
      summary: Subscribe contact by contact_id
      description: >-
        This endpoint subscribes an existing contact to a newsletter using their
        **contact_id**.


        It also allows updating name, email, and custom input fields. If
        automation is configured for the newsletter, an automation instance will
        be created.
      parameters:
        - name: workspace
          in: path
          description: ID of the workspace.
          required: true
          schema:
            type: string
            format: uuid
        - name: newsletter
          in: path
          required: true
          schema:
            type: integer
          description: The newsletter ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                contact_id:
                  type: string
                  format: uuid
                  description: Existing contact ID
                  example: e7b8d2a2-4c3f-4a1e-9c2e-123456789abc
                name:
                  type: string
                  nullable: true
                  example: John Doe
                email:
                  type: string
                  nullable: true
                  format: email
                  example: john@example.com
                custom_input_value:
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                        example: 1
                      value:
                        type: string
                        example: Some value
                    required:
                      - id
                      - value
                status:
                  type: boolean
                  description: true = subscribed, false = unsubscribed
                  example: true
              required:
                - contact_id
                - status
      responses:
        '200':
          $ref: '#/components/responses/200'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
components:
  responses:
    '200':
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                type: object
                properties: {}
            required:
              - data
    '401':
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Unauthenticated.
            required:
              - message
    '404':
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Resource not found.
              status:
                type: integer
                example: 404
            required:
              - message
              - status
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````