User profiles
User profiles API: 3 endpoints under /v1.
Get a user profile
GET /v1/memory/users/{workspaceId}/{userId}/profile
Returns the free-text profile of one end user, the same text added to the context as userProfile when a search passes that userId. Requires the read permission and permission to act for the user.
See also: Blocks and user profiles.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
workspaceId (required) | path | string (uuid) | Workspace to act in. A workspace the credential cannot access returns 404. |
userId (required) | path | string | End user to act for. Requires permission to act for users. |
applicationId | query | string (uuid) | Application scope. Omit to use the workspace's shared pool; a credential bound to an application cannot request another one. |
Responses
| Status | Description |
|---|---|
200 | The user profile. |
Response fields
| Field | Description |
|---|---|
userId | The end user the profile belongs to. |
content | Profile text. |
createdAt | When the profile was created. |
updatedAt | When the profile was last changed. |
Example
curl -X GET "$API/v1/memory/users/$WS/<userId>/profile" \
-H "Authorization: Bearer $KEY"Write a user profile
PUT /v1/memory/users/{workspaceId}/{userId}/profile
Creates or replaces the end user's profile text. Profiles are plain text, at most 2000 characters by default, and are not embedded or consolidated. Requires the write permission and permission to act for the user.
See also: Blocks and user profiles.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
workspaceId (required) | path | string (uuid) | Workspace to act in. A workspace the credential cannot access returns 404. |
userId (required) | path | string | End user to act for. Requires permission to act for users. |
Request body (UpsertUserProfileRequest)
| Field | Type | Description |
|---|---|---|
applicationId | string (uuid) | Application scope of the profile. |
content | string | The full profile text; at most 2000 characters by default. |
Responses
| Status | Description |
|---|---|
200 | Confirmation with status updated. |
Response fields
| Field | Description |
|---|---|
status | Always updated on success. |
Example
curl -X PUT "$API/v1/memory/users/$WS/<userId>/profile" \
-H "Authorization: Bearer $KEY" \
-H 'Content-Type: application/json' \
-d '{}'Delete a user profile
DELETE /v1/memory/users/{workspaceId}/{userId}/profile
Deletes the end user's profile in the workspace (or application). The server answers 204 No Content on success. Requires the write permission and permission to act for the user.
See also: Blocks and user profiles.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
workspaceId (required) | path | string (uuid) | Workspace to act in. A workspace the credential cannot access returns 404. |
userId (required) | path | string | End user to act for. Requires permission to act for users. |
applicationId | query | string (uuid) | Application scope. Omit to use the workspace's shared pool; a credential bound to an application cannot request another one. |
Responses
| Status | Description |
|---|---|
204 | No content |
Example
curl -X DELETE "$API/v1/memory/users/$WS/<userId>/profile" \
-H "Authorization: Bearer $KEY"