<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to create an empty Hosted Feature service using the ArcGIS REST API using API key authentication? in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-create-an-empty-hosted-feature-service/m-p/1635947#M5018</link>
    <description>&lt;P&gt;I am trying to create an empty Hosted Feature service from my python script using the ArcGIS REST API. I want that service to have multiple layers, and the schema would be dynamically created at creation type.&lt;/P&gt;&lt;P&gt;I thought of using API key authentication, as it would be an internal script, and would run without any human interaction.&lt;/P&gt;&lt;P&gt;I thought that the &lt;EM&gt;createService API&lt;/EM&gt; call (&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/create-service/" target="_blank"&gt;https://developers.arcgis.com/rest/users-groups-and-items/create-service/&lt;/A&gt;) would be the right thing to look at. Confusingly, the documentation says: "&lt;STRONG&gt;&lt;EM&gt;This endpoint is only accessible to the content owner and members who are assigned the default administrator role. All other members will receive a permissions error when attempting to access this endpoint.&lt;/EM&gt;&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;When I tried using this API via postman, I got the error message:&lt;EM&gt; ["User '&amp;lt;UserName&amp;gt;' does not have publishing privileges"].&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The API key has been created by an account, which has a publisher role, and can create an empty feature service in the WebUI using the &lt;EM&gt;New Item &amp;gt;&amp;gt; Create a feature layer&amp;gt;&amp;gt; Define Your Own Layer flow&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;For debugging purposes, I checked using oAuth Based authentication, and if I used the access token from there, I could successfully use the &lt;EM&gt;createService API call&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;But since I need to run the Script in an Automated manner every week, I can't really use an OAuth Based authentication.&lt;/P&gt;&lt;P&gt;What's the right method to make the &lt;EM&gt;createService API call&lt;/EM&gt; using API key authentication?&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jul 2025 14:54:52 GMT</pubDate>
    <dc:creator>devdattaTH</dc:creator>
    <dc:date>2025-07-24T14:54:52Z</dc:date>
    <item>
      <title>How to create an empty Hosted Feature service using the ArcGIS REST API using API key authentication?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-create-an-empty-hosted-feature-service/m-p/1635947#M5018</link>
      <description>&lt;P&gt;I am trying to create an empty Hosted Feature service from my python script using the ArcGIS REST API. I want that service to have multiple layers, and the schema would be dynamically created at creation type.&lt;/P&gt;&lt;P&gt;I thought of using API key authentication, as it would be an internal script, and would run without any human interaction.&lt;/P&gt;&lt;P&gt;I thought that the &lt;EM&gt;createService API&lt;/EM&gt; call (&lt;A href="https://developers.arcgis.com/rest/users-groups-and-items/create-service/" target="_blank"&gt;https://developers.arcgis.com/rest/users-groups-and-items/create-service/&lt;/A&gt;) would be the right thing to look at. Confusingly, the documentation says: "&lt;STRONG&gt;&lt;EM&gt;This endpoint is only accessible to the content owner and members who are assigned the default administrator role. All other members will receive a permissions error when attempting to access this endpoint.&lt;/EM&gt;&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;When I tried using this API via postman, I got the error message:&lt;EM&gt; ["User '&amp;lt;UserName&amp;gt;' does not have publishing privileges"].&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;The API key has been created by an account, which has a publisher role, and can create an empty feature service in the WebUI using the &lt;EM&gt;New Item &amp;gt;&amp;gt; Create a feature layer&amp;gt;&amp;gt; Define Your Own Layer flow&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;For debugging purposes, I checked using oAuth Based authentication, and if I used the access token from there, I could successfully use the &lt;EM&gt;createService API call&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;But since I need to run the Script in an Automated manner every week, I can't really use an OAuth Based authentication.&lt;/P&gt;&lt;P&gt;What's the right method to make the &lt;EM&gt;createService API call&lt;/EM&gt; using API key authentication?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2025 14:54:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-create-an-empty-hosted-feature-service/m-p/1635947#M5018</guid>
      <dc:creator>devdattaTH</dc:creator>
      <dc:date>2025-07-24T14:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an empty Hosted Feature service using the ArcGIS REST API using API key authentication?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-create-an-empty-hosted-feature-service/m-p/1639133#M5019</link>
      <description>&lt;P&gt;Hi devdattaTH, It sounds like you might need to give your API key additional privileges. From your description, you'll at least want to give it `portal:user:createItem` and `portal:publisher:publishFeatures` personal scope privileges.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/documentation/security-and-authentication/api-key-authentication/api-key-credentials/#privileges" target="_blank"&gt;https://developers.arcgis.com/documentation/security-and-authentication/api-key-authentication/api-key-credentials/#privileges&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/documentation/security-and-authentication/reference/privileges/#privilege-scopes" target="_blank"&gt;https://developers.arcgis.com/documentation/security-and-authentication/reference/privileges/#privilege-scopes&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Let us know if this helps...&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Tue, 05 Aug 2025 12:22:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-create-an-empty-hosted-feature-service/m-p/1639133#M5019</guid>
      <dc:creator>MarkTorrey</dc:creator>
      <dc:date>2025-08-05T12:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an empty Hosted Feature service using the ArcGIS REST API using API key authentication?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-create-an-empty-hosted-feature-service/m-p/1639207#M5020</link>
      <description>&lt;P&gt;That is one of the first things I checked, and the key does have both the permissions.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-08-05 201302.png" style="width: 449px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/137850i378195CCC1CA7BDC/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-08-05 201302.png" alt="Screenshot 2025-08-05 201302.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-08-05 200826.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/137851i5E2B7460DB2199B7/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-08-05 200826.png" alt="Screenshot 2025-08-05 200826.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Aug 2025 14:44:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-create-an-empty-hosted-feature-service/m-p/1639207#M5020</guid>
      <dc:creator>devdattaTH</dc:creator>
      <dc:date>2025-08-05T14:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an empty Hosted Feature service using the ArcGIS REST API using API key authentication?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-create-an-empty-hosted-feature-service/m-p/1639211#M5021</link>
      <description>&lt;P&gt;One thing I have notices in my testing is that If I use a key from my ArcGIS location platform account (where my account is an admin) the call to &lt;EM&gt;createService API&lt;/EM&gt; does work.&lt;BR /&gt;&lt;BR /&gt;But If I am a user with the publisher role, and create an API key with the shown Privileges, on my organisation's ArcGIS Online account, it does not work.&lt;BR /&gt;&lt;BR /&gt;And as mentioned in the original post, if I use Oauth Based Authentication, and use the access token from that workflow, I can make the api call to&amp;nbsp;&lt;EM&gt;createService API&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Aug 2025 14:49:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-create-an-empty-hosted-feature-service/m-p/1639211#M5021</guid>
      <dc:creator>devdattaTH</dc:creator>
      <dc:date>2025-08-05T14:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an empty Hosted Feature service using the ArcGIS REST API using API key authentication?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-create-an-empty-hosted-feature-service/m-p/1639274#M5022</link>
      <description>&lt;P&gt;What's the user type of your ArcGIS Online account?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Aug 2025 16:10:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-create-an-empty-hosted-feature-service/m-p/1639274#M5022</guid>
      <dc:creator>MarkTorrey</dc:creator>
      <dc:date>2025-08-05T16:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to create an empty Hosted Feature service using the ArcGIS REST API using API key authentication?</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-create-an-empty-hosted-feature-service/m-p/1639520#M5023</link>
      <description>&lt;P&gt;My user type is Creator:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="devdattaTH_0-1754463981530.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/137914iEF2D6141160237E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="devdattaTH_0-1754463981530.png" alt="devdattaTH_0-1754463981530.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Aug 2025 07:06:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/how-to-create-an-empty-hosted-feature-service/m-p/1639520#M5023</guid>
      <dc:creator>devdattaTH</dc:creator>
      <dc:date>2025-08-06T07:06:27Z</dc:date>
    </item>
  </channel>
</rss>

