# \RepositoryTokensApi

All URIs are relative to *http://localhost*

Method | HTTP request | Description
------------- | ------------- | -------------
[**create_repo_token**](RepositoryTokensApi.md#create_repo_token) | **POST** /api/v1/repositories/{key}/tokens | Create a new access token scoped to a repository.
[**get_repo_token**](RepositoryTokensApi.md#get_repo_token) | **GET** /api/v1/repositories/{key}/tokens/{token_id} | Get details of a specific token on a repository.
[**list_repo_tokens**](RepositoryTokensApi.md#list_repo_tokens) | **GET** /api/v1/repositories/{key}/tokens | List all access tokens configured on a repository.
[**revoke_repo_token**](RepositoryTokensApi.md#revoke_repo_token) | **DELETE** /api/v1/repositories/{key}/tokens/{token_id} | Revoke an access token from a repository.



## create_repo_token

> models::CreateRepoTokenResponse create_repo_token(key, create_repo_token_request)
Create a new access token scoped to a repository.

The token is automatically restricted to this repository. The plaintext token value is returned only in this response and cannot be retrieved later.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**key** | **String** | Repository key | [required] |
**create_repo_token_request** | [**CreateRepoTokenRequest**](CreateRepoTokenRequest.md) |  | [required] |

### Return type

[**models::CreateRepoTokenResponse**](CreateRepoTokenResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### 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)


## get_repo_token

> models::RepoTokenResponse get_repo_token(key, token_id)
Get details of a specific token on a repository.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**key** | **String** | Repository key | [required] |
**token_id** | **uuid::Uuid** | Token ID | [required] |

### Return type

[**models::RepoTokenResponse**](RepoTokenResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **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)


## list_repo_tokens

> models::RepoTokenListResponse list_repo_tokens(key)
List all access tokens configured on a repository.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**key** | **String** | Repository key | [required] |

### Return type

[**models::RepoTokenListResponse**](RepoTokenListResponse.md)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **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_repo_token

> revoke_repo_token(key, token_id)
Revoke an access token from a repository.

This soft-revokes the token by setting `revoked_at`. The token will immediately stop working for authentication.

### Parameters


Name | Type | Description  | Required | Notes
------------- | ------------- | ------------- | ------------- | -------------
**key** | **String** | Repository key | [required] |
**token_id** | **uuid::Uuid** | Token ID | [required] |

### Return type

 (empty response body)

### Authorization

[bearer_auth](../README.md#bearer_auth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: Not defined

[[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)

