Setting up SuiteCRM API v8 keys and URL rewriting

A planning guide to generating SuiteCRM API v8 OAuth2 keys, setting file ownership, enabling URL rewriting and keeping the Authorization header through proxies.

On this page

Setting up SuiteCRM API v8 keys and URL rewriting before any integration runs

Before any client can connect, the SuiteCRM 8 API v8 has to answer requests on your own server. The API uses OAuth2 with a key pair you generate on the server, and it depends on three things being right: file ownership and permissions on the key files, URL rewriting that routes API paths to the application, and a web server that forwards the Authorization header to PHP. If any of these is wrong, the token endpoint or the resources will fail in ways that look like client bugs, so the server should be proven before anyone writes integration code.

Start by confirming the platform itself. Check that your PHP, Apache and MariaDB or MySQL versions appear in the SuiteCRM 8 compatibility matrix for the release you run. Then generate the OAuth2 key pair with the console tooling in the SuiteCRM 8 installation, run it as the same system user the web server uses, and confirm that the private key is readable by PHP but not by other local accounts. Wrong ownership here is one of the most common reasons a token request returns an error even when the keys look correct. Record where the keys live and who holds them, because rotating them later affects every connected client.

Next, enable mod_rewrite and confirm the .htaccess rules for the API path are honored, which means AllowOverride must permit them in the virtual host. Then test the path with a plain request to the token endpoint and to a public metadata route. Many reverse proxies, load balancers and CDNs strip the Authorization header by default, so test through the same path that real clients will use, not only from the server itself. Confirm the exact proxy settings with your network or platform team, and document them, because a proxy change later can break every integration without any change in SuiteCRM. The client credentials and authorization code flows that use these keys are covered on their own pages.

What you need in place before configuring API v8

API v8 depends on the server stack, the SuiteCRM build and the network path in front of it, so each prerequisite should be confirmed before any key is generated. The cards below cover what to check, in the order a team usually verifies it.

Supported PHP, web server and database

SuiteCRM 8.10 supports PHP 8.2, 8.3 and 8.4, Apache 2.4, and MariaDB 10.6, 10.11, 11.4 and 11.8 or MySQL 8.0 and 8.4, on Linux, Unix or macOS. Check that the PHP version on the host is one of these before you touch the API configuration, because an unsupported PHP build is a common reason token requests fail for reasons unrelated to keys. Confirm the exact matrix against the vendor page for the version you deploy.

Compatibility matrix

A SuiteCRM 8.10 instance

Confirm the instance is on the 8.10 line and record the exact patch level. SuiteCRM 8.10.2 is the current release named in the researched facts, but your team should check the release notes for the version it runs before relying on any API behavior described here. Patch releases carry only security and bug fixes, so a patch upgrade should not change the API setup, while minor releases can. Note the version in your change record.

Core release notes

Shell access with console rights

The key pair and the cache clear are run from the SuiteCRM console on the server, so you need a shell account that can run the console as the web server user, or with sudo that preserves the correct ownership. Confirm who holds this access and that it is logged. Without it, you cannot generate keys in place, and workarounds that copy keys between hosts often leave files owned by the wrong user.

Reverse proxy or load balancer settings

If a reverse proxy or load balancer sits in front of the server, you need to know whether it forwards the Authorization header to the backend. Many proxies strip or rewrite it by default, which makes every bearer token request fail with an authentication error that looks like a bad key. List every hop between the client and Apache, and plan a test request that passes through all of them.

Rewrite rules and file permissions

The API routes depend on mod_rewrite being enabled and on the web server user owning the files it writes, including the key pair directory. Confirm that Apache allows rewrite overrides for the SuiteCRM directory and that the deployment user can write the configuration without giving the web server access to a private key it does not need. Record these checks with the server baseline so they survive a rebuild.

A backup and staging copy

Take a file and database backup before changing server configuration, and make the first API change on a staging instance that matches production. Changes to rewrite rules and key files are easy to reverse only if you know the prior state. Ask your team who approves a production change and how a rollback is run.

How to generate the keys and enable rewriting in order

