Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node operation allows creating an authentication token for a specified user in the system. It is useful when you want to programmatically generate tokens that can be used for API authentication or other access control mechanisms tied to user accounts. For example, you might use this to create personal access tokens for users to integrate with external tools or automate workflows securely.

Properties

Name Meaning
Username The username of the user for whom the token will be created.
Name A name or label for the token being created, to identify its purpose or usage.
Scopes JSON array defining the scopes or permissions granted to the token (e.g., read, write).

Output

The output contains a JSON object representing the newly created token details. This typically includes the token string itself and metadata such as its name and associated scopes. The token can then be used for authenticating API requests on behalf of the user.

No binary data output is involved in this operation.

Dependencies

  • Requires an API key credential configured in n8n to authenticate requests against the target service.
  • The base URL for the API must be set correctly in the credentials to reach the user management endpoint.

Troubleshooting

  • Invalid username or user not found: Ensure the username provided exists in the system.
  • Insufficient permissions: The API key used must have rights to create tokens for users.
  • Malformed scopes JSON: The scopes property must be valid JSON; otherwise, the request will fail.
  • Network or authentication errors: Verify API URL and credentials are correct and active.

Links and References

  • Refer to the target service's API documentation for "Create User Token" endpoint details.
  • JSON formatting guides for properly specifying scopes.

Discussion