JavaScript
import Migma from 'migma'; const migma = new Migma('YOUR_API_KEY'); const { data, error } = await migma.contacts.create({ email: 'john@example.com', firstName: 'John', lastName: 'Smith', projectId: 'PROJECT_ID' });
{ "success": true, "data": { "id": "<string>", "email": "jsmith@example.com", "firstName": "<string>", "lastName": "<string>", "country": "<string>", "language": "<string>", "tags": [ "<string>" ], "customFields": {}, "status": "subscribed", "createdAt": "2023-11-07T05:31:56Z", "updatedAt": "2023-11-07T05:31:56Z" }, "error": "<string>" }
Add a single contact. Requires API key with AUDIENCE_WRITE.
API key authentication. Use 'Authorization: Bearer YOUR_API_KEY' where YOUR_API_KEY is obtained from the Migma dashboard under Settings → API Integration.
Contact created
Show child attributes
Was this page helpful?
Suggestions
Contact support