# app.didpic.identity.getSession

> Published by [lexicons.didpic.app](https://lexicon.garden/identity/did:plc:an2jtp4jgkkbtmwfzhpbxawd)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:an2jtp4jgkkbtmwfzhpbxawd/app.didpic.identity.getSession)
- [Documentation](https://lexicon.garden/lexicon/did:plc:an2jtp4jgkkbtmwfzhpbxawd/app.didpic.identity.getSession/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:an2jtp4jgkkbtmwfzhpbxawd/app.didpic.identity.getSession/examples)

## Definitions

### `app.didpic.identity.getSession`

**Type**: `query`

Return the authenticated viewer's identity along with any opaque flags clients may use to gate UI.

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes |  |
| `roles` | `array` | Yes | Opaque flags assigned to the viewer. Values are implementation-defined; treat unknown entries as informational. |
| `handle` | `string` (handle) | No |  |
| `envAdmin` | `boolean` | Yes | Implementation-defined flag. Clients should treat as opaque. |
| `avatarCid` | `string` | No |  |
| `displayName` | `string` | No |  |

## Raw Schema

```json
{
  "id": "app.didpic.identity.getSession",
  "defs": {
    "main": {
      "type": "query",
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "did",
            "roles",
            "envAdmin"
          ],
          "properties": {
            "did": {
              "type": "string",
              "format": "did"
            },
            "roles": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Opaque flags assigned to the viewer. Values are implementation-defined; treat unknown entries as informational."
            },
            "handle": {
              "type": "string",
              "format": "handle"
            },
            "envAdmin": {
              "type": "boolean",
              "description": "Implementation-defined flag. Clients should treat as opaque."
            },
            "avatarCid": {
              "type": "string"
            },
            "displayName": {
              "type": "string"
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Return the authenticated viewer's identity along with any opaque flags clients may use to gate UI."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
