Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/project_access_tokens.md')
-rw-r--r--doc/api/project_access_tokens.md13
1 files changed, 8 insertions, 5 deletions
diff --git a/doc/api/project_access_tokens.md b/doc/api/project_access_tokens.md
index 2f386e22001..f8e7c0f3633 100644
--- a/doc/api/project_access_tokens.md
+++ b/doc/api/project_access_tokens.md
@@ -1,7 +1,7 @@
---
stage: Govern
group: Authentication
-info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
+info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments
---
# Project access tokens API **(FREE ALL)**
@@ -139,6 +139,8 @@ curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" \
Rotate a project access token. Revokes the previous token and creates a new token that expires in one week.
+In GitLab 16.6 and later, you can use the `expires_at` parameter to set a different expiry date. This non-default expiry date can be up to a maximum of one year from the rotation date.
+
WARNING:
When you rotate a project access token, the new token retains the expiry date of the old token. For more information, see [issue 423362](https://gitlab.com/gitlab-org/gitlab/-/issues/423362).
@@ -146,10 +148,11 @@ When you rotate a project access token, the new token retains the expiry date of
POST /projects/:id/access_tokens/:token_id/rotate
```
-| Attribute | Type | required | Description |
-|-----------|---------|----------|---------------------|
-| `id` | integer or string | yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) |
-| `token_id` | integer or string | yes | ID of the project access token |
+| Attribute | Type | required | Description |
+|-----------|------------|----------|---------------------|
+| `id` | integer/string | yes | ID or [URL-encoded path of the project](rest/index.md#namespaced-path-encoding) |
+| `token_id` | integer/string | yes | ID of the project access token |
+| `expires_at` | date | no | Expiration date of the access token in ISO format (`YYYY-MM-DD`). [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/416795) in GitLab 16.6. |
```shell
curl --request POST --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/<project_id>/access_tokens/<token_id>/rotate"