Pular para o conteúdo

Metas do mês

GET
/v1/goals
curl --request GET \
--url 'https://developers.nexo.winningsales.com.br/v1/goals?month=example' \
--header 'Authorization: Bearer <token>'

A meta de cada dono e a do time no mês. Metas do CRM têm prioridade quando o mês tem alguma; sem elas, valem as definidas por um admin no Nexo. Todo dono ativo aparece, com nulo para “sem meta”. Só admin e líder de vendas, como no app.

month
required

Month in the company calendar, YYYY-MM

string
/^\d{4}-(0[1-9]|1[0-2])$/

Month in the company calendar, YYYY-MM

Metas do mês

Media typeapplication/json
object
month
required

Month shown, YYYY-MM

string
source
required

Crm = goals read from the CRM, read-only here; nexu = goals set by an admin; null = none yet

string
nullable
Allowed values: crm nexu
editable
required

False when the goals of the month come from the CRM

boolean
currency
required

Currency of every amount

string
team
required

Goal of the team

object
ownGoalInCents
required

Goal set for the team itself

integer
nullable
ownersSumInCents
required

Sum of the goals of the owners

integer
nullable
differenceInCents
required

Team goal minus the sum, when both exist

integer
nullable
source
required

Source of the goal of the team itself, when it has one

string
nullable
Allowed values: crm nexu
origin
required

Suggested = accepted or edited from the suggestion pelo histórico; null = manual (nexu) or read from the CRM

string
nullable
Allowed values: suggested
owners
required

Every active CRM owner, plus owners that still have a goal, by name

Array<object>
object
ownerId
required

CRM owner id

string format: uuid
name
required

Owner name from the CRM

string
nullable
goalInCents
required

Goal of the month; null means “sem meta”

integer
nullable
source
required

Source of this owner goal, when it has one

string
nullable
Allowed values: crm nexu
origin
required

Suggested = accepted or edited from the suggestion pelo histórico; null = manual (nexu) or read from the CRM

string
nullable
Allowed values: suggested

Example

{
"source": "crm",
"team": {
"source": "crm",
"origin": "suggested"
},
"owners": [
{
"source": "crm",
"origin": "suggested"
}
]
}

Mês inválido

Media typeapplication/json
object
type
required

Stable machine-readable error code (e.g. identity.email_already_in_use)

string
title
required

Error class name

string
status
required

HTTP status code

integer
detail
required

Human-readable message, safe to display to end users

string
requestId
required

Correlation id — send it to support to locate the full trail

string
nullable
meta

Structured details safe for the frontend (field errors, ids)

object
key
additional properties

Example generated

{
"type": "example",
"title": "example",
"status": 1,
"detail": "example",
"requestId": "example",
"meta": {
"additionalProperty": "example"
}
}

Token ausente, inválido, expirado ou revogado

Media typeapplication/json
object
type
required

Stable machine-readable error code (e.g. identity.email_already_in_use)

string
title
required

Error class name

string
status
required

HTTP status code

integer
detail
required

Human-readable message, safe to display to end users

string
requestId
required

Correlation id — send it to support to locate the full trail

string
nullable
meta

Structured details safe for the frontend (field errors, ids)

object
key
additional properties

Example

{
"type": "public_api.invalid_credential",
"title": "InvalidCredentialError",
"status": 401,
"detail": "Token de acesso inválido, expirado ou revogado. Crie um novo token de acesso no Nexo.",
"requestId": "019fcae7-3e54-755a-8458-bdb605b324bb"
}

Papel, escopo do token ou plano não permitem a operação

Media typeapplication/json
object
type
required

Stable machine-readable error code (e.g. identity.email_already_in_use)

string
title
required

Error class name

string
status
required

HTTP status code

integer
detail
required

Human-readable message, safe to display to end users

string
requestId
required

Correlation id — send it to support to locate the full trail

string
nullable
meta

Structured details safe for the frontend (field errors, ids)

object
key
additional properties

Example

{
"type": "public_api.insufficient_scope",
"title": "InsufficientScopeError",
"status": 403,
"detail": "Este token não tem o escopo conversations:read, exigido por esta operação. Gere um token com esse escopo.",
"requestId": "019fcae7-3e54-755a-8458-bdb605b324bb",
"meta": {
"operation": "conversations.reading",
"scope": "conversations:read"
}
}

Limite de chamadas da empresa ou do token atingido

Media typeapplication/json
object
type
required

Stable machine-readable error code (e.g. identity.email_already_in_use)

string
title
required

Error class name

string
status
required

HTTP status code

integer
detail
required

Human-readable message, safe to display to end users

string
requestId
required

Correlation id — send it to support to locate the full trail

string
nullable
meta

Structured details safe for the frontend (field errors, ids)

object
key
additional properties

Example

{
"type": "public_api.rate_limited",
"title": "PublicRateLimitedError",
"status": 429,
"detail": "Muitas chamadas em pouco tempo. Tente de novo em 12 segundos.",
"requestId": "019fcae7-3e54-755a-8458-bdb605b324bb",
"meta": {
"class": "content",
"limitedBy": "company",
"limit": 120,
"windowSeconds": 60,
"retryAfterSeconds": 12
}
}