# API כושלת ב secondsite, עבדה ב primary/default site

**URL:** <https://meta.discourse.org/t/api-fails-on-secondsite-worked-on-primary-default-site/276937>\
**Category:** Development\
**Tags:** rest-api\
**Created:** [28 באוגוסט,‏ 2023,‏ 8:03pm UTC](https://meta.discourse.org/t/api-fails-on-secondsite-worked-on-primary-default-site/276937 "2023-08-28T20:03:05Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![MikeNolan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mikenolan/32/297597_2.png) [@MikeNolan](https://meta.discourse.org/u/MikeNolan)\
**Post date:** [28 באוגוסט,‏ 2023,‏ 8:03pm UTC](https://meta.discourse.org/t/api-fails-on-secondsite-worked-on-primary-default-site/276937/1 "2023-08-28T20:03:05Z")

</div>

I’m splitting a site into two separate sites using the multi-site method and it’s Bang Your Head against the API time–again.

Now what I’m trying to do is inactive the users from list 1 (the default site) on list 2 (the secondsite.)

I’ve already inactivated the users on list 2 from list 1, all I changed in my PHP script was to generate a new API key on the second site, insert it into the CURL call and I’m getting Invalid\_Access errors.

Here’s an expurgated call (missing most of the API key), which is valid for this user only and global access.

curl -X PUT -H “Content-Type: multipart/form-data;” -H “Api-Key: a23…” -H “Api-Username: nolan” “[https://nu-sports.tssi.com/admin/users/4/deactivate.json/](https://nu-sports.tssi.com/admin/users/4/deactivate.json/)”  
% Total % Received % Xferd Average Speed Time Time Time Current  
Dload Upload Total Spent Left Speed  
0 98 0 98 0 0 212 0 --:–:-- --:–:-- --:–:-- 4454  
{“errors”:[“You are not permitted to view the requested resource.”],“error\_type”:“invalid\_access”}

What’s the secret sauce I’m missing?

---

_[View the full topic](https://meta.discourse.org/t/api-fails-on-secondsite-worked-on-primary-default-site/276937)._
