Mule-Dev-201 · Domain 5 of 12

Mule-Dev-201 Domain 5: Building API Implementation Interfaces

This section is about the implementation side of an API: building interface flows by hand with HTTP Listeners, generating them with APIkit from RAML, and returning the status codes and bodies the specification promises.

Exam weight
7%
Official objectives
3
Estimated questions estimate
~4
Suggested study time estimate
5–7 hrs

About 11 min read Reviewed October 2026

Overview

Once a specification exists, a Mule developer builds the API implementation that fulfils it. You can do this by hand, with HTTP Listener sources whose paths and allowed methods match the resources, or you can let APIkit read the RAML and scaffold the interface. APIkit generates a main flow with an HTTP Listener and an APIkit Router, a console flow, an error handler mapped to HTTP status codes, and one flow per resource and method that returns the example response from the specification.

The exam guide lists three objectives: manually build API implementations from a specification, whether RAML or not; predict the results of APIkit based on a RAML specification; and implement correct responses based on the specification, either manually or with APIkit. Expect to know generated flow names such as get:\orders\(orderId):orders-config, which APIKIT error a bad request raises, and how the listener's response status is set from vars.httpStatus.

How it's tested

Questions usually show a short RAML file and ask what APIkit generates or how the router responds to a given request. Manual questions show an HTTP Listener configuration and ask which requests it accepts. Response questions ask how to return a particular status code or body from an implementation flow.

  • Predict scaffolding

    Given RAML resources and methods, you identify the flows APIkit generates and their names.

  • Predict the router

    A request with a wrong method, missing parameter or bad media type is sent, and you choose the APIKIT error and HTTP status.

  • Set the response

    You choose how an implementation flow returns 201 or 404 with the right body, manually or through APIkit's variables.

Reasoning it through

A RAML file declares /orders with get and post and /orders/{orderId} with get. A client sends DELETE /api/orders/5. The APIkit Router finds the resource but no delete method, so it raises APIKIT:METHOD_NOT_ALLOWED. The scaffolded error handler in the main flow maps that error to status 405 with a message body, so the client receives 405 rather than 404 or 500.

Objectives 3

Official objectives from the Salesforce outline, in outline order.

