Redmine API keys and user impersonation for integrations: what the method does
A team wiring a CI job, chat bot or reporting tool to Redmine has to decide how that integration proves who it is. The Redmine REST API answers that question with per-user API keys. A key can be sent as a key parameter, as the username in HTTP Basic authentication, or in the X-Redmine-API-Key header. Each key belongs to one Redmine user, so every request runs with that user's roles, project memberships and visibility. An integration is therefore only as narrow as the account whose key it carries, which makes the choice of account the first design decision, before any code is written.
Two conditions shape the setup. The REST API is disabled until an administrator enables it in the Redmine administration settings, so confirm that with the administrator before planning the integration. Administrators can also act as another user by sending the X-Redmine-Switch-User header with a login name alongside their own key. This is useful for reproducing what a particular user sees or for recording actions under a person's name, but it means one administrator key can reach any account. Decide whether the integration needs impersonation at all, and if it does, record who may hold that key and why. The Redmine REST API documentation describes the header and the authentication methods in full.
Two related methods are covered elsewhere. OAuth2 authorization for applications, available since Redmine 6.1, replaces shared keys for applications that act on behalf of users, and outgoing webhooks in Redmine 7.0 push events to external tools instead of having them poll the API. This section only describes what key-based API access does and who it acts as, so use it to decide whether a plain key is appropriate before reading those sibling topics.
What you need before creating integration keys
Four decisions and one check come before any API key is issued. Each card below names a condition that the integration depends on, from the Redmine version line to the administrator who will own impersonation.
Choose a supported Redmine line
Redmine 7.0.x is the fully supported line and receives new features, bug fixes and security updates. Redmine 6.1.x receives only bug fixes and security updates, and 6.0.x receives only important security updates. Confirm which line your instance runs before you design key handling, because the key last-use tracking described on this page starts in 7.0.0. Plan an upgrade if you are on 5.1 or older, since those releases are unsupported.
Redmine download pageEnable the REST API deliberately
The REST API is off until an administrator enables it in the Redmine administration settings. Treat that switch as a change to the attack surface, not a formality, and record who turned it on and why. Confirm that the resources your integration needs, such as issues, projects, users and time entries, are the stable core resources before you build against them.
Redmine REST API docsCreate a dedicated integration account
Each integration should authenticate as its own user, not as a personal account or a shared administrator. Give that account only the project memberships and roles the integration needs, and confirm in the role settings what it can read and change. Its key then appears in the audit trail as the integration, which makes later review of its actions possible. Ask whether your team has a naming rule for these accounts.
Serve Redmine over HTTPS
API keys travel in request headers or parameters, so the Redmine endpoint must sit behind TLS on a network path you control. Confirm the certificate chain that your integration clients trust, and check that the reverse proxy does not log or cache the X-Redmine-API-Key header. Plain HTTP exposes every key to anyone on the path, so resolve this before any key is generated.
Name an administrator to own impersonation
Administrators can act as another user by sending the X-Redmine-Switch-User header, which makes impersonation a privileged capability. Name one accountable administrator who approves its use, reviews who it is used for, and can revoke the integration key that enables it. Agree in writing who may hold this role, because the person who owns it decides how far the integration can reach into other users' work.
How to set up a service account API key step by step
This sequence turns the Redmine REST API from a shared administrator credential into a scoped service account that an integration can call, with each step ending in a check that proves the access is what you intended.
Enable the REST API in administration
An administrator signs in, opens Administration, then Settings, then the API tab, and turns on the REST web service. Until this is enabled, API requests are refused regardless of the key being used. Confirm it is done by sending an unauthenticated request to a public project endpoint from a test client; the response should show the server is reachable and refuse access to restricted data rather than return a server error. Record the change in your administration log so the setting has an owner.
Create a non-person service account
Create a dedicated user for the integration, named for its function (for example, a CI reporter account) and not tied to any employee. Use an email address that a team mailbox controls, and disable interactive login if your identity policy allows it. Confirm the account exists, is active, and is listed under Users with no personal group memberships beyond what it needs. This account will own every action the integration takes, so its name should appear clearly in journals and audit trails.
Grant only the roles the integration needs
Add the service account as a member of each project it must reach, and assign a role that carries only the permissions the integration uses, such as viewing issues or adding comments. Avoid the administrator flag and avoid global roles. Check the result by signing in as the account in a private browser window and confirming it sees the intended project and nothing else. If a project appears that should not be visible, remove the membership before continuing.
Generate the account's API key
While signed in as the service account, open My account, choose the API access key option and generate a key. Redmine shows the key once on the account page, so copy it immediately and do not paste it into tickets or chat. Confirm generation by checking that the account page now shows a key the integration owner can retrieve only through the account, and that the key appears in the account's record without being displayed to other users.
Store the key in a secrets manager
Save the key in your organization's secrets manager with the account name, the target Redmine instance, the owning team and a rotation reminder. Grant read access only to the service or pipeline that calls the API, and keep it out of source repositories, container images and build logs. Confirm the storage by retrieving the secret through the same path the integration will use, in a test environment, and verifying the value matches the key without printing it to the console.
Send the key in the request header
Configure the integration to send the key in the X-Redmine-API-Key header on every request, rather than as a key parameter in the URL, where it can appear in proxy and web server logs. Keep the header value injected at runtime from the secrets manager. Confirm the setup by making a request that works with the header and fails when the header is removed, which shows the integration is authenticating with the service account rather than an anonymous session.
Confirm access with a read-only call
Run a read-only query such as GET /projects.json or GET /issues.json?project_id=your-project-identifier&limit=25, using the identifier of the single project the integration should reach. A 200 response that lists only that project confirms the scope is correct. Then try a call to a project the account should not see and expect a refusal. Only after both checks pass should write permissions be exercised, and record the results with the date and the key's last-use entry in the account page for the audit file.
When administrator impersonation with X-Redmine-Switch-User is justified
Use X-Redmine-Switch-User only for support investigations, data migrations and audit tasks where someone must see exactly what a named user sees. Only an administrator can switch users, and once the header is set, Redmine treats the request as that user. Every permission the target account holds applies to the call, including access to private projects, restricted trackers and fields that the integration account itself would never reach. Before you use the header, confirm which account you are switching to, confirm that account's roles in the affected projects, and record the ticket or change that justifies the work. An administrator key that is used for impersonation is effectively a master key to every account, so treat it with the same care as the other administrator credentials in your environment.
Do not put the header in routine sync jobs, scheduled imports or chat bots. Those jobs should run under a dedicated service account with the narrowest roles that cover their work, so that a leaked key exposes only that scope. If a job needs data from several projects, grant the service account membership in those projects rather than switching to a person who happens to belong to them. Impersonation in a recurring job also hides who actually acted, because the audit trail shows the target user rather than the caller, which makes later reviews harder.
Log each switch at the point where your integration or reverse proxy receives it. Record the administrator identity behind the key, the target user, the endpoint, the time and the reason code or ticket number. Redmine's own history will show the changes as made by the switched user, so your external log is the only place that ties the action to the administrator. Ask your Redmine administrator to confirm how the proxy or gateway in front of Redmine can capture request headers, and test that the log entry is written before the first real use. Review these logs on a regular schedule, and confirm the retention period with your compliance owner.
Choosing how the API key is sent: header, parameter or Basic auth
The X-Redmine-API-Key header is the method to use unless something specific rules it out. The key travels in the request headers rather than in the address, so it does not appear in the request line that web servers and load balancers commonly record. It also keeps the key out of browser history, shared links and copied commands. Most modern HTTP clients, including standard libraries in Python, Ruby, Java and Go, let you set a custom header in a few lines.
- Where the key sits: Only in the request headers, which access logs usually do not record by default.
- Client support: Any client that can set custom headers can use it without changes to the URL.
- Consistency: One method across scripts and services makes key rotation and audits simpler.
- Upstream logging: Confirm that your reverse proxy, API gateway and application tracing do not capture full headers in debug or error output.
Before you standardize on the header, check that no proxy in the path strips custom headers, since a dropped header looks like an authentication failure.
When Redmine sits behind a reverse proxy, web server or load balancer, the access log is the most likely place for a key to leak. A key passed as a key query parameter is written in full to the request line of many default log formats, and those logs are often shipped to a central store with broad read access. Choosing the header keeps the key out of that path, but the proxy configuration still decides what gets logged.
- Query parameter risk: A
key=value in the URL is recorded in access logs, referrer data and sometimes monitoring tools. - Header risk: Custom logging formats or debug tracing can still capture headers, so review them explicitly.
- Log access: Treat log stores as sensitive if any integration key could appear in them.
- Existing logs: Search historical logs for
key=patterns if an integration has used the parameter before, and plan rotation if matches exist. - Proxy settings: Confirm the proxy forwards the
X-Redmine-API-Keyheader unchanged to Redmine.
Check your current log format and a sample request on a test key before you rely on this setup.
Some older scripts, monitoring checks and commercial connectors only support HTTP Basic authentication. Redmine accepts the API key as the username in Basic auth, with any password value, which lets those tools work without code changes. This method still keeps the key out of the URL, but the key is encoded in an Authorization header, not hidden, so it needs the same protection as any other credential.
- Username field: Put the API key in the username field and a dummy value in the password field, as described in the REST API documentation.
- Transport: Basic auth sends credentials on every request, so use HTTPS only.
- Tool review: Check whether the tool writes its request configuration to disk, displays it in a UI or stores it in plain text.
- Migration path: Plan to move these tools to the header when they support custom headers or when they are next updated.
- Support check: Confirm the specific tool's Basic auth behavior with its vendor, since some tools send the password field differently.
Record which legacy integrations use Basic auth so you can retire that pattern in a planned way.
For one-off commands, shell scripts and manual checks, the header is still the better choice, but the most common mistake is pasting a key into a command line where it ends up in shell history or process listings. Environment variables and a file readable only by the service account reduce that exposure. Quick tests are where the key most often ends up in a query string because it is the shortest form to type.
- Command history: Avoid typing keys directly into commands. Read them from an environment variable or a protected file.
- Header in curl: Pass the header with the
-Hoption, referencing the variable rather than the literal value. - Query strings in examples: Remove
key=examples from runbooks and wiki pages that teams copy from. - Process visibility: Command-line arguments can be visible to other users on the host through process listings.
- Cleanup: Clear shell history on shared machines and rotate any key that was typed into a shared terminal.
Before sharing a runbook, confirm that every example uses the header and a placeholder rather than a working key.
Most organizations run several integrations at once, and each one may have different client capabilities and log exposure. A simple decision record for each integration keeps the choice consistent and reviewable. The question to answer is which method the client supports, where its requests pass, and who can read the logs they produce. The answer determines whether the integration is acceptable as is or needs a change before go-live.
- Inventory: List every integration, its client library and the method it uses today.
- Path review: Identify each proxy, gateway and log store the requests pass through.
- Decision rule: Use the header where supported, Basic auth over HTTPS where it is the only option, and the parameter only as a last resort.
- Exceptions: Record any integration that uses a parameter or Basic auth with an owner and a retirement date.
- Coordination: Confirm the chosen method with the team that runs the Redmine server and the team that owns the proxy.
Review the record whenever a client library or proxy changes, since either can alter how the key is sent or logged.
Mapping integration identities, roles and resource access
This table maps each integration to the account it runs under, the roles it needs, the resources it touches, and whether it may switch users. Use it to review each integration before it gets a key, and to confirm that one owner can rotate that key without breaking other systems.
| Integration | Account and role needs | Resources read or written | Switch-user and key owner |
|---|---|---|---|
| Issue sync to chat or CI | Dedicated service account, member of only the projects it posts to, role limited to viewing and adding issues | Issues and their journals, projects it belongs to | Switch-user not needed. Owner is the platform team that runs the integration |
| Time entry import from payroll or HR | Dedicated service account with time logging permission in named projects only | Time entries, projects, users for lookup | Switch-user not needed. Owner is the finance systems lead |
| Nightly user and group sync from HR | Dedicated administrative service account, reviewed and kept separate from day-to-day automation | Users and group memberships, read and update only what the sync requires | Switch-user not needed. Owner is the identity administrator who holds the admin account |
| Project creation from a request portal | Service account with rights to create projects under a named parent, no access to existing project content | Projects and project memberships | Switch-user not needed. Confirm whether the portal can create projects without administrator rights in your version |
| Reports on issue status for dashboards | Read-only service account, member of reporting projects only | Issues, projects, users for display names | Switch-user not needed. Owner is the reporting team |
| Per-user actions run by an admin tool | Administrator account that acts as the named user through X-Redmine-Switch-User | Depends on the acting user's own roles and visibility | Switch-user allowed only for this tool and logged to the administrator. Owner is the security team, which approves the tool |
| Legacy script using a shared personal key | Account should be replaced with a service account, then its role and memberships reviewed | Confirm each resource it touches before reassigning | Switch-user not allowed. Owner must be named before the key is moved |
Securing API keys, impersonation and key use
An integration that calls the Redmine REST API holds a key that can read and change issues, projects and users. The controls below decide how far that key reaches, who answers for it, and whether anyone notices when it is misused. Read them together, because a well-scoped service account still needs a rotation owner and a record of its use.
Keep keys out of source code
Store each API key in a secrets manager or the integration's runtime secret store, never in a repository, a CI variable visible to every job, or a configuration file that gets copied between environments. Check your Git history and CI logs for keys already committed, since a key removed from the current branch remains in older commits. Send the key only in the X-Redmine-API-Key header, because keys passed as a query parameter tend to appear in proxy and web server access logs.
Assign rotation ownership
Name one team, not one person, as the owner of each service account key, and record who can issue a replacement and where the integration reads it. Rotation should be a planned change with a window in which the old and new keys both work, so consumers can switch without an outage. Confirm how your Redmine version lets you regenerate a key for a user and whether the old key is invalidated immediately.
Scope the service account role
Give the service account a dedicated Redmine user and add it only to the projects it needs, with a role that grants the exact permissions for the calls the integration makes. A bot that only reads issues should not hold permissions to edit members, manage versions or view private issues in unrelated projects. Review the role after each new integration feature, because permissions tend to grow as scripts are extended.
Restrict administrator keys
An administrator's API key can do anything the administrator can do, so it should never be the key a routine integration uses. Keep administrator keys out of automation entirely, or limit them to a short list of named maintenance tasks run by a small group. Document who holds each administrator key and remove keys belonging to people who leave the team.
Log and approve impersonation
Administrators can act as another user by sending the X-Redmine-Switch-User header, which is useful for reproducing a user's view but makes actions appear to come from that user. Allow it only for tasks that have an approved ticket or change record, and have the calling script write the administrator, target user, request and time to your own log. Redmine's history shows the impersonated user as the author, so your external log is the only place that records who acted.
Enforce TLS-only transport
Every request that carries an API key or basic authentication credentials should go over HTTPS, and the Redmine host should reject plain HTTP for API paths rather than redirect them. Confirm that the reverse proxy in front of Redmine terminates TLS with a current configuration and that clients verify certificates instead of disabling checks. Redirects from HTTP can drop custom headers, so test the full call path after any proxy change.
Review key last-use data
Redmine 7.0.0 began tracking the last time each API and Atom access key was used, which lets you find keys that no longer match a running integration. Review this data on a schedule, compare it against your inventory of service accounts, and disable keys that show no use or belong to retired systems. Confirm in your own instance where the last-use date appears for each user, because the interface and reporting depend on your Redmine version.
Redmine 7.0 changesPagination limits that keep sync jobs predictable
A single list call from the Redmine REST API does not return everything. List calls return 25 results by default and cap the limit parameter at 100, so any sync job that reads issues, time entries or users must page through results with offset and limit and keep requesting pages until none remain. Treat the page size as a fixed ceiling for planning: a project with several thousand issues needs dozens of requests, and the job's run time, its retry behavior and its effect on the server all follow from that count. Confirm the current limits against the Redmine REST API documentation for the version you run before you hard-code them, because the defaults are the values the integration will depend on.
Detect truncation from the response itself rather than assuming a call was complete. Each paginated list response carries total_count, offset and limit fields, so the job should compare offset plus the number of records returned against total_count and stop only when they match. Store the last successful offset and a stable sort order, such as sort=id, so a retried run resumes without skipping or duplicating records when issues change during the pull. Log the total count at the start of each run; a sudden drop or rise between runs is an early signal that filters, permissions or the service account's visibility have changed.
Schedule full-history pulls, such as an initial backfill or a monthly reconciliation, outside working hours and run them under the service account described earlier, so that their volume is attributable in your logs. Incremental jobs should filter on updated_on and run more often with small result sets. Before going live, have the team measure request counts and run time on a copy of your largest project, and confirm with your Redmine administrator whether any reverse proxy or rate limit in front of the application restricts request rates.
How an integration request reaches Redmine with a service key or impersonation
The request starts in the integration job, which reads its API key from a secrets manager and calls Redmine over HTTPS through a reverse proxy that sits on the Redmine side of the trust boundary. Redmine authenticates the key first. If the key belongs to an administrator and the request carries X-Redmine-Switch-User, Redmine acts as the named user, so permission checks use that user's project roles. Before you go live, check which account the key belongs to, whether the header is present, and that paged JSON or XML results come back only for projects that user can see.
Request path from the integration job through the trust boundary into Redmine's permission checks.
Common failures with Redmine API keys and impersonation
This table lists the failures integration teams most often hit when calling the Redmine REST API with keys or administrator impersonation. Each row gives the likely cause and the fix, so you can match a symptom to its source before changing permissions. Check the REST API setting and key placement first, since they account for many of the errors.
| Symptom | Likely cause | Fix |
|---|---|---|
| 401 or 403 on every call | The REST API is disabled in administration settings, so Redmine rejects all API requests | An administrator enables the REST API under the authentication settings, then the integration retries the same request |
| 401 with a valid-looking key | The key is sent in a place Redmine does not read, such as a custom header name or a misspelled parameter | Send the key in the X-Redmine-API-Key header, or as the key parameter, and confirm the header name exactly |
| Data returned belongs to the wrong person | The key was copied from a different user account, often a personal account used during testing | Generate the key from the dedicated service account and record which account owns each integration |
| 403 when switching user | A non-administrator sent X-Redmine-Switch-User, which only administrators can use to act as another user | Use the administrator key only for the impersonation step, or have the integration act under its own service account |
| 403 or empty results for one project | The service account is not a member of that project, or its role lacks the permission for the resource | Add the service account to the project with a role that grants the needed view or edit permissions, then retest |
| Partial lists with no error | List calls return 25 results by default and stop at a maximum of 100, so the integration silently drops records | Page through results with limit and offset parameters and check the total count in each response |
| Keys visible in logs or shared URLs | Keys sent as a query parameter appear in web server access logs, proxy logs, browser history and error reports | Send the key in the X-Redmine-API-Key header, mask it in logs, and rotate any key that has appeared in a URL |
Questions teams ask before setting up Redmine API keys
Do we need a service account, or can integrations use a personal API key?
Use a dedicated service account for any integration that runs unattended. A personal key ties every action to one person, so when that person changes role or leaves, the integration breaks and the audit trail becomes hard to read. A service account is a normal Redmine user with its own name, its own group memberships and only the roles the integration needs. Personal keys still make sense for a developer testing a script against their own permissions. Set the service account's role on each project explicitly, and record who owns it so someone answers when its key is due for rotation or its access must change.
How much effort does a Redmine API key setup take?
The effort depends on how many projects and roles the integrations touch, how many integrations share keys, and where the secrets are stored. The base steps are small: an administrator enables the REST API, a service account is created, and a key is generated from the account's settings. The work grows with each integration that needs its own permissions, each project where the account needs a role, and each place a key must be stored safely, such as a vault or CI secret store. Ask any quote to list those counts explicitly, so the scope matches what your environment actually contains.
Can our internal team set up Redmine API keys without a partner?
Often yes, if the team already runs Redmine and has someone comfortable with Redmine administration and your secrets tooling. Internal teams usually handle the account and key creation well. Where they tend to need help is in the access design: deciding which roles each integration needs, separating read and write access, and checking that impersonation is limited to the cases that need it. Confirm these points against your own Redmine version and your own policies, since the details of role settings and administrator features can change between releases.
What does the work need from our team?
Plan for four inputs. First, an administrator account that can enable the REST API, create users, set roles and manage project memberships. Second, a test instance where keys and integrations can be tried before production, ideally matching your production Redmine version. Third, named owners for each service account and each integration, so there is a person to approve changes. Fourth, the secrets tooling you already use, since keys should be stored there rather than in scripts or wikis. Agree on these before the work starts so access requests do not stall the project.
How do we rotate Redmine API keys safely?
Rotation is a process you run on a schedule, not a one-time task. Generate a new key for the service account, update the integration's secret store, confirm the integration works with the new key, then retire the old value. Check which integrations use each key before rotating, because a shared key rotated in one place will break the others. Recent Redmine 7.0 releases started tracking when API and Atom keys were last used, which helps identify unused keys. Confirm how your version reports last use before relying on it for cleanup decisions.
When should we bring in a partner for Redmine API access?
Bring in a partner when the integration touches sensitive projects, when several systems share keys, or when your compliance or security team needs evidence of how access is controlled. A partner is also useful when you plan to move from shared keys to a newer method, since that changes how each integration authenticates. DeployOpen implements and hardens self-hosted open-source platforms in your own infrastructure and prepares access controls and evidence for compliance assessments, but it does not issue audit reports or certifications. Ask for a written scope that lists integrations, projects, roles and deliverables before work begins.
Is user impersonation with X-Redmine-Switch-User safe to use in integrations?
Impersonation lets an administrator's API key act as another user by sending the X-Redmine-Switch-User header, so it should be used only where a specific integration needs to act for a named user. Every impersonated action runs with that user's permissions, which makes the administrator key a high-value secret. Restrict who can hold such keys, keep impersonation out of routine automation, and review which integrations use it. Confirm the behavior and audit trail in your Redmine version before approving the pattern.
What to confirm in your own Redmine before going live
Before an integration touches production, confirm what the service account can actually do in your Redmine version. Roles and permissions are set per project and per role, so a user who can read issues in one project may be unable to read them in another, and a role that was reasonable in an earlier release may behave differently after an upgrade. Log in as the service account, call the endpoints the integration needs (issues, projects, users, time entries) and compare the results with what the integration expects. Also confirm whether the account is an administrator, because administrator status changes what X-Redmine-Switch-User can reach. Keep a written record of the role names, project memberships and admin flag, since that record is the evidence an auditor or security reviewer will ask for.
Next, confirm how your traffic path handles credentials. A reverse proxy, load balancer or web application firewall may write request headers or query strings to access logs, and an API key sent as a key parameter is far more likely to be captured this way than one sent in the X-Redmine-API-Key header. Check your proxy's log format, your APM or tracing tools and any error reporting service that records full request URLs. Then confirm whether the integration you plan to use can send the key in a header at all. Some libraries and webhook receivers only support query parameters or basic authentication, and that limitation should be known before the design is fixed. Also ask how your secrets manager feeds the key into the integration: whether it is injected as an environment variable, fetched at runtime, or stored in a configuration file, and who can read it. Confirm rotation steps for the key and for any scheduled jobs that depend on it, and test a rotation in a non-production instance first.
How DeployOpen works on this
DeployOpen plans and implements Redmine integration access inside your own infrastructure, starting with a written list of which service accounts exist, what each may do, and where their keys are stored. The work covers key issuance, the header and impersonation conventions your integrations use, and the evidence your security team needs to review them.
How we scope
- Inventory every integration that calls the Redmine REST API and name the account each one should use.
- Define which projects, trackers and resources each service account may read or change, written as a fixed scope.
- Decide whether any administrator impersonation is needed, and record who may use it and for which tasks.
How we build
- Create dedicated service accounts with least-privilege roles and configure the REST API setting for your instance.
- Wire integrations to send keys in the X-Redmine-API-Key header and handle pagination at the default 25 and maximum 100 results.
- Test each integration against the scope, including requests that should fail, and check key last-use records in Redmine 7.0 or later.
How we hand over
- Deliver a written register of service accounts, owners, permitted actions and key rotation steps.
- Document how to revoke a key, how impersonation requests are logged and how to confirm an integration's access.
- Walk your administrators and integration owners through the runbook so they can operate it without us.
How we support
- Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
- Ongoing support, upgrades and continuous testing are available as a retainer, covering access changes as integrations grow.
- Ask any quote to itemize the scope so you can see what is one-time work and what recurs under a retainer.

