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.lists.restore('list_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.lists.restore(
"list_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.Lists.Restore(
context.TODO(),
"list_id",
courier.ListRestoreParams{},
)
if err != nil {
panic(err.Error())
}
}package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.core.JsonValue;
import com.courier.models.lists.ListRestoreParams;
import java.util.Map;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
ListRestoreParams params = ListRestoreParams.builder()
.listId("list_id")
.body(JsonValue.from(<String, Object>Map.of()))
.build();
client.lists().restore(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.lists.restore("list_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->lists->restore('list_id');
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Lists;
CourierClient client = new();
ListRestoreParams parameters = new() { ListID = "list_id" };
await client.Lists.Restore(parameters);courier lists restore \
--api-key 'My API Key' \
--list-id list_idcurl --request PUT \
--url https://api.courier.com/lists/{list_id}/restore \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'Lists
Restore a list
Restore a previously deleted list.
PUT
/
lists
/
{list_id}
/
restore
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.lists.restore('list_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.lists.restore(
"list_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.Lists.Restore(
context.TODO(),
"list_id",
courier.ListRestoreParams{},
)
if err != nil {
panic(err.Error())
}
}package com.courier.example;
import com.courier.client.CourierClient;
import com.courier.client.okhttp.CourierOkHttpClient;
import com.courier.core.JsonValue;
import com.courier.models.lists.ListRestoreParams;
import java.util.Map;
public final class Main {
private Main() {}
public static void main(String[] args) {
CourierClient client = CourierOkHttpClient.fromEnv();
ListRestoreParams params = ListRestoreParams.builder()
.listId("list_id")
.body(JsonValue.from(<String, Object>Map.of()))
.build();
client.lists().restore(params);
}
}require "courier"
courier = Courier::Client.new(api_key: "My API Key")
result = courier.lists.restore("list_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->lists->restore('list_id');
var_dump($result);
} catch (APIException $e) {
echo $e->getMessage();
}using TryCourier;
using TryCourier.Models.Lists;
CourierClient client = new();
ListRestoreParams parameters = new() { ListID = "list_id" };
await client.Lists.Restore(parameters);courier lists restore \
--api-key 'My API Key' \
--list-id list_idcurl --request PUT \
--url https://api.courier.com/lists/{list_id}/restore \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
A unique identifier representing the list you wish to retrieve.
Body
application/json
The body is of type object.
Response
204 - undefined
⌘I