Postman API
  1. API
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
      GET
    • Create Collection
      POST
    • Create a Fork
      POST
    • Merge a Fork
      POST
    • Delete Collection
      DELETE
    • Single Collection
      GET
    • Update Collection
      PUT
  • 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
    • Create Mock
    • Delete Mock
    • Single Mock
    • Update Mock
    • Publish Mock
    • Unpublish Mock
  • 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. API

Create relations

POST
/apis/{apiId}/versions/{apiVersionId}/relations
APIRelations

This call allows you to add existing Postman entities as new relations to an API. The request body should contain the relations to be created along with an array of entity IDs.

Relation Entity ID type
contracttest Collection UIDs
integrationtest Collection UIDs
documentation Collection UIDs
testsuite Collection UIDs
environment Environment UIDs
mock Mock IDs
monitor Monitor IDs

Requires API Key as X-Api-Key request header or apikey URL query parameter.

Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.getpostman.com/apis//versions//relations' \
--header 'Content-Type: application/json' \
--data-raw '{
    "contracttest": [
        "collection-uid-1"
    ],
    "documentation": [
        "collection-uid-3"
    ],
    "mock": [
        "mock-uid-1"
    ],
    "testsuite": [
        "collection-uid-1",
        "collection-uid-2"
    ]
}'
Response Response Example
{
  "contracttest": [
    "5bcece87-ca4b-4e75-a967-2a6845626164"
  ],
  "documentation": [
    "2084eba6-a17b-4751-8f03-ea60f30ba19c"
  ],
  "testsuite": [
    "e525fa71-035e-4620-acda-ce878524f1e7",
    "17a974b2-ce79-4b95-9d3f-217d6ff7e979"
  ]
}

Request

Path Params
apiId
string 
required
apiVersionId
string 
required
Body Params application/json
contracttest
array[string]
optional
documentation
array[string]
optional
mock
array[string]
optional
testsuite
array[string]
optional
Examples

Responses

🟢200Create multiple relations from existing collections
application/json
Body
contracttest
array[string]
optional
documentation
array[string]
optional
testsuite
array[string]
optional
Previous
Get linked relations
Next
Create Schema
Built with