Create a contact book
Create a new contact book.
https://app.usenotix.dev/api/v1/contactBooksNeeds a full access key. Sending access keys cannot call this. Key permissions lists the extra rules some calls have.
Create a new contact book. Double opt-in is off unless doubleOptInEnabled is true, and then doubleOptInFrom is required: an address on one of your verified domains. Without it the request is refused with 422 and nothing is created.
Body parameters
Off unless set to true. When true, doubleOptInFrom is required.
The confirmation email's from address, on one of your verified domains. Required when doubleOptInEnabled is true.
Can be null.
Headers
Bearer followed by your API key.
Errors
doubleOptInEnabled is true but doubleOptInFrom is missing, or is not on one of your verified domains. Nothing was created.
Every error has the same shape. See all error codes.
curl -X POST "https://app.usenotix.dev/api/v1/contactBooks" \
-H "Authorization: Bearer $NOTIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme"
}'
import { Notix } from "notix-js";
const notix = new Notix(process.env.NOTIX_API_KEY);
const { data, error } = await notix.contactBooks.create({
name: "Newsletter",
variables: ["company", "plan"],
});
from notix import Notix
notix = Notix() # reads NOTIX_API_KEY
book, _ = notix.contact_books.create({"name": "Newsletter", "variables": ["company", "plan"]})
use Notix\Notix;
$notix = new Notix(getenv('NOTIX_API_KEY'));
$book = $notix->contactBooks->create(['name' => 'Newsletter', 'variables' => ['company', 'plan']]);
{
"id": "clx1234567890",
"name": "Newsletter Subscribers",
"teamId": 1,
"properties": {
"customField1": "value1"
},
"variables": [
"registrationCode",
"company"
],
"emoji": "📙",
"createdAt": "string",
"updatedAt": "string"
}