Skip to content

Implement GET APIs for Deploy Tokens

Implement new API endpoint:

Get a single project's deploy token by ID.

GET /projects/:id/deploy_tokens/:token_id

Parameters:

Attribute Type Required Description
id integer/string {check-circle} Yes ID or URL-encoded path of the project owned by the authenticated user
token_id integer {check-circle} Yes ID of the deploy token

Example request:

curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/deploy_tokens/1"

Example response:

{
  "id": 1,
  "name": "MyToken",
  "username": "gitlab+deploy-token-1",
  "expires_at": "2020-02-14T00:00:00.000Z",
  "revoked": false,
  "expired": false,
  "scopes": [
    "read_repository",
    "read_registry"
  ]
}
Edited by Hannah Sutor