Retrieve current identity
import requests
url = "https://api.datagrid.com/v1/identity"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.datagrid.com/v1/identity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.datagrid.com/v1/identity \
--header 'Authorization: Bearer <token>'{
"object": "identity",
"user_id": "<string>",
"current_teamspace_id": "<string>",
"teamspaces": [
{
"teamspace_id": "<string>",
"permissions": {
"role": "owner",
"agent_ids": [
"<string>"
]
}
}
]
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}Identity
Retrieve current identity
Returns the identity of the authenticated caller — the user ID, current teamspace, and all teamspace memberships that the API key or JWT resolves to.
GET
/
identity
Retrieve current identity
import requests
url = "https://api.datagrid.com/v1/identity"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.datagrid.com/v1/identity', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url https://api.datagrid.com/v1/identity \
--header 'Authorization: Bearer <token>'{
"object": "identity",
"user_id": "<string>",
"current_teamspace_id": "<string>",
"teamspaces": [
{
"teamspace_id": "<string>",
"permissions": {
"role": "owner",
"agent_ids": [
"<string>"
]
}
}
]
}{
"status_code": 123,
"error": "rate_limit_exceeded",
"message": "<string>",
"retryable": true,
"statusCode": 123,
"mitigation": "<string>",
"details": {
"reason": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
Caller identity
Available options:
identity The ID of the authenticated user.
The teamspace ID this request is scoped to. Resolution depends on the caller type:
- Org-scoped API keys (default): always the teamspace the
key was minted in. The
Datagrid-Teamspaceheader is ignored. - Account-scoped API keys (
scopeLevel: "account"): the teamspace selected by theDatagrid-Teamspaceheader, when that teamspace lives under the same account as the key. Falls back to the key's home teamspace when the header is absent. - JWT callers: the
Datagrid-Teamspaceheader when present (and the user is a member), otherwise the user's default teamspace.
All teamspaces the authenticated user is a member of.
Show child attributes
Show child attributes