Skip to content

Improve api usage docs (create personal access token) #34231

Closed
@johnd0e

Description

@johnd0e

Description

As per https://docs.gitea.io/en-us/api-usage/#authentication-via-the-api, the required command should be:

curl -H "Content-Type: application/json" -d '{"name":test_token","scopes":["read|write:activitypub|issue|misc|notification|organization|package|repository|user"]}'
-u 'username:password' "https://gitea.your.host/api/v1/users/{username}/tokens"

When I run it I get this error message:

{"message":"invalid access token scope provided: invalid access token scope: read|write:activity|pub|issue|misc|notification|organization|package|repository|user","url":"https://gitea.com/api/swagger"}

Unfortunately, I cannot find any docs on this topic.

Also:

  1. There is a typo: missed quotemark in test_token"
  2. Here is {username} substitution, but in other places on the same page I see other variations: <username>, yourusername. It is misleading.

Gitea Version

gitea.com instance

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

gitea.com instance

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/docsThis PR mainly updates/creates documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions