Get customer context
curl --request GET \
--url https://app.bily.ai/api/customer/v1/context \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://app.bily.ai/api/customer/v1/context', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.bily.ai/api/customer/v1/context"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"user": {
"id": "<string>",
"email": "jsmith@example.com",
"emailVerified": true,
"name": "<string>",
"image": "<string>"
},
"organizations": [
{
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"createdAt": "<string>",
"stores": [
{
"id": "<string>",
"url": "store.example.com",
"type": "<string>",
"currency": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"role": "<string>"
}
]
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}Identity
Get customer context
Returns the authenticated user with accessible organizations and their nested stores in one request. A store-scoped API key is narrowed automatically; use organizationId only to explicitly select an accessible organization.
GET
/
context
Get customer context
curl --request GET \
--url https://app.bily.ai/api/customer/v1/context \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://app.bily.ai/api/customer/v1/context', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.bily.ai/api/customer/v1/context"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"user": {
"id": "<string>",
"email": "jsmith@example.com",
"emailVerified": true,
"name": "<string>",
"image": "<string>"
},
"organizations": [
{
"id": "<string>",
"name": "<string>",
"slug": "<string>",
"createdAt": "<string>",
"stores": [
{
"id": "<string>",
"url": "store.example.com",
"type": "<string>",
"currency": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>"
}
],
"role": "<string>"
}
]
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}{
"error": "Store not found",
"requestId": "<string>",
"details": "<unknown>",
"retryAfter": "<string>"
}Authorizations
ApiKeyAuthBearerAuth
A server-side Bily API key created under Settings > MCP > Access key fallback. Select the intended store before creating it.
Query Parameters
An explicitly selected accessible organization. Omit this parameter for an ordinary store-scoped API key; Bily uses the organization and store recorded on the key.