Objetivos
GET https://metriva.com.br/api/goals/
curl --request GET \
--url 'https://metriva.com.br/api/goals/' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://metriva.com.br/api/goals/' \
--header 'Authorization: Bearer {api_key}' \
| Parâmetros | Detalhes | Descrição |
|---|---|---|
| website_id | Opcional Inteiro | |
| type | Opcional String | Valores permitidos: pageview , custom |
| search | Opcional String | A cadeia de pesquisa. |
| search_by | Opcional String | Por qual campo você está pesquisando. Os valores permitidos são: name, path, key. |
| order_by | Opcional String | Por que campo ordenar os resultados. Os valores permitidos são: goal_id, last_datetime, datetime, name, path, key. |
| order_type | Opcional String | A ordenação dos resultados. Os valores permitidos são: ASC para ordenação ascendente, e DESC para ordenação descendente. |
| page | Opcional Inteiro | O número da página da qual pretende obter resultados. O padrão é 1. |
| results_per_page | Opcional Inteiro | Quantos resultados você quer por página. Os valores permitidos são: 10 , 25 , 50 , 100 , 250 , 500 , 1000. O padrão é 25. |
{
"data": [
{
"id": 1,
"website_id": 1,
"user_id": 1,
"key": "123456789",
"type": "custom",
"path": null,
"name": "Example",
"datetime": "2026-05-29 15:11:37",
"last_datetime": null
},
],
"meta": {
"page": 1,
"results_per_page": 25,
"total": 1,
"total_pages": 1
},
"links": {
"first": "https://metriva.com.br/api/goals?page=1",
"last": "https://metriva.com.br/api/goals?page=1",
"next": null,
"prev": null,
"self": "https://metriva.com.br/api/goals?page=1"
}
}
GET https://metriva.com.br/api/goals/{goal_id}
curl --request GET \
--url 'https://metriva.com.br/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://metriva.com.br/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
{
"data": {
"id": 1,
"website_id": 1,
"user_id": 1,
"key": "123456789",
"type": "custom",
"path": null,
"name": "Example",
"datetime": "2026-05-29 15:11:37",
"last_datetime": null
}
}
POST https://metriva.com.br/api/goals
| Parâmetros | Detalhes | Descrição |
|---|---|---|
| website_id | Obrigatório Inteiro | - |
| type | Obrigatório String | Valores permitidos: pageview , custom |
| name | Obrigatório String | - |
| path | Opcional String | Disponível quando: type = pageview |
| key | Opcional String | - |
curl --request POST \
--url 'https://metriva.com.br/api/goals' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'chart_datetime=2026-05-29 15:11:37' \
--url 'https://metriva.com.br/api/goals' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'chart_datetime=2026-05-29 15:11:37' \
{
"data": {
"id": 1
}
}
POST https://metriva.com.br/api/goals/{goal_id}
| Parâmetros | Detalhes | Descrição |
|---|---|---|
| website_id | Opcional Inteiro | - |
| type | Opcional String | Valores permitidos: pageview , custom |
| name | Opcional String | - |
| path | Opcional String | Disponível quando: type = pageview |
| key | Opcional String | - |
curl --request POST \
--url 'https://metriva.com.br/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'is_enabled=0' \
--url 'https://metriva.com.br/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: multipart/form-data' \
--form 'name=Example' \
--form 'is_enabled=0' \
{
"data": {
"id": 1
}
}
DELETE https://metriva.com.br/api/goals/{goal_id}
curl --request DELETE \
--url 'https://metriva.com.br/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \
--url 'https://metriva.com.br/api/goals/{goal_id}' \
--header 'Authorization: Bearer {api_key}' \