API credits are used by multi-step API (MSA) and Postman API monitors to test API endpoints that require multiple sequential HTTP requests.
API credits
API credits are calculated based on the number of HTTP requests a monitor sends to a web server or API endpoint. An HTTP request occurs when a client retrieves or sends data, such as loading an HTML page, creating a new resource, or updating a database entry. Each API monitor you create and activate (in production or staging mode) contains either one or chained HTTP requests.
For multi-step API monitors, each request step consumes one credit. Wait steps are free and don’t consume credits. For Postman API monitors, each request in your collection consumes one credit.
Calculation: 1 credit = 1 HTTP request = 1 step in the monitor
Unlike uptime and browser monitors, the number of created API monitors does not affect credit usage. Credits are calculated based on the number of API steps, not the number of monitors. Check intervals also do not affect credit usage.
Multi-step API examples
Scenario A: Basic authentication
Suppose you want to monitor if your end-to-end authentication works correctly. You have two API endpoints that allow users to request a token for identification and verify its validity:
POST /requestToken— endpoint to get the token. Users usually send their username and password to request a token.GET /validateToken— endpoint to validate the token.
In this case, you must create a single API monitor that follows the process sequentially. To do this, complete the following steps:
- Step 1:
/requestToken - Step 2:
/validateToken
In this scenario, you consume two API credits since the monitor performs two requests: to send information (credentials) to request a token, and to request verification of that token.
Scenario B: Complex API workflow for ordering system
Suppose you have an API that contains a large record of shipping details for your transport service business. Your customer service team always gets many tickets to update customers' shipping addresses due to incorrect destinations. To ensure that this process always works as expected in the backend, we want to track this workflow.
You need to create one monitor that includes several endpoints:
GET /allOrders- Wait step
GET /allOrders/{orderId}PATCH /allOrders/{orderId}
In this scenario, you consume three API credits because the monitor sends HTTP requests to the GET and PATCH endpoints. The wait step does not consume any credits, as it does not send a request to the server and only adds a delay between two requests.
Scenario C: Complex API workflow using multiple endpoints
Suppose you want to monitor two different API workflows, such as ordering system and payment processing. You created two MSA monitors with the following flow:
-
Monitor A: Ordering system - contains three request steps to check order information and edit a specific order detail:
a.
GET /allOrdersb.
GET /allOrders/{orderId}c.
PUT /allOrders/{orderId} -
Monitor B: Payment process - contains four request steps to check payment:
a.
POST /api/authenticationb.
POST /api/payment/validationc. Wait step
d.
POST /api/payment/processe. Wait step
f.
GET /api/payment/status
In this scenario, Monitor A consumes three credits and Monitor B consumes four credits. Each request step calculates one credit. (3 + 4 = 7 HTTP requests).
Postman API examples
Scenario A: E-commerce monitoring
Suppose you want to monitor your e-commerce platform to test if the payment process works correctly. You have exported your Postman collection and uploaded it to Uptrends. Uptrends detects the following requests:
GET /allOrdersGET /allOrders/{orderId}PUT /allOrders/{orderId}
There are a total of three credits in this scenario. Each request is counted as one credit.
Scenario B: Data processing
Suppose you want to monitor your end-to-end data and CI/CD workflow. You want to establish a connection from a data source, retrieve that data, and prepare raw data into a usable format for analytics or reporting, and save it to your database.
You used an API URL for your Postman collection. Uptrends detects the following requests:
POST /api/v1/datasources/connectGET /api/v1/datasources/{connectionId}/fetchPATCH /api/v1/pipelines/{pipelineId}/transformPUT /api/v1/pipelines/{pipelineId}/save
There are a total of 4 credits in this scenario. Each request is counted as one credit.