Listar campos disponíveis
curl --request GET \
--url https://api.metrito.com/v3/fields \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.metrito.com/v3/fields"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.metrito.com/v3/fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.metrito.com/v3/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.metrito.com/v3/fields"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.metrito.com/v3/fields")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metrito.com/v3/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"fields": [
{
"key": "spend",
"name": "Investimento",
"short_name": "Invest.",
"description": "Valor gasto em anúncios",
"type": "measure",
"data_type": "currency",
"display_type": "currency",
"source_key": "v3-ads",
"sources": [
"meta_ads",
"google_ads",
"tiktok_ads"
],
"good_direction": "down",
"available": true,
"filterable": true,
"sortable": true
},
{
"key": "ctr",
"name": "CTR",
"short_name": "CTR",
"description": "Taxa de clique (clicks / impressions)",
"type": "measure",
"data_type": "percentage",
"display_type": "percentage",
"source_key": "v3-ads",
"sources": [
"meta_ads",
"google_ads",
"tiktok_ads"
],
"good_direction": "up",
"available": true,
"filterable": false,
"sortable": true
}
],
"count": 2,
"source": "v3-ads",
"timestamp": "2026-03-15T12:00:00.000Z"
}{
"error": {
"type": "authentication_error",
"code": "invalid_credentials",
"message": "Você não está autenticado para isso.",
"request_id": "req_abc123"
}
}API de Dados
Listar Campos Disponíveis
Retorna a lista de todas as métricas e dimensões disponíveis para consulta, com metadados como nome, descrição, tipo de dado e fontes suportadas.
Autenticação obrigatória em api.metrito.com:
- JWT —
Authorization: Bearer {jwt}e headerX-Workspace-Id - API Key —
Authorization: Bearer mtk_live_...ou headerx-api-key(workspace resolvido pela chave;X-Workspace-Idnão é necessário)
Requer escopo data:read quando usar API Key.
GET
/
v3
/
fields
Listar campos disponíveis
curl --request GET \
--url https://api.metrito.com/v3/fields \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.metrito.com/v3/fields"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.metrito.com/v3/fields', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.metrito.com/v3/fields",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.metrito.com/v3/fields"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.metrito.com/v3/fields")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.metrito.com/v3/fields")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"fields": [
{
"key": "spend",
"name": "Investimento",
"short_name": "Invest.",
"description": "Valor gasto em anúncios",
"type": "measure",
"data_type": "currency",
"display_type": "currency",
"source_key": "v3-ads",
"sources": [
"meta_ads",
"google_ads",
"tiktok_ads"
],
"good_direction": "down",
"available": true,
"filterable": true,
"sortable": true
},
{
"key": "ctr",
"name": "CTR",
"short_name": "CTR",
"description": "Taxa de clique (clicks / impressions)",
"type": "measure",
"data_type": "percentage",
"display_type": "percentage",
"source_key": "v3-ads",
"sources": [
"meta_ads",
"google_ads",
"tiktok_ads"
],
"good_direction": "up",
"available": true,
"filterable": false,
"sortable": true
}
],
"count": 2,
"source": "v3-ads",
"timestamp": "2026-03-15T12:00:00.000Z"
}{
"error": {
"type": "authentication_error",
"code": "invalid_credentials",
"message": "Você não está autenticado para isso.",
"request_id": "req_abc123"
}
}Autorizações
bearerAuthapiKeyAuth
JWT da plataforma ou API key mtk_live_... enviada no header Authorization
Cabeçalhos
Obrigatório quando usar JWT. Opcional quando usar API key (mtk_live_...)
Exemplo:
"69162064162b926ae607959b"