List the caller's own role cards
const url = 'https://api.harperharbor.com/open/v1/role/mine?pageNum=1&pageSize=20';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.harperharbor.com/open/v1/role/mine?pageNum=1&pageSize=20' \ --header 'Authorization: Bearer <token>'Lists role cards owned by the bearer account, newest first (by creation time). Only the caller’s cards are ever returned; identity comes from the bearer, not from any parameter. Requires the role.read capability. Cards that are hosted revisions or pending hosting transfers are excluded. Name and summary are returned in the card’s origin language (language). q searches the name and summary in every language of the card, case-insensitively and as a plain substring (no pattern syntax); Traditional and Simplified Chinese characters match each other, so 夜行侦探 finds 夜行偵探. total counts every card matching the filters, and hasNextPage tells whether a later page has more.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”1-based page number. Out-of-range or non-numeric values are clamped to 1..1000000.
Items per page. Out-of-range or non-numeric values are clamped to 1..100; the default is 20.
Only cards created through this origin. Empty = every origin. Not validated: an unknown value yields an empty list.
Keyword matched against the card name and summary in any of its languages: case-insensitive substring, Traditional and Simplified Chinese interchangeable. Surrounding spaces are ignored and only the first 100 characters are used. Empty = no keyword filter.
Responses
Section titled “Responses”Page of the caller’s role cards.
object
object
Card id.
Public card number.
Origin language of the card; name and summary are in this language.
Summary in the origin language.
Same as roleBackground; kept for older clients.
Portrait image URL; empty string when the card has none.
Card visibility, e.g. unlisted, public.
Chat count.
Where the card was created.
Cards matching the filters across all pages.
Whether a later page has more cards.
Examplegenerated
{ "roleList": [ { "characterRoleId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "roleNumId": 1, "language": "example", "roleName": "example", "roleDesc": "example", "roleAvatar": "example", "roleBackground": "example", "roleVisibility": "example", "reviewStatus": "example", "talkNum": 1, "creationMethod": "example" } ], "total": 1, "hasNextPage": true}unauthorized — missing or invalid bearer.
object
Error code (snake_case) or, for legacy handlers, a free-text/localized message.
Human-readable sentence. Present only on middleware errors and /me, /me/wallet.
Whether retrying may succeed. Present only on middleware errors, /me, /me/wallet and service/share routes.
Only on a first-turn context_capacity_exceeded: the smallest context tier that fits the whole card with room to talk. Save it as context in player settings and resend. Absent when no tier fits.
The token budget of required_context_tier for the selected model, for display.
Only on a first-turn context_capacity_exceeded: whether saving trimConstantLore=true lets the card play at the current tier. Absent on mid-conversation capacity errors.
Only on insufficient_credits: the credits this turn needs before it can start. Absent when the refusal came without an estimate.
Only on insufficient_credits: the credits the wallet could set aside for it.
Examplegenerated
{ "error": "example", "message": "example", "retryable": true, "required_context_tier": 1, "required_context_tokens": 1, "constant_lore_trim_fits": true, "credits_needed": 1, "credits_available": 1}