API “Add a user to a team” results in a 404 error. Please tell me the problem of my request.
Add a user to a team
curl --request POST \
--url https://app.asana.com/api/1.0/teams/< target team GID>/addUser\
--header 'accept: application/json' \
--header 'authorization: < my API key >'\
--header 'content-type: application/json' \
--data '
{
"data": {
"user": "< email address of the subject >"
}
}
'
Background: Creating tools in Python for team admins using Asana. When the script read the file with the email address, it checked if the member was registered with Asana and created a tool to add them to the team and it was working fine, but from early 2025/3 it stopped working with a 404 error.
I searched the forums and didn’t see any updates to this API.
What else have you tried?
・Run Python by rolling back to a working, low-code git
・API key reissue
・The API executor is an administrator on the target team.
For your reference, we also provide a log of API execution with Python tools.
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json; charset=UTF-8', 'Content-Length': '196', 'Connection': 'keep-alive', 'Date': 'Sun, 16 Mar 2025 23:56:07 GMT', 'cache-control': 'no-store', 'pragma': 'no-cache', 'x-frame-options': 'DENY', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'content-security-policy': "report-uri https://app.asana.com/-/csp_report?report_only=false;default-src 'none';frame-src 'none';frame-ancestors 'none'," 'x-asana-api-version': '1.0', 'asana-change': 'name=cross_workspace_deprecation;info=https://forum.asana.com/t/change-get-projects-get-users-and-get-tags-will-require-a-workspace-or-team/1031581, name=new_user_task_lists;info=https://forum.asana.com/t/update-on-our-planned-api-changes-to-user-task-lists-a-k-a-my-tasks/103828, name=new_goal_memberships;info=https://forum.asana.com/t/launched-team-sharing-for-goals/378601;affected=true', 'x-envoy-upstream-service-time': '1478', 'server': 'istio-envoy', 'X-Cache': 'Error from cloudfront', 'Via': '1.1 0c2f67f0b8f93e39e73cbead78d06c2c.cloudfront.net (CloudFront)', 'X-Amz-Cf-Pop': 'KIX56-C1', 'X-Amz-Cf-Id': 'mleF1_gUqLg6HPES5IJBcsMkHf997n3FeNuLdkN-6jn2Ka-Zowx7bA==', 'Referrer-Policy': 'strict-origin-when-cross-origin', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains; preload', 'X-Robots-Tag': 'none', 'X-UA-Compatible': 'IE=edge,chrome=1'})
HTTP response body: b'{"errors":[{"message":"No matching route for request","help":"For more information on API status codes and how to handle them, read the docs on errors: https://developers.asana.com/docs/errors"}]}'
Thanks.