This sequence takes a SuiteCRM 8 server from a clean install to a working API v8 token endpoint, with each step confirmed before the next one starts. Following the order prevents most of the failures that look like authentication bugs but are really server configuration problems.

  1. Confirm web server and PHP versions

    The administrator checks that the web server, PHP version, and database on the host match the SuiteCRM 8 release you are deploying. The SuiteCRM 8.10 compatibility matrix lists supported PHP versions (8.2, 8.3 and 8.4), Apache 2.4, the supported MariaDB and MySQL versions, and Linux, Unix or macOS as the operating systems. Confirm the exact list for your target minor release before you change anything, because a mismatch here can cause errors that appear later in the token flow. Done when the installed versions appear in the compatibility matrix for your release and the SuiteCRM installer or system check shows no blocking errors.

  2. Set file ownership so the web user can read keys

    The administrator sets ownership on the SuiteCRM installation so the web server user can read the OAuth2 key files and the configuration that references them, while keeping write access limited to the directories SuiteCRM needs to write. Use the ownership and permission commands from the SuiteDocs API guide for your version rather than copying generic examples, since the directories involved depend on your install layout. Done when the web user can open the key location as a test read and no key file is world-readable.

  3. Generate the OAuth2 key pair

    The administrator generates the OAuth2 private and public key pair using the SuiteCRM console command documented in the SuiteDocs API v8 guide for the release you run. Store the private key where only the web user and the operations team can read it, and record the passphrase in your secrets manager, not in a shared document. Confirm the exact command name and any options from the guide before running it. Done when both key files exist in the expected location with the ownership set in the previous step, and the console reports the keys were created without errors.

  4. Enable mod_rewrite and the API routing configuration

    The administrator enables Apache's rewrite module and adds the routing configuration that sends API requests to the SuiteCRM front controller, following the rewrite rules in the SuiteDocs API guide for your version. Override settings must allow the rules to take effect in the SuiteCRM directory, so confirm that the configuration is read by the server. Reload Apache after the change and check the configuration syntax first. Done when a request to a known API path reaches SuiteCRM and returns a SuiteCRM response, not a 404 from Apache.

  5. Confirm the Authorization header reaches PHP

    The administrator verifies that the Authorization header sent by the client arrives at PHP unchanged. Reverse proxies, load balancers, and some Apache passthrough settings remove or rename this header, which causes the token to be ignored even when the keys and rewrite rules are correct. Check each proxy layer in front of the server and make sure the header is forwarded, and confirm the mechanism in the SuiteDocs API guide. Done when a test request with a header value returns that value in the PHP environment for the SuiteCRM app.

  6. Test the token endpoint and read the result

    The engineer sends a client credentials or password token request to the token endpoint using a test client created in SuiteCRM, then calls a read-only API resource with the returned bearer token. A successful token response confirms the keys, rewrite rules, and header path all work together. A 401 on the follow-up call with a valid token usually means the Authorization header is being stripped at a proxy layer, so return to the previous step. Done when the token endpoint returns an access token and an authenticated API read succeeds.

How the OAuth2 key pair and the token endpoint fit together

The private key signs the access tokens that SuiteCRM issues, and the public key lets SuiteCRM verify that a token was signed by the instance itself. Both files are generated for one SuiteCRM instance and stored in its configuration directory, with the passphrase kept in the environment configuration. The web server process must be able to read the private key so PHP can sign tokens, but nothing outside that process should be able to fetch it. Store it outside the web root, restrict it to the account that runs the application, and confirm that a direct request for the key file returns nothing. Your security team should also confirm that backups of the instance treat the private key as a secret rather than as ordinary configuration.

A client first posts its credentials to the token endpoint, which is the OAuth2 path SuiteCRM exposes under the API root, and receives an access token with an expiry time. The client then sends that token in the Authorization header as a bearer credential on each request to a JSON API resource, such as a module collection. SuiteCRM checks the token signature against the public key on every call, so a request that works in a browser session but fails with an authorization error often points to a header that a reverse proxy removed, the wrong key path, or a key pair the instance no longer matches. Test the endpoint with one token request and one resource read before you build any integration on top of it.

The key pair belongs to a single instance. If you copy the keys from production to staging, or restore a database into a new environment without the matching keys, every token issued before the move becomes invalid and clients must request new ones. Plan the move explicitly: decide which environment owns the keys, record where each copy lives, and tell integration owners that their stored tokens will fail during cutover. Confirm the exact key and passphrase handling steps for your SuiteCRM version in the official documentation before you change any environment.

How a client request reaches the SuiteCRM API through the proxy

The request starts at the API client and passes the reverse proxy or load balancer first, which is the trust boundary between the public edge and the application host. Apache then applies mod_rewrite to hand the path to the SuiteCRM front controller, which reads the OAuth2 key files and the database before answering. Check at the proxy hop: the Authorization header is the one most often stripped, so confirm it reaches PHP intact.

Request path from client through the proxy to the SuiteCRM API and its stores.

How the setup differs on a direct server and behind a proxy

On a direct Apache host, SuiteCRM receives client requests without an intermediary, so the web server is responsible for file ownership, rewrite handling and the Authorization header. Most failures on this layout are local and can be found by reading the server configuration and testing a token request from the host itself.

  • File ownership: The web server user must be able to read the application and write to the directories SuiteCRM uses for cache and uploads, while the OAuth2 private key should be readable only by the web server account and the administrators who manage it.
  • Key pair permissions: Confirm the private key is not readable by other local users, and check that the public key has the ownership the application expects after you regenerate the pair.
  • Rewrite rules: Confirm that mod_rewrite is loaded and that AllowOverride permits the directives in the SuiteCRM .htaccess file, or the API routes will return not-found errors.
  • Authorization header: Depending on how PHP is integrated with Apache, the Authorization header may not reach the application, so send a bearer request with curl from the server and confirm the application receives it.

Run these checks with a test token request from the host before you involve the rest of the network path.

Which server settings map to which API behavior

This table lists the server-side items the API v8 setup touches, what each one controls and the symptom you will see when it is wrong. Read it top to bottom when a token request or API call fails, because the first failing item usually shows up as a 401, a 404 or a server error. Confirm exact file locations and key settings against the SuiteCRM 8 documentation for your release before you change anything.

SettingWhat it controlsSymptom when it is wrong
OAuth2 private key fileSigns access tokens issued by the token endpointToken requests return a server error; logs show the key cannot be read
OAuth2 public key fileVerifies tokens on every API callFresh tokens still return 401 after keys were regenerated
Key passphrase settingMust match the passphrase used when the key pair was generatedToken endpoint rejects every request after a passphrase change
Web server user and file ownershipLets the web server read keys and write cache and log directoriesKey errors after running console commands as root, or cache write failures
Rewrite rule (mod_rewrite)Sends API paths through the front controller instead of the file systemLogin pages load, but /Api paths return 404 or HTML instead of JSON
Authorization header forwardingPasses the Bearer token from the client to PHPRequests reach the API but report the caller as unauthenticated
Reverse proxy or load balancerMust forward the Authorization header and the original host nameCalls succeed on the server directly but fail through the proxy
Token endpoint responseReturns the access token, its type and its lifetime for clients to storeClients send malformed headers or refresh too late when the response fields differ

Protecting the keys and the header in transit

The OAuth2 private key signs every token your API v8 integration relies on, and the Authorization header carries those tokens on every request. The controls below cover where the key lives, who can copy it, how traffic is protected, what gets logged and how keys are replaced. Confirm each one with your security team against your own hosting setup before go-live.

Keep the private key out of the web root

The private key file used to sign API v8 tokens should sit in a directory the web server never serves, with the owner set to the account that runs PHP and permissions tight enough that other local users cannot read it. Check that a direct browser request for the key path returns no content. Confirm the exact location and mode with your own hosting layout, since shared hosts and container images often differ.

Limit who can copy the key

A key copied into a backup is still a live key. Backups that many administrators, vendors or storage tiers can read effectively widen the set of people who can mint tokens. Ask who has access to backup sets that contain the key file, whether those copies are encrypted, and whether the key is excluded from broadly shared snapshots and kept only in a restricted secrets store.

Serve the API over TLS only

Tokens and the Authorization header travel with every API call, so the public endpoint should accept HTTPS only and redirect or refuse plain HTTP. Check the certificate chain, the protocol versions your reverse proxy allows and whether any internal hop between a load balancer and the Apache host is also encrypted. Your security team should confirm the policy, since the right choice depends on how traffic leaves your network.

Keep Authorization headers out of logs

Access logs, proxy logs, application debug output and error traces can all record request headers. An unfiltered log turns every captured bearer token into a usable credential for its lifetime. Review the Apache and proxy log formats, confirm that the Authorization header is not written in any log, and check log shipping and retention so that a support ticket containing a log extract does not expose tokens.

Plan key rotation and token revocation

