Cannot Create Tag with API


#1

When I try to create a Tag using API, I get successful response. However, the Tag is not visible on UI. Even if i perform Get by ID immediately, I get 404

{
“errors”: [
{
“message”: “tag: Not a recognized ID: 321517827073100”,
“help”: “For more information on API status codes and how to handle them, read the docs on errors: https://asana.com/developers/documentation/getting-started/errors
}
]
}


#2

Hey @Amar_Nevagi,

That’s odd; I was just able to test creating and GETting a tag by ID, and it worked fine for me. What comes back from the request when it appears to be successful?

Another thing I noticed when investigating is that object ID isn’t associated with anything in our database, tag or otherwise. Is that an ID you got back from Asana for a tag you tried to create?

One other thing worth noting is that you won’t see the tag in the UI until you tag a task with it, e.g. with addTag in the API using the ID of the newly created tag. This is for a number of reasons that are fairly internal to how tags are implemented, but it is something that causes some confusion.


#3

Hi,

I have the same issue.
I create lot of tags using batch api and expected to see them in GET /tags?limit=10&workspace=xxxxxxxxx or GET /workspaces/xxxxxxxx/tags?limit=10. But I did not see any of those tags.
As per the above discussion I understood that tag should be associated with task. If that is the case than create tag should have mandatory task_id.

Is there any api to retrieve all tags created under workspace?


#4

Hi @parikshit_sardessai,

When creating a tag, it does not have to be associated with a task. Tags can be created via the API and live in the Asana data store without being associated with a task. It’s only in the Asana UI that a tag will be invisible unless it’s associated with a task.

To get all of the tags in a workspace, use:
/workspaces/{workspaceId}/tags

Not sure why you got no tags back when you used that endpoint. Did you check the return code when you created them to insure that they were created successfully?

You might want to simplify things just for testing by just creating one tag rather than using the batch API, making sure you get a success return code, then querying the workspace to see if you get it back.


#5

Hi @Phil_Seeman

Yes I created one tag at a time by using POST /tags api. I got 200 response with id aswell. But I cannot see those tags in /workspaces/{workspaceId}/tags.

I linked some of those tags to a task and then I was able to see tags in /workspaces/{workspaceId}/tags.

But the ones which are not associated to task are still not visible.