> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cail.health/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cail.health/_mcp/server.

# Get the calling user’s profile

GET https://staging.cail.health/v1/users/me

Returns the calling user’s profile, including identity-provider details, every organisation the user is a member of, and the role in each. Use this to drive an organisation switcher in the operator UI and to populate user-display fields.

Reference: https://docs.cail.health/api-references/api-reference/manage-your-organization/me

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: cail-api
  version: 1.0.0
paths:
  /v1/users/me:
    get:
      operationId: me
      summary: Get the calling user’s profile
      description: >-
        Returns the calling user’s profile, including identity-provider details,
        every organisation the user is a member of, and the role in each. Use
        this to drive an organisation switcher in the operator UI and to
        populate user-display fields.
      tags:
        - subpackage_manageYourOrganization
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The calling user’s profile.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserMeResponse'
servers:
  - url: https://staging.cail.health
    description: https://staging.cail.health
components:
  schemas:
    UserMeResponseEmail:
      type: object
      properties: {}
      description: Email address from JWT claims.
      title: UserMeResponseEmail
    UserMeResponseName:
      type: object
      properties: {}
      description: Display name from JWT claims.
      title: UserMeResponseName
    UserMeResponsePicture:
      type: object
      properties: {}
      description: Profile picture URL.
      title: UserMeResponsePicture
    UserOrganizationMembershipAuth0OrgId:
      type: object
      properties: {}
      description: >-
        Auth0 organisation identifier matching the JWT `dom` claim when this
        organisation is the active session. Null when no Auth0 mapping exists.
      title: UserOrganizationMembershipAuth0OrgId
    UserOrganizationMembership:
      type: object
      properties:
        organizationId:
          type: string
          description: CAIL stable identifier of the organisation the user belongs to.
        organizationName:
          type: string
          description: Human-readable organisation name.
        auth0OrgId:
          oneOf:
            - $ref: '#/components/schemas/UserOrganizationMembershipAuth0OrgId'
            - type: 'null'
          description: >-
            Auth0 organisation identifier matching the JWT `dom` claim when this
            organisation is the active session. Null when no Auth0 mapping
            exists.
        role:
          type: string
          description: Role the user holds in this organisation.
      required:
        - organizationId
        - organizationName
        - auth0OrgId
        - role
      title: UserOrganizationMembership
    UserMeResponse:
      type: object
      properties:
        userId:
          type: string
          description: Stable identifier of the calling user.
        provider:
          type: string
          description: Identity provider that authenticated the user.
        email:
          oneOf:
            - $ref: '#/components/schemas/UserMeResponseEmail'
            - type: 'null'
          description: Email address from JWT claims.
        name:
          oneOf:
            - $ref: '#/components/schemas/UserMeResponseName'
            - type: 'null'
          description: Display name from JWT claims.
        picture:
          oneOf:
            - $ref: '#/components/schemas/UserMeResponsePicture'
            - type: 'null'
          description: Profile picture URL.
        organizations:
          type: array
          items:
            $ref: '#/components/schemas/UserOrganizationMembership'
          description: Organisations the user is a member of, with their role in each.
      required:
        - userId
        - provider
        - email
        - name
        - picture
        - organizations
      title: UserMeResponse
  securitySchemes:
    auth0Bearer:
      type: http
      scheme: bearer

```

## Examples



**Response**

```json
{
  "userId": "auth0|654a2f4d1b3c4e9a8d2f3c1b",
  "provider": "auth0",
  "email": "jane@example.health",
  "name": "Jane Smith",
  "picture": null,
  "organizations": [
    {
      "organizationId": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
      "organizationName": "Lambeth Primary Care Network",
      "auth0OrgId": "org_d3p9F2yPsBcRtgZB",
      "role": "owner"
    },
    {
      "organizationId": "org_02HZX9P3Q5R7S9T1V3W5Y7Z9A1",
      "organizationName": "Southwark Urgent Care",
      "auth0OrgId": "org_RhwYx4DcvF8Hg2KL",
      "role": "member"
    }
  ]
}
```

**SDK Code**

```python A user with two organisation memberships
import requests

url = "https://staging.cail.health/v1/users/me"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript A user with two organisation memberships
const url = 'https://staging.cail.health/v1/users/me';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go A user with two organisation memberships
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://staging.cail.health/v1/users/me"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby A user with two organisation memberships
require 'uri'
require 'net/http'

url = URI("https://staging.cail.health/v1/users/me")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java A user with two organisation memberships
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://staging.cail.health/v1/users/me")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php A user with two organisation memberships
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://staging.cail.health/v1/users/me', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp A user with two organisation memberships
using RestSharp;

var client = new RestClient("https://staging.cail.health/v1/users/me");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift A user with two organisation memberships
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://staging.cail.health/v1/users/me")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```