Create An API Token
POST
/tokens
const url = 'https://markdawn.space/api/v1/tokens';const options = { method: 'POST', headers: { cookie: 'better-auth.session_token=<better-auth.session_token>', 'Content-Type': 'application/json' }, body: '{"name":"Local CLI","scopes":["pages:read"],"expiresAt":null}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://markdawn.space/api/v1/tokens \ --header 'Content-Type: application/json' \ --cookie better-auth.session_token=<better-auth.session_token> \ --data '{ "name": "Local CLI", "scopes": [ "pages:read" ], "expiresAt": null }'Creates an API token through a browser session. The token secret appears only in this response. If scopes is omitted, the token starts with pages:read.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”Token metadata and the secret, which is shown only once.