When a custom SuiteCRM API v8 endpoint is the right answer
Build a custom endpoint when your team needs a SuiteCRM 8 API route that the standard JSON API does not provide. Custom routes and controllers under custom/application/Ext/Api/V8 are the supported extension point for this job. The extension adds routes beside the core API, so the core API code stays in place and your additions load alongside it. It does not replace the standard JSON API, which remains the right path for create, read, update and delete on core modules. Your route also needs an explicit authentication decision. Confirm whether it uses the same OAuth2 token checks as core routes, and which integration user it runs as, before any data is exposed.
Before you write code, test whether the need can be met with what the standard API already offers. Filtering, included relationships and existing resources cover many integrations, and every custom route adds maintenance that someone must own. A custom endpoint is usually justified when one call must combine data from several modules, return a payload shaped for a specific client, or run an action beyond a single record change. For example, an illustrative service portal might need case and account data in one response. Webhooks and file exports follow a different path through entry points, so keep that choice separate in your design and decide it first.
Treat the endpoint as code your organization will maintain. SuiteCRM 8 minor releases arrive roughly every eight weeks, and each one can change the framework your controller depends on, so plan a retest against each new minor before it reaches production. Patch releases carry only security and bug fixes and no database changes, which makes them lower risk, but you still need to rerun your endpoint tests. Ask any partner quoting the work to separate the one-time build from the recurring cost of upgrade testing, documentation and handover. Also confirm which SuiteCRM 8 version you will run at launch, because the behavior of your extension is tied to that release.
What a team needs before writing a custom API v8 endpoint
A custom endpoint is only as dependable as the environment it is built in. The four cards below cover the platform versions, a staging copy, working OAuth2 access and direct file system access, which together let a team write, test and deploy an extension without guessing. Confirm each item before the build starts, because version targets change with every minor release.
Confirmed SuiteCRM 8 version
Pin the exact SuiteCRM 8 minor and patch release you run, and read its release notes before writing code against it. Minor releases arrive roughly every eight weeks and can change extension points, so an endpoint written for one minor may need adjustment on the next. Record the version in the project README so every developer and reviewer builds against the same target.
SuiteCRM-Core releasesSupported PHP, Apache and database
Check the PHP, Apache, MariaDB and MySQL versions against the compatibility matrix for your SuiteCRM 8 release, not against a previous one. Mismatched PHP or database versions often surface as errors inside custom controllers that look like code bugs. Treat the matrix as the version target to confirm before work starts, since supported ranges are updated with each release.
Compatibility matrixA staging instance that matches production
Build endpoints on a staging instance with the same SuiteCRM version, PHP settings, database engine and module customizations as production. Load representative records so route behavior and permission checks can be tested against real data shapes. Keep production out of the development loop, and plan how the staging copy will be refreshed when production data changes.
Working OAuth2 API access
Confirm that the API v8 OAuth2 key pair exists, that a test client can obtain a token, and that the Authorization header reaches PHP through the web server and any reverse proxy. Custom routes inherit this authentication, so a broken token flow will look like a failing endpoint. Ask the team who owns the client registration and the key pair before development starts.
Developer access to the file system
Developers need write access to custom/application/Ext/Api/V8 on the staging server, plus the ability to run cache rebuilds and read web server and application logs. Agree how changes are delivered, through version control and a deployment pipeline rather than direct edits on the server. Limit that access so developers cannot change production files, and confirm the file ownership model with the operations team.
How to build and register a custom endpoint step by step
This sequence takes a SuiteCRM 8 installation from a working API v8 baseline to a tested custom endpoint under the /custom/ prefix. Each step stays inside the extension folder so the change can be reviewed, rebuilt and repeated after upgrades. The result is a route that answers an authenticated request and refuses one from a user without permission.
Confirm the API v8 baseline works
Before adding any code, request a token with an existing OAuth2 client and call a standard v8 resource, such as listing records from one module with a small page size. This shows that the key pair, file permissions, URL rewriting and the Authorization header are all working. The step is done when the standard call returns a 200 response with JSON data for the integration user. If it fails here, fix the base setup first, because a custom route will fail for the same reasons and the error will look like a code problem.
Create the extension folder structure
Under the SuiteCRM 8 installation root, create the extension directory custom/application/Ext/Api/V8 and keep all custom API files inside it. This keeps core files untouched, which helps the change survive upgrades. Set ownership to the same web server user that owns the rest of the installation so the application can read the new files. Confirm the expected subfolders and file names for your release in the SuiteCRM developer documentation. The step is done when a directory listing shows the files readable by the web server user.
Define the custom route
In the extension folder, create the route definition file. Give the route a unique path under the /custom/ prefix, set the HTTP method, and name the controller it maps to. Choose a path that will not collide with core routes, and state in the definition whether the route requires authentication. Check the syntax of the file with a PHP lint command before going further. The step is done when the file parses without errors and the route is ready to be picked up by the rebuild in a later step. Confirm the registration keys your release expects.
Write the controller and return JSON
Create the controller class that the route points to. Keep the first version small and read-only, for example a fixed JSON payload or a count of records the integration user can see. Use SuiteCRM's service and permission checks instead of querying the database directly, so the endpoint respects module access. Return the response as JSON with an explicit status code. The step is done when a PHP lint on the controller passes and the class name and namespace match the file location.
Clear caches and rebuild extensions
Run the cache clear and extension rebuild commands that your SuiteCRM 8 release provides. Run them from the installation root and as the web server user so the generated files keep the correct ownership. Then check the route listing from the console and confirm the custom path and method appear once. If the route is missing, the extension was not picked up: check the folder path, file names and permissions, then rebuild again. Confirm the exact commands for your version before running them in production.
Test with an authenticated request
Send a request to the new path with the token from the baseline step, then send two more: one without a token and one with a token for a user who lacks permission. The expected outcomes come from your design, typically a success response with the payload for the authorized user, a refusal without a token, and a refusal for the restricted user. Record the requests and responses in the change record so the same test can be repeated after each SuiteCRM minor upgrade. The step is done when all three outcomes match the design.
A bearer token passes the web server and authentication before any custom controller runs
The request starts at the API client, which sends an OAuth2 bearer token to the web server. Rewrite rules pass it to the API v8 router, which resolves either a core route or a custom route registered from custom/application/Ext/Api/V8. The trust boundary sits at the web server and the authentication step: nothing reaches the controller or the SuiteCRM data layer until the token is validated. Check that the Authorization header survives every proxy hop, and that access checks run again inside the data layer.
Request path from client to a custom controller, with the trust boundary marked.
Keeping custom endpoints upgrade-safe across SuiteCRM 8 minor releases
Custom endpoints survive upgrades only if they stay outside SuiteCRM's core files. Routes and controllers placed under custom/application/Ext/Api/V8 are loaded through the extension framework, so a minor release replaces the core code while your extension files remain in place. Edits made directly to core API classes or route definitions are overwritten by the next upgrade, and the failure often appears only after the new version is live. Before you write the first route, agree with your team that nothing under the core application tree will be changed, and that any behavior you need from core is reached through the extension point instead.
Upgrade safety does not mean the extension keeps working unchanged. SuiteCRM minor 8.x releases arrive roughly every eight weeks, and each one can change the classes, services and authentication behavior your controllers depend on. Treat regression testing of every custom endpoint as a required step of each minor upgrade, covering the authorization path, the JSON response shape and the calls your integrations make. Keep a short, versioned test list for each endpoint so the person running the upgrade does not have to rediscover what the extension is meant to do.
Patch releases need the same retest, even though they contain no new features. SuiteCRM describes patch releases as carrying only security and bug fixes with no database changes, which makes them easy to approve quickly. A bug fix can still alter behavior that an endpoint relies on, and a security fix can tighten access checks that your integration hits. Retest each extension on every patch, run the checks against a staging instance first, and confirm with your team how fast a security patch must reach production. The SuiteCRM LTS and release lifecycle page is the place to confirm the current release cadence and support dates before you set that schedule.
Choosing between custom endpoints, entry points and existing API resources
Start here whenever the integration only reads or writes records the platform already exposes through the JSON API. Standard module resources inherit the platform's authentication, role-based access and field-level permissions, so the integration user's rights are enforced without new code. Because nothing is added to the application, there is no custom code to retest after each minor release, and client applications keep the same request shapes they already use.
- Security: access follows the roles and module permissions already defined for the integration user, which keeps the review scope small.
- Upgrade effort: lowest, since no extension files are added under the custom folder.
- Client impact: clients use documented resources, so no new contract needs to be published.
- Limits: complex business logic, aggregated responses or multi-record operations may need several calls, which can slow clients down.
- Migration context: if the existing calls are legacy v4.1 requests, see the sibling topic on moving SuiteCRM integrations from API v4.1 to v8.
Before building anything, confirm with your SuiteCRM version's API reference which resources and relationships the integration needs.",
Use a custom route when authenticated consumers need an operation the standard resources cannot express, such as a combined response, a server-side calculation or a narrow action on one record. The route is registered through the extension mechanism under custom/application/Ext/Api/V8, so it runs behind the same OAuth2 token checks as core endpoints. The trade-off is that your team owns the controller, its input validation and its tests for the life of the integration.
- Security: the request still needs a valid bearer token, but your code is responsible for authorization checks inside the controller, which must not trust the caller's scope alone.
- Upgrade effort: moderate, because each SuiteCRM minor release needs a check that the route still loads and the controller still matches core service signatures.
- Client impact: clients gain a new endpoint that must be versioned and documented internally, and removing it later is a breaking change for them.
- Operations: log failed calls and track token use by the integration user so that misuse is visible.
- Authentication setup: token issuance and scoping are covered in the sibling topics on the client credentials and authorization code grants.
Confirm that the route is reachable through your reverse proxy and that the Authorization header reaches PHP, as covered in the sibling topic on API v8 keys and URL rewriting.",
Use an entry point for requests that cannot carry a SuiteCRM API token, such as an inbound webhook from a third-party service or a file stream that a browser or external tool downloads directly. Entry points are served from the /ep/ clean URL and are registered through the extension framework. Because they are reachable without a token, they widen the attack surface, so the design has to add its own verification for every request.
- Security: highest exposure of the three options. Verify signatures or shared secrets, restrict accepted methods, validate input and limit what the response reveals.
- Upgrade effort: moderate, because the entry point depends on the extension framework and its routing, which should be retested on each upgrade.
- Client impact: the external sender must be configured with the exact URL and secret, and rotating either requires coordinated changes on both sides.
- Data exposure: file exports served without authentication need signed, expiring links or equivalent controls, which must be designed and tested.
- Detail: the sibling topic on SuiteCRM entry points for webhooks and file streams covers the implementation steps.
Ask your security team to review the entry point design before it is built, and plan a retest after the first upgrade.
How request data, user context and records map into a custom endpoint
This table traces each piece of data a custom SuiteCRM API v8 endpoint touches, from the inbound request and token subject through the SuiteCRM user, roles, module beans and the JSON response. Read each row as a question to answer in code review and in testing: who is the caller, what may they read or write, and what does the response expose. The main takeaway is that the token identifies a user, but every field still needs its own access check before it is returned or saved.
| Mapping point | How it maps in a custom endpoint | Access check to run | What to confirm in the target environment |
|---|---|---|---|
| Inbound request fields | Query parameters, path IDs and JSON body fields are read by the controller and assigned to bean fields or filter clauses. | Validate type, length and allowed values per field before any bean is loaded or saved. | Confirm which request fields the client actually sends and that unexpected keys are rejected or ignored. |
| OAuth2 token subject | The bearer token resolves to a SuiteCRM user ID for the request. Client credentials tokens may act as a configured integration user instead. | Confirm the token is valid, unexpired and issued for the expected client before reading the subject. | Confirm which grant the integration uses and which user the client credentials integration maps to. |
| SuiteCRM user context | The current user object supplies the identity used for ownership, team and visibility rules in the request. | Do not trust user IDs sent in the body. Take identity from the token and check it against the record. | Confirm the user is active, not locked and has the expected role in the target instance. |
| Roles and ACL checks | SuiteCRM role permissions decide module-level view, list, edit, delete and export rights for the user. | Call the ACL check for the specific module and action, not only for the endpoint as a whole. | Confirm the role matrix for the integration user and test with a non-admin account. |
| Module and bean fields read | The controller loads the bean and selects the fields it returns, such as name, status or account link. | Check field-level visibility for each field, including fields hidden by layout or field access settings. | Confirm which fields are sensitive in your data model, such as contact details or internal notes. |
| Module and bean fields written | Accepted body fields are mapped onto bean attributes and saved through the standard bean lifecycle. | Check edit rights and field-level write access, and reject fields the user cannot change. | Confirm that writes trigger the expected logic hooks and workflows, and that no field is set by the client to a privileged value. |
| JSON response shape | The response returns a defined set of attributes and relationships, built from the bean data the caller is allowed to see. | Filter out fields the caller lacks rights to, and avoid echoing raw bean objects or error traces. | Confirm the response schema against the client's expectations and check the output for hidden fields in a test run. |
Securing a custom endpoint so it cannot bypass SuiteCRM access controls
A custom route in SuiteCRM API v8 runs your code, not the standard module endpoints, so it can read or write data the standard checks would have blocked. The cards below cover the controls that keep an extension inside the same access model as the CRM, and the points where teams most often leave a gap.
Authenticate every custom route
Treat the route's authentication requirement as a deliberate setting, not a default you inherit. Confirm that each route in your extension requires a valid OAuth2 token from SuiteCRM before any logic runs, and that no route is reachable by an anonymous request unless you have chosen that on purpose. Test each route with no token, an expired token and a token for a different user, and record the results.
Run ACL checks inside the controller
Authentication tells you who is calling, not what they may see. Inside the controller, check module-level permissions for the action and record-level access for the specific bean, using SuiteCRM's own ACL functions rather than your own role logic. A route that loads a record by ID and returns its fields without these checks is the most common way an extension exposes data it should not.
Validate all input before use
Treat every request parameter, header and body field as untrusted. Check types, lengths and allowed values against an explicit list, reject unknown fields, and never pass raw input into database queries, file paths or outbound URLs. Confirm that record IDs are checked against the requesting user's access before the record is loaded, so a valid but foreign ID cannot be used to probe other records.
Scope the integration user
Routes called by back-office systems usually run as a dedicated SuiteCRM user, so that user's role decides the blast radius. Grant only the modules and actions the endpoint needs, avoid administrator roles, and review the role whenever the endpoint's behavior changes. Ask whether one integration user or several per system is the right split for your audit trail.
Log every call with its identity
Record who called each route, when, the action taken, the record IDs touched and the outcome, including rejected requests. Logs should identify the OAuth client and the SuiteCRM user, and must not store tokens, passwords or full personal data in plain text. Decide where these logs are kept, how long they are retained and who can read them before the endpoint goes live.
Keep secrets out of extension code
Database credentials, API keys for third-party services and signing secrets should come from the server environment or your secret store, never from files committed to the extension folder. Check that your extension does not echo configuration values in error messages or responses, and that secrets are rotated when staff with access change roles. Confirm current guidance on configuration and secret handling in the SuiteCRM documentation before you finalize the design.
Why a custom SuiteCRM API v8 endpoint returns 404, 401 or stale behavior
This table pairs each common failure with its likely cause, the check that confirms it and the fix. Read it from the status code or symptom you see, then work down the row before changing code. Most failures on a new route come from caches, proxies, file ownership or ACL rules rather than from the endpoint logic itself.
| Symptom | Likely cause | Check | Fix |
|---|---|---|---|
| 404 on a new route | The extension was added under custom/application/Ext/Api/V8 but was not rebuilt, or the cache still holds the old route list | Confirm the extension file exists in the expected path and that the route appears after a rebuild of extensions and caches | Rebuild extensions and clear caches using the documented commands for your install, then retest the exact URL including the /custom/ prefix |
| 404 only on some servers | URL rewriting does not pass the request to the API front controller, or the route path differs between environments | Request the route on the server itself and compare with the proxy path; check mod_rewrite is active | Fix the rewrite rules and the proxy path so both environments resolve the same route |
| 401 Unauthorized | The Authorization header is stripped by a reverse proxy or load balancer before it reaches PHP | Log the incoming headers at the web server and at the application edge and compare them | Configure the proxy to forward the Authorization header, then retest with a freshly issued token |
| 401 with a valid-looking token | The access token has expired or was issued for a different client or scope | Decode the token claims and compare expiry time and scope with what the route requires | Request a new token and confirm the client and scope match the integration user's permissions |
| 403 Forbidden | The authenticated user lacks ACL permission on the module or action the endpoint touches | Test the same action as the integration user in the user interface and review role settings for that module | Grant the narrowest role needed to the integration user, not a full administrator role |
| Behavior changed after an upgrade | The upgrade replaced or renamed core files or changed a base class the extension depends on | Compare release notes for the target version and review the extension against the changed core classes | Rewrite the extension against the new version in staging and retest before production |
| Extension ignored or fails to load | File ownership or permissions prevent the web server user from reading the extension or writing the cache | List owner and mode of the extension files and the cache directories and compare with the web server user | Correct ownership and permissions, then rebuild extensions and clear caches |
| Stale response after a code change | An opcode cache or a browser or proxy cache serves the previous version of the code or response | Check whether PHP opcode caching is enabled and whether responses carry cache headers | Reload the PHP process or clear the opcode cache, and set explicit no-cache rules for dynamic routes |
Questions teams ask before building custom SuiteCRM API endpoints
What drives the cost of a custom SuiteCRM API v8 endpoint?
Cost follows the scope of the written work: how many routes and controllers are needed, how complex the access rules are, and how much testing is required before release. A single read-only route for one object is a small job. A set of write routes that change related records, respect role-based permissions and return data in a documented shape is a larger one. Whoever builds it, the client pays for design, development, testing and handover. Ask any partner for a quote that lists routes, permission rules, test cases and documentation as separate lines, so the cost of each part is visible.
How long does it take to build a custom endpoint in SuiteCRM?
Duration depends on the same drivers as cost: the number of routes, how many roles and ACL rules must be honored, how many environments need the change, and how long the client's review and approval steps take. No duration is fixed by SuiteCRM itself. A small, well-specified endpoint can move quickly through a staging instance, while endpoints that touch many modules or depend on unresolved business rules take longer because the rules must be settled first. Ask for milestones tied to staging deployment and sign-off rather than a single end date.
What does the client team need to provide for an endpoint project?
The client team needs to supply a clear specification of what each route must return and accept, the roles that should see or change each record, and a named business owner who signs off on behavior. Engineers need access to a staging SuiteCRM 8 instance that matches production closely enough to test, plus a way to create test users with the same roles as real users. Security or compliance reviewers should be involved early if the endpoint exposes personal or regulated data. Missing decisions about access rules are the most common cause of rework.
Can an in-house PHP developer build a custom SuiteCRM endpoint?
Yes, a developer who knows PHP, the SuiteCRM 8 codebase and the extension mechanism under the custom directory can build simple endpoints in-house. The harder part is the surrounding work: understanding how SuiteCRM's access control applies to the records involved, writing tests, handling OAuth2 token scopes, and making sure the change survives upgrades. Teams with a single developer should consider who will maintain the code after that person moves on. Ask whether the code will have documentation, automated tests and a named owner before the first release.
How do SuiteCRM upgrades affect custom API endpoints?
Custom endpoints placed in the extension locations, rather than edited in core files, are designed to survive most upgrades, but each new minor release should still be tested against them. SuiteCRM 8 minor releases arrive roughly every eight weeks, and the release notes can change framework behavior that an endpoint depends on. Plan a regression test run against a staging copy of each target version, and budget time for fixes when a release changes an API class your code calls. Patch releases carry only security and bug fixes, so they usually need less retesting, but this should be confirmed for each release.
What security risks come with a custom SuiteCRM endpoint?
The main risk is that a custom route returns or changes records that the calling user should not reach, because the endpoint bypasses the access checks that the standard API applies. Each route should enforce the same module and field permissions as the built-in resources, and it should be covered by tests that use low-privilege accounts. Routes that accept no authentication, such as webhooks or file downloads, need separate design and should be reviewed as public surfaces. Ask for a security review of each route before release and for OAuth2 client scopes limited to what each integration needs.
When should a team avoid building a custom SuiteCRM endpoint?
Avoid a custom endpoint when a standard API v8 resource, a SuiteCRM setting, or a documented integration already covers the need, because a custom route adds code to maintain on every upgrade. It is also a poor fit when the required data can be read through an existing resource with a small change to the client, when the integration is one-off and could be done as an export, or when no one on the team can own the code after release. For inbound events from another system, a webhook entry point may be a better starting point than a new query route, so compare the options first.
How DeployOpen scopes and supports custom SuiteCRM API endpoints
DeployOpen sets up custom SuiteCRM API v8 endpoints as a fixed-scope engagement, with the scope agreed in writing before any code is written. The written scope names each route, the data it reads or writes, the roles and OAuth2 scopes allowed to call it, the input validation and error responses, and the tests that prove it behaves as specified. It also lists the deliverables: the controller and route files under custom/application/Ext/Api/V8, the configuration changes, the test results, and the handover notes. Because the scope is fixed, the quote follows from the written list of endpoints and their access rules, so a CISO or platform lead can see what is included and what is excluded before approving the work. Ask for the endpoint inventory and the access matrix in the quote, and confirm which SuiteCRM version and PHP, database and web server versions the build will target.
All implementation happens inside your own infrastructure, on the servers, cloud accounts or data center environment you control, with the code deployed to your staging and production instances under your change process. DeployOpen does not host your SuiteCRM instance or hold your data outside that environment. Test evidence, such as endpoint test results and access checks, is delivered to your team, but DeployOpen does not issue audit reports, attestations or certifications. If your organization needs independent assurance for the endpoints, your auditor or certification body performs that work, and DeployOpen prepares the controls and evidence they will review.
Upgrades are where custom endpoints most often break, so ongoing support is offered as a retainer rather than assumed in the build price. A retainer covers re-running the endpoint test suite against each SuiteCRM 8 minor release, reviewing changes to the extension framework, and retesting access rules after patches. Minor releases arrive on a roughly eight-week cadence, so ask the retainer provider how upgrade testing is scheduled, who approves production changes, and what happens when a release changes behavior your endpoints depend on. Agree those terms in writing alongside the build scope.

