Skip to content

docs: Document repository API token creation and scope OD-395 - #2725

Open
pedrobpereira wants to merge 2 commits into
masterfrom
doc/repo-tokens-product-page-OD-395
Open

docs: Document repository API token creation and scope OD-395#2725
pedrobpereira wants to merge 2 commits into
masterfrom
doc/repo-tokens-product-page-OD-395

Conversation

@pedrobpereira

@pedrobpereira pedrobpereira commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Changes

  • docs/codacy-api/api-tokens.md: document repository API token name rules, mandatory 1-year-max expiry (no never-expire option), that the token value stays fully visible after creation (not masked), grandfathered legacy tokens without an expiry, the distinct "token expired" error, and the full list of 13 operations a repository token can authorize (own repository only).
  • docs/codacy-api/using-the-codacy-api.md: correct the auth section's outdated claim that all API v3 endpoints require an account token, and add a note on repository-token expiry/error behavior.

👀 Live preview

https://doc-repo-tokens-product-page-od-395--docs-codacy.netlify.app

🚧 To do

  • If relevant, include the Jira issue key at the end of the pull request title
  • Perform a self-review of the changes
  • Fix any issues reported by the CI/CD

Manual Testing

Add manual testing evidence here (steps, screenshots, environment).

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Overall readability score: 53.92 (🔴 -0.01)

File Readability
using-the-codacy-api.md 55.65 (🔴 -0.08)
api-tokens.md 66.14 (🔴 -2)
View detailed metrics

🟢 - Shows an increase in readability
🔴 - Shows a decrease in readability

File Readability FRE GF ARI CLI DCRS
using-the-codacy-api.md 55.65 42.41 11.2 13.1 11.84 7.19
  🔴 -0.08 🔴 -0.2 🔴 -0.08 🔴 -0.1 🟢 +0.05 🟢 +0.05
api-tokens.md 66.14 31.28 8.79 9.8 10.66 6.65
  🔴 -2 🔴 -8.96 🔴 -0.12 🔴 -0.3 🟢 +0 🟢 +0.04

Averages:

  Readability FRE GF ARI CLI DCRS
Average 53.92 42.81 10.93 12.34 12.29 8.04
  🔴 -0.01 🔴 -0.04 🟢 +0 🟢 +0 🟢 +0 🟢 +0
View metric targets
Metric Range Ideal score
Flesch Reading Ease 100 (very easy read) to 0 (extremely difficult read) 60
Gunning Fog 6 (very easy read) to 17 (extremely difficult read) 8 or less
Auto. Read. Index 6 (very easy read) to 14 (extremely difficult read) 8 or less
Coleman Liau Index 6 (very easy read) to 17 (extremely difficult read) 8 or less
Dale-Chall Readability 4.9 (very easy read) to 9.9 (extremely difficult read) 6.9 or less

@github-actions
github-actions Bot temporarily deployed to Netlify August 6, 2026 13:22 Inactive
@codacy-production

Copy link
Copy Markdown
Contributor

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@pedrobpereira
pedrobpereira force-pushed the doc/repo-tokens-product-page-OD-395 branch from fd791d7 to 5234b79 Compare August 6, 2026 13:28
@github-actions
github-actions Bot temporarily deployed to Netlify August 6, 2026 13:30 Inactive
@pedrobpereira
pedrobpereira force-pushed the doc/repo-tokens-product-page-OD-395 branch from 5234b79 to 8b7d7ba Compare August 6, 2026 13:32
@github-actions
github-actions Bot temporarily deployed to Netlify August 6, 2026 13:34 Inactive
Cover name rules, mandatory 1-year expiry, the 13 allowed operations, and expired-token handling for repository tokens.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@pedrobpereira
pedrobpereira force-pushed the doc/repo-tokens-product-page-OD-395 branch from 8b7d7ba to fdebbb4 Compare August 6, 2026 13:35
@github-actions
github-actions Bot temporarily deployed to Netlify August 6, 2026 13:36 Inactive
@LipeGheno
LipeGheno marked this pull request as ready for review August 11, 2026 12:43
@LipeGheno
LipeGheno requested a review from a team as a code owner August 11, 2026 12:43

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

The documentation updates generally align with the requirements for detailing Repository API token creation and scoping. However, the PR fails to document that token values remain fully visible (not masked) after creation, a detail explicitly mentioned in the PR intent. Additionally, the phrasing in some sections could lead to confusion between the restricted scope of API v3 tokens versus legacy API v2 behavior. Codacy results indicate the PR is up to standards with no new quality issues.

About this PR

  • The PR description indicates that documentation would include a note about the token value staying 'fully visible after creation (not masked)', but this information is absent from the repository API tokens section.

Test suggestions

  • Verify documentation of naming constraints for repository tokens.
  • Verify documentation of the 1-year maximum expiration and absence of 'never-expire' option.
  • Verify documentation of the 13 specific authorized operations for API v3.
  • Verify documentation that legacy tokens without expiry are grandfathered.
  • Verify mention of 'token value stays fully visible after creation (not masked)'
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify mention of 'token value stays fully visible after creation (not masked)'

TIP Improve review quality by adding custom instructions
TIP How was this review? Give us feedback

Comment thread docs/codacy-api/api-tokens.md Outdated

1. Click the button **Create API token** under **Repository API tokens**.

- Optionally give the token a name. Names may contain only letters, numbers, and dashes, up to 100 characters. If you don't set a name, Codacy generates one for you.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM RISK

The PR description mentions that the documentation should state 'the token value stays fully visible after creation (not masked)'. This information is missing from this section of the diff.


### What repository API tokens can do on API v3 {: id="repository-api-token-operations"}

On **API v3**, a repository API token authorizes only the following operations, and only on the repository it was created for. This restriction doesn't apply to **API v2**, where a repository API token can access any endpoint for its repository:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM RISK

Suggestion: The current phrasing suggests the following list applies to API v2, while it actually describes the restricted set for API v3.

Suggested change
On **API v3**, a repository API token authorizes only the following operations, and only on the repository it was created for. This restriction doesn't apply to **API v2**, where a repository API token can access any endpoint for its repository:
On **API v3**, a repository API token authorizes only the following operations on the repository it was created for (unlike the legacy **API v2**, which allows access to all endpoints for that repository):

Performing `GET` requests for public repositories doesn't require authentication.

!!! note
Repository API tokens always have an expiration date (up to one year). A request authenticated with an expired repository API token is rejected with a distinct "token expired" error, rather than the generic error you'd get from an invalid or unknown token — see [repository API tokens](api-tokens.md#repository-api-tokens).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚪ LOW RISK

Suggestion: This statement is too absolute and contradicts the legacy token exception mentioned in the main documentation. Adding a qualifier improves accuracy.

Suggested change
Repository API tokens always have an expiration date (up to one year). A request authenticated with an expired repository API token is rejected with a distinct "token expired" error, rather than the generic error you'd get from an invalid or unknown token — see [repository API tokens](api-tokens.md#repository-api-tokens).
New repository API tokens always have an expiration date (up to one year). A request authenticated with an expired repository API token is rejected with a distinct "token expired" error, rather than the generic error you'd get from an invalid or unknown token — see [repository API tokens](api-tokens.md#repository-api-tokens).

- Repository token names are unique per repository (confirmed by
  Andrzej Janczak), not just character-restricted.
- The Codacy Cloud CLI doesn't currently support repository tokens
  (confirmed by Andrzej Janczak) — the intro list implied it did for
  both token types.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions
github-actions Bot temporarily deployed to Netlify August 11, 2026 14:05 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants