Ziwako Docs
ZiwakoRéférence APICollections

Create Collection

POST
/collections

Create a new versatile container for items, such as a shopping cart, wishlist, favorites list, or marketing campaign.

Collections are multi-purpose containers used to organize items (services, products, or profiles) within the Ziwako ecosystem. Every collection is owned by an entity (defined by owner and ownerModel) and can be configured with specific privacy rules and operational settings.

Whether you are building a simple "Favorites" feature or a complex "Shared Bundle" for a team, this endpoint initializes the collection's metadata, visibility, and behavioral constraints.

Authorization

X-API-Key<token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/collections" \  -H "Content-Type: application/json" \  -d '{    "title": "string",    "ownerModel": "string",    "owner": "string"  }'
{  "type": "success",  "code": "string",  "status": 0,  "message": "string",  "data": {    "id": "string",    "title": "string",    "description": "string",    "type": "cart",    "privacy": "public",    "owner": "string",    "ownerModel": "User",    "participants": [      {        "profil": "string",        "profilType": "Profil",        "role": "owner",        "joinedAt": "2019-08-24T14:15:22Z",        "invitedByType": "Profil",        "invitedBy": null,        "permissions": {          "canAddItems": false,          "canRemoveItems": false,          "canModifyItems": false,          "canInviteOthers": false,          "canModifyCollection": false        }      }    ],    "items": [      {        "_id": "64f1a2b3c4d5e6f7g8h9i0j1",        "item": {          "_id": "64f1a2b3c4d5e6f7g8h9i0j2",          "name": "Smartphone XYZ",          "description": "Latest smartphone model",          "productType": "electronics"        },        "itemType": "Product",        "itemId": "64f1a2b3c4d5e6f7g8h9i0j2",        "collectionParent": {          "_id": "64f1a2b3c4d5e6f7g8h9i0j3",          "title": "My Wishlist",          "type": "wishlist",          "privacy": "private"        },        "collectionId": "64f1a2b3c4d5e6f7g8h9i0j3",        "owner": {          "_id": "64f1a2b3c4d5e6f7g8h9i0j4",          "firstName": "John",          "lastName": "Doe",          "email": "john.doe@example.com"        },        "ownerModel": "Profil",        "metadata": {          "position": 1,          "priority": "high",          "rating": 5,          "quantity": 1,          "addedBy": {            "_id": "64f1a2b3c4d5e6f7g8h9i0j4",            "firstName": "John",            "lastName": "Doe",            "email": "john.doe@example.com"          },          "addedByType": "Profil",          "addedAt": "2024-01-15T10:30:00Z",          "tags": [            "electronics",            "wishlist"          ],          "notes": "Really want this phone!"        },        "status": "active",        "payload": {},        "createdAt": "2024-01-15T10:30:00Z",        "updatedAt": "2024-01-15T10:30:00Z"      }    ],    "settings": {      "allowDuplicates": false,      "maxItems": 1,      "autoSort": false,      "sortBy": "name",      "sortOrder": "asc",      "notifyOnItemAdded": true,      "notifyOnParticipantJoin": true,      "notifyOnChanges": false,      "expiresAt": "2019-08-24T14:15:22Z",      "autoCleanup": false    },    "tags": [      "string"    ],    "category": "string",    "isTemplate": false,    "templateCategory": "string",    "stats": {      "totalItems": 0,      "totalValue": 0,      "lastActivity": "2019-08-24T14:15:22Z",      "popularItems": [        null      ],      "activityCount": {        "daily": 0,        "weekly": 0,        "monthly": 0      }    },    "shareableLink": "http://example.com",    "shareStats": {      "views": 0,      "shares": 0,      "likes": 0    },    "payload": {},    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z",    "lastActivityAt": "2019-08-24T14:15:22Z"  }}