TagsService
A list of all methods in the TagsService
service. Click on the method name to view detailed information about that method.
Methods | Description |
---|---|
getApiTags | Gets all the tags associated with an API. |
updateApiTags | Updates an API's associated tags. This endpoint replaces all existing tags with those you pass in the request body. |
getCollectionTags | Gets all the tags associated with a collection. |
updateCollectionTags | Updates a collection's associated tags. This endpoint replaces all existing tags with those you pass in the request body. |
getTaggedEntities | Gets Postman elements (entities) by a given tag. Tags enable you to organize and search workspaces, APIs, and collections that contain shared tags. Note: Tagging is available on Postman Enterprise plans. |
getWorkspaceTags | Gets all the tags associated with a workspace. |
updateWorkspaceTags | Updates a workspace's associated tags. This endpoint replaces all existing tags with those you pass in the request body. |
getApiTags
Gets all the tags associated with an API.
- HTTP Method:
GET
- Endpoint:
/apis/{apiId}/tags
Parameters
Name | Type | Required | Description |
---|---|---|---|
apiId | string | ✅ | The API's unique ID. |
accept | Accept | ✅ | The application/vnd.api.v10+json request header required to use the endpoint. |
Return Type
TagGetPut
Example Usage Code Snippet
import { PostmanClient } from 'postman_client';
(async () => {
const postmanClient = new PostmanClient({
apiKey: 'YOUR_API_KEY',
});
const accept = Accept.APPLICATIONVNDAPIV10JSON;
const { data } = await postmanClient.tags.getApiTags('12345678-6fd634a3-79ba-451d-8f07-56a953f96667', {
accept: accept,
});
console.log(data);
})();
updateApiTags
Updates an API's associated tags. This endpoint replaces all existing tags with those you pass in the request body.
- HTTP Method:
PUT
- Endpoint:
/apis/{apiId}/tags
Parameters
Name | Type | Required | Description |
---|---|---|---|
body | TagUpdateTags | ❌ | The request body. |
apiId | string | ✅ | The API's unique ID. |
accept | Accept | ✅ | The application/vnd.api.v10+json request header required to use the endpoint. |
Return Type
TagGetPut
Example Usage Code Snippet
import { PostmanClient, TagUpdateTags } from 'postman_client';
(async () => {
const postmanClient = new PostmanClient({
apiKey: 'YOUR_API_KEY',
});
const accept = Accept.APPLICATIONVNDAPIV10JSON;
const tagUpdateTagsTags: TagUpdateTagsTags = {
slug: 'needs-review',
};
const input: TagUpdateTags = {
tags: [tagUpdateTagsTags],
};
const { data } = await postmanClient.tags.updateApiTags('12345678-6fd634a3-79ba-451d-8f07-56a953f96667', input, {
accept: accept,
});
console.log(data);
})();
getCollectionTags
Gets all the tags associated with a collection.
- HTTP Method:
GET
- Endpoint:
/collections/{collectionId}/tags
Parameters
Name | Type | Required | Description |
---|---|---|---|
collectionId | string | ✅ | The collection's unique ID. |
Return Type
TagGetPut
Example Usage Code Snippet
import { PostmanClient } from 'postman_client';
(async () => {
const postmanClient = new PostmanClient({
apiKey: 'YOUR_API_KEY',
});
const { data } = await postmanClient.tags.getCollectionTags('12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2');
console.log(data);
})();
updateCollectionTags
Updates a collection's associated tags. This endpoint replaces all existing tags with those you pass in the request body.
- HTTP Method:
PUT
- Endpoint:
/collections/{collectionId}/tags
Parameters
Name | Type | Required | Description |
---|---|---|---|
body | TagUpdateTags | ❌ | The request body. |
collectionId | string | ✅ | The collection's unique ID. |
Return Type
TagGetPut
Example Usage Code Snippet
import { PostmanClient, TagUpdateTags } from 'postman_client';
(async () => {
const postmanClient = new PostmanClient({
apiKey: 'YOUR_API_KEY',
});
const tagUpdateTagsTags: TagUpdateTagsTags = {
slug: 'needs-review',
};
const input: TagUpdateTags = {
tags: [tagUpdateTagsTags],
};
const { data } = await postmanClient.tags.updateCollectionTags(
'12345678-12ece9e1-2abf-4edc-8e34-de66e74114d2',
input,
);
console.log(data);
})();
getTaggedEntities
Gets Postman elements (entities) by a given tag. Tags enable you to organize and search workspaces, APIs, and collections that contain shared tags. Note: Tagging is available on Postman Enterprise plans.
- HTTP Method:
GET
- Endpoint:
/tags/{slug}/entities
Parameters
Name | Type | Required | Description |
---|---|---|---|
slug | string | ✅ | The tag's ID within a team or individual (non-team) user scope. |
limit | number | ❌ | The maximum number of tagged elements to return in a single call. |
direction | AscDescDefaultDesc | ❌ | The ascending (asc ) or descending (desc ) order to sort the results by, based on the time of the entity's tagging. |
cursor | string | ❌ | The cursor to get the next set of results in the paginated response. If you pass an invalid value, the API only returns the first set of results. |
entityType | GetTaggedEntitiesEntityType | ❌ | Filter results for the given entity type. |
Return Type
GetTaggedEntities
Example Usage Code Snippet
import { PostmanClient } from 'postman_client';
(async () => {
const postmanClient = new PostmanClient({
apiKey: 'YOUR_API_KEY',
});
const direction = AscDescDefaultDesc.ASC;
const entityType = GetTaggedEntitiesEntityType.API;
const { data } = await postmanClient.tags.getTaggedEntities('needs-review', {
limit: 2,
direction: direction,
cursor: 'eyJpZCI6ODYsImVudGl0eVR5cGUiOiJhcGkifQ==',
entityType: entityType,
});
console.log(data);
})();
getWorkspaceTags
Gets all the tags associated with a workspace.
- HTTP Method:
GET
- Endpoint:
/workspaces/{workspaceId}/tags
Parameters
Name | Type | Required | Description |
---|---|---|---|
workspaceId | string | ✅ | The workspace's ID. |
Return Type
TagGetPut
Example Usage Code Snippet
import { PostmanClient } from 'postman_client';
(async () => {
const postmanClient = new PostmanClient({
apiKey: 'YOUR_API_KEY',
});
const { data } = await postmanClient.tags.getWorkspaceTags('1f0df51a-8658-4ee8-a2a1-d2567dfa09a9');
console.log(data);
})();
updateWorkspaceTags
Updates a workspace's associated tags. This endpoint replaces all existing tags with those you pass in the request body.
- HTTP Method:
PUT
- Endpoint:
/workspaces/{workspaceId}/tags
Parameters
Name | Type | Required | Description |
---|---|---|---|
body | TagUpdateTags | ❌ | The request body. |
workspaceId | string | ✅ | The workspace's ID. |
Return Type
TagGetPut
Example Usage Code Snippet
import { PostmanClient, TagUpdateTags } from 'postman_client';
(async () => {
const postmanClient = new PostmanClient({
apiKey: 'YOUR_API_KEY',
});
const tagUpdateTagsTags: TagUpdateTagsTags = {
slug: 'needs-review',
};
const input: TagUpdateTags = {
tags: [tagUpdateTagsTags],
};
const { data } = await postmanClient.tags.updateWorkspaceTags('1f0df51a-8658-4ee8-a2a1-d2567dfa09a9', input);
console.log(data);
})();
Build Your Own SDKs with liblab
Build developer friendly SDKs in minutes from your APIs