Postman Mocks API
Operations for creating and managing mock servers.
Operations for creating and managing mock servers.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/postman-mocks-api"
curl "https://apis.io/api/v1/apis?limit=25"
Discovery needs no key. Ratings and market analysis are Pro.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Postman Mocks API
version: 1.0.0
description: 'Operations tagged mocks across 3 of this provider''s published API definitions: postman-api-openapi.yml, postman-mock-servers-api-openapi.yml, postman-mocks-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.postman.com
description: https://api.postman.com
- url: https://api.eu.postman.com
description: https://api.eu.postman.com
- url: https://api.getpostman.com
description: Postman Production API Server
tags:
- name: mocks
paths:
/mocks:
get:
operationId: getMocks
summary: Get all mock servers
description: 'Gets all active mock servers. By default, this endpoint returns only mock servers you created across all workspaces.
**Note:**
If you pass both the `teamId` and `workspace` query parameters, this endpoint only accepts the `workspace` query.
'
tags:
- mocks
parameters:
- name: teamId
in: query
description: Return only results that belong to the given team ID.
required: false
schema:
$ref: '#/components/schemas/teamIdResultsQuery'
- name: workspace
in: query
description: Return only results found in the given workspace ID.
required: false
schema:
$ref: '#/components/schemas/workspaceId'
- name: x-api-key
in: header
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/getMocks'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/GetMocksRequestUnauthorizedError'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/mock500Error'
post:
operationId: createMock
summary: Create a mock server
description: 'Creates a mock server in a collection.
**Note:**
- You cannot create mocks for collections added to an API definition.
- If you do not include the `workspaceId` query parameter, the system creates the mock server in the oldest personal Internal workspace you own.
'
tags:
- mocks
parameters:
- name: workspace
in: query
description: The workspace's ID.
required: true
schema:
$ref: '#/components/schemas/workspaceId'
- name: x-api-key
in: header
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/mockCreateUpdateResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/CreateMockRequestBadRequestError'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/CreateMockRequestUnauthorizedError'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/mock500Error'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/createMock'
servers:
- url: https://api.postman.com
description: https://api.postman.com
- url: https://api.eu.postman.com
description: https://api.eu.postman.com
/mocks/{mockId}:
get:
operationId: getMock
summary: Get a mock server
description: Gets information about a mock server.
tags:
- mocks
parameters:
- name: mockId
in: path
description: The mock's ID.
required: true
schema:
$ref: '#/components/schemas/mockId'
- name: x-api-key
in: header
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/getMock'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/GetMockRequestUnauthorizedError'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/commonErrorNameMessageDetails'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/mock500Error'
put:
operationId: updateMock
summary: Update a mock server
description: Updates a mock server's properties, such as its name or collection.
tags:
- mocks
parameters:
- name: mockId
in: path
description: The mock's ID.
required: true
schema:
$ref: '#/components/schemas/mockId'
- name: x-api-key
in: header
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/mockCreateUpdateResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMockRequestBadRequestError'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMockRequestUnauthorizedError'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/commonErrorNameMessageDetails'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/mock500Error'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/updateMock'
delete:
operationId: deleteMock
summary: Delete a mock server
description: Deletes a mock server.
tags:
- mocks
parameters:
- name: mockId
in: path
description: The mock's ID.
required: true
schema:
$ref: '#/components/schemas/mockId'
- name: x-api-key
in: header
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/deleteMock'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteMockRequestUnauthorizedError'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/commonErrorNameMessageDetails'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/mock500Error'
servers:
- url: https://api.postman.com
description: https://api.postman.com
- url: https://api.eu.postman.com
description: https://api.eu.postman.com
/mocks/{mockId}/call-logs:
get:
operationId: getMockCallLogs
summary: Get a mock server's call logs
description: 'Gets a mock server''s call logs. You can get a maximum of 6.5MB of call logs or a total of 100 call logs, whichever limit is met first in one API call.
Call logs contain exchanged request and response data made to mock servers. The logs provide visibility into how the mock servers are being used. You can log data to debug, test, analyze, and more, depending upon the use case.
**Note:**
Call logs have a retention period based on your [Postman plan](https://www.postman.com/pricing/#mock-calls). For more information, see [this article](https://support.postman.com/hc/en-us/articles/21219973964951-I-can-t-see-my-mock-server-logs-history) in the [Postman Support Center](https://support.postman.com/).
'
tags:
- mocks
parameters:
- name: mockId
in: path
description: The mock's ID.
required: true
schema:
$ref: '#/components/schemas/mockId'
- name: limit
in: query
description: The maximum number of rows to return in the response.
required: false
schema:
$ref: '#/components/schemas/limitDefault100'
default: 100
- name: cursor
in: query
description: The pointer to the first record of the set of paginated results. To view the next response, use the `nextCursor` value for this parameter.
required: false
schema:
$ref: '#/components/schemas/cursor'
- name: until
in: query
description: Return only results created until this given time, in [ISO 8601](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format. This value cannot be earlier than the `since` value.
required: false
schema:
$ref: '#/components/schemas/untilDateTime'
- name: since
in: query
description: Return only results created since the given time, in [ISO 8601](https://datatracker.ietf.org/doc/html/rfc3339#section-5.6) format. This value cannot be later than the `until` value.
required: false
schema:
$ref: '#/components/schemas/sinceDateTime'
- name: responseStatusCode
in: query
description: Return only call logs that match the given HTTP response status code.
required: false
schema:
$ref: '#/components/schemas/mockResponseStatusCode'
- name: responseType
in: query
description: Return only call logs that match the given response type. Matching is not case-sensitive.
required: false
schema:
$ref: '#/components/schemas/mockResponseType'
- name: requestMethod
in: query
description: Return only call logs that match the given HTTP method. Matching is not case-sensitive.
required: false
schema:
$ref: '#/components/schemas/mockRequestMethod'
- name: requestPath
in: query
description: Return only call logs that match the given request path. Matching is not case-sensitive.
required: false
schema:
$ref: '#/components/schemas/mockRequestPath'
- name: sort
in: query
description: Sort the results by the given value. If you use this query parameter, you must also use the `direction` parameter.
required: false
schema:
$ref: '#/components/schemas/mockSortServedAt'
- name: direction
in: query
description: Sort in ascending (`asc`) or descending (`desc`) order. Matching is not case-sensitive. If you use this query parameter, you must also use the `sort` parameter.
required: false
schema:
$ref: '#/components/schemas/ascDesc'
- name: include
in: query
description: Include call log records with header and body data. This query parameter accepts the `request.headers`, `request.body`, `response.headers`, and `response.body` values. For multiple include types, comma-separate each value.
required: false
schema:
$ref: '#/components/schemas/mockInclude'
- name: x-api-key
in: header
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/getMockCallLogs'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/GetMockCallLogsRequestBadRequestError'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/GetMockCallLogsRequestUnauthorizedError'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/commonErrorNameMessageDetails'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/GetMockCallLogsRequestInternalServerError'
servers:
- url: https://api.postman.com
description: https://api.postman.com
- url: https://api.eu.postman.com
description: https://api.eu.postman.com
/mocks/{mockId}/publish:
post:
operationId: publishMock
summary: Publish a mock server
description: Publishes a mock server. Publishing a mock server sets its **Access Control** configuration setting to public.
tags:
- mocks
parameters:
- name: mockId
in: path
description: The mock's ID.
required: true
schema:
$ref: '#/components/schemas/mockId'
- name: x-api-key
in: header
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/publishUnpublishMockResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/PublishMockRequestBadRequestError'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/PublishMockRequestUnauthorizedError'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/commonErrorNameMessageDetails'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/mock500Error'
servers:
- url: https://api.postman.com
description: https://api.postman.com
- url: https://api.eu.postman.com
description: https://api.eu.postman.com
/mocks/{mockId}/unpublish:
delete:
operationId: unpublishMock
summary: Unpublish a mock server
description: Unpublishes a mock server. Unpublishing a mock server sets its **Access Control** configuration setting to private.
tags:
- mocks
parameters:
- name: mockId
in: path
description: The mock's ID.
required: true
schema:
$ref: '#/components/schemas/mockId'
- name: x-api-key
in: header
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/publishUnpublishMockResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/UnpublishMockRequestBadRequestError'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/UnpublishMockRequestUnauthorizedError'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/commonErrorNameMessageDetails'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/mock500Error'
servers:
- url: https://api.postman.com
description: https://api.postman.com
- url: https://api.eu.postman.com
description: https://api.eu.postman.com
/mocks/{mockId}/server-responses:
get:
operationId: getMockServerResponses
summary: Get all server responses
description: Gets all of a mock server's server responses.
tags:
- mocks
parameters:
- name: mockId
in: path
description: The mock's ID.
required: true
schema:
$ref: '#/components/schemas/mockId'
- name: x-api-key
in: header
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/getMockServerResponses'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/GetMockServerResponsesRequestUnauthorizedError'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/mockServerResponse404Error'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/GetMockServerResponsesRequestInternalServerError'
post:
operationId: createMockServerResponse
summary: Create a server response
description: 'Creates a server response. Server responses let you simulate 5xx server-level responses, such as 500 or 503.
Server-level responses are agnostic to application-level logic. Server responses let you simulate this behavior on a mock server. You do not need to define each error for all exposed paths on the mock server.
If you set a server response as active, then all the calls to the mock server return with that active server response.
**Note:**
You can create multiple server responses for a mock server, but only one mock server can be set as active.
'
tags:
- mocks
parameters:
- name: mockId
in: path
description: The mock's ID.
required: true
schema:
$ref: '#/components/schemas/mockId'
- name: x-api-key
in: header
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/mockServerResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/CreateMockServerResponseRequestBadRequestError'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/CreateMockServerResponseRequestUnauthorizedError'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/mockServerResponse404Error'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/CreateMockServerResponseRequestInternalServerError'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/createMockServerResponse'
servers:
- url: https://api.postman.com
description: https://api.postman.com
- url: https://api.eu.postman.com
description: https://api.eu.postman.com
/mocks/{mockId}/server-responses/{serverResponseId}:
get:
operationId: getMockServerResponse
summary: Get a server response
description: Gets information about a server response.
tags:
- mocks
parameters:
- name: mockId
in: path
description: The mock's ID.
required: true
schema:
$ref: '#/components/schemas/mockId'
- name: serverResponseId
in: path
description: The server response's ID.
required: true
schema:
$ref: '#/components/schemas/serverResponseId'
- name: x-api-key
in: header
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/mockServerResponse'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/GetMockServerResponseRequestUnauthorizedError'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/mockServerResponse404Error'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/GetMockServerResponseRequestInternalServerError'
put:
operationId: updateMockServerResponse
summary: Update a server response
description: Updates a server response.
tags:
- mocks
parameters:
- name: mockId
in: path
description: The mock's ID.
required: true
schema:
$ref: '#/components/schemas/mockId'
- name: serverResponseId
in: path
description: The server response's ID.
required: true
schema:
$ref: '#/components/schemas/serverResponseId'
- name: x-api-key
in: header
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/mockServerResponse'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMockServerResponseRequestBadRequestError'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMockServerResponseRequestUnauthorizedError'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/mockServerResponse404Error'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateMockServerResponseRequestInternalServerError'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/updateMockServerResponse'
delete:
operationId: deleteMockServerResponse
summary: Delete a server response
description: Deletes a mock server's server response.
tags:
- mocks
parameters:
- name: mockId
in: path
description: The mock's ID.
required: true
schema:
$ref: '#/components/schemas/mockId'
- name: serverResponseId
in: path
description: The server response's ID.
required: true
schema:
$ref: '#/components/schemas/serverResponseId'
- name: x-api-key
in: header
required: true
schema:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/deleteMockServerResponse'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteMockServerResponseRequestUnauthorizedError'
'404':
description: Not Found
content:
application/json:
schema:
$ref: '#/components/schemas/mockServerResponse404Error'
'500':
description: Internal Server Error
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteMockServerResponseRequestInternalServerError'
servers:
- url: https://api.postman.com
description: https://api.postman.com
- url: https://api.eu.postman.com
description: https://api.eu.postman.com
components:
schemas:
CreateMockServerResponseRequestInternalServerError:
oneOf:
- $ref: '#/components/schemas/commonErrorTypeTitleDetail'
- $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
- $ref: '#/components/schemas/commonErrorNameMessage'
title: CreateMockServerResponseRequestInternalServerError
CreateMockRequestUnauthorizedError:
oneOf:
- $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
- $ref: '#/components/schemas/commonErrorNameMessage'
title: CreateMockRequestUnauthorizedError
UpdateMockServerResponseServerResponseLanguage:
type: string
enum:
- text
- javascript
- json
- html
- xml
description: The server response's body language type.
title: UpdateMockServerResponseServerResponseLanguage
GetMocksMocksItemsConfigDelayType:
type: string
enum:
- fixed
description: 'The type of simulated delay value:
- `fixed` — The delay value is a fixed value.
'
title: GetMocksMocksItemsConfigDelayType
mockCreateUpdateResponse:
type: object
properties:
mock:
$ref: '#/components/schemas/MockCreateUpdateResponseMock'
description: Information about the mock server.
title: mockCreateUpdateResponse
serverResponseId:
type: string
title: serverResponseId
UpdateMockMockConfig:
type: object
properties:
serverResponseId:
type:
- string
- 'null'
description: The server response ID. This sets the given server response as the default response for each request. To deactivate a server response, pass a null value.
description: The mock server's configuration settings.
title: UpdateMockMockConfig
teamIdResultsQuery:
type: string
title: teamIdResultsQuery
MockCreateUpdateResponseMock:
type: object
properties:
id:
type: string
description: The mock server's ID.
owner:
type: string
description: The ID of mock server's owner.
uid:
type: string
format: uid
description: The mock server's unique ID.
collection:
type: string
description: The unique ID of the mock's associated collection.
mockUrl:
type: string
format: url
description: The mock server URL.
name:
type: string
description: The mock server's name.
config:
$ref: '#/components/schemas/MockCreateUpdateResponseMockConfig'
description: Information about the mock server's configuration.
createdAt:
type: string
format: date-time
description: The date and time at which the mock server was created.
updatedAt:
type: string
format: date-time
description: The date and time at which the mock server was last updated.
environment:
type: string
description: The unique ID of the mock's associated environment.
description: Information about the mock server.
title: MockCreateUpdateResponseMock
mockResponseStatusCode:
type: number
format: double
title: mockResponseStatusCode
createMock:
type: object
properties:
mock:
$ref: '#/components/schemas/CreateMockMock'
title: createMock
GetMockMockConfig:
type: object
properties:
headers:
type: array
items:
type: string
description: A list of the mock server's headers.
matchBody:
type: boolean
description: If true, match the request body.
matchQueryParams:
type: boolean
description: If true, match query parameters.
matchWildcards:
type: boolean
description: If true, use wildcard variable matching.
delay:
oneOf:
- $ref: '#/components/schemas/GetMockMockConfigDelay'
- type: 'null'
description: Information about the mock server's simulated network delay settings. This returns a null value if there are no configured network delay settings.
serverResponseId:
type:
- string
- 'null'
description: The ID of mock server's default response for requests. All calls to the mock server will return the defined response.
description: Information about the mock server's configuration.
title: GetMockMockConfig
cursor:
type: string
title: cursor
MockCreateUpdateResponseMockConfigDelay:
type: object
properties:
type:
$ref: '#/components/schemas/MockCreateUpdateResponseMockConfigDelayType'
description: The `fixed` value.
duration:
type: integer
description: For custom network delays, the custom configured delay, in milliseconds.
preset:
$ref: '#/components/schemas/MockCreateUpdateResponseMockConfigDelayPreset'
description: 'The simulated fixed network delay value:
- `1` — 2G (300 ms).
- `2` — 3G (100 ms).
The object does not return this value for custom delay values.
'
description: Information about the mock server's simulated network delay settings. This returns a null value if there are no configured network delay settings.
title: MockCreateUpdateResponseMockConfigDelay
commonErrorNameMessage:
type: object
properties:
error:
$ref: '#/components/schemas/CommonErrorNameMessageError'
description: Information about the error.
title: commonErrorNameMessage
mockServerResponse404Error:
type: object
properties:
error:
$ref: '#/components/schemas/MockServerResponse404ErrorError'
title: mockServerResponse404Error
MockServerResponse404ErrorError:
type: object
properties:
name:
type: string
description: The error name.
header:
type: string
description: Information about the error.
message:
type: string
description: The error message.
title: MockServerResponse404ErrorError
CommonErrorTypeTitleDetailStatusType:
oneOf:
- type: string
format: uri-reference
- type: string
title: CommonErrorTypeTitleDetailStatusType
MockServerResponseHeadersItems:
type: object
properties:
key:
type: string
description: The request header's key value.
value:
# --- truncated at 32 KB (73 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/postman/refs/heads/main/openapi/postman-mocks-api-openapi.yml