# Losant API block to create Application

**URL:** <https://forums.losant.com/t/losant-api-block-to-create-application/4541>\
**Category:** Help\
**Tags:** application\
**Created:** [May 20, 2022, 10:26am UTC](https://forums.losant.com/t/losant-api-block-to-create-application/4541 "2022-05-20T10:26:03Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paolo\_Proxy](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Paolo\_Proxy](https://forums.losant.com/u/Paolo_Proxy)\
**Post date:** [May 20, 2022, 10:26am UTC](https://forums.losant.com/t/losant-api-block-to-create-application/4541/1 "2022-05-20T10:26:03Z")

</div>

Hi there,  
I am unable to find the Application Create option in this block:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/e/ea24dbdf3aafaf979bbc006d8456a1ff373bc4fc.png)

But I can see this should be possible from the documentation

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/7/79c42a3fe6ffcc74da9bdb75b9fc99de6ec643b4.png)

Is it under a different name?

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [May 20, 2022, 1:45pm UTC](https://forums.losant.com/t/losant-api-block-to-create-application/4541/2 "2022-05-20T13:45:50Z")

</div>

The [Losant API Node](https://docs.losant.com/workflows/data/losant-api/) can only operate in the context of an application; creating a new application falls outside of that context, thus the operation is not exposed.

If you want to create an application in a workflow (sidebar, I’m interested to hear what the use case is if you don’t mind sharing), you can use an [HTTP Node](https://docs.losant.com/workflows/data/http/) and make a `POST https://api.losant.com/applications` request, filling out the [body](https://docs.losant.com/rest-api/applications/#post) appropriately.

You will need to [authenticate the request](https://docs.losant.com/rest-api/overview/#authenticating-a-request) with a [User Token](https://docs.losant.com/user-accounts/user-tokens/). For security purposes I recommend creating a token with as limited a scope as possible (for example, only giving it permission for the Applications: Post endpoint).

---

<div class="post-metadata">

**Author:** ![Paolo\_Proxy](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Paolo\_Proxy](https://forums.losant.com/u/Paolo_Proxy)\
**Post date:** [May 20, 2022, 7:11pm UTC](https://forums.losant.com/t/losant-api-block-to-create-application/4541/3 "2022-05-20T19:11:53Z")

</div>

Alright makes sense, yes the reason is that I have the concept of an application from a system we have developed and I have to migrate those applications into Losant, so I want to do it automatically and incrementally.  
Then for each application I will also load a set of devices and that’s pretty much it.

---

<div class="post-metadata">

**Author:** ![Paolo\_Proxy](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Paolo\_Proxy](https://forums.losant.com/u/Paolo_Proxy)\
**Post date:** [May 23, 2022, 11:03am UTC](https://forums.losant.com/t/losant-api-block-to-create-application/4541/4 "2022-05-23T11:03:57Z")

</div>

Ouch getting some grief from the POST method.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/3/38dd90707488a6d4a4c1615ee1751c612ced3195.png)

The API token is set to all permissions, I didn’t know which ones I had to enable, but I am getting an Access is Forbidden.

Application token is set to all:

![image](https://us1.discourse-cdn.com/flex015/uploads/getstructure/original/2X/f/f78401ebf4741effb7f5819d7bd10bb849b6c476.png)

---

<div class="post-metadata">

**Author:** ![Paolo\_Proxy](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Paolo\_Proxy](https://forums.losant.com/u/Paolo_Proxy)\
**Post date:** [May 23, 2022, 11:11am UTC](https://forums.losant.com/t/losant-api-block-to-create-application/4541/5 "2022-05-23T11:11:43Z")

</div>

Okay, this is interesting, I was in the wrong panel, so when I go into the User panel I created an API token. I can see how my applications created in the Sandbox, which I can then later import in my Organization but the problem is that I am unable more than 5 devices because of the limitations.  
Hmmmmm

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [May 23, 2022, 12:01pm UTC](https://forums.losant.com/t/losant-api-block-to-create-application/4541/6 "2022-05-23T12:01:48Z")

</div>

“I was in the wrong panel” - meaning you had created an [application-scoped token](https://docs.losant.com/applications/application-tokens/) instead of a [user-scoped token](https://docs.losant.com/user-accounts/user-tokens/)? I know you marked this as resolved but I just want to confirm where things went wrong so we can make the documentation a little more clear if necessary.

---

<div class="post-metadata">

**Author:** ![Paolo\_Proxy](https://avatars.discourse-cdn.com/v4/letter/p/b5ac83/32.png) [@Paolo\_Proxy](https://forums.losant.com/u/Paolo_Proxy)\
**Post date:** [May 23, 2022, 2:31pm UTC](https://forums.losant.com/t/losant-api-block-to-create-application/4541/7 "2022-05-23T14:31:26Z")

</div>

Hi that is correct, it would be helpful if:

- creation of the application can be directly scoped into an Org not the Sandbox (otherwise I get the device limitations)
- an API to also automatically transfer Application from Sandbox to an Org

Question: will the application ID change when I transfer from the sandbox to an org?

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [May 23, 2022, 2:34pm UTC](https://forums.losant.com/t/losant-api-block-to-create-application/4541/8 "2022-05-23T14:34:37Z")

</div>

So a user token is not really “sandbox-scoped”; rather, it’s scoped to anything your user account has access to, which includes any organizations you are a member of. And assuming you are an editor or administrator in the organization, you would be able to use that token to create an application in that org.

Check out the [schema for creating an application](https://docs.losant.com/rest-api/schemas#application-post); you can pass an `orgId` in the request, and that will serve as the owner of the new application.

FYI, the Losant user interface also uses the same public API that we expose to everybody else, so if you see it is possible to take a particular action in the web portal, it’s a safe bet that it is also possible to do the same action in the API.

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [May 23, 2022, 6:22pm UTC](https://forums.losant.com/t/losant-api-block-to-create-application/4541/9 "2022-05-23T18:22:22Z")

</div>

To answer your other two questions:

- There are API endpoints to [transfer sandbox-owned resources](https://docs.losant.com/rest-api/me/#transfer-resources) and [organization-owned resources](https://docs.losant.com/rest-api/org/#transfer-resources)
- The application ID and IDs of all the application resources _will not change_ when transferring to a new owner.
