Create conversion goal
POST
/api/v1/conversions/goals
const url = 'https://example.com/api/v1/conversions/goals';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Purchase","key":"purchase","description":"User completed a purchase","collectionId":"550e8400-e29b-41d4-a716-446655440000"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/conversions/goals \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Purchase", "key": "purchase", "description": "User completed a purchase", "collectionId": "550e8400-e29b-41d4-a716-446655440000" }'Authorizations
Заголовок раздела «Authorizations»Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Media typeapplication/json
object
name
required
string
Example
Purchasekey
required
URL-safe slug (3-50 chars, lowercase alphanumeric, hyphens, underscores)
string
Example
purchasedescription
string
Example
User completed a purchasecollectionId
Scope goal to a specific collection (campaign)
string
Example
550e8400-e29b-41d4-a716-446655440000Responses
Заголовок раздела «Responses»Goal created