Skip to main content

Collection

In the Nostradamus platform, a collection is a structured set of data that you store and manage. Think of a collection as a specialized database that holds all the relevant information for a particular entity.

Each collection is designed to contain the contacts data specific to a single company. This means that for every company you work with, you will have a separate collection dedicated solely to storing and organizing its contacts.

When you create a new collection in the Nostradamus platform, it starts out empty. There won't be any data present initially. You will need to import your data into this new collection to start using it effectively.

How to create a collection

To create a collection, you need to send a POST request to the collection endpoint. Required parameters to be specified in the request body are:

  • name: the name of your choice;
  • product: Datumo;
  • timezone: the default timezone for the collection, you can specify any timezone from the IANA Time Zone Database.

Additionally you can specify:

  • tag: Additional metadata that can be associated to the collection.

No additional properties are required for Datumo.

curl --location 'https://nostradamus.u-hopper.com/api/collection' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token my-secret-token' \
--data '{
"name": "My Collection",
"product": "Datumo",
"timezone": "Europe/Rome",
"tag": {},
"properties": {}
}'

How to list collections

You can retrieve the list of the collections associated to your organization by sending a GET request to the collection endpoint.

curl --location 'https://nostradamus.u-hopper.com/api/collection' \
--header 'Authorization: Token my-secret-token'

You will receive a paginated list of collections.

Pagination allows you to control how many records are returned at a time and which part of the list to start from. You can specify the limit (i.e., the maximum number of records to return per page) and the offset (i.e., the number of records to skip before starting to return results) by adding the query parameters limit and offset to the request.

How to retrieve a collection

You can retrieve a specific collection by sending a GET request to the collection endpoint with the collection ID.

curl --location 'https://nostradamus.u-hopper.com/api/collection/{my-collection-id}' \
--header 'Authorization: Token my-secret-token'

You will receive the details of the collection.

How to update a collection

You can update a collection by sending a PUT request to the collection endpoint with the collection ID.

curl --request PUT --location 'https://nostradamus.u-hopper.com/api/collection/{my-collection-id}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Token my-secret-token' \
--data '{
"name": "My Updated Collection",
"timezone": "Europe/Rome",
"tag": {}
}'

You will receive the updated details of the collection.

How to delete a collection

You can delete a collection by sending a DELETE request to the collection endpoint with the collection ID.

curl --request DELETE --location 'https://nostradamus.u-hopper.com/api/collection/{my-collection-id}' \
--header 'Authorization: Token my-secret-token'

You will receive a confirmation that the collection has been deleted.