---
title: "Relate a card to a thread"
method: POST
path: "/api/inboxes/{channelId}/threads/{threadId}/relate-card"
tags: ["Inboxes"]
---

# Relate a card to a thread

`POST /api/inboxes/{channelId}/threads/{threadId}/relate-card`

## Request

- Base URL: `https://core-api.getaptly.com`
- URL: `https://core-api.getaptly.com/api/inboxes/{channelId}/threads/{threadId}/relate-card`
- Auth: one of:
  - API key in header `x-token`
  - API key in header `Authorization`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/getaptly/apis/aptly-api/docs/api/inboxes/:channelId/threads/:threadId/relate-card/post.ts> (a function with typed inputs; its response is checked against the schema)

Relates a card to the thread, so the thread appears in the card's related
conversations. The card is not created under the thread; it is only
related to it. Undo with `POST .../unrelate-card`. Runs the same
relation the Aptly apps do: the acting user must be able to see the
thread and have read access to the card's board, and the card's
conversation metrics are recalculated. Relating an already-related card
is a no-op.

The acting user is the delegate token's own user. With an API key or
partner token, name one in `userId`.

## Path parameters

- `channelId` string, required
- `threadId` string, required

## Request body

- object
  - `cardId` string, required: The card to relate.
  - `userId` string: Acting user. Required with an API key or partner token.

## Response `200`

Related.

- object
  - `data` object
    - `threadId` string
    - `cardId` string
    - `related` boolean: `true`.

## Other responses

- `400`: Invalid body or missing `userId`.
- `401`: The acting user is not in the company.
- `403`: No access to this inbox or to the card's board, or the acting user is a guest.
- `404`: Inbox, thread or card not found, or the acting user cannot see the thread.

---

[API](https://skmtc.dev/getaptly/apis/aptly-api.md) - [All operations](https://skmtc.dev/getaptly/apis/aptly-api/llms.txt) - [OpenAPI document](https://skmtc.dev/getaptly/apis/aptly-api/revisions/75c367e0b8e5?raw)
