Workspace
Check what a key can do, list the websites it covers, and read the semantic layer: every metric and dimension, plus the outcomes this particular workspace can be measured by.
| Endpoint | Method | Path | Permission |
|---|---|---|---|
| Get key info What this key is and what it can do | GET | /v1/me | any key |
| List outcomes Which outcomes this workspace can be measured by | GET | /v1/outcomes | metrics:read |
| Get schema Every metric, dimension and filter operator | GET | /v1/schema | any key |
| List websites Websites this key can reach | GET | /v1/websites | any key |
Base URL https://app.sourceloop.ai/api/v1
Get key info
What this key is and what it can do
GET /v1/me
Any valid API key. No extra scope needed.
The first call to make. Returns the scopes, plan and websites this key reaches.
curl -s -X GET "https://app.sourceloop.ai/api/v1/me" \
-H "Authorization: Bearer $SOURCELOOP_API_KEY" const res = await fetch(
"https://app.sourceloop.ai/api/v1/me",
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SOURCELOOP_API_KEY}`,
},
},
);
const data = await res.json(); import os, requests
res = requests.get(
"https://app.sourceloop.ai/api/v1/me",
headers={"Authorization": f"Bearer {os.environ['SOURCELOOP_API_KEY']}"},
)
data = res.json() Responses
-
200Key identity -
403Something was wrong with the request or the credential. -
429Too many requests for this workspace in the current minute. Wait Retry-After seconds and repeat the request unchanged.
List outcomes
Which outcomes this workspace can be measured by
GET /v1/outcomes
Requires metrics:read
The companion to /schema, and the one to read before sending `outcome` or `outcome_values` to /metrics. /schema lists what KINDS of thing can be counted and is identical for every customer. This says which of them THIS workspace has data for, and what its own stage ladder is called, because a CRM ladder is renamed by its own admins and a lead-gen customer has no deals at all.
Every outcome is listed, including ones this workspace has never produced. Those come back with `available: false` and an empty `values` list rather than being omitted, so a client can say "you have no deals yet" instead of silently dropping the option.
An empty `values` list means one of two things, and `available` tells them apart: conversions and revenue take no narrowing at all, whereas an unavailable outcome has simply produced nothing here.
Guessing a stage key instead of reading it here returns an empty result that is indistinguishable from a real zero.
curl -s -X GET "https://app.sourceloop.ai/api/v1/outcomes?website=acme.com" \
-H "Authorization: Bearer $SOURCELOOP_API_KEY" const res = await fetch(
"https://app.sourceloop.ai/api/v1/outcomes?website=acme.com",
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SOURCELOOP_API_KEY}`,
},
},
);
const data = await res.json(); import os, requests
res = requests.get(
"https://app.sourceloop.ai/api/v1/outcomes?website=acme.com",
headers={"Authorization": f"Bearer {os.environ['SOURCELOOP_API_KEY']}"},
)
data = res.json() Query parameters
websitestringWebsite domain, e.g. acme.com. Required only when the key covers more than one.
Responses
-
200One entry per outcome, each with its values and availability -
403Something was wrong with the request or the credential. -
429Too many requests for this workspace in the current minute. Wait Retry-After seconds and repeat the request unchanged.
Get schema
Every metric, dimension and filter operator
GET /v1/schema
Any valid API key. No extra scope needed.
Generated from the same registry the query compiler uses, so it cannot drift from behaviour. Read this instead of guessing names.
curl -s -X GET "https://app.sourceloop.ai/api/v1/schema" \
-H "Authorization: Bearer $SOURCELOOP_API_KEY" const res = await fetch(
"https://app.sourceloop.ai/api/v1/schema",
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SOURCELOOP_API_KEY}`,
},
},
);
const data = await res.json(); import os, requests
res = requests.get(
"https://app.sourceloop.ai/api/v1/schema",
headers={"Authorization": f"Bearer {os.environ['SOURCELOOP_API_KEY']}"},
)
data = res.json() Responses
-
200Schema document -
429Too many requests for this workspace in the current minute. Wait Retry-After seconds and repeat the request unchanged.
List websites
Websites this key can reach
GET /v1/websites
Any valid API key. No extra scope needed.
With each one's timezone and currency, which every other response is expressed in.
curl -s -X GET "https://app.sourceloop.ai/api/v1/websites" \
-H "Authorization: Bearer $SOURCELOOP_API_KEY" const res = await fetch(
"https://app.sourceloop.ai/api/v1/websites",
{
method: "GET",
headers: {
Authorization: `Bearer ${process.env.SOURCELOOP_API_KEY}`,
},
},
);
const data = await res.json(); import os, requests
res = requests.get(
"https://app.sourceloop.ai/api/v1/websites",
headers={"Authorization": f"Bearer {os.environ['SOURCELOOP_API_KEY']}"},
)
data = res.json() Responses
-
200Websites -
429Too many requests for this workspace in the current minute. Wait Retry-After seconds and repeat the request unchanged.