Skip to main content

Adding a tag

Adding a tag

Contents

Overview

  • Call name: add-tag
  • Endpoint URL: https://{API hostname}/auth/add-tag
  • Request methods: POST
  • Request Content-Type: application/json or application/x-www-form-urlencoded
  • Response Content-Type: application/json
  • Auth required: yes

This endpoint creates a new tag for a chain.

Version-specific information

The following version-specific changes apply to this endpoint. See the versioning page for more details.

VersionChange details
N/AN/A

Permissions and Authentication

This API call requires admin authentication:

  • The performing user must be logged in and have WRITE access to the chain to which the tag is connected
  • User and privileged authentication methods are not permitted for this endpoint

Headers

Standard headers are used for this endpoint. No special headers are required.

HTTP Parameters

The following HTTP parameters can be passed to the API:

ParameterDescription
chain_id(integer, mandatory) The ID of the chain this tag belongs to
value(string, mandatory, max=255) The string value of the tag
model_class(string, mandatory, max=64) The class name of the model, e.g. user

Sample request

POST /auth/add-tag HTTP/1.1
Content-Type: application/json

{
"chain_id": 1,
"value": "baby_club_feb_2025",
"model_class": "user"
}

Sample response

{
"result": {
"code": 1,
"status": "ok"
},
"results": {
"tag": {
"active": true,
"chain": {
"email_address": "info@foo.com",
"id": 1,
"name": "FOO Chain, inc.",
"phone_number": "01 1234 4321"
},
"created_date": "2025-01-23T13:53:39+00:00",
"deleted": false,
"id": 1,
"last_modified_date": "2025-01-23T13:53:39+00:00",
"model_class": "user",
"value": "baby_club_feb_2025"
},
"result_type": "add-tag"
}
}

Possible error responses

The following represents a list of possible error responses for the add-tag endpoint:

CodeName and DescriptionHTTP Status Code
6no_valid_session
The user needs to be logged in and a valid session key needs to be sent
401
52missing_necessary_parameters
Required parameters (chain_id, value, model_class) missing
400
68permission_denied_or_non_existent
This user has insufficient permissions for this object or the object does not exist
403
154chain_id_invalid
The supplied chain_id is not valid
400
230entity_not_found
The specified chain was not found
400