get-private-tokens.rst (1456B)
1 .. http:get:: [/instances/$INSTANCE]/private/tokens 2 3 Retrieve a list of issued access tokens for ``$INSTANCE``. 4 5 @since **v19** 6 7 **Required permission**: ``tokens-read`` 8 9 **Request:** 10 11 :query limit: *Optional.* 12 At most return the given number of results. Negative for descending by ``serial``, positive for ascending by ``serial``. Defaults to ``-20``. 13 :query offset: *Optional.* 14 Starting ``serial`` for :ref:`pagination <row-id-pagination>`. 15 16 **Response:** 17 18 :http:statuscode:`200 OK`: 19 Response is a `TokenInfos`. 20 :http:statuscode:`204 No content`: 21 No tokens. 22 :http:statuscode:`401 Unauthorized`: 23 Invalid or missing credentials. 24 :http:statuscode:`403 Forbidden`: 25 Missing rights. 26 27 **Details:** 28 29 .. ts:def:: TokenInfos 30 31 interface TokenInfos { 32 tokens: TokenInfo[]; 33 } 34 35 .. ts:def:: TokenInfo 36 37 interface TokenInfo { 38 // Time when the token was created. 39 creation_time: Timestamp; 40 41 // Time when the token expires. 42 expiration: Timestamp; 43 44 // Scope for the token. 45 scope: "readonly" | "readwrite" | ...; 46 47 // Is the token refreshable into a new token during its 48 // validity? 49 // Refreshable tokens effectively provide indefinite 50 // access if they are refreshed in time. 51 refreshable: boolean; 52 53 // Optional token description 54 description?: string; 55 56 // Opaque unique ID used for pagination. 57 serial: Integer; 58 }