# GET /api/v1/user

**Get the current user**

## StackHawk Current User

This endpoint provides details about the requesting user. This information helps determine what access an authorized user has on the StackHawk platform, and how they are authenticated.

The StackHawk user is seperated into two sections. `provider` specifies how the user authenticates. `external` specifies details of the user, and the access they have to the StackHawk Platform.

### User

A StackHawk User as identified by the platform.

| Parameter | Default | Description |
|:---:|:---:|:---:|
|stackhawkId|""|An internal identifier for this user. _This is not the user uuid_.|
|provider|{}|Information about the login provider assigned to this user. [Read More](#providerinfo)|
|external|{}|Information about the user itself, and how they appear in the platform. [Read More](#userexternal)|
|createdTimestamp|0|Creation timestamp of this user.|

### ProviderInfo

Information about a users access Provider to the StackHawk platform.

| Parameter | Default | Description |
|:---:|:---:|:---:|
|slug|"UNKNOWN"|User access provider.|
|clientId|""|Provider client Id.|
|created|0|Milliseconds since epoch timestamp of when the user access was granted.|

### UserExternal

Information about the User and how they can access the platform.

| Parameter | Default | Description |
|:---:|:---:|:---:|
|id|""|The UUID identifier of this user.|
|email|""|Users email address.|
|firstName|""|Users first name.|
|lastName|""|Users last name.|
|fullName|""|Users full name.|
|avatarUrl|""|Users avatar url.|
|applicationIds|[]|An array of application ids this user has access to.|
|organizations|[]|Organizations a user is a part of. [Read More](#userorganization)|
|preferences|{}|User preferences; options that can be set by the user. [Read More](#userpreferences)|
|metadata|[]|Metadata associated to this external user. Primarily used for stuffing 3rd party verification data.|
|teams|[]|Teams this user belongs to.|

### UserPreferences

User settings and preferences for interaction within StackHawk.

| Parameter | Default | Description |
|:---:|:---:|:---:|
|dontReceiveWeeklyEmail|false|If the user will be opted out of weekly organization update emails.|
|defaultOrganizationId|""|The UUID identifier of the organization a user currently logs into.|
|dontReceiveTrialingEmails|false|If `true`, the user will be opted out of stackhawk subscription-trialing notifications.|
|pinnedApplicationIds|[]|UUIDs of applications the user has pinned to the top of the application list.|

User preferences can be adjusted from the [account settings page](https://app.stackhawk.com/settings/account) in the StackHawk platform.

### UserOrganization

Represents the relationship between a User and an Organization they belong to.

| Parameter | Default | Description |
|:---:|:---:|:---:|
|organization|{}|The StackHawk organization this user belongs to.|
|role|"UNKNOWN"|The organization role the user belongs to within this organization.|
|features|[]|Specific access features available to this organization.|
|metadata|[]|The user's organizational specific metadata.|
|achievements|[]|Specific product journey events that have triggered for this user.|
|permissions|[]|Permissions the User has in this organization.|

### Organization

A StackHawk Organization.

| Parameter | Default | Description |
|:---:|:---:|:---:|
|id|""|The UUID identifier of this StackHawk Organization.|
|name|""|The name of this Organization.|
|subscription|{}|The billing subscription of this Organization.|
|isLinkedToExternalBilling|false|If this organization is yet connected to external billing (Stripe).|
|plan|""|The feature plan this organization belongs to.|
|features|[]|Specific overrides to the feature flags in the plan.|
|settings|{}|Organization settings.|
|createdTimestamp|0|Creation timestamp of this organization.|

A StackHawk platform user can belong to many organizations.

> Requires `read:profile` permission.

## Responses

### 200 — Response of the current user.

#### application/json

- `unclaimedInviteOrganizationIds` (string[]) — Unclaimed invitations to the organization.
- `user` (user.User)
  - `createdTimestamp` (integer<int64>) — Creation timestamp of this user.
  - `external` (user.UserExternal)
    - `applicationIds` (string[]) — An array of application ids this user has access to.
    - `avatarUrl` (string) — Users avatar url.
    - `email` (string) — Users email address.
    - `firstName` (string) — Users first name.
    - `fullName` (string) — Users full name.
    - `id` (string) — The UUID identifier of this user.
    - `lastName` (string) — Users last name.
    - `metadata` (user.UserMetadata[]) — Metadata associated to this external user. Primarily used for stuffing 3rd party verification data.
      - `name` (string) — Metadata name.
      - `value` (string) — Metadata value.
    - `organizations` (user.UserOrganization[]) — Organizations a user is a part of.
      - `achievements` (user.UserAchievement[]) — Specific product journey events that have triggered for this user.
        - `achievement` (string) — Achievement event. One of a few defined events that can happen.
        - `timestamp` (integer<int64>) — Achievement timestamp.
      - `features` (feature.Feature[]) — Specific access features available to this organization.
        - `enabled` (boolean) — If the feature is enabled.
        - `name` (string) — The name of the feature.
      - `metadata` (user.UserMetadata[]) — The user's organizational specific metadata.
        - `name` (string) — Metadata name.
        - `value` (string) — Metadata value.
      - `organization` (organization.Organization)
        - `createdTimestamp` (integer<int64>) — Creation timestamp of this organization.
        - `features` (feature.Feature[]) — Specific overrides to the feature flags in the plan.
        - `id` (string) — The UUID identifier of this StackHawk Organization.
        - `isLinkedToExternalBilling` (boolean) — If this organization is yet connected to external billing (Stripe).
        - `name` (string) — The name of this Organization.
        - `plan` (string) — The feature plan this organization belongs to.
        - `settings` (organization.OrgSettings)
        - `subscription` (organization.Subscription)
      - `permissions` (string[]) — Permissions the User has in this organization.
      - `role` (string) — The organization role the user belongs to within this organization.
    - `preferences` (user.UserPreferences)
      - `defaultOrganizationId` (string) — The UUID identifier of the organization a user currently logs into.
      - `dontReceiveTrialingEmails` (boolean) — If `true`, the user will be opted out of stackhawk subscription-trialing notifications.
      - `dontReceiveUpdatesEmail` (boolean) — UNUSED. (currently unused) if `true`, the user will be opted out of Company Update emails.
      - `dontReceiveWeeklyEmail` (boolean) — If the user will be opted out of weekly organization update emails.
      - `pinnedApplicationIds` (string[]) — UUIDs of applications the user has pinned to the top of the application list.
    - `teams` (user.UserTeam[]) — Teams this user belongs to.
      - `id` (string) — The UUID identifier of the team.
      - `name` (string) — The name of the team.
      - `organizationId` (string) — The organization ID this team belongs to.
  - `organizationIds` (string[]) — OrganizationIds **deprecated** - 4/26/22.
  - `provider` (user.ProviderInfo)
    - `clientId` (string) — Provider client Id.
    - `created` (integer<int64>) — Milliseconds since epoch timestamp of when the user access was granted.
    - `slug` (string) — User access provider.
  - `stackhawkId` (string) — An internal identifier for this user. _This is not the user uuid_.

#### application/x-protobuf

- `unclaimedInviteOrganizationIds` (string[]) — Unclaimed invitations to the organization.
- `user` (user.User)
  - `createdTimestamp` (integer<int64>) — Creation timestamp of this user.
  - `external` (user.UserExternal)
    - `applicationIds` (string[]) — An array of application ids this user has access to.
    - `avatarUrl` (string) — Users avatar url.
    - `email` (string) — Users email address.
    - `firstName` (string) — Users first name.
    - `fullName` (string) — Users full name.
    - `id` (string) — The UUID identifier of this user.
    - `lastName` (string) — Users last name.
    - `metadata` (user.UserMetadata[]) — Metadata associated to this external user. Primarily used for stuffing 3rd party verification data.
      - `name` (string) — Metadata name.
      - `value` (string) — Metadata value.
    - `organizations` (user.UserOrganization[]) — Organizations a user is a part of.
      - `achievements` (user.UserAchievement[]) — Specific product journey events that have triggered for this user.
        - `achievement` (string) — Achievement event. One of a few defined events that can happen.
        - `timestamp` (integer<int64>) — Achievement timestamp.
      - `features` (feature.Feature[]) — Specific access features available to this organization.
        - `enabled` (boolean) — If the feature is enabled.
        - `name` (string) — The name of the feature.
      - `metadata` (user.UserMetadata[]) — The user's organizational specific metadata.
        - `name` (string) — Metadata name.
        - `value` (string) — Metadata value.
      - `organization` (organization.Organization)
        - `createdTimestamp` (integer<int64>) — Creation timestamp of this organization.
        - `features` (feature.Feature[]) — Specific overrides to the feature flags in the plan.
        - `id` (string) — The UUID identifier of this StackHawk Organization.
        - `isLinkedToExternalBilling` (boolean) — If this organization is yet connected to external billing (Stripe).
        - `name` (string) — The name of this Organization.
        - `plan` (string) — The feature plan this organization belongs to.
        - `settings` (organization.OrgSettings)
        - `subscription` (organization.Subscription)
      - `permissions` (string[]) — Permissions the User has in this organization.
      - `role` (string) — The organization role the user belongs to within this organization.
    - `preferences` (user.UserPreferences)
      - `defaultOrganizationId` (string) — The UUID identifier of the organization a user currently logs into.
      - `dontReceiveTrialingEmails` (boolean) — If `true`, the user will be opted out of stackhawk subscription-trialing notifications.
      - `dontReceiveUpdatesEmail` (boolean) — UNUSED. (currently unused) if `true`, the user will be opted out of Company Update emails.
      - `dontReceiveWeeklyEmail` (boolean) — If the user will be opted out of weekly organization update emails.
      - `pinnedApplicationIds` (string[]) — UUIDs of applications the user has pinned to the top of the application list.
    - `teams` (user.UserTeam[]) — Teams this user belongs to.
      - `id` (string) — The UUID identifier of the team.
      - `name` (string) — The name of the team.
      - `organizationId` (string) — The organization ID this team belongs to.
  - `organizationIds` (string[]) — OrganizationIds **deprecated** - 4/26/22.
  - `provider` (user.ProviderInfo)
    - `clientId` (string) — Provider client Id.
    - `created` (integer<int64>) — Milliseconds since epoch timestamp of when the user access was granted.
    - `slug` (string) — User access provider.
  - `stackhawkId` (string) — An internal identifier for this user. _This is not the user uuid_.
