Skip to main content
DELETE
/
preferences
/
sections
/
{section_id}
/
topics
/
{topic_id}
JavaScript
import Courier from '@trycourier/courier';

const client = new Courier({
  apiKey: process.env['COURIER_API_KEY'], // This is the default and can be omitted
});

await client.workspacePreferences.topics.archive('topic_id', { section_id: 'section_id' });
import os
from courier import Courier

client = Courier(
api_key=os.environ.get("COURIER_API_KEY"), # This is the default and can be omitted
)
client.workspace_preferences.topics.archive(
topic_id="topic_id",
section_id="section_id",
)
package main

import (
"context"

"github.com/trycourier/courier-go"
"github.com/trycourier/courier-go/option"
)

func main() {
client := courier.NewClient(
option.WithAPIKey("My API Key"),
)
err := client.WorkspacePreferences.Topics.Archive(
context.TODO(),
"topic_id",
courier.WorkspacePreferenceTopicArchiveParams{
SectionID: "section_id",
},
)
if err != nil {
panic(err.Error())
}
}
package com.courier.example;

import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.models.workspacepreferences.topics.TopicArchiveParams;

public final class Main {
private Main() {}

public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();

TopicArchiveParams params = TopicArchiveParams.builder()
.sectionId("section_id")
.topicId("topic_id")
.build();
client.workspacePreferences().topics().archive(params);
}
}
require "courier"

courier = Courier::Client.new(api_key: "My API Key")

result = courier.workspace_preferences.topics.archive("topic_id", section_id: "section_id")

puts(result)
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Courier\Client;
use Courier\Core\Exceptions\APIException;

$client = new Client(apiKey: getenv('COURIER_API_KEY') ?: 'My API Key');

try {
$result = $client->workspacePreferences->topics->archive(
'topic_id', sectionID: 'section_id'
);

var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}
using TryCourier;
using TryCourier.Models.WorkspacePreferences.Topics;

CourierClient client = new();

TopicArchiveParams parameters = new()
{
SectionID = "section_id",
TopicID = "topic_id",
};

await client.WorkspacePreferences.Topics.Archive(parameters);
courier workspace-preferences:topics archive \
--api-key 'My API Key' \
--section-id section_id \
--topic-id topic_id
curl --request DELETE \
--url https://api.courier.com/preferences/sections/{section_id}/topics/{topic_id} \
--header 'Authorization: Bearer <token>'
{
  "message": "Example message text",
  "type": "invalid_request_error"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

section_id
string
required

Id of the workspace preference.

topic_id
string
required

Id of the subscription preference topic.

Response

Successfully archived.