Tags

Tags are a powerful way to categorize and group your links, making it easier to find and share them.

The object

The tag object has the following attributes:

  • Name
    id
    Type
    uuid
    Description

    The tag id.

  • Name
    workspace_id
    Type
    string
    Description

    The identifier for the workspace.

  • Name
    name
    Type
    string
    Description

    The tag name, Example: Marketing.

  • Name
    color
    Type
    string
    Description

    The color of the tag, the available colors are red, orange, yellow, green, cyan, teal, blue, indigo, purple,fuchsia, pink, zinc.

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the tag was created.

  • Name
    updated_at
    Type
    timestamp
    Description

    Timestamp of when the tag was last updated.


GET/tags

List

This enpoint allows you to get a list paginated of tags associated with the workspace.

Request

GET
/tags
curl -X GET https://lua.sh/api/v1/tags \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json"

Response

{
  "data": [
    {
      "id": "9d613a9a-5561-4dc1-b779-543f04143da9",
      "workspace_id": "9d5f3cf9-fa6f-498b-b5be-bd078b7d5339",
      "name": "Marketing",
      "color": "green",
      "created_at": "2024-10-31T21:13:25.000000Z",
      "updated_at": "2024-10-31T21:13:25.000000Z"
    }
  ],
  "links": {
    "first": "https://lua.sh/api/v1/tags?page=1",
    "last": "https://lua.sh/api/v1/tags?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "links": [
      {
        "url": null,
        "label": "Previous",
        "active": false
      },
      {
        "url": "https://lua.sh/api/v1/tags?page=1",
        "label": "1",
        "active": true
      },
      {
        "url": null,
        "label": "Next",
        "active": false
      }
    ],
    "path": "https://lua.sh/api/v1/tags",
    "per_page": 25,
    "to": 1,
    "total": 1
  }
}

POST/tags

Create

This endpoint allows you to create a new tag for the workspace.

Attributes

  • Name
    name
    Type
    string
    Required
    *
    Description

    The name of the tag, e.g., Marketing.

  • Name
    color
    Type
    string
    Required
    *
    Description

    The color of the tag, the available colors are red, orange, yellow, green, cyan, teal, blue, indigo, purple,fuchsia, pink, zinc.

Request

POST
/tags
curl -X POST https://lua.sh/api/v1/tags \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d name="Marketing" \
  -d color="green"

Response

{
  "id": "9d856e9f-518c-49ea-a421-9ce3bd22257d",
  "workspace_id": "9d5f3cf9-fa6f-498b-b5be-bd078b7d5339",
  "name": "Marketing",
  "color": "green",
  "created_at": "2024-11-18T21:08:41.000000Z",
  "updated_at": "2024-11-18T21:08:41.000000Z"
}

PUT/tags/{id}

Update

This endpoint enables you to update the name and color of a tag.

Attributes

  • Name
    name
    Type
    string
    Required
    *
    Description

    The name of the tag, e.g., Marketing.

  • Name
    color
    Type
    string
    Required
    *
    Description

    The color of the tag, the available colors are red, orange, yellow, green, cyan, teal, blue, indigo, purple,fuchsia, pink, zinc.

Request

PUT
/tags/{id}
curl -X PUT https://lua.sh/api/v1/links/{id} \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d name="Marketing" \
  -d color="green"

Response

{
  "id": "9d856e9f-518c-49ea-a421-9ce3bd22257d",
  "workspace_id": "9d5f3cf9-fa6f-498b-b5be-bd078b7d5339",
  "name": "Marketing",
  "color": "green",
  "created_at": "2024-11-18T21:08:41.000000Z",
  "updated_at": "2024-11-18T21:09:46.000000Z"
}

DELETE/tags/{id}

Delete

This endpoint allows you to delete a tag from the workspace.

Attributes

  • Name
    key
    Type
    uuid
    Required
    *
    Description

    The tag id.

Request

DELETE
/tags/{id}
curl -X DELETE https://lua.sh/api/v1/tags/{id} \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json"

Response

{
  "message": "Tag deleted"
}