VirtuousAI
Reference

Access tokens

List Access Tokens

GET
/api/v1/access-tokens

Query Parameters

tokenType?|
includeRevoked?boolean
Defaultfalse
limit?integer
Default50
Range1 <= value <= 200
cursor?|

Header Parameters

authorization?|
X-API-Key?|
vai_token?|

Response Body

application/json

application/json

curl -X GET "https://loading/api/v1/access-tokens"
{
  "items": [
    {
      "createdAt": "2019-08-24T14:15:22Z",
      "expiresAt": "2019-08-24T14:15:22Z",
      "id": "string",
      "lastUsedAt": "2019-08-24T14:15:22Z",
      "name": "string",
      "revokedAt": "2019-08-24T14:15:22Z",
      "tokenPrefix": "string",
      "tokenType": "session"
    }
  ],
  "nextCursor": "string"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Create Access Token

POST
/api/v1/access-tokens

Header Parameters

authorization?|
X-API-Key?|
vai_token?|

Request Body

application/json

expiresInDays?|
name*string
Length1 <= length <= 255

Response Body

application/json

application/json

curl -X POST "https://loading/api/v1/access-tokens" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{
  "plaintext": "string",
  "token": {
    "createdAt": "2019-08-24T14:15:22Z",
    "expiresAt": "2019-08-24T14:15:22Z",
    "id": "string",
    "lastUsedAt": "2019-08-24T14:15:22Z",
    "name": "string",
    "revokedAt": "2019-08-24T14:15:22Z",
    "tokenPrefix": "string",
    "tokenType": "session"
  }
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Revoke All Access Tokens

DELETE
/api/v1/access-tokens

Query Parameters

exclude_current?boolean
Defaulttrue

Header Parameters

authorization?|
X-API-Key?|
vai_token?|

Response Body

application/json

application/json

curl -X DELETE "https://loading/api/v1/access-tokens"
{
  "revokedCount": 0
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Get Access Token

GET
/api/v1/access-tokens/{token_id}

Path Parameters

token_id*string
Formatuuid

Header Parameters

authorization?|
X-API-Key?|
vai_token?|

Response Body

application/json

application/json

curl -X GET "https://loading/api/v1/access-tokens/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{
  "createdAt": "2019-08-24T14:15:22Z",
  "expiresAt": "2019-08-24T14:15:22Z",
  "id": "string",
  "lastUsedAt": "2019-08-24T14:15:22Z",
  "name": "string",
  "revokedAt": "2019-08-24T14:15:22Z",
  "tokenPrefix": "string",
  "tokenType": "session"
}
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}

Revoke Access Token

DELETE
/api/v1/access-tokens/{token_id}

Path Parameters

token_id*string
Formatuuid

Header Parameters

authorization?|
X-API-Key?|
vai_token?|

Response Body

application/json

curl -X DELETE "https://loading/api/v1/access-tokens/497f6eca-6276-4993-bfeb-53cbbbba6f08"
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}