# manageConversation

This method allows you to manage a conversation thread by archiving, starring, or muting it.

```typescript
try {
  const workflow = await linkedapi.manageConversation.execute({
    threadId: "2-Zjhm...",
    operation: "archive"
  });

  const { errors } = await linkedapi.manageConversation.result(workflow.workflowId);

  // The list of possible execution errors is below
  if (errors && errors.length > 0) {
    console.warn('Workflow completed with execution errors:');
    errors.forEach(error => {
      console.warn(` - Type: ${error.type}, Message: ${error.message}`);
    });
  } else {
    console.log('Conversation updated successfully.');
  }
} catch (e) {
  // A list of all critical errors can be found here:
  // https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
  if (e instanceof LinkedApiError) {
    console.error(`Critical Error - Type: ${e.type}, Message: ${e.message}`);
  } else {
    console.error('An unexpected, non-API error occurred:', e);
  }
}
```

```python
from linkedapi import ManageConversationParams, LinkedApiError

try:
    workflow = linkedapi.manage_conversation.execute(
        ManageConversationParams(
            thread_id="2-Zjhm...",
            operation="archive",
        )
    )

    result = linkedapi.manage_conversation.result(workflow.workflow_id)
    errors = result.errors

    # The list of possible execution errors is below
    if errors:
        print("Workflow completed with execution errors:")
        for error in errors:
            print(f" - Type: {error.type}, Message: {error.message}")
    else:
        print("Conversation updated successfully.")
except LinkedApiError as e:
    # A list of all critical errors can be found here:
    # https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
    print(f"Critical Error - Type: {e.type}, Message: {e.message}")
except Exception as error:
    print("An unexpected, non-API error occurred:", error)
```

## Params

- `threadId`  – identifier of the conversation thread to manage, as returned by [`pollInbox`](/sdks/poll-inbox) or [`pollConversations`](/sdks/poll-conversations), or read from the address bar of an open conversation — the `<id>` in `linkedin.com/messaging/thread/<id>`.
- `operation`  – operation to apply to the thread: `archive`, `unarchive`, `star`, `unstar`, `mute`, or `unmute`.

## Data

The method doesn't return any data.

## Errors

- `threadNotFound` – provided `threadId` does not match an existing conversation.
