# Retrieve the profile

> Returns the org admin who connected your app, their organization, the scopes they granted, and when the grant expires.

Source: https://www.bloomtext.com/developers/api/reference/get-profile/

`GET /me`

Returns the org admin who connected your app, their organization, the scopes they granted, and when the grant expires.

**Credentials:** [Org admin’s OAuth token](https://www.bloomtext.com/developers/api/oauth/) only · **Scope:** `messages.read`

### Returns

Returns `200 OK` with the [Profile object](https://www.bloomtext.com/developers/api/reference/profile-object/).

### Errors

Failed requests return `application/problem+json` [problem details](https://www.bloomtext.com/developers/api/errors/). The errors specific to this endpoint:

| Status | Code | Meaning |
| --- | --- | --- |
| 400 | `invalid_request` | The request is malformed, such as invalid JSON. |
| 401 | `invalid_token` | The API key or access token is missing, expired, or revoked. |
| 403 | `insufficient_scope` | The credential doesn’t have the scope this endpoint needs. |
| 403 | `oauth_required` | API keys can’t use this endpoint. It needs an org admin’s OAuth token. |
| 429 | `rate_limited` | Too many requests. Retry after `Retry-After` seconds. |

```bash filename="Request"
curl "https://api.bloomtext.com/v1/me" \
  -H "Authorization: Bearer $BLOOMTEXT_ACCESS_TOKEN"
```

```js filename="Request"
const response = await fetch('https://api.bloomtext.com/v1/me', {
  headers: {
    Authorization: `Bearer ${process.env.BLOOMTEXT_ACCESS_TOKEN}`,
  },
})

if (!response.ok) throw new Error(`BloomText API error: ${response.status}`)
const data = await response.json()
```

```python filename="Request"
import os

import requests

response = requests.get(
    "https://api.bloomtext.com/v1/me",
    headers={
        "Authorization": f"Bearer {os.environ['BLOOMTEXT_ACCESS_TOKEN']}",
    },
)
response.raise_for_status()
data = response.json()
```

```go filename="Request"
package main

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

func main() {
	req, err := http.NewRequest("GET", "https://api.bloomtext.com/v1/me", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+os.Getenv("BLOOMTEXT_ACCESS_TOKEN"))

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, _ := io.ReadAll(res.Body)
	fmt.Println(res.Status, string(out))
}
```

```ruby filename="Request"
require "net/http"
require "json"

uri = URI("https://api.bloomtext.com/v1/me")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer #{ENV.fetch("BLOOMTEXT_ACCESS_TOKEN")}"

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
  http.request(request)
end
data = JSON.parse(response.body)
```

```json filename="Response · 200 OK"
{
  "user": {
    "id": "8b9c2d2f-6b1a-44f4-a7b1-0d6d3f2d6f55",
    "name": "Alex Example",
    "role": "admin"
  },
  "organization": {
    "id": "6db1e3f5-9b7f-4f2b-8be1-0f1e1d7d7d8c",
    "name": "Example Clinic"
  },
  "app": {
    "client_id": "bt_client_7Hq2mX9aLk",
    "name": "Acme EHR Assistant"
  },
  "scopes": [
    "messages.read",
    "offline_access"
  ],
  "expires_at": "2027-09-21T15:04:05Z"
}
```