Rotation replaces the signing key, but tokens already issued may remain valid until they expire, so rotation alone does not cut off an exposed token. Write a plan that covers when keys rotate, who generates the new pair, how the old private key is destroyed, how integrations receive new configuration and how existing access is revoked. Ask your SuiteCRM partner or vendor to confirm how the installed version handles token invalidation.

Why the token request or API call fails after setup

This table pairs each common symptom with its most likely cause and the first fix to try when the OAuth2 token request or an API v8 call fails. Work down the rows in order of how often each cause appears on a new server. Most failures trace back to the web server layer, file ownership or a key pair that no longer matches the tokens in use.

SymptomLikely causeFix to try first
Every API call returns 401 even with a correct client ID and secretThe proxy or web server strips the Authorization header before PHP receives itPass the header through in the proxy config, or add a rewrite rule that copies it into a server variable, then retest the token call
Token endpoint returns 404URL rewriting is not active, so the front controller never handles the /Api pathEnable mod_rewrite, confirm the Apache virtual host allows overrides for the SuiteCRM directory, and reload Apache
Permission denied when reading the private or public key filesFiles were replaced during a deploy and now belong to a different user than the web serverSet the owner of the keys directory and key files to the Apache user, then restrict the private key to read-only for that user
Invalid signature or invalid token after regenerating keysTokens issued under the old key pair are still in use, or the public and private keys do not matchGenerate a fresh pair as one step, confirm both files are from that run, clear cached tokens and request a new token
Redirect loop or browser blocked mixed content on the token or API URLThe site URL is set to HTTP while HTTPS terminates at a load balancer, or a redirect rule sends the request back to itselfSet the public site URL to the HTTPS address, make sure the proxy forwards the original scheme, and remove duplicate redirect rules

Questions teams ask before setting up SuiteCRM API v8 keys

How long does SuiteCRM API v8 key setup take?

Duration depends on the state of the server and the number of integrations, not on the key generation itself, which is a short command sequence. The main drivers are whether the SuiteCRM 8 instance already runs on a supported stack, whether the web server passes the Authorization header through to PHP, whether URL rewriting is already configured, and how many integration clients need their own credentials. Teams with a working install and a clear list of clients usually finish faster than teams that must first fix file ownership, permissions and proxy configuration. Ask any partner to show how they will verify the setup against a staging instance before giving a timeline, because the verification steps are where most delays appear.

Can an internal engineer set up SuiteCRM API v8 keys alone?

Often yes, if the engineer is comfortable with Linux administration, Apache configuration and PHP, and has access to the server and the SuiteCRM 8 configuration. The work is mostly sequential: generate the OAuth2 key pair, set file ownership and permissions so the web server user can read the keys, enable URL rewriting, and confirm that the Authorization header reaches the application. The harder part is diagnosing a proxy, load balancer or hosting panel that strips headers, which requires access to those layers. Teams without that access, or without someone who can test the change on staging first, usually gain more from a short partner review than from doing the whole task alone.

What should we provide to a partner before API v8 setup starts?

Provide the information needed to reproduce your environment before any change is made:

  • The SuiteCRM 8 version and the exact PHP, Apache and database versions in use, checked against the compatibility matrix.
  • Access to a staging instance that matches production, plus a documented backup of files and database.
  • Details of the web server, reverse proxy or load balancer in front of SuiteCRM, and who administers each layer.
  • The list of planned integrations, the systems that will call the API and the access each one needs.
  • Your change approval process and the window in which production changes are allowed.
Can we connect a SuiteCRM 7 instance to the API v8 directly?

No. SuiteCRM documents the move from SuiteCRM 7 to 8 as a migration, not an upgrade, so the 7 instance must be brought to the latest 7.14.x or later and its data moved into a new SuiteCRM 8 environment. API v8 setup therefore happens on the SuiteCRM 8 side, after that migration. The SuiteCRM migration documentation advises testing on a staging instance, backing up files and database, and reviewing customizations because the migration may remove non-core files under the public/legacy folder. Plan the key setup as part of the migration project, not as a step before it.

What changes after a SuiteCRM 8 minor upgrade?

Minor upgrades can change the files, configuration expectations and supported platform versions that the API setup depends on, so the key and rewrite configuration should be checked after each one. SuiteCRM 8 minor releases arrive roughly every eight weeks, while patch releases contain only security and bug fixes with no new features or database changes. Review the compatibility matrix for the new release, confirm the file permissions on the key directory still match the web server user, and test a token request and one authenticated call on staging before production. Ask your partner whether the setup steps are recorded in a runbook that the next upgrade can reuse.

What does a partner's fixed-scope quote depend on?

A fixed-scope quote follows from the written scope, so the number of items on that scope drives it. The main inputs are the number of SuiteCRM 8 instances, whether staging exists, the state of the hosting stack and any proxy or load balancer that must be changed, the number of integration clients and scopes to configure, whether a runbook and handover are required, and the verification and retest effort agreed in writing. DeployOpen does not publish a price list, so ask for the scope items above to be listed in the quote along with what is excluded, such as ongoing support, which is available as a separate retainer.

Why do API requests fail when the Authorization header is missing?

Many reverse proxies, load balancers and shared hosting setups remove the Authorization header before it reaches PHP, so SuiteCRM receives an unauthenticated request even though the client sent a valid token. The fix is usually a web server rule that passes the header through to the application, and confirming it with a test request that returns the header value. Check the proxy configuration first, because the symptom looks like an application bug. Confirm the exact change with your web server documentation and the SuiteCRM 8 configuration references before applying it on production.

What to confirm in your environment before you start

Start by confirming the exact SuiteCRM version you run, because API v8 behavior and its published documentation are tied to a specific release line. The supplied facts list SuiteCRM 8.10.2 as published on July 31, 2026, and 8.10 supports PHP 8.2, 8.3 and 8.4, Apache 2.4, and MariaDB or MySQL versions listed in the compatibility matrix. Confirm your PHP, Apache and database versions against that matrix, then read the API documentation for your exact minor release rather than assuming the steps from a newer or older guide still apply. Minor releases arrive roughly every eight weeks, so the version you test on may not be the one in production by the time you go live. The official SuiteCRM compatibility matrix is the place to start, and it should be checked again at each upgrade.

Next, find out whether anything between the client and Apache changes the request before SuiteCRM sees it. A reverse proxy, load balancer, CDN or web application firewall can drop the Authorization header or rewrite paths, and either one will make a correct configuration look broken. Ask the team that runs those layers whether they forward Authorization to the backend, whether they cache responses under /Api/, and whether they terminate TLS and pass the original scheme. Confirm this with a test request that reaches the SuiteCRM API through the same path your integrations will use, not only a direct call to the origin server. Where the proxy is owned by another team, get the change written down before the build starts.

Decide where the OAuth2 key files will live in each environment, and who can read them. The private key and its passphrase must sit outside the web root, with paths for development, staging and production kept separate so a copied database or file set does not carry production keys into a test system. Confirm who owns the web server user that must read the key files, and who approves the change when a key is rotated. Ask the platform team to name the person who owns the web server configuration, the person who holds the production keys, and the rotation schedule that both agree to. Your own security policy on secrets storage should decide whether the keys go into a vault or a restricted file, and the SuiteCRM install and configuration docs should be read in full before choosing.

How DeployOpen scopes and delivers SuiteCRM API v8 setup

DeployOpen plans and delivers the API v8 setup on servers you control, starting with a written scope that names the hosts, web server and SuiteCRM version involved. The work covers key pair generation, file ownership and permissions, URL rewriting and proxy header handling, then tests and documents each step so your team can run it afterward.

How we scope

  • We confirm the SuiteCRM 8 version, PHP, Apache and database versions against the compatibility matrix before any change.
  • We record the web server, reverse proxies and load balancers that sit in front of SuiteCRM, since each can strip the Authorization header.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts, and a quote follows from that scope.

How we build

  • We generate the OAuth2 key pair on the server with the correct ownership so the web server user can read the private key.
  • We set the mod_rewrite rules and proxy settings, then confirm the API responds with the Authorization header intact end to end.
  • We run the work on a staging instance first and keep a tested rollback for files and configuration before touching production.

How we hand over

  • You receive a written record of the key locations, file permissions, rewrite rules and proxy changes made during the work.
  • Test requests show a token request and an authenticated API call succeeding from the host and from the proxy path.
  • We walk your administrators through key rotation steps and the checks to repeat after each SuiteCRM minor release.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer after the initial setup is complete.
  • Retesting covers the API after SuiteCRM upgrades, web server changes and proxy changes, which are the most common points of breakage.
  • Support questions are answered against the documented configuration, so changes stay traceable to the written scope.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.