POST /v1/deal-goals
POST
/v1/deal-goals
const url = 'https://seu-endereco-da-api/v1/deal-goals';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"scope":"general","pipelineId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","userId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","channelId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","metric":"won_value","periodStart":"example","targetValue":1}'};
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://seu-endereco-da-api/v1/deal-goals \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "scope": "general", "pipelineId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "userId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "channelId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "metric": "won_value", "periodStart": "example", "targetValue": 1 }'Permissão que a Chave de acesso precisa: Gerenciar metas (goals:manage).
Authorizations
Seção intitulada “Authorizations”Request Bodyrequired
Seção intitulada “Request Bodyrequired”Media typeapplication/json
object
scope
required
string
pipelineId
string format: uuid
userId
string format: uuid
channelId
string format: uuid
metric
required
string
periodStart
required
string
targetValue
required
number
Responses
Seção intitulada “Responses”Media typeapplication/json
object
id
required
string
scope
required
string
pipelineId
required
string
userId
required
string
channelId
required
string
metric
required
string
periodStart
required
string
targetValue
required
number
Example
{ "scope": "general", "metric": "won_value"}Scope shape does not match the informed ids
Pipeline or user not found
Goal already exists for this scope, metric and month