Skip to content

Tags

Tags can be assigned to packages to facilitate better package tracking and searching. One package can only have one active tag at a time.

MethodRoute
POST/teams/{team_id}/tags
NameTypeRequiredDescription
X-API-KEYStringYesAPI key
Content-TypeStringYesMust be application/json
NameTypeRequiredDescription
team_idStringYesThe Team ID to bind the tag to
NameTypeRequiredDescription
nameStringYesThe name you want to give the new tag
Terminal window
curl -d '{"name": "$NAME"}' \
-H "X-API-KEY: $API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.massive.app/v1/teams/$TEAM_ID/tags

After a successful request, this endpoint returns 201 Created:

{
"id": "01FZGG2QQQTJV9CJ1Q2ZNXVKCQ",
"name": "test",
"team_id": "01FX8CYWMQAEGW8AYSNQRGAMRM",
"active": true,
"created_at": "2022-03-31T17:23:57.815Z",
"updated_at": "2022-03-31T13:23:57.815Z"
}
PropertyDescription
idThe ID of the newly created tag
nameThe name you gave the tag
team_idThe ID of the Team this tag belongs to
activeWhether or not this tag is active
created_atWhen this tag was created
updated_atWhen this tag was last updated
MethodRoute
GET/teams/{team_id}/tags
NameTypeRequiredDescription
X-API-KEYStringYesAPI key
NameTypeRequiredDescription
team_idStringYesThe ID of the Team whose tags you are fetching
Terminal window
curl -H "X-API-KEY: $API_KEY" \
-X GET https://api.massive.app/v1/teams/$TEAM_ID/tags

After a successful request, this endpoint returns 200 OK:

[
{
"id": "01FZGG2QQQTJV9CJ1Q2ZNXVKCQ",
"name": "test",
"team_id": "01FX8CYWMQAEGW8AYSNQRGAMRM",
"active": true,
"created_at": "2022-03-31T17:23:57.815Z",
"updated_at": "2022-03-31T13:23:57.815Z"
}
]

To delete a tag, you will need its ID.

MethodRoute
DELETE/tags/{tag_id}
NameTypeRequiredDescription
X-API-KEYStringYesAPI key
NameTypeRequiredDescription
tag_idStringYesThe ID of the tag you wish to delete
Terminal window
curl -H "X-API-KEY: $API_KEY" \
-X DELETE https://api.massive.app/v1/tags/$TAG_ID

After a successful request, this endpoint returns 204 No Content with no body.

Tags can be applied to multiple entities. This section covers how to apply tags to entities that support it.

Tags are received as a JSON object containing one or more of the following properties:

NameTypeDescription
idStringThe ID of the tag you wish to apply
nameStringThe name of the tag you wish to apply

If id is provided, the API checks your Team’s tags for a matching ID. If the tag does not exist, no tag will be attached and no error is returned.

If name is provided and id was either not provided or invalid, a tag will be found or created on your Team using the provided name.

The order of operations for applying tags:

  1. If id was provided: get tag by ID. If found, use this tag. If not found, continue to name check.
  2. If name was provided: check if your Team has a tag with this name. If it does, use this tag. If not, create a tag with the provided name and use it.

You can tag packages on creation or on update using the correct API endpoints.

MethodRoute
POST/teams/{team_id}/packages
NameTypeRequiredDescription
X-API-KEYStringYesAPI key
Content-TypeStringYesMust be application/json
NameTypeRequiredDescription
team_idStringYesThe ID of the Team to create a package on
NameTypeRequiredDescription
access_limitIntegerNoOverride default number of downloads for the package
descriptionStringYesDescription of the package
nameStringYesName of the package
passwordStringNoPassword required to download the package
recipientsString[]YesEmail address of recipient(s)
tagTagNoA tag object used to set the package’s tag
Terminal window
curl -d '{"name":"$NAME","description":"$DESCRIPTION","recipients":["$RECIPIENTS"],"tag":{"name":"test tag"}}' \
-H "X-API-KEY: $API_KEY" \
-H "Content-Type: application/json" \
-X POST https://api.massive.app/v1/teams/$TEAM_ID/packages

After a successful request, this endpoint returns 201 Created with the package object including the applied tag.

MethodRoute
PUT/packages/{package_id}
NameTypeRequiredDescription
X-Package-TokenStringYesPackage JSON Web Token with write access
Content-TypeStringYesMust be application/json
NameTypeRequiredDescription
package_idStringYesThe ID of the package being updated

When updating a package, provide the complete package object. To update a package’s tag, include a tag object as described in the Tag Objects section above. To remove a tag from a package, remove the tag property from the request body.

Terminal window
curl -d '{"tag":{"name":"new tag name"}}' \
-H "X-Package-Token: $PACKAGE_TOKEN" \
-H "Content-Type: application/json" \
-X PUT https://api.massive.app/v1/packages/$PACKAGE_ID