---
title: "Get a credential"
method: GET
path: "/api/tokens/{credential}"
tags: ["Credentials"]
---

# Get a credential

`GET /api/tokens/{credential}`

## Request

- Base URL: `https://git.cafe`
- URL: `https://git.cafe/api/tokens/{credential}`
- Auth: one of:
  - API key in cookie `gc-session`
  - HTTP bearer
  - HTTP basic
  - HTTP token

Returns one credential summary without returning its secret. Requires authenticated authority and enforces current resource policy.

## Path parameters

- `credential` string, required

## Response `200`

Response for status 200

- CredentialSummary
  - `id` string, required
  - `name` string, required
  - `tokenLastEight` string, nullable, required
  - `actorId` string, required
  - `delegatorActorId` string, nullable, required
  - `createdAt` string, date-time, required
  - `expiresAt` string, date-time, nullable, required
  - `revokedAt` string, date-time, nullable, required
  - `scopes` ScopeStatement[], required
    - union
      - object
        - `kind` 'profile', required
        - `family` 'metadata' | 'pins', required
        - `level` 'read' | 'write', required
        - `selector` union, required
          - object
            - `mode` 'all', required
          - object
            - `mode` 'where', required
            - `id` string
      - object
        - `kind` 'issue', required
        - `family` 'contents', required
        - `level` 'read' | 'write' | 'admin', required
        - `selector` union, required
          - object
            - `mode` 'all', required
          - object
            - `mode` 'where', required
            - `id` string
            - `repo` string
            - `org` string
      - object
        - `kind` 'issue', required
        - `family` 'labels' | 'assignees' | 'milestones' | 'state' | 'edit' | 'lock' | 'links' | 'pin', required
        - `level` 'write', required
        - `selector` union, required
          - object
            - `mode` 'all', required
          - object
            - `mode` 'where', required
            - `id` string
            - `repo` string
            - `org` string
      - object
        - `kind` 'credential', required
        - `family` 'independent' | 'delegate', required
        - `level` 'write', required
        - `selector` union, required
          - object
            - `mode` 'all', required
          - object
            - `mode` 'where', required
            - `owner` string
            - `recipient` string
      - object
        - `kind` 'repo', required
        - `family` 'contents' | 'metadata' | 'administration' | 'rulesets' | 'webhooks' | 'attachments' | 'settings' | 'visibility' | 'collaborators' | 'default-branch' | 'transfer' | 'catalog' | 'ci' | 'mirrors' | 'maintenance' | 'push-recovery' | 'sync' | 'stacks' | 'checks', required
        - `level` 'read' | 'write' | 'admin', required
        - `selector` union, required
          - object
            - `mode` 'all', required
          - object
            - `mode` 'where', required
            - `id` string
            - `org` string
            - `name` string
      - object
        - `kind` 'org', required
        - `family` 'metadata' | 'membership' | 'administration' | 'webhooks' | 'settings' | 'rulesets' | 'repositories' | 'ci' | 'runners' | 'billing' | 'apps' | 'closure', required
        - `level` 'read' | 'write' | 'admin', required
        - `selector` union, required
          - object
            - `mode` 'all', required
          - object
            - `mode` 'where', required
            - `id` string
      - object
        - `kind` 'pr', required
        - `family` 'contents', required
        - `level` 'read' | 'write' | 'admin', required
        - `selector` union, required
          - object
            - `mode` 'all', required
          - object
            - `mode` 'where', required
            - `id` string
            - `repo` string
            - `org` string
            - `source` object
              - …
            - `target` string
      - object
        - `kind` 'pr', required
        - `family` 'merge', required
        - `level` 'write', required
        - `selector` union, required
          - object
            - `mode` 'all', required
          - object
            - `mode` 'where', required
            - `id` string
            - `repo` string
            - `org` string
            - `source` object
              - …
            - `target` string
      - object
        - `kind` 'pr', required
        - `family` 'review', required
        - `level` 'read' | 'write', required
        - `selector` union, required
          - object
            - `mode` 'all', required
          - object
            - `mode` 'where', required
            - `id` string
            - `repo` string
            - `org` string
            - `source` object
              - …
            - `target` string
      - object
        - `kind` 'pr', required
        - `family` 'labels' | 'assignees' | 'milestones' | 'state' | 'edit' | 'lock' | 'verdict' | 'dismiss' | 'reviewers', required
        - `level` 'write', required
        - `selector` union, required
          - object
            - `mode` 'all', required
          - object
            - `mode` 'where', required
            - `id` string
            - `repo` string
            - `org` string
            - `source` object
              - …
            - `target` string
      - object
        - `kind` 'comment', required
        - `family` 'contents' | 'moderation' | 'triage', required
        - `level` 'read' | 'write', required
        - `selector` union, required
          - object
            - `mode` 'all', required
          - object
            - `mode` 'where', required
            - `id` union
              - …
            - `repo` string
            - `org` string
            - `parent` union
              - …
            - `commentKind` 'conversation' | 'inline' | 'review'
      - object
        - `kind` 'team', required
        - `family` 'metadata' | 'membership' | 'repositories', required
        - `level` 'read' | 'write' | 'admin', required
        - `selector` union, required
          - object
            - `mode` 'all', required
          - object
            - `mode` 'where', required
            - `id` string
            - `org` string
            - `ancestors` TeamId[]
      - object
        - `kind` 'branch', required
        - `family` 'contents' | 'rulesets', required
        - `level` 'read' | 'write' | 'admin', required
        - `selector` union, required
          - object
            - `mode` 'all', required
          - object
            - `mode` 'where', required
            - `repo` string
            - `org` string
            - `ref` string

## Other responses

- `400`: The request is invalid.
- `401`: Authentication is required, or the supplied credential is invalid.
- `403`: The credential does not permit this operation. A `code`, when present, names the refusal.
- `404`: The resource does not exist or is not visible to the caller.
- `409`: The request conflicts with the current state. A `code`, when present, names the refusal; `retryable` says whether the same request can succeed later, and `operationId` names the operation in the way.
- `429`: A rate limit is exhausted. Wait Retry-After seconds; the value is a hint, so back off on a repeat 429.
- `503`: A required service is temporarily unavailable; retry later.

---

[API](https://skmtc.dev/gitcafe/apis/git-cafe-api.md) - [All operations](https://skmtc.dev/gitcafe/apis/git-cafe-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitcafe/apis/git-cafe-api/revisions/9fa233d2986d?raw)
