List Mock APIs
Endpoint
GET /apiops/projects/{projectName}/mockapis/
Authentication
Requires a Personal API Access Token.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| projectName | string | Yes | Project name |
Response
Success Response (200 OK)
{
"status": "SUCCESS",
"resultList": [
{
"id": "66f1c0a2e4b0a1b2c3d4e5f6",
"name": "Customer Accounts",
"description": "Mock of the customer accounts service",
"version": "1.0.0",
"projectId": "66f1bf10e4b0a1b2c3d4e5a1"
},
{
"id": "66f1c0b7e4b0a1b2c3d4e5f7",
"name": "Orders",
"description": null,
"version": "1.0",
"projectId": "66f1bf10e4b0a1b2c3d4e5a1"
}
],
"resultCount": 2
}
Response Fields
| Field | Type | Description |
|---|---|---|
| id | string | Mock API ID |
| name | string | Mock API name |
| description | string | Mock API description, null when not set |
| version | string | Mock API version. The generated OpenAPI specification uses it as info.version. A Mock API saved before the version field existed returns 1.0. |
| projectId | string | ID of the project that owns the Mock API |
Error Response (400 Bad Request)
The user does not have the required permission, or the project does not exist.
{
"status": "FAILURE",
"resultMessage": "User does not have required VIEW permission for API_CREATOR in this project!"
}
Error Response (401 Unauthorized)
The token is missing or not valid. For the error format, see Error Handling.
cURL Example
curl -X GET \
"https://demo.apinizer.com/apiops/projects/MyProject/mockapis/" \
-H "Authorization: Bearer YOUR_TOKEN"
Notes and Warnings
- Read-only: This endpoint does not modify anything and does not trigger a deployment
- Empty project: A project with no Mock APIs returns
resultList: []andresultCount: 0, not an error - No endpoints: The list does not contain the endpoints of the Mock APIs. To get them, use Get Mock API
Permissions
- User must have
API_CREATOR+VIEWpermission in the project
Related Documentation
- Get Mock API - Get the full definition of a Mock API
- Create or Update Mock API - Save a Mock API definition by name