5.1 Manually build API implementations from an API specification, RAML or not.HTTP Listener paths, allowed methods and parameters without APIkit.
What it means
Without APIkit, each resource and method can be implemented by a flow whose HTTP Listener path and allowed methods match the specification. A path such as /orders/{orderId} captures a URI parameter, and allowed methods restrict which verbs the listener accepts. A single listener on /api/* with a Choice router on attributes.method and attributes.requestPath is another approach.
What to understand
Know the listener settings: a shared HTTP Listener config with host and port, a path with wildcards or placeholders, and allowed methods. Values arrive in attributes.uriParams, attributes.queryParams and attributes.headers. Without APIkit, there is no automatic validation against the specification, so you must check required parameters and body formats yourself, for example with the Validation module. This approach works for OAS specifications or undocumented legacy interfaces as well as RAML.
How it shows up
You choose a listener path and method configuration that implements a described resource.
Common confusion
A listener path of /orders does not match /orders/5; use /orders/{orderId} or a wildcard to capture child paths.
5.2 Predict the results of APIkit based upon a RAML specification.Generated flows, router validation and APIKIT error types.
What it means
APIkit scaffolding creates a main flow with an HTTP Listener, usually on /api/*, and an APIkit Router; a console flow; an error handler; and one flow per resource and method named like get:\orders:api-config or post:\orders:application\json:api-config. Each generated flow returns the RAML example as its initial response.
What to understand
The router validates each request against the specification and routes it to the matching flow. Typical errors are APIKIT:NOT_FOUND for an unknown resource, APIKIT:METHOD_NOT_ALLOWED for an undeclared method, APIKIT:BAD_REQUEST for missing or invalid parameters or bodies, APIKIT:UNSUPPORTED_MEDIA_TYPE for a wrong content type, APIKIT:NOT_ACCEPTABLE for an unsupported Accept header, and APIKIT:NOT_IMPLEMENTED when no flow exists for a declared method. Rescaffolding after a RAML change adds flows for new methods without deleting your existing logic.
How it shows up
A RAML fragment and a request are shown, and you choose the generated flow name or the resulting status code.
Common confusion
An unknown resource returns 404, while a known resource with an undeclared method returns 405.
5.3 Implement correct responses based on a RAML specification, either manually or with APIkit.Status codes, bodies and headers that match the contract.
What it means
Each method's responses block in the specification defines status codes and bodies. In an APIkit project the main flow's listener sets its response status from #[vars.httpStatus default 200], so a flow sets vars.httpStatus to 201 after creating a resource. The scaffolded error handler maps APIKIT errors to 400, 404, 405, 406, 415 and 501.
What to understand
In a manual implementation you configure the HTTP Listener's response and error response sections with status code and header expressions, often reading variables set in the flow. Replace the example payload returned by scaffolding with real data from your connectors. Add your own error mappings or handlers so backend failures return meaningful codes, such as 404 when a record is not found, rather than a generic 500.
How it shows up
You choose how to return 201 for a POST or 404 when a database query finds nothing.
Common confusion
Setting the payload to an error message does not change the status code; the listener's status setting does.

High-yield concepts

The terms, rules and formulas this domain turns into questions most often.

  • APIkit Router

    Validates requests against the RAML and routes them to the matching flow.

    Remember
    Raises APIKIT errors when validation fails.
    Tested as
    Central to every APIkit question.
    Trap
    Thinking routing works without validation.
  • Scaffolding

    APIkit generates flows from the RAML specification.

    Remember
    One flow per resource and method, plus main and console flows.
    Tested as
    Predicting generated artifacts.
    Trap
    Expecting business logic to be generated.
  • Generated flow names

    Pattern method:\resource:config, with path separators as backslashes and URI parameters in parentheses.

    Remember
    Body-specific flows include the media type.
    Tested as
    Naming questions.
    Trap
    Reading the slashes as forward slashes.
  • APIKIT:BAD_REQUEST

    Raised for missing or invalid parameters, headers or body.

    Remember
    Mapped to 400 by the scaffolded handler.
    Tested as
    Validation scenario questions.
    Trap
    Expecting 500 for an invalid query parameter.
  • APIKIT:NOT_FOUND and METHOD_NOT_ALLOWED

    Unknown resource versus known resource with an undeclared method.

    Remember
    404 versus 405.
    Tested as
    Common distractor pair.
    Trap
    Swapping the two codes.
  • APIKIT:NOT_IMPLEMENTED

    Raised when a declared method has no implementation flow.

    Remember
    Mapped to 501.
    Tested as
    Occurs after a RAML change without rescaffolding.
    Trap
    Thinking the router returns 404 instead.
  • vars.httpStatus

    Variable read by the generated listener to set the response status.

    Remember
    Default is 200 when the variable is not set.
    Tested as
    Returning 201 or custom codes.
    Trap
    Setting the status in the payload.
  • Console flow

    Generated flow that serves an interactive API console.

    Remember
    Useful for testing during development.
    Tested as
    Recognising generated flows.
    Trap
    Confusing it with the main flow.
  • Manual listener interface

    HTTP Listeners with paths and allowed methods matching the specification.

    Remember
    No automatic request validation.
    Tested as
    Implementing a non-RAML interface.
    Trap
    Assuming the listener rejects invalid bodies automatically.

Side by side

Concepts candidates mix up, compared on the point that decides the answer.

Manual interface vs APIkit

ConceptMeaningKey differenceCommon trap
Manual HTTP Listener flows Developer sets paths, methods and validation Works with any specification or none Forgetting to validate inputs
APIkit scaffolding Generates router, flows and error mappings from RAML Automatic validation and routing Expecting it to write integration logic

APIkit errors and status codes

ConceptMeaningKey differenceCommon trap
APIKIT:NOT_FOUND Path matches no resource 404 Choosing 405
APIKIT:METHOD_NOT_ALLOWED Resource exists, method not declared 405 Choosing 404
APIKIT:BAD_REQUEST Parameters, headers or body invalid 400 Choosing 500
APIKIT:UNSUPPORTED_MEDIA_TYPE Content-Type not declared for the body 415 Choosing 406, which concerns the Accept header

Exam traps

Each trap is an answer that looks right. Learn the clue that should change your mind.

  1. 405 vs 404

    What candidates pick
    404 for a declared resource called with an undeclared method.
    Why it looks right
    The operation does not exist, which sounds like not found.
    Why it's wrong
    The router finds the resource, so it raises METHOD_NOT_ALLOWED, mapped to 405.

    Clue to watch for The path matches the RAML but the verb does not.

  2. Invalid input is a server error

    What candidates pick
    500 for a missing required query parameter.
    Why it looks right
    Errors often default to 500.
    Why it's wrong
    The router raises APIKIT:BAD_REQUEST, which the generated handler maps to 400.

    Clue to watch for The request omits or mistypes a declared parameter.

  3. Rescaffold overwrites

    What candidates pick
    Believing regenerating flows deletes custom code.
    Why it looks right
    Code generators often overwrite files.
    Why it's wrong
    APIkit adds flows for new resources and methods and keeps existing implementation flows.

    Clue to watch for The stem mentions an updated RAML file.

  4. Status in payload

    What candidates pick
    Setting the payload to {status: 201} to return Created.
    Why it looks right
    The response body seems to describe the result.
    Why it's wrong
    The HTTP status comes from the listener configuration, which in APIkit reads vars.httpStatus.

    Clue to watch for The requirement names an HTTP status code.

  5. Accept vs Content-Type

    What candidates pick
    415 when the client's Accept header asks for an unsupported format.
    Why it looks right
    Both relate to media types.
    Why it's wrong
    An unsupported Accept header leads to 406; 415 is for an unsupported request body type.

    Clue to watch for Look at which header is wrong.

Answer framework

Work through these steps for any APIkit or interface question.

  1. Map the request path to a RAML resource; if none matches, expect APIKIT:NOT_FOUND and a 404 response from the scaffolded error handler in the main flow.
  2. Check whether the method is declared on that resource; if not, expect APIKIT:METHOD_NOT_ALLOWED and a 405 response, even though the path itself is valid.
  3. Validate parameters, headers and body against types and required settings; a failure means APIKIT:BAD_REQUEST and 400.
  4. Check the Content-Type and Accept headers against the declared media types for 415 or 406 outcomes, remembering which header each code concerns.
  5. If the request is valid, name the generated flow that handles it and work out the status from vars.httpStatus or the listener configuration.

Practice question

An APIkit project is scaffolded from RAML declaring /invoices with get, where queryParameters status is an enum of paid and unpaid. A client sends GET /api/invoices?status=overdue. The scaffolded main flow error handler is unchanged. What does the client receive?

Choose one answer

Want more like this? The Mule-Dev-201 practice test has questions for every domain.

Checklist

0 of 10

Tick each one you can do without notes. Your ticks stay in this browser.

Study strategy

Use the RAML you wrote for Designing APIs and scaffold it with APIkit in Anypoint Studio. Before running anything, predict the generated flows and their names, then compare with what Studio created. Send good and bad requests from the APIkit console or a REST client and record the status code and APIKIT error type for each.

Next, build the same interface manually with HTTP Listeners for each resource. Notice how much validation you now have to write yourself, and use the Validation module or a Choice router to reject bad input. Then practise returning 201, 404 and 400 in both versions.

Keep a small table of APIKIT errors, causes and codes, and drill it until it is automatic. Because the section is 7%, about a week of short sessions is enough, but the APIkit lab also supports later study of error handling and routing, so keep the project and extend it as you progress.

FAQ

What share of Mule-Dev-201 is Building API Implementation Interfaces?

Building API Implementation Interfaces is 7% of the exam, about four of the 60 scored questions. Most of them focus on APIkit behaviour and correct responses.

Does APIkit work with OAS as well as RAML?

Current APIkit versions support RAML and OAS specifications. The exam objectives name RAML for APIkit prediction, so study RAML-based scaffolding first.

Which flows does APIkit generate?

A main flow with an HTTP Listener and APIkit Router, a console flow, error handling mapped to HTTP codes, and one implementation flow per resource and method returning the RAML example.

How do I return a 201 Created status from an APIkit flow?

Set vars.httpStatus to 201 in the implementation flow. The scaffolded listener reads it in its response status expression, defaulting to 200 when the variable is not set.

What happens if I add a method to the RAML after scaffolding?

Until you rescaffold, the router raises APIKIT:NOT_IMPLEMENTED, mapped to 501, for that method. Rescaffolding adds the missing flow without removing your existing ones.

Should I always use APIkit?

Not always. APIkit is convenient when you have a RAML or OAS specification. A manual listener interface suits simple endpoints or legacy contracts, but then you must validate requests yourself.

Other CRM & Business Applications certifications

Where the same subject shows up in other exams. Cards marked "Same subject" open the matching domain.

Test your Domain 5 knowledge

You have studied manual interfaces, APIkit scaffolding and response codes. Practise Mule-Dev-201 questions that ask what the APIkit Router does with a request.

Keep going