Read the signed-in Member
GET /v1/members/me
| Property | Value |
|---|---|
| Operation | get_current_member |
| Group | Members |
| Scope | organization:read |
| Route class | read |
| Idempotency | No Idempotency-Key |
| Audit | Not audited: A configuration read; Members are Organization data, not Call content. |
| Released in | 1.35.0 |
| Phase 0 host | Served (the hosted api pins 1.65.0) |
Answers the Member record of the Member session that makes the request, with the id of its Organization. Any valid Member session reads its own record, whatever its role: the access matrix (access-control-and-isolation.md section 4.2) grants every role a read of its Members row, and no members:read is needed, which only owner, admin and operator hold in Phase 0. The descriptor names organization:read, a permission every role holds, because a route names one permission; it is not what admits the caller. The route is for a Member session only: the api refuses every API key with forbidden, whatever its scopes, because a key is not a Member. It exists so that a console signed in as a developer or an agent_operator, who may start a demo Call (calls:write) but cannot list Members, reads its own role. From 1.45.0 a Member ID token whose identity is not a Member is refused with forbidden and one detail at path /headers/authorization whose code is a SignInRefusalCode: sign_in_pending (the sign-in is kept as a sign-in attempt of its verified email, waiting for an operator to approve it), member_disabled, email_unverified, email_held (the verified email belongs to a Member linked to another identity), ambiguous_membership, unknown_role or, from 1.51.0, invitation_expired (the Member of the verified email is invited and its invitation lapsed). The detail carries a code and fixed words, never the email or the identity. A sign-in with no Member while the Member pool serves no Organization, and an API key, are refused with no detail. The refusal comes before the route, so every public route answers it to such a token; this read is the one a console asks to choose between its holding page and its refused page.
Request
Set VOCAL_API to the base URL of your API and VOCAL_API_KEY to an API key with the organization:read scope (Authentication and keys). Replace each placeholder, such as agt_... or <name>, with your own value.
curl "$VOCAL_API/v1/members/me" \
-H "Authorization: Bearer $VOCAL_API_KEY"const response = await fetch(`${process.env.VOCAL_API}/v1/members/me`, {
headers: {
Authorization: `Bearer ${process.env.VOCAL_API_KEY}`,
},
});
console.log(response.status, await response.text());import os
import requests
response = requests.get(
f"{os.environ['VOCAL_API']}/v1/members/me",
headers={
"Authorization": f"Bearer {os.environ['VOCAL_API_KEY']}",
},
)
print(response.status_code, response.text)Responses
| Status | Content type | Shape | Error codes |
|---|---|---|---|
200 | application/json | MemberSelf | |
400 | application/json | ErrorEnvelope | invalid_request |
401 | application/json | ErrorEnvelope | unauthenticated |
403 | application/json | ErrorEnvelope | forbidden |
429 | application/json | ErrorEnvelope | rate_limited |
500 | application/json | ErrorEnvelope | internal_error |
Fields of the 200 answer
The shape is MemberSelf.
| Field | Type | Required | Description |
|---|---|---|---|
created_at | Timestamp | yes | |
display_name | string or null | yes | A display name. |
email | string | yes | An email address, compared ignoring case. |
id | MemberId | yes | |
invitation_expires_at | Timestamp or null | no | When the invitation of an invited Member lapses (1.51.0): 72 hours after the invitation or the approval that created it. Null once the Member is active or disabled, and for a Member the seed created; absent from an api before 1.51.0. After it a sign-in with the email is refused with invitation_expired. |
invited_by | MemberId or null | no | The Member who invited or approved this Member (1.51.0), or null when the seed or an operator command created it; absent from an api before 1.51.0. |
last_sign_in_at | Timestamp or null | yes | The last sign-in, or null before the first. |
object | "member" | yes | |
organization_id | OrganizationId | yes | The Organization the Member belongs to, the one its session is signed in to. |
revision | integer | yes | Counts writes to the Member; returned as the ETag and required in If-Match. |
role | MemberRole | yes | |
status | MemberStatus | yes | |
updated_at | Timestamp | yes |