Get the caller's identity - Spacefast Docs
Get the caller's identity
Returns the subject behind the calling credential, the user account when the subject is a person, the tenants the credential’s policy reaches, every team it can act in with that team’s plan, and private-beta state. user is null for a team-subject or service-subject credential. intercom is present only for a signed-in dashboard browser session.
GET/v1/me
Authorization
AuthorizationBearer token · headerrequired
Authorization: Bearer <token> with an API key (sfa_ prefix), an OAuth access token, a session token, or a Space machine credential (sfm_ prefix).
Query parameters
teamIdstring
Responses
200Response for status 200
$schemastring
Canonical JSON Schema URL for this response body. The server also sends it in the Link: rel="describedby" response header.
dataobjectrequired
subjectobjectrequiredtypestringrequired- What the credential acts as:
usera person,teama team's own machine credential,externalan external customer's,systemSpacefast itself.
- What the credential acts as:
idstringrequired- ID of that user, team, external customer, or system actor.
userobject | anyrequired- The person behind the credential. Null when the credential acts as a team, an external customer, or Spacefast itself;
idstringrequired- ID of the signed-in account.
emailstring | anyrequired- The account's primary email address.
namestring | anyrequired- Display name, null until the account sets one.
isAutomatticianbooleanrequired- Whether the account's WordPress.com login belongs to an Automattician.
wpcomobject | anyrequired- The WordPress.com profile captured at the account's last WP.com sign-in, verbatim.
isSuperadminbooleanrequired- Whether this browser session belongs to a platform operator.
pendingDeletionAtstring | anyrequired- ISO 8601 timestamp for when the account's closure was requested.
dashboardPrefsobjectrequired- The account's dashboard preferences.
privacyobjectrequired- The account's opt-out elections.
analyticsOptOutbooleanrequiredadvertisingOptOutbooleanrequired
- The account's opt-out elections.
- The person behind the credential. Null when the credential acts as a team, an external customer, or Spacefast itself;
tenantsobject[]required- The tenants the credential's policy reaches.
idstringrequiredkindstringrequirednamestringrequiredaccessstringrequired
- The tenants the credential's policy reaches.
teamsobject[]required- The teams the credential can act in:
idstringrequirednamestringrequiredslugstring | anyrequiredrolestring | anyrequiredplanstringrequired
- The teams the credential can act in:
intercomobject | anyrequired- Everything the Intercom Messenger needs to boot.
api_basestringrequired app_idstringrequireduser_idstringrequiredemailstringnamestringcreated_atintegercompanyobjectcompany_idstringrequirednamestringrequiredplanstring
intercom_user_jwtstringrequiredsession_durationintegerrequiredexpiresAtstringrequired
- Everything the Intercom Messenger needs to boot.
betaobjectrequired- Private-beta state.
gateEnabledbooleanrequiredenrolledbooleanrequiredeligibleTeamsobject[]required- Teams the account may join to get in.
teamIdstringrequirednamestringrequiredslugstring | anyrequiredsourcestringrequired
- Teams the account may join to get in.
- Private-beta state.
Try it
Server
Base URLhttps://api.spacefast.com
Parameters
teamIdquery
Request examples
curl -X GET "https://api.spacefast.com/v1/me" \
-H "Authorization: Bearer YOUR_TOKEN"
const response = await fetch("https://api.spacefast.com/v1/me", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});
import requests
response = requests.get(
"https://api.spacefast.com/v1/me",
headers={
"Authorization": "Bearer YOUR_TOKEN"
},
)
Response:
{
"$schema": "http://example.com",
"data": {
"subject": {
"type": "user",
"id": "string"
},
"user": {
"id": "string",
"email": "string",
"name": "string",
"isAutomattician": true,
"wpcom": {
"property1": null,
"property2": null
},
"isSuperadmin": true,
"pendingDeletionAt": "string",
"dashboardPrefs": {
"property1": null,
"property2": null
},
"privacy": {
"analyticsOptOut": true,
"advertisingOptOut": true
}
},
"tenants": [
{
"id": "string",
"kind": "string",
"name": "string",
"access": "full"
}
],
"teams": [
{
"id": "string",
"name": "string",
"slug": "string",
"role": "string",
"plan": "free"
}
],
"intercom": {
"api_base": "http://example.com",
"app_id": "string",
"user_id": "string",
"email": "user@example.com",
"name": "string",
"created_at": 9007199254740991,
"company": {
"company_id": "string",
"name": "string",
"plan": "free"
},
"intercom_user_jwt": "string",
"session_duration": 9007199254740991,
"expiresAt": "2019-08-24T14:15:22Z"
},
"beta": {
"gateEnabled": true,
"enrolled": true,
"eligibleTeams": [
{
"teamId": "string",
"name": "string",
"slug": "string",
"source": "invitation"
}
]
}
}
}
{
"$schema": "http://example.com",
"type": "string",
"title": "string",
"status": -9007199254740991,
"detail": "string",
"code": "string",
"pointer": "string",
"details": {
"property1": null,
"property2": null
},
"suggestions": [
"string"
],
"next": [
"string"
],
"requestId": "string"
}