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 orapikey
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
Responses
Modified at 2023-08-15 05:41:03