# \TokensApi
All URIs are relative to *http://localhost:5000*
[**create_token**](TokensApi.md#create_token) | **POST** /v3/oauth2/tokens | Generate a Tapis JWT
[**create_v2_token**](TokensApi.md#create_v2_token) | **POST** /v3/oauth2/v2/token | Create a v2 bearer token from a Tapis v3 JWT.
[**generate_device_code**](TokensApi.md#generate_device_code) | **POST** /v3/oauth2/device/code | Generate a device code.
[**revoke_token**](TokensApi.md#revoke_token) | **POST** /v3/oauth2/tokens/revoke | Revoke a token.
## create_token
> models::CreateToken201Response create_token(new_token)
Generate a Tapis JWT
Generate a Tapis JWT using some OAuth2 grant type. Typically, a request to this endpoint is the last step in the token generation process. The fields required in the request payload depend on the grant type being used (see details below).
### Parameters
**new_token** | [**NewToken**](NewToken.md) | | [required] |
### Return type
[**models::CreateToken201Response**](create_token_201_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json, application/x-www-form-urlencoded
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## create_v2_token
> models::CreateV2Token200Response create_v2_token(v2_token)
Create a v2 bearer token from a Tapis v3 JWT.
Create a v2 token from a Tapis v3 JWT. Note that only some tenants for both v2 and v3 are supported.
### Parameters
**v2_token** | [**V2Token**](V2Token.md) | | [required] |
### Return type
[**models::CreateV2Token200Response**](create_v2_token_200_response.md)
### Authorization
[TapisJWT](../README.md#TapisJWT)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## generate_device_code
> models::GenerateDeviceCode200Response generate_device_code(new_device_code)
Generate a device code.
Generate a device code; this is the first step in the device_code grant type. See the OAuth2 documentation for details.
### Parameters
**new_device_code** | [**NewDeviceCode**](NewDeviceCode.md) | | [required] |
### Return type
[**models::GenerateDeviceCode200Response**](generate_device_code_200_response.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
## revoke_token
> models::BasicResponse revoke_token(revoke_token_request)
Revoke a token.
Revoke a Tapis JWT. Pass the token to revoke in the body of the request. Once revoked, a token cannot be unrevoked. Only user tokens generated by this Authenticator can be revoked with this endpoint.
### Parameters
**revoke_token_request** | [**RevokeTokenRequest**](RevokeTokenRequest.md) | | [required] |
### Return type
[**models::BasicResponse**](BasicResponse.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)