Identidade
Ver a chave e a organização
Devolve a organização e a chave API por trás do pedido.
GET https://api.diska.ai/v1/me
Âmbito: nenhum — qualquer chave válida
Não exige âmbito: use-o para confirmar que a chave funciona. scopes: [] significa acesso total.
Exemplos
curl "https://api.diska.ai/v1/me" \
-H "Authorization: Bearer $DISKA_API_KEY"
import os
import requests
response = requests.get(
"https://api.diska.ai/v1/me",
headers={"Authorization": f"Bearer {os.environ['DISKA_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json())
// Node.js 18 ou superior, num ficheiro .mjs
const response = await fetch('https://api.diska.ai/v1/me', {
headers: { Authorization: `Bearer ${process.env.DISKA_API_KEY}` }
})
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())
<?php
$ch = curl_init('https://api.diska.ai/v1/me');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('DISKA_API_KEY')],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status >= 400) {
throw new RuntimeException("HTTP $status: $body");
}
print_r(json_decode($body, true));
Experimentar
Envie o pedido a partir desta página, com a sua chave. A chave fica só nesta página: não é guardada e só é enviada para api.diska.ai. Use uma chave de teste com os âmbitos mínimos.
GET
https://api.diska.ai/v1/meComeça por dsk_. Fica só neste separador do browser.
Introduza uma chave API (dsk_…).
Resposta 200
| Campo | Tipo | Descrição |
|---|---|---|
organization | object | A organização da chave. |
organization.id | string | Identificador da organização. |
organization.name | string | Nome da organização. |
organization.slug | string | Identificador legível da organização. |
key | object | A chave usada no pedido. |
key.id | string | Identificador da chave. |
key.name | string | Nome dado à chave. |
key.key_preview | string | Início e fim da chave, para a identificar (dsk_a1b2…F5A4). |
key.scopes | array | Âmbitos da chave. Lista vazia = acesso total. |
key.expires_at | string | null | Data de expiração, ou null se não expira. |
key.created_at | string | null | Data de criação (ISO 8601). |
key.last_used_at | string | null | Último uso (actualizado no máximo de 5 em 5 minutos). |
{
"organization": {
"id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
"name": "A Minha Empresa",
"slug": "recepcao"
},
"key": {
"id": "5c2e8a14-7d3b-4f9e-a1c6-0b8d2f4e6a93",
"name": "Integração CRM",
"key_preview": "dsk_a1b2…F5A4",
"scopes": [
"agents:read",
"calls:read"
],
"expires_at": "2026-10-25T18:40:00Z",
"created_at": "2026-10-25T18:40:00Z",
"last_used_at": "2026-10-25T18:40:00Z"
}
}
Erros
Este endpoint não tem erros próprios.
Os erros comuns a todos os endpoints (401, 403, 422, 429 e 5xx) estão em Erros.

