Tags


Search

Search for tags.

Endpoint

Method URI Description
GET /users/{user_id}/tags Search user owned tags
GET /teams/{team_id}/tags Search team owned tags

Example Response

{
    "data": [
        {
            "id": 1,
            "name": "Tag Name",
            "audience": "Sphere",
            "status": "Shown",
            "owner_type": "users",
            "owner_id": 1,
            "created_at": "2019-06-04T20:54:56Z",
            "updated_at": "2019-06-04T20:54:56Z",
            "contacts_count": 2,
            "inboxes": [
                {
                    "id": 1,
                    "value": "[email protected]",
                    "status": "Active",
                    "created_at": "2019-06-17T03:18:48Z",
                    "updated_at": "2019-06-17T03:18:48Z"
                }
            ]
        }
    ],
    "links": {
        "first": "https://api.happygrasshopper.com/v3/contacts/11882201/tags?page=1",
        "last": "https://api.happygrasshopper.com/v3/contacts/11882201/tags?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": null,
        "last_page": 1,
        "path": "https://api.happygrasshopper.com/v3/contacts/11882201/tags",
        "per_page": 15,
        "to": null,
        "total": 1
    }
}

Create

Create an tag.

Endpoint

Method URI Description
POST /users/{user_id}/tags Create a user owned tag
POST /teams/{team_id}/tags Create a team owned tag

Body Params

{
    "name": "Tag Name",
    "audience": "Sphere",
    "status": "Shown"
}

Example Response

{
    "id": 1,
    "name": "Tag Name",
    "audience": "Sphere",
    "status": "Shown",
    "owner_type": "users",
    "owner_id": 1,
    "created_at": "2019-06-04T20:54:56Z",
    "updated_at": "2019-06-04T20:54:56Z",
    "contacts_count": 2,
    "inboxes": [
        {
            "id": 1,
            "value": "[email protected]",
            "status": "Active",
            "created_at": "2019-06-17T03:18:48Z",
            "updated_at": "2019-06-17T03:18:48Z"
        }
    ]
}

Read

Retrieve an tag.

Endpoint

Method URI Description
GET /tags/{tag_id} Retrieve an tag by it's id

Example Response

{
    "id": 1,
    "name": "Tag Name",
    "audience": "Sphere",
    "status": "Shown",
    "owner_type": "users",
    "owner_id": 1,
    "created_at": "2019-06-04T20:54:56Z",
    "updated_at": "2019-06-04T20:54:56Z",
    "contacts_count": 2,
    "inboxes": [
        {
            "id": 1,
            "value": "[email protected]",
            "status": "Active",
            "created_at": "2019-06-17T03:18:48Z",
            "updated_at": "2019-06-17T03:18:48Z"
        }
    ]
}

Update

Update an tag.

Endpoint

Method URI Description
PUT /tags/{tag_id} Update an tag

Body Params

{
    "name": "Tag Name",
    "audience": "Sphere",
    "status": "Shown"
}

Example Response

{
    "id": 1,
    "name": "Tag Name",
    "audience": "Sphere",
    "status": "Shown",
    "owner_type": "users",
    "owner_id": 1,
    "created_at": "2019-06-04T20:54:56Z",
    "updated_at": "2019-06-04T20:54:56Z",
    "contacts_count": 2,
    "inboxes": [
        {
            "id": 1,
            "value": "[email protected]",
            "status": "Active",
            "created_at": "2019-06-17T03:18:48Z",
            "updated_at": "2019-06-17T03:18:48Z"
        }
    ]
}

Delete

Delete an tag.

Endpoint

Method URI Description
DELETE /tags/{tag_id} Delete an tag by it's id

Example Response

{
    "success": true
}