Skip to main content

Instance Organization Actions

https://api.losant.com/instances/INSTANCE_ID/orgs/ORG_ID

Below are the various requests that can be performed against the Instance Organization resource, as well as the expected parameters and the potential responses.

Delete

Deletes an organization

Method And Url

DELETE https://api.losant.com/instances/INSTANCE_ID/orgs/ORG_ID

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.User, instanceOrg.*, or instanceOrg.delete.

Request Path Components

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec8687ae143cd83dc4a97
ORG_IDID associated with the organization575ed6e87ae143cd83dc4aa8

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X DELETE \
https://api.losant.com/instances/INSTANCE_ID/orgs/ORG_ID

Successful Responses

CodeTypeDescription
200SuccessIf organization was successfully deleted

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if instance or organization was not found

Device Counts

Returns device counts by day for the time range specified for this organization

Method And Url

GET https://api.losant.com/instances/INSTANCE_ID/orgs/ORG_ID/deviceCounts

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.Instance.read, all.User, all.User.read, instanceOrg.*, or instanceOrg.deviceCounts.

Request Path Components

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec8687ae143cd83dc4a97
ORG_IDID associated with the organization575ed6e87ae143cd83dc4aa8

Request Query Parameters

NameRequiredDescriptionDefaultExample
startNStart of range for device count query (ms since epoch)start=0
endNEnd of range for device count query (ms since epoch)0end=1465790400000

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/instances/INSTANCE_ID/orgs/ORG_ID/deviceCounts

Successful Responses

CodeTypeDescription
200Device CountsDevice counts by day

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if instance or organization was not found

Get

Retrieves information on an organization

Method And Url

GET https://api.losant.com/instances/INSTANCE_ID/orgs/ORG_ID

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.Instance.read, all.User, all.User.read, instanceOrg.*, or instanceOrg.get.

Request Path Components

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec8687ae143cd83dc4a97
ORG_IDID associated with the organization575ed6e87ae143cd83dc4aa8

Request Query Parameters

NameRequiredDescriptionDefaultExample
summaryIncludeNComma-separated list of summary fields to include in org summarysummaryInclude=payloadCount

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/instances/INSTANCE_ID/orgs/ORG_ID

Successful Responses

CodeTypeDescription
200Instance OrganizationA single organization

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if instance or organization was not found

Notebook Minute Counts

Returns notebook execution usage by day for the time range specified for this organization

Method And Url

GET https://api.losant.com/instances/INSTANCE_ID/orgs/ORG_ID/notebookMinuteCounts

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.Instance.read, all.User, all.User.read, instanceOrg.*, or instanceOrg.notebookMinuteCounts.

Request Path Components

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec8687ae143cd83dc4a97
ORG_IDID associated with the organization575ed6e87ae143cd83dc4aa8

Request Query Parameters

NameRequiredDescriptionDefaultExample
startNStart of range for notebook execution query (ms since epoch)start=0
endNEnd of range for notebook execution query (ms since epoch)end=1465790400000

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/instances/INSTANCE_ID/orgs/ORG_ID/notebookMinuteCounts

Successful Responses

CodeTypeDescription
200Notebook Minute CountsNotebook usage information

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if instance or organization was not found

Patch

Updates information about an organization

Method And Url

PATCH https://api.losant.com/instances/INSTANCE_ID/orgs/ORG_ID

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.User, instanceOrg.*, or instanceOrg.patch.

Request Path Components

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec8687ae143cd83dc4a97
ORG_IDID associated with the organization575ed6e87ae143cd83dc4aa8

Request Query Parameters

NameRequiredDescriptionDefaultExample
summaryIncludeNComma-separated list of summary fields to include in org summarysummaryInclude=payloadCount

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Request Body

The body of the request should be serialized JSON that validates against the Instance Owned Organization Patch schema. For example, the following would be a valid body for this request:

{
"name": "My Org",
"limits": {
"member": 500
},
"auditLogEnabled": true
}

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X PATCH \
-d '{"name":"My Org","limits":{"member":500},"auditLogEnabled":true}' \
https://api.losant.com/instances/INSTANCE_ID/orgs/ORG_ID

Successful Responses

CodeTypeDescription
200Instance OrganizationUpdated organization information

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if instance or organization was not found

Payload Counts

Returns payload counts for the time range specified for all applications this organization owns

Method And Url

GET https://api.losant.com/instances/INSTANCE_ID/orgs/ORG_ID/payloadCounts

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.Instance.read, all.User, all.User.read, instanceOrg.*, or instanceOrg.payloadCounts.

Request Path Components

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec8687ae143cd83dc4a97
ORG_IDID associated with the organization575ed6e87ae143cd83dc4aa8

Request Query Parameters

NameRequiredDescriptionDefaultExample
startNStart of range for payload count query (ms since epoch)start=0
endNEnd of range for payload count query (ms since epoch)end=1465790400000
asBytesNIf the resulting stats should be returned as bytesfalseasBytes=true

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/instances/INSTANCE_ID/orgs/ORG_ID/payloadCounts

Successful Responses

CodeTypeDescription
200Payload StatsPayload counts, by type and source

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if instance or organization was not found

Payload Counts Breakdown

Returns payload counts per resolution in the time range specified for all application this organization owns

Method And Url

GET https://api.losant.com/instances/INSTANCE_ID/orgs/ORG_ID/payloadCountsBreakdown

Authentication

A valid API access token is required to access this endpoint. The token must include at least one of the following scopes: all.Instance, all.Instance.read, all.User, all.User.read, instanceOrg.*, or instanceOrg.payloadCountsBreakdown.

Request Path Components

Path ComponentDescriptionExample
INSTANCE_IDID associated with the instance575ec8687ae143cd83dc4a97
ORG_IDID associated with the organization575ed6e87ae143cd83dc4aa8

Request Query Parameters

NameRequiredDescriptionDefaultExample
startNStart of range for payload count query (ms since epoch)start=0
endNEnd of range for payload count query (ms since epoch)end=1465790400000
resolutionNResolution in milliseconds. Accepted values are: 86400000, 360000086400000resolution=86400000
asBytesNIf the resulting stats should be returned as bytesfalseasBytes=true
includeNonBillableNIf non-billable payloads should be included in the resultfalseincludeNonBillable=true

Request Headers

NameRequiredDescriptionDefault
AuthorizationYThe token for authenticating the request, prepended with Bearer

Curl Example

curl -H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer YOUR_API_ACCESS_TOKEN' \
-X GET \
https://api.losant.com/instances/INSTANCE_ID/orgs/ORG_ID/payloadCountsBreakdown

Successful Responses

CodeTypeDescription
200Payload Counts BreakdownPayload counts, by type and source

Error Responses

CodeTypeDescription
400ErrorError if malformed request
404ErrorError if instance or organization was not found

Schemas

Device Counts

Schema for the result of a device counts request

