# Me API V3

Use **Me API** to retrieve details about the currently authenticated Sprinklr user. Developers can use this endpoint to identify the user associated with an access token and retrieve user, customer, and workspace information.

The endpoint requires no request parameters or request body. Authentication determines which user's information is returned.

## Overview

| Operation | Method | Path |
|  --- | --- | --- |
| Fetch current user | `GET` | `/api/v3/me` |


There is no request body, no query parameter, and no path parameter. **The access token itself is the input.**

The operation is part of User API V3, which also provides operations for retrieving and managing other users.

## Base URL

```
https://api3.sprinklr.com/{env}/api/v3/me
```

Replace {env} with your assigned Sprinklr environment. See [APIs | Sprinklr Developer Portal](https://dev.sprinklr.com/apis) for the published environment list.

For the production environment at app.sprinklr.com, omit the {env} segment from the URL.

> **Credentials are environment-scoped.** An API key and token generated for one environment return `401` against another, even when the request is otherwise perfect. Because `/me` is the endpoint you will use to *test* credentials, this is worth stating plainly: a `401` from `/me` very often means "right credentials, wrong environment" rather than "bad credentials."


## Authentication

Me API V3 requires bearer-token and API-key authentication. The V3 API reference specifies both bearerAuth and apiKeyAuth for this operation. See [API Overview](https://dev.sprinklr.com/api-overview) for portal registration, API key and secret generation, and the Authorization flow.

Include the following headers:

This is a `GET` with no request body, so there is **no `Content-Type` header**.

| Header | Value | Purpose |
|  --- | --- | --- |
| `Authorization` | `Bearer {{accessToken}}` | Credential used by the API to authenticate a user with the server |
| `Key` | `{{apiKey}}` | API key that authenticates the application with the server. See [API Key and Secret Generation](https://dev.sprinklr.com/api-key-and-secret-generation) |
| `Accept` | `application/json` | Determines the acceptable response type from the server |


A Content-Type header is not required because the GET request does not contain a request body.

## Fetch the current user

Use the following operation to retrieve information about the authenticated user:

```
GET /api/v3/me
```

The operation does not require query parameters, path parameters, or a request body.

### Example request

```bash
curl -X GET \
  'https://api3.sprinklr.com/{env}/api/v3/me' \
  -H 'Authorization: Bearer {{accessToken}}' \
  -H 'Key: {{apiKey}}' \
  -H 'Accept: application/json'
```

## Response

The response provides information about the authenticated user, including the user's identifier, name, email address, user type, customer, workspace, and configured properties.

**V3 returns `data` as an array containing the user object:**

```json
{
  "data": [
    {
      "id": 60000000,
      "type": "PARTNER_ADMIN",
      "name": "Jane Doe",
      "email": "jane.doe@example.com",
      "properties": {
        "spr_user_availability_status": ["Connection Issue"],
        "support_access": ["true"],
        "_c_00000000000000000000000a": ["Morning Shift"]
      },
      "customerId": 60000000,
      "workspaceId": 60000002
    }
  ],
  "errors": []
}
```

*The `properties` map is abridged here. A real response contains many more entries.*

### Response fields

| Field | Type | Description |
|  --- | --- | --- |
| `id` | Integer | Numeric user ID of the authenticated user |
| `type` | String | User type — see [The `type` field](#the-type-field) |
| `name` | String | Display name of the user |
| `email` | String | Email address of the user |
| `properties` | Object | Map of custom-field keys to arrays of string values — see [The `properties` map](#the-properties-map) |
| `customerId` | Integer | Identifier of the customer/partner the user belongs to |
| `workspaceId` | Integer | Identifier of the user's workspace |
| `errors` | Array | Sibling of `data`. Empty on success |


These fields are also represented in Sprinklr's authenticated-user example.

> The structure returned by /me differs from the broader /user resource. GET /api/v3/user returns the richer user schema used to retrieve another user by ID or email.


## Status codes

| HTTP status | Description |
|  --- | --- |
| `200 OK` | Authenticated user returned |
| `400 Bad Request` | Malformed request. Unusual here — there is nothing to malform but headers |
| `401 Unauthorized` | Invalid, missing, or expired `Authorization` token or `Key` header, or credentials from a different environment |
| `403 Forbidden` | Credentials valid but not permitted |
| `404 Not Found` | Wrong path or wrong `{env}` segment |


### The error object

| Field | Type | Description |
|  --- | --- | --- |
| `id` | String | Error identifier |
| `code` | Integer | Numeric error code |
| `message` | String | Error key, for example `account.not.found` |


Error responses return `data` as `null`.

## Migrating from V2

To migrate from Me API V2 to V3, update the version in the endpoint:

```
For V2, - GET https://api3.sprinklr.com/{env}/api/v2/me
For V3, + GET https://api3.sprinklr.com/{env}/api/v3/me
```

## Common Use Cases

### Verify credentials before anything else

```bash
curl -s -o /dev/null -w '%{http_code}\n' \
  'https://api3.sprinklr.com/{env}/api/v3/me' \
  -H 'Authorization: Bearer {{accessToken}}' \
  -H 'Key: {{apiKey}}' \
  -H 'Accept: application/json'
```

`200` means the token, the API key, and the environment all agree. Anything else means the problem is your credentials, not the endpoint you were originally calling.

### Discover the workspace at startup

```python
me = current_user(requests.get(url, headers=headers).json())
WORKSPACE_ID = me["workspaceId"]
CUSTOMER_ID  = me["customerId"]
USER_ID      = me["id"]
```

Cache these for the process lifetime rather than calling `/me` per request.

### Gate administrative features on user type

```python
if me["type"] in ("PARTNER_ADMIN", "CLIENT_ADMIN"):
    enable_admin_features()
else:
    enable_standard_features()   # default branch handles unknown types
```

### Read a custom property safely

```python
def prop(me, key, default=None):
    values = me.get("properties", {}).get(key)
    if not values:
        return default
    return values[0]              # always an array of strings

status = prop(me, "spr_user_availability_status")
```

## Related

- [Me Api (V2)](https://legacy-dev.sprinklr.com/me-api)
- [User APIs](https://legacy-dev.sprinklr.com/user-apis)
- [SCIM (User) APIs](https://legacy-dev.sprinklr.com/scim-user-apis)
- [Read User](https://legacy-dev.sprinklr.com/read-user)
- [API Overview](https://legacy-dev.sprinklr.com/api-overview)