# Users

The profile of the person a personal token or OAuth token acts as.

Your user id is the `user_id` of the member whose `is_self` is `true` in the member list, which needs `member.read`, and the `actor_id` of the audit events you caused.

Contains: [Members](https://sparklogs.com/docs/api/reference/members.md)

Ids: text.

- `GET /users/{user_id}` [Read your profile](#read-user)

## User object

A person's own profile: user id, email and names.

- `id` (string): Your user id.
- `email` (email): Your email address.
- `full_name` (string or null): Your full name.
- `display_name` (string or null): The name shown for you in the app.

## Read your profile

`GET https://engine.sparklogs.app/app-api/users/{user_id}`

Preview

Returns the profile of the person the credential acts as: your user id, email and names. Any other user id returns 404. A workspace token acts as no person and is refused.

### Access

- Works with: Signed-in person, Personal token, OAuth token

Needs no privilege: it reads only the profile of the person the credential acts as.

### Behavior

- Retry: Safe to send again

### Path parameters

- `user_id` (string, required): The user's id.

### Query parameters

- `fields` (array of string): Comma-separated top-level fields of each object to return instead of the default set.

Sent by default: `id`, `email`, `full_name`, `display_name`

### Response (200)

- `user` (User, required): The user.
- `message` (string, required): What the call did, as a short phrase for a person to read. Its wording may change: act on the HTTP status.

### Errors

| Status | Code | When | Send again? |
| - | - | - | - |
| 400 | `APP_API_ERR_BAD_PARAMETERS` | A query parameter it does not take, one given twice, or `fields` naming a field it does not have. | No |
| 401 | `APP_API_ERR_UNAUTHORIZED` | The token is missing, not valid, expired or revoked, or its workspace is deleted. | No |
| 403 | `APP_API_ERR_CREDENTIAL_NOT_ADMITTED` | The call does not take a credential of this kind: `workspace_key`. | No |
| 404 | `APP_API_ERR_RECORD_NOT_FOUND` | The user id is not the caller's own. | No |
| 429 | `APP_API_ERR_TOO_MANY_REQUESTS` (cause `call_limit` or `invalid_token_attempts`) | The token made more calls than its limit (`cause` `call_limit`; `Retry-After` says when to try again), or the address it came from sent too many tokens that are not valid (`cause` `invalid_token_attempts`). | After `Retry-After` |
| 500 | `APP_API_ERR_TECHNICAL_ISSUE` | The call failed on the server. | Read first |
| 503 | `APP_API_ERR_MAINTENANCE` | SparkLogs is in scheduled maintenance. | After `Retry-After` |

Every call can also return the [common errors](https://sparklogs.com/docs/api/errors.md).

### Related

- [List members](https://sparklogs.com/docs/api/reference/members.md#list-members)
- [Read credential metadata](https://sparklogs.com/docs/api/reference/credential.md#read-credential)

### Example

Read your own profile

```bash
curl -X GET \
  "https://engine.sparklogs.app/app-api/users/AlexRiveraExampleUserId00001" \
  -H "Authorization: Bearer $SPARKLOGS_TOKEN"
```

Response (200)

```json
{
  "message": "user retrieved",
  "user": {
    "id": "AlexRiveraExampleUserId00001",
    "email": "alex.rivera@example.com",
    "full_name": "Alex Rivera",
    "display_name": "Alex"
  }
}
```

---

Source: <https://sparklogs.com/docs/api/reference/users>
All SparkLogs documentation in Markdown: <https://sparklogs.com/llms.txt>
