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

# Update Contact Topic Subscription

> Subscribe or unsubscribe a contact from a topic.

## Endpoint

`PUT /contacts/:contact_id/topics/:topic_id`

## Request body

```json theme={null}
{
  "is_subscribed": true
}
```

## Response

```json theme={null}
{
  "data": {
    "id": "0df0fc92-89f2-4f23-a9e6-e9da2f3c1685",
    "contact_id": "c671f89b-3ec1-4c58-9ad2-4ef8c2917cda",
    "topic_id": "8c3c4d0e-f7f3-4d7f-92ae-b1498f6a2fa9",
    "is_subscribed": true,
    "subscribed_at": "2026-06-08T15:12:00.000Z",
    "unsubscribed_at": null
  }
}
```

Successful updates also emit `sendrealm.topic.subscribed` or `sendrealm.topic.unsubscribed`.


## OpenAPI

````yaml api-reference/openapi.json PUT /contacts/{contact_id}/topics/{topic_id}
openapi: 3.0.1
info:
  title: Sendrealm API
  description: >-
    API for email, push, audience resources, domains, campaign drafts,
    templates, events, topics, and automations
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.sendrealm.com
security:
  - bearerAuth: []
paths:
  /contacts/{contact_id}/topics/{topic_id}:
    put:
      summary: Update a contact topic subscription
      parameters:
        - name: contact_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: topic_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - is_subscribed
              properties:
                is_subscribed:
                  type: boolean
      responses:
        '200':
          description: Subscription updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TopicSubscriptionResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    TopicSubscriptionResponse:
      type: object
      required:
        - status
        - data
      properties:
        status:
          type: integer
          description: HTTP response status code
        data:
          $ref: '#/components/schemas/TopicSubscription'
    TopicSubscription:
      type: object
      required:
        - id
        - contact_id
        - topic_id
        - is_subscribed
        - subscribed_at
        - unsubscribed_at
      properties:
        id:
          type: string
          format: uuid
        contact_id:
          type: string
          format: uuid
        topic_id:
          type: string
          format: uuid
        is_subscribed:
          type: boolean
        subscribed_at:
          type: string
          format: date-time
        unsubscribed_at:
          type: string
          format: date-time
          nullable: true
    Error:
      type: object
      required:
        - status
        - error
      properties:
        status:
          type: integer
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
            message:
              type: string
            details:
              $ref: '#/components/schemas/JsonValue'
            issues:
              type: array
              items:
                $ref: '#/components/schemas/ValidationIssue'
    JsonValue:
      oneOf:
        - type: string
          nullable: true
        - type: number
        - type: boolean
        - type: object
          additionalProperties:
            $ref: '#/components/schemas/JsonValue'
        - type: array
          items:
            $ref: '#/components/schemas/JsonValue'
    ValidationIssue:
      type: object
      required:
        - code
        - path
        - message
      properties:
        code:
          type: string
        path:
          type: string
          nullable: true
        message:
          type: string
  responses:
    BadRequest:
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````