Postman API
  1. Mocks
Postman API
  • API
    • Get all APIs
      GET
    • Create API
      POST
    • Delete an API
      DELETE
    • Single API
      GET
    • Update an API
      PUT
    • Get All API Versions
      GET
    • Create API Version
      POST
    • Delete an API Version
      DELETE
    • Get an API Version
      GET
    • Update an API Version
      PUT
    • Get contract test relations
      GET
    • Get documentation relations
      GET
    • Get environment relations
      GET
    • Get integration test relations
      GET
    • Get monitor relations
      GET
    • Get linked relations
      GET
    • Create relations
      POST
    • Create Schema
      POST
    • Get Schema
      GET
    • Update Schema
      PUT
    • Create collection from schema
      POST
    • Get test suite relations
      GET
    • Sync relations with schema
      PUT
  • Collections
    • All Collections
    • Create Collection
    • Create a Fork
    • Merge a Fork
    • Delete Collection
    • Single Collection
    • Update Collection
  • Environments
    • All Environments
    • Create Environment
    • Delete Environment
    • Single Environment
    • Update Environment
  • Import
    • Import exported data
    • Import external API specification
  • User
    • API Key Owner
  • Mocks
    • All Mocks
      GET
    • Create Mock
      POST
    • Delete Mock
      DELETE
    • Single Mock
      GET
    • Update Mock
      PUT
    • Publish Mock
      POST
    • Unpublish Mock
      DELETE
  • Monitors
    • All Monitors
    • Create Monitor
    • Delete Monitor
    • Single Monitor
    • Update Monitor
    • Run a Monitor
  • Webhooks
    • Create Webhook
  • Workspaces
    • All workspaces
    • Create Workspace
    • Delete Workspace
    • Single workspace
    • Update Workspace
  1. Mocks

Update Mock

PUT
/mocks/{mock_uid}
Mocks
This endpoint allows you to update a mock you have created using its uid. The endpoint allows you to edit fields,
name
environment
description
private
versionTag
Requires API Key as X-Api-Key request header or apikey URL query parameter.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://api.getpostman.com/mocks/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "mock": {
        "description": "example describing update mock description",
        "environment": "11582779-ac1b6608-deb7-4c05-9d48-ee775aabfc19",
        "name": "My Mock Server",
        "private": false,
        "versionTag": "abf07d3d-f8ec-47d4-8015-9fe83078b4ec"
    }
}'
Response Response Example
{
  "mock": {
    "collection": "11582779-fd6797e2-de6b-4699-975c-85290e4c2499",
    "config": {
      "headers": [],
      "matchBody": false,
      "matchQueryParams": true,
      "matchWildcards": true
    },
    "environment": "11582779-ac1b6608-deb7-4c05-9d48-ee775aabfc19",
    "id": "06040138-dd6b-4cce-9a02-7e1c1ab59723",
    "mockUrl": "https://06040138-dd6b-4cce-9a02-7e1c1ab59723.mock.pstmn.io",
    "name": "My Mock Server",
    "owner": "11582779",
    "uid": "11582779-06040138-dd6b-4cce-9a02-7e1c1ab59723"
  }
}

Request

Path Params
mock_uid
string 
required
Body Params application/json
mock
object 
optional
description
string 
optional
Example:
example describing update mock description
environment
string 
optional
Example:
11582779-ac1b6608-deb7-4c05-9d48-ee775aabfc19
name
string 
optional
Example:
My Mock Server
private
boolean 
optional
Example:
false
versionTag
string 
optional
Example:
abf07d3d-f8ec-47d4-8015-9fe83078b4ec
Examples

Responses

🟢200success Response
application/json
Body
mock
object 
optional
collection
string 
optional
Example:
11582779-fd6797e2-de6b-4699-975c-85290e4c2499
config
object 
optional
environment
string 
optional
Example:
11582779-ac1b6608-deb7-4c05-9d48-ee775aabfc19
id
string 
optional
Example:
06040138-dd6b-4cce-9a02-7e1c1ab59723
mockUrl
string 
optional
Example:
https://06040138-dd6b-4cce-9a02-7e1c1ab59723.mock.pstmn.io
name
string 
optional
Example:
My Mock Server
owner
string 
optional
Example:
11582779
uid
string 
optional
Example:
11582779-06040138-dd6b-4cce-9a02-7e1c1ab59723
Previous
Single Mock
Next
Publish Mock
Built with