Device Counts Schema

  • {} 3 keys
    • "http://json-schema.org/draft-07/schema#"
    • "object"
    • {} 3 keys
      • {} 2 keys
        • {} 2 keys
          • {} 2 keys

        Device Counts Example

        • {} 3 keys
          • "1999-05-20T05:00:00.000Z"
          • "1999-06-20T04:59:59.999Z"
          • [] 1 item

          Error

          Schema for errors returned by the API

          Error Schema

          • {} 3 keys
            • "http://json-schema.org/draft-07/schema#"
            • "object"
            • {} 2 keys
              • {} 1 key
                • {} 1 key

              Error Example

              • {} 2 keys
                • "NotFound"
                • "Application was not found"

              Instance Organization

              Schema for the body of an Organization owned by an instance

              Instance Organization Schema

              • {} 5 keys
                • "http://json-schema.org/draft-07/schema#"
                • "object"
                • {} 25 keys
                  • {} 2 keys
                    • {} 2 keys
                      • {} 3 keys
                        • {} 2 keys
                          • {} 2 keys
                            • {} 2 keys
                              • {} 2 keys
                                • {} 2 keys
                                  • {} 3 keys
                                    • {} 2 keys
                                      • {} 2 keys
                                        • {} 1 key
                                          • {} 1 key
                                            • {} 1 key
                                              • {} 3 keys
                                                • {} 2 keys
                                                  • {} 2 keys
                                                    • {} 3 keys
                                                      • {} 2 keys
                                                        • {} 2 keys
                                                          • {} 2 keys
                                                            • {} 3 keys
                                                              • {} 2 keys
                                                                • {} 2 keys
                                                                  • {} 2 keys
                                                                  • false
                                                                  • [] 1 item

                                                                  Instance Organization Example

                                                                  • {} 19 keys
                                                                    • "2022-10-26T19:27:42.736Z"
                                                                    • "2024-10-24T17:04:32.009Z"
                                                                    • "My Org"
                                                                    • "60106426dc03c6aad06540bb"
                                                                    • "60106426dc03c6aad06540bb"
                                                                    • "60106426dc03c6aad06560ba"
                                                                    • "My Org Description"
                                                                    • "#057180"
                                                                    • {} 33 keys
                                                                      • {} 27 keys
                                                                        • [] 0 items
                                                                          • false
                                                                          • false
                                                                          • false
                                                                          • [] 1 item
                                                                            • "notRequired"
                                                                            • {} 2 keys
                                                                              • "2023-01-01T00:00:00.000Z"
                                                                              • "2023-01-31T11:59:59.999Z"

                                                                            Instance Owned Organization Patch

                                                                            Schema for the body of an Organization modification request within an instance

                                                                            Instance Owned Organization Patch Schema

                                                                            • {} 4 keys
                                                                              • "http://json-schema.org/draft-07/schema#"
                                                                              • "object"
                                                                              • {} 12 keys
                                                                                • {} 3 keys
                                                                                  • {} 2 keys
                                                                                    • {} 2 keys
                                                                                      • {} 3 keys
                                                                                        • {} 2 keys
                                                                                          • {} 1 key
                                                                                            • {} 1 key
                                                                                              • {} 1 key
                                                                                                • {} 3 keys
                                                                                                  • {} 2 keys
                                                                                                    • {} 2 keys
                                                                                                      • {} 3 keys
                                                                                                      • false

                                                                                                    Instance Owned Organization Patch Example

                                                                                                    • {} 3 keys
                                                                                                      • "My Org"
                                                                                                      • {} 1 key
                                                                                                        • true

                                                                                                      Notebook Minute Counts

                                                                                                      Schema for the result of a notebook minute counts request

                                                                                                      Notebook Minute Counts Schema

                                                                                                      • {} 3 keys
                                                                                                        • "http://json-schema.org/draft-07/schema#"
                                                                                                        • "object"
                                                                                                        • {} 3 keys
                                                                                                          • {} 2 keys
                                                                                                            • {} 2 keys
                                                                                                              • {} 2 keys

                                                                                                            Notebook Minute Counts Example

                                                                                                            • {} 3 keys
                                                                                                              • "1999-05-20T05:00:00.000Z"
                                                                                                              • "1999-06-20T04:59:59.999Z"
                                                                                                              • [] 1 item

                                                                                                              Payload Counts Breakdown

                                                                                                              Schema for the result of a payload counts breakdown request

                                                                                                              Payload Counts Breakdown Schema

                                                                                                              • {} 3 keys
                                                                                                                • "http://json-schema.org/draft-07/schema#"
                                                                                                                • "object"
                                                                                                                • {} 3 keys
                                                                                                                  • {} 2 keys
                                                                                                                    • {} 2 keys
                                                                                                                      • {} 2 keys

                                                                                                                    Payload Counts Breakdown Example

                                                                                                                    • {} 3 keys
                                                                                                                      • "1999-05-20T05:00:00.000Z"
                                                                                                                      • "1999-06-20T04:59:59.999Z"
                                                                                                                      • [] 1 item

                                                                                                                      Payload Stats

                                                                                                                      Schema for the result of a payload stats request

                                                                                                                      Payload Stats Schema

                                                                                                                      • {} 3 keys
                                                                                                                        • "http://json-schema.org/draft-07/schema#"
                                                                                                                        • "object"
                                                                                                                        • {} 19 keys
                                                                                                                          • {} 2 keys
                                                                                                                            • {} 2 keys
                                                                                                                              • {} 2 keys
                                                                                                                                • {} 2 keys
                                                                                                                                  • {} 2 keys
                                                                                                                                    • {} 2 keys
                                                                                                                                      • {} 2 keys
                                                                                                                                        • {} 2 keys
                                                                                                                                          • {} 2 keys
                                                                                                                                            • {} 2 keys
                                                                                                                                              • {} 2 keys
                                                                                                                                                • {} 2 keys
                                                                                                                                                  • {} 2 keys
                                                                                                                                                    • {} 2 keys
                                                                                                                                                      • {} 2 keys
                                                                                                                                                        • {} 2 keys
                                                                                                                                                          • {} 2 keys
                                                                                                                                                            • {} 2 keys
                                                                                                                                                              • {} 2 keys

                                                                                                                                                            Payload Stats Example

                                                                                                                                                            • {} 6 keys
                                                                                                                                                              • {} 1 key
                                                                                                                                                                • {} 2 keys
                                                                                                                                                                  • {} 1 key
                                                                                                                                                                    • {} 1 key
                                                                                                                                                                      • {} 1 key
                                                                                                                                                                        • {} 1 key

                                                                                                                                                                        Success

                                                                                                                                                                        Schema for reporting a successful operation

                                                                                                                                                                        Success Schema

                                                                                                                                                                        • {} 3 keys
                                                                                                                                                                          • "http://json-schema.org/draft-07/schema#"
                                                                                                                                                                          • "object"
                                                                                                                                                                          • {} 1 key
                                                                                                                                                                            • {} 2 keys

                                                                                                                                                                          Success Example

                                                                                                                                                                          • {} 1 key
                                                                                                                                                                            • true

                                                                                                                                                                          Was this page helpful?


                                                                                                                                                                          Still looking for help? You can also search the Losant Forums or submit your question there.