User notes¶
A note is short private text the caller stores about another account.
All routes on this page are user-only. They require a user session token (Authorization: Bearer <token>). A valid Bot <token> credential is refused with 403 ACCESS_DENIED, and an invalid one with 401 UNAUTHORIZED.
A note is private to its author
The target account never receives the note in an HTTP response or Gateway Dispatch. A note has no relationship requirement, so the caller can hold one for an account that is neither a friend nor blocked.
User note object¶
The note the caller holds for one target account.
Structure¶
| Field | Type | Description |
|---|---|---|
| note | string | The note text the caller stored for the target account, or an empty string when there is none |
A stored note is never empty: writing an empty or whitespace-only note deletes it instead.
User notes record¶
Every note the caller has stored, as a map from target account ID to note text.
Structure¶
| Field | Type | Description |
|---|---|---|
| notes | map[snowflake, string] | Each property name is the snowflake of one target account, and its value is that account's note text |
A target with no note has no property, so an account with no notes receives {"notes": {}}.
The Gateway delivers the same map (without the notes wrapper) as the notes field of the Ready payload, so a connected client already holds it before calling List user notes.
Example¶
{
"notes": {
"1501314428688998182": "met at the Berlin meetup",
"1501314428688998183": "always posts the good links"
}
}
List user notes¶
GET /users/@me/notes
Returns the caller's complete user notes record. The operation is not paged, so every stored note comes back in one response.
A note has no creation or modification timestamp.
Response¶
| Status | Body | Condition |
|---|---|---|
| 200 | user notes record | Notes were returned, possibly as an empty map |
Rate limit¶
60 requests per 10 seconds for each authenticated user, on the user:notes:read bucket, shared with Get user note.
Get user note¶
GET /users/@me/notes/{target_id}
Returns the caller's user note object for one target account.
A target with no stored note returns 200 with an empty note, not an error. TEBHOS does not check that the target account exists, so an unknown ID behaves the same way.
Path parameters¶
| Field | Type | Description |
|---|---|---|
| target_id | snowflake | The ID of the account the note describes |
Response¶
| Status | Body | Condition |
|---|---|---|
| 200 | user note object | The note, or an empty string, was returned |
| 400 | error response | target_id is not an integer and the request returns BAD_REQUEST |
Example¶
Rate limit¶
60 requests per 10 seconds for each authenticated user, on the user:notes:read bucket, shared with List user notes.
Set user note¶
PUT /users/@me/notes/{target_id}
Creates, replaces, or deletes the caller's note for one target account. Returns the submitted note. Emits a User Note Update Gateway event.
The supplied text becomes the complete stored note. Leading and trailing whitespace is removed before it is stored. The caller can store a note for any ID, including a bot account and its own account; TEBHOS does not check that the target exists.
An omitted, null, or blank note deletes it
{}, {"note": null}, {"note": ""}, and a note made only of whitespace all delete the stored note. There is no separate delete route. The request body itself must be a JSON object; an empty request body is rejected with 400.
Path parameters¶
| Field | Type | Description |
|---|---|---|
| target_id | snowflake | The ID of the account the note describes |
JSON body¶
| Field | Type | Description |
|---|---|---|
| note? | ?string | The complete replacement note text (at most 256 characters), or null to delete the stored note |
The 256-character limit is counted in Unicode characters on the value as sent, before whitespace is trimmed.
Response¶
| Status | Body | Condition |
|---|---|---|
| 200 | user note object | The note was set or deleted. note echoes the submitted value as sent (untrimmed), or an empty string after a deletion |
| 400 | error response | target_id is not an integer (BAD_REQUEST), or note is longer than 256 characters (INVALID_FORM_BODY) |
Side effects¶
Supplying text creates or replaces the note, and a request that supplies none deletes it. User Note Update reaches the caller's own sessions for every accepted request, including one that supplies the current value and one that deletes an absent note.
The Dispatch payload has these members:
| Field | Type | Description |
|---|---|---|
| id | snowflake | The target account ID |
| target_user_id | snowflake | The same ID, kept for older clients |
| note | string | The note text as submitted, or an empty string on a deletion |
Rate limit¶
40 requests per 10 seconds for each authenticated user, on the user:notes:write bucket.
Legacy note route¶
POST /profile/{profile_id}/note
An older route kept for earlier TEBHOS clients. It takes the same {"note": ...} body and writes to the same storage as Set user note, so blank values delete the note and text is trimmed before it is stored. It returns 200 with {"message": ..., "note": ...}.
Prefer Set user note
The legacy route has no per-route rate limit bucket, applies no 256-character limit, and it emits no User Note Update, so the caller's other sessions are not told about the change. New integrations should use Set user note.