# Topics

Create, rename, archive and delete Topics, the threads that hold one piece of work, and ask in them or read their messages.

## Operations

POST [Archive a Topic](https://heyarchie.com/en-gb/developers/api-reference/topics/archive-a-topic/)

Archives a Topic you have finished with, so it drops out of the default list of active topics. It needs topic_id and returns the topic's permakey and its new status, archived. An archived topic cannot be archived again, and topic.update with status active restores it.

POST [Ask a Question](https://heyarchie.com/en-gb/developers/api-reference/topics/ask-a-question/)

Asks Archie a question in a Topic's conversation and waits for the answer. It needs topic_id and question, and it waits up to timeout_seconds, which defaults to 120. If the answer is not ready in time it returns status running with the ids to poll while the turn carries on, and topic.messages reads the answer once it is done. When it finishes in time it returns status completed with the answer.

POST [Create a Topic in the Caller's Workspace](https://heyarchie.com/en-gb/developers/api-reference/topics/create-a-topic-in-the-callers-workspace/)

Creates a new Topic in your workspace, for example one for a client's year-end work. It needs a name, and you can also set type (client by default), client_id and theme_color. It returns the new topic's permakey, name, type and workspace, and the permakey is the id to use in every later topic call.

POST [Soft-Delete a Topic](https://heyarchie.com/en-gb/developers/api-reference/topics/soft-delete-a-topic/)

Soft-deletes a Topic and unlinks its conversations, so the topic drops off every list. It needs topic_id and returns deleted as true. Only an operator can reverse a deletion, and because the consequence level is critical it needs a person's confirmation before it runs.

POST [Get a Topic by UUID](https://heyarchie.com/en-gb/developers/api-reference/topics/get-a-topic-by-uuid/)

Gets one Topic so you can see where a client's work stands. It needs topic_id, which is the topic's permakey or its UUID, and include_canvas adds the topic's canvas when you want it. It returns the name, type, status, client, conversation count, member count and metadata.

POST [Link a Conversation to a Topic](https://heyarchie.com/en-gb/developers/api-reference/topics/link-a-conversation-to-a-topic/)

Links an existing conversation to a Topic so the discussion sits with the client's work. It needs topic_id and conversation_id. A conversation belongs to at most one topic, and linking it again to the same topic changes nothing. It returns linked, which is true once the conversation is in the topic.

POST [List Topics in the Caller's Workspace](https://heyarchie.com/en-gb/developers/api-reference/topics/list-topics-in-the-callers-workspace/)

Lists the Topics in your workspace so you can find the client or matter you need. It needs no inputs, and you can narrow the list with status (active by default), type and search, then page through it with limit and offset. It returns each topic's permakey, name, type, status and last-updated time, plus the total number of topics.

POST [Read a Topic Conversation's Messages](https://heyarchie.com/en-gb/developers/api-reference/topics/read-a-topic-conversations-messages/)

Reads the messages in a Topic's conversation, oldest first, so you can follow a discussion or collect the answer to a question you posted. It needs topic_id and returns each message with its role, content and citations, plus a total, paged with limit and offset. It never creates a conversation.

POST [Post a Message](https://heyarchie.com/en-gb/developers/api-reference/topics/post-a-message/)

Posts a message into a Topic's conversation and sends it to Archie for an answer. It needs topic_id and message, and it returns at once with message_id and query_id instead of waiting. Read the answer later with topic.messages. When the topic has no conversation yet, one is created and linked for you.

POST [Update a Topic's Metadata](https://heyarchie.com/en-gb/developers/api-reference/topics/update-a-topics-metadata/)

Changes the details of an existing Topic, such as its name or the client it is bound to. It needs topic_id and changes only the fields you supply: name, type, status, theme colour, client, description or icon. Setting status to active restores an archived topic, but a deleted topic cannot be updated. It returns the topic's permakey, name, type and status.

Endpoints

[POST /api/v1/skills/topic.archive/invoke](https://heyarchie.com/en-gb/developers/api-reference/topics/archive-a-topic/)[POST /api/v1/skills/topic.ask/invoke](https://heyarchie.com/en-gb/developers/api-reference/topics/ask-a-question/)[POST /api/v1/skills/topic.create/invoke](https://heyarchie.com/en-gb/developers/api-reference/topics/create-a-topic-in-the-callers-workspace/)[POST /api/v1/skills/topic.delete/invoke](https://heyarchie.com/en-gb/developers/api-reference/topics/soft-delete-a-topic/)[POST /api/v1/skills/topic.get/invoke](https://heyarchie.com/en-gb/developers/api-reference/topics/get-a-topic-by-uuid/)[POST /api/v1/skills/topic.link.conversation/invoke](https://heyarchie.com/en-gb/developers/api-reference/topics/link-a-conversation-to-a-topic/)[POST /api/v1/skills/topic.list/invoke](https://heyarchie.com/en-gb/developers/api-reference/topics/list-topics-in-the-callers-workspace/)[POST /api/v1/skills/topic.messages/invoke](https://heyarchie.com/en-gb/developers/api-reference/topics/read-a-topic-conversations-messages/)[POST /api/v1/skills/topic.post.message/invoke](https://heyarchie.com/en-gb/developers/api-reference/topics/post-a-message/)[POST /api/v1/skills/topic.update/invoke](https://heyarchie.com/en-gb/developers/api-reference/topics/update-a-topics-metadata/)
