# After request schema This is the function schema which defines all the middleware to be run after calling the [sdk.request](/docs/chatlayer/actions/sdk-object) method. This will be the schema which will be used to inject middleware into your code. The after request middleware takes in 3 arguments: - Response: The response you receive from the request - [sdk](/docs/chatlayer/actions/sdk-object) - [bundle](/docs/chatlayer/actions/bundle-object) ```javascript const stringify = (response, sdk, bundle) => { if (response.status === 200 || response.status === 201) { return response.text(); } else { throw new Error("Internal server errror: check with system admin"); } return response; }; module.exports = { afters: [stringify] }; ``` ```javascript const after = require("./src/after"); module.exports = { afterResponse: [...after.afters], }; ``` In the above example we can see that on the app schema, afterResponse property is an array of functions which includes a function that converts the response into text if status code is 200 or 201 and throws error if the status code is anything else. Please note that afterResponse method is called after each [sdk.request](/docs/chatlayer/actions/sdk-object) method